Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/linker.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVitek Karas <10670590+vitek-karas@users.noreply.github.com>2022-02-17 22:16:17 +0300
committerGitHub <noreply@github.com>2022-02-17 22:16:17 +0300
commit7a56f52fc834ee33ef8337c6097ee51a7adba6a4 (patch)
tree3bd5b4b16cf072222c3fc3b92f0e88ef4c3672e6 /test/Mono.Linker.Tests.Cases
parent08c7a14489aa9aeef8957338b2176862363b92ab (diff)
Adds a test for brackward branch merging an unknown value to the result (#2625)
This is a test for https://github.com/dotnet/linker/issues/2624
Diffstat (limited to 'test/Mono.Linker.Tests.Cases')
-rw-r--r--test/Mono.Linker.Tests.Cases/DataFlow/LocalDataFlow.cs16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/Mono.Linker.Tests.Cases/DataFlow/LocalDataFlow.cs b/test/Mono.Linker.Tests.Cases/DataFlow/LocalDataFlow.cs
index eca6e9368..eba80858b 100644
--- a/test/Mono.Linker.Tests.Cases/DataFlow/LocalDataFlow.cs
+++ b/test/Mono.Linker.Tests.Cases/DataFlow/LocalDataFlow.cs
@@ -39,6 +39,9 @@ namespace Mono.Linker.Tests.Cases.DataFlow
TestNoWarningsInRUCMethod ();
TestNoWarningsInRUCType ();
+
+ // These are probably just bugs
+ TestBackwardEdgeWithLdElem ();
}
[UnrecognizedReflectionAccessPattern (typeof (LocalDataFlow), nameof (RequirePublicFields), new Type[] { typeof (string) },
@@ -389,6 +392,19 @@ namespace Mono.Linker.Tests.Cases.DataFlow
}
}
+ // https://github.com/dotnet/linker/issues/2624
+ // [ExpectedWarning ("IL2063")] // The types loaded from the array don't have annotations, so the "return" should warn
+ [return: DynamicallyAccessedMembers (DynamicallyAccessedMemberTypes.PublicMethods)]
+ public static Type TestBackwardEdgeWithLdElem (Type[] types = null)
+ {
+ Type resultType = null;
+ foreach (var type in types) {
+ resultType = type;
+ }
+
+ return resultType;
+ }
+
public static void RequireAll (
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)]
string type)