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/Csc/OnlyTypeUsedInAssemblyWithReferenceIsTypeOnAttributeCtorOnType.cs')
-rw-r--r--test/Mono.Linker.Tests.Cases/Attributes/Csc/OnlyTypeUsedInAssemblyWithReferenceIsTypeOnAttributeCtorOnType.cs33
1 files changed, 33 insertions, 0 deletions
diff --git a/test/Mono.Linker.Tests.Cases/Attributes/Csc/OnlyTypeUsedInAssemblyWithReferenceIsTypeOnAttributeCtorOnType.cs b/test/Mono.Linker.Tests.Cases/Attributes/Csc/OnlyTypeUsedInAssemblyWithReferenceIsTypeOnAttributeCtorOnType.cs
new file mode 100644
index 000000000..ed284479a
--- /dev/null
+++ b/test/Mono.Linker.Tests.Cases/Attributes/Csc/OnlyTypeUsedInAssemblyWithReferenceIsTypeOnAttributeCtorOnType.cs
@@ -0,0 +1,33 @@
+using Mono.Linker.Tests.Cases.Attributes.Dependencies;
+using Mono.Linker.Tests.Cases.Expectations.Assertions;
+using Mono.Linker.Tests.Cases.Expectations.Metadata;
+
+[assembly: KeptAttributeAttribute (typeof (System.Diagnostics.DebuggableAttribute))]
+
+namespace Mono.Linker.Tests.Cases.Attributes.Csc {
+ /// <summary>
+ /// This explicit csc test exists to ensure that csc adds references in this scenario
+ /// </summary>
+ [SetupCSharpCompilerToUse ("csc")]
+ [SetupCompileBefore ("LibraryWithAttribute.dll", new [] { typeof(AttributeDefinedInReference) })]
+ [SetupCompileBefore ("LibraryWithType.dll", new [] { typeof(TypeDefinedInReference) })]
+ [SetupCompileBefore ("LibraryWithTypeAndReference.dll", new [] { typeof(TypeDefinedInReferenceWithReference) }, new [] { "LibraryWithType.dll", "LibraryWithAttribute.dll" }, compilerToUse: "csc")]
+ [KeptTypeInAssembly ("LibraryWithTypeAndReference.dll", typeof (TypeDefinedInReferenceWithReference))]
+ [RemovedMemberInAssembly ("LibraryWithTypeAndReference.dll", typeof (TypeDefinedInReferenceWithReference), "Unused()")]
+ [KeptTypeInAssembly ("LibraryWithType.dll", typeof (TypeDefinedInReference))]
+ [RemovedMemberInAssembly ("LibraryWithType.dll", typeof (TypeDefinedInReference), "Unused()")]
+ [KeptMemberInAssembly ("LibraryWithAttribute.dll", typeof (AttributeDefinedInReference), ".ctor(System.Type)")]
+ public class OnlyTypeUsedInAssemblyWithReferenceIsTypeOnAttributeCtorOnType {
+ public static void Main ()
+ {
+ var foo = new Foo ();
+ }
+
+ [Kept]
+ [KeptMember (".ctor()")]
+ [KeptAttributeAttribute (typeof (AttributeDefinedInReference))]
+ [AttributeDefinedInReference (typeof (TypeDefinedInReferenceWithReference))]
+ class Foo {
+ }
+ }
+} \ No newline at end of file