diff options
Diffstat (limited to 'test/Mono.Linker.Tests.Cases/LinkXml/UsedNonRequiredTypeIsKept.cs')
-rw-r--r-- | test/Mono.Linker.Tests.Cases/LinkXml/UsedNonRequiredTypeIsKept.cs | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/test/Mono.Linker.Tests.Cases/LinkXml/UsedNonRequiredTypeIsKept.cs b/test/Mono.Linker.Tests.Cases/LinkXml/UsedNonRequiredTypeIsKept.cs new file mode 100644 index 000000000..37cce219c --- /dev/null +++ b/test/Mono.Linker.Tests.Cases/LinkXml/UsedNonRequiredTypeIsKept.cs @@ -0,0 +1,52 @@ +using Mono.Linker.Tests.Cases.Expectations.Assertions; + +namespace Mono.Linker.Tests.Cases.LinkXml { + public class UsedNonRequiredTypeIsKept { + public static void Main () + { + var tmp = typeof (Used1).ToString (); + tmp = typeof (Used2).ToString (); + tmp = typeof (Used3).ToString (); + } + + class Used1 { + [Kept] + public int field; + + public void Method () + { + } + + public int Property { get; set; } + } + + [KeptMember (".ctor()")] + class Used2 { + public int field; + + [Kept] + public void Method () + { + } + + [Kept] + [KeptBackingField] + public int Property { [Kept] get; [Kept] set; } + } + + [KeptMember (".ctor()")] + class Used3 { + [Kept] + public int field; + + [Kept] + public void Method () + { + } + + [Kept] + [KeptBackingField] + public int Property { [Kept] get; [Kept] set; } + } + } +}
\ No newline at end of file |