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