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/Basic/UnusedFieldsOfStructsAreKept.cs')
-rw-r--r--test/Mono.Linker.Tests.Cases/Basic/UnusedFieldsOfStructsAreKept.cs28
1 files changed, 28 insertions, 0 deletions
diff --git a/test/Mono.Linker.Tests.Cases/Basic/UnusedFieldsOfStructsAreKept.cs b/test/Mono.Linker.Tests.Cases/Basic/UnusedFieldsOfStructsAreKept.cs
new file mode 100644
index 000000000..a4443a7ff
--- /dev/null
+++ b/test/Mono.Linker.Tests.Cases/Basic/UnusedFieldsOfStructsAreKept.cs
@@ -0,0 +1,28 @@
+using Mono.Linker.Tests.Cases.Expectations.Assertions;
+
+namespace Mono.Linker.Tests.Cases.Basic {
+ public class UnusedFieldsOfStructsAreKept {
+ public static void Main ()
+ {
+ A a = new A ();
+ PreventCompilerOptimization (a);
+ }
+
+ [Kept]
+ static void PreventCompilerOptimization (A a)
+ {
+ }
+
+ [Kept]
+ struct A {
+ [Kept]
+ private int UnusedField1;
+ [Kept]
+ private int UnusedField2;
+
+ public void UnusedMethod ()
+ {
+ }
+ }
+ }
+} \ No newline at end of file