diff options
Diffstat (limited to 'test/Mono.Linker.Tests.Cases/Attributes/OnlyKeepUsed/UsedAttributeTypeOnPropertyIsKept.cs')
-rw-r--r-- | test/Mono.Linker.Tests.Cases/Attributes/OnlyKeepUsed/UsedAttributeTypeOnPropertyIsKept.cs | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/test/Mono.Linker.Tests.Cases/Attributes/OnlyKeepUsed/UsedAttributeTypeOnPropertyIsKept.cs b/test/Mono.Linker.Tests.Cases/Attributes/OnlyKeepUsed/UsedAttributeTypeOnPropertyIsKept.cs new file mode 100644 index 000000000..8932d7252 --- /dev/null +++ b/test/Mono.Linker.Tests.Cases/Attributes/OnlyKeepUsed/UsedAttributeTypeOnPropertyIsKept.cs @@ -0,0 +1,32 @@ +using System; +using Mono.Linker.Tests.Cases.Expectations.Assertions; +using Mono.Linker.Tests.Cases.Expectations.Metadata; + +namespace Mono.Linker.Tests.Cases.Attributes.OnlyKeepUsed { + [SetupLinkerArgument ("--used-attrs-only", "true")] + class UsedAttributeTypeOnPropertyIsKept { + static void Main () + { + var bar = new Bar (); + bar.Value = "Hello"; + var tmp = bar.Value; + var str = typeof (FooAttribute).ToString (); + } + + [Kept] + [KeptMember (".ctor()")] + class Bar { + [Foo] + [Kept] + [KeptBackingField] + [KeptAttributeAttribute (typeof (FooAttribute))] + public string Value { [Foo] [Kept] [KeptAttributeAttribute (typeof (FooAttribute))] get; [Foo] [Kept] [KeptAttributeAttribute (typeof (FooAttribute))]set; } + } + + [Kept] + [KeptMember (".ctor()")] + [KeptBaseType (typeof(Attribute))] + class FooAttribute : Attribute { + } + } +} |