diff options
Diffstat (limited to 'test/Mono.Linker.Tests.Cases/Attributes.StructLayout')
-rw-r--r-- | test/Mono.Linker.Tests.Cases/Attributes.StructLayout/SequentialClass.cs | 18 |
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; + } } } } |