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 'linker/Tests/Mono.Linker.Tests.Cases/Interop/InternalCalls/UnusedFieldsOfTypesAreNotRemoved.cs')
-rw-r--r--linker/Tests/Mono.Linker.Tests.Cases/Interop/InternalCalls/UnusedFieldsOfTypesAreNotRemoved.cs23
1 files changed, 23 insertions, 0 deletions
diff --git a/linker/Tests/Mono.Linker.Tests.Cases/Interop/InternalCalls/UnusedFieldsOfTypesAreNotRemoved.cs b/linker/Tests/Mono.Linker.Tests.Cases/Interop/InternalCalls/UnusedFieldsOfTypesAreNotRemoved.cs
new file mode 100644
index 000000000..09809a60e
--- /dev/null
+++ b/linker/Tests/Mono.Linker.Tests.Cases/Interop/InternalCalls/UnusedFieldsOfTypesAreNotRemoved.cs
@@ -0,0 +1,23 @@
+using System.Runtime.CompilerServices;
+using Mono.Linker.Tests.Cases.Expectations.Assertions;
+
+namespace Mono.Linker.Tests.Cases.Interop.InternalCalls {
+ class UnusedFieldsOfTypesAreNotRemoved {
+ public static void Main ()
+ {
+ var a = new A ();
+ SomeMethod (a);
+ }
+
+ [KeptMember (".ctor()")]
+ class A {
+ [Kept] private int field1;
+
+ [Kept] private int field2;
+ }
+
+ [Kept]
+ [MethodImpl (MethodImplOptions.InternalCall)]
+ static extern void SomeMethod (A a);
+ }
+} \ No newline at end of file