diff options
author | Vitek Karas <10670590+vitek-karas@users.noreply.github.com> | 2022-04-21 13:59:42 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-21 13:59:42 +0300 |
commit | 3226921178c34eb9364e3ebdc39b3831b97a6cc1 (patch) | |
tree | 8bd1af4aee46e069401fdd266d990cc6221ec794 /test | |
parent | 6374217e191b8cef0c5a3d862f4291583eb959f4 (diff) |
Share method handle related intrinsics (#2754)
Moving some simple method handle related intrinsics and unifying the values related to it.
Diffstat (limited to 'test')
2 files changed, 22 insertions, 0 deletions
diff --git a/test/ILLink.RoslynAnalyzer.Tests/generated/ILLink.RoslynAnalyzer.Tests.Generator/ILLink.RoslynAnalyzer.Tests.TestCaseGenerator/DataFlowTests.g.cs b/test/ILLink.RoslynAnalyzer.Tests/generated/ILLink.RoslynAnalyzer.Tests.Generator/ILLink.RoslynAnalyzer.Tests.TestCaseGenerator/DataFlowTests.g.cs index 14f3e1f99..1d65207ed 100644 --- a/test/ILLink.RoslynAnalyzer.Tests/generated/ILLink.RoslynAnalyzer.Tests.Generator/ILLink.RoslynAnalyzer.Tests.TestCaseGenerator/DataFlowTests.g.cs +++ b/test/ILLink.RoslynAnalyzer.Tests/generated/ILLink.RoslynAnalyzer.Tests.Generator/ILLink.RoslynAnalyzer.Tests.TestCaseGenerator/DataFlowTests.g.cs @@ -25,5 +25,11 @@ namespace ILLink.RoslynAnalyzer.Tests return RunTest (allowMissingWarnings: true); } + [Fact] + public Task UnsafeDataFlow () + { + return RunTest (allowMissingWarnings: true); + } + } }
\ No newline at end of file diff --git a/test/Mono.Linker.Tests.Cases/DataFlow/MakeGenericDataFlow.cs b/test/Mono.Linker.Tests.Cases/DataFlow/MakeGenericDataFlow.cs index 73c6d875d..f9a00a0ce 100644 --- a/test/Mono.Linker.Tests.Cases/DataFlow/MakeGenericDataFlow.cs +++ b/test/Mono.Linker.Tests.Cases/DataFlow/MakeGenericDataFlow.cs @@ -264,6 +264,9 @@ namespace Mono.Linker.Tests.Cases.DataFlow TestWithNewConstraint (); TestWithStructConstraint (); TestWithUnmanagedConstraint (); + + TestGetMethodFromHandle (); + TestGetMethodFromHandleWithWarning (); } static void TestNullMethod () @@ -684,6 +687,19 @@ namespace Mono.Linker.Tests.Cases.DataFlow { var t = new T (); } + + static void TestGetMethodFromHandle (Type unknownType = null) + { + MethodInfo m = (MethodInfo) MethodInfo.GetMethodFromHandle (typeof (MakeGenericMethod).GetMethod (nameof (GenericWithNoRequirements)).MethodHandle); + m.MakeGenericMethod (unknownType); + } + + [ExpectedWarning ("IL2070", nameof (MethodInfo.MakeGenericMethod))] + static void TestGetMethodFromHandleWithWarning ([DynamicallyAccessedMembers (DynamicallyAccessedMemberTypes.PublicMethods)] Type publicMethodsType = null) + { + MethodInfo m = (MethodInfo) MethodInfo.GetMethodFromHandle (typeof (MakeGenericMethod).GetMethod (nameof (GenericWithRequirements)).MethodHandle); + m.MakeGenericMethod (publicMethodsType); + } } public class TestType |