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/Attributes.StructLayout')
-rw-r--r--test/Mono.Linker.Tests.Cases/Attributes.StructLayout/SequentialClass.cs18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/Mono.Linker.Tests.Cases/Attributes.StructLayout/SequentialClass.cs b/test/Mono.Linker.Tests.Cases/Attributes.StructLayout/SequentialClass.cs
index fd92a3b6b..f0a4c0072 100644
--- a/test/Mono.Linker.Tests.Cases/Attributes.StructLayout/SequentialClass.cs
+++ b/test/Mono.Linker.Tests.Cases/Attributes.StructLayout/SequentialClass.cs
@@ -29,11 +29,25 @@ namespace Mono.Linker.Tests.Cases.Attributes.StructLayout
public int never_used;
}
+ [Kept]
+ [StructLayout (LayoutKind.Sequential)]
+ class UnallocatedButWithSingleFieldUsedSequentialClassData
+ {
+ [Kept]
+ public int never_used;
+
+ [Kept]
+ public int used;
+ }
+
public class SequentialClass
{
[Kept]
static UnallocatedSequentialClassData _field;
+ [Kept]
+ static UnallocatedButWithSingleFieldUsedSequentialClassData _otherField;
+
public static void Main ()
{
var c = new SequentialClassData ();
@@ -44,6 +58,10 @@ namespace Mono.Linker.Tests.Cases.Attributes.StructLayout
_field = null;
typeof (UnallocatedButReferencedWithReflectionSequentialClassData).ToString ();
+
+ if (string.Empty.Length > 0) {
+ _otherField.used = 123;
+ }
}
}
}