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:
Diffstat (limited to 'test/Mono.Linker.Tests.Cases/Reflection/MethodUsedViaReflectionWithDefaultBindingFlags.cs')
-rw-r--r--test/Mono.Linker.Tests.Cases/Reflection/MethodUsedViaReflectionWithDefaultBindingFlags.cs36
1 files changed, 36 insertions, 0 deletions
diff --git a/test/Mono.Linker.Tests.Cases/Reflection/MethodUsedViaReflectionWithDefaultBindingFlags.cs b/test/Mono.Linker.Tests.Cases/Reflection/MethodUsedViaReflectionWithDefaultBindingFlags.cs
new file mode 100644
index 000000000..7a2a4ae10
--- /dev/null
+++ b/test/Mono.Linker.Tests.Cases/Reflection/MethodUsedViaReflectionWithDefaultBindingFlags.cs
@@ -0,0 +1,36 @@
+using System.Reflection;
+using Mono.Linker.Tests.Cases.Expectations.Assertions;
+
+namespace Mono.Linker.Tests.Cases.Reflection {
+ public class MethodUsedViaReflectionWithDefaultBindingFlags {
+ public static void Main ()
+ {
+ var method = typeof (MethodUsedViaReflectionWithDefaultBindingFlags).GetMethod ("OnlyCalledViaReflection");
+ method.Invoke (null, new object[] { });
+ }
+
+ [Kept]
+ private static int OnlyCalledViaReflection ()
+ {
+ return 42;
+ }
+
+ [Kept]
+ private int OnlyCalledViaReflection (int foo)
+ {
+ return 43;
+ }
+
+ [Kept]
+ public int OnlyCalledViaReflection (int foo, int bar)
+ {
+ return 44;
+ }
+
+ [Kept]
+ public static int OnlyCalledViaReflection (int foo, int bar, int baz)
+ {
+ return 45;
+ }
+ }
+}