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/OnlyKeepUsed/UnusedAttributePreservedViaLinkXmlIsKept.cs')
-rw-r--r--test/Mono.Linker.Tests.Cases/Attributes/OnlyKeepUsed/UnusedAttributePreservedViaLinkXmlIsKept.cs33
1 files changed, 33 insertions, 0 deletions
diff --git a/test/Mono.Linker.Tests.Cases/Attributes/OnlyKeepUsed/UnusedAttributePreservedViaLinkXmlIsKept.cs b/test/Mono.Linker.Tests.Cases/Attributes/OnlyKeepUsed/UnusedAttributePreservedViaLinkXmlIsKept.cs
new file mode 100644
index 000000000..c7273e993
--- /dev/null
+++ b/test/Mono.Linker.Tests.Cases/Attributes/OnlyKeepUsed/UnusedAttributePreservedViaLinkXmlIsKept.cs
@@ -0,0 +1,33 @@
+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 UnusedAttributePreservedViaLinkXmlIsKept {
+ static void Main ()
+ {
+ var tmp = new Bar ();
+ tmp.Method ();
+ }
+
+ [Kept]
+ [KeptMember (".ctor()")]
+ [KeptAttributeAttribute (typeof (FooAttribute))]
+ [Foo]
+ class Bar {
+ [Kept]
+ [KeptAttributeAttribute (typeof (FooAttribute))]
+ [Foo]
+ public void Method ()
+ {
+ }
+ }
+
+ [Kept]
+ [KeptMember (".ctor()")]
+ [KeptBaseType (typeof (Attribute))]
+ class FooAttribute : Attribute {
+ }
+ }
+}