blob: 72c26152010c6364919ad4d548d9c766d13bbada (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
|
using System;
using Mono.Linker.Tests.Cases.Expectations.Assertions;
using Mono.Linker.Tests.Cases.Expectations.Metadata;
using Mono.Linker.Tests.Cases.TypeForwarding.Dependencies;
namespace Mono.Linker.Tests.Cases.TypeForwarding
{
// On .NET FW the built in compiler will drop the reference to the forwarder assembly when compiling the test assembly.
// Use roslyn to give consistent behavior across platforms
[SetupCSharpCompilerToUse ("csc")]
// Actions:
// link - This assembly, Forwarder.dll and Implementation.dll
[SetupLinkerUserAction ("link")]
[KeepTypeForwarderOnlyAssemblies ("false")]
[SetupCompileBefore ("Forwarder.dll", new[] { "Dependencies/ReferenceImplementationLibrary.cs" }, defines: new[] { "INCLUDE_REFERENCE_IMPL" })]
// After compiling the test case we then replace the reference impl with implementation + type forwarder
[SetupCompileAfter ("Implementation.dll", new[] { "Dependencies/ImplementationLibrary.cs" })]
[SetupCompileAfter ("Forwarder.dll", new[] { "Dependencies/ForwarderLibrary.cs" }, references: new[] { "Implementation.dll" })]
[RemovedAssembly ("Forwarder.dll")]
[KeptMemberInAssembly ("Implementation.dll", typeof (ImplementationLibrary))]
class AttributeArgumentForwarded
{
static void Main ()
{
Test_1 ();
Test_1b ();
Test_1c ();
Test_2 ();
Test_3 ();
Test_3a ();
}
[Kept]
[KeptAttributeAttribute (typeof (TestTypeAttribute))]
[TestType (typeof (ImplementationLibrary))]
public static void Test_1 ()
{
}
[Kept]
[KeptAttributeAttribute (typeof (TestTypeAttribute))]
[TestType (typeof (ImplementationLibrary[,][]))]
public static void Test_1b ()
{
}
[Kept]
[KeptAttributeAttribute (typeof (TestTypeAttribute))]
[TestType (typeof (ImplementationLibrary[,][]))]
public static void Test_1c ()
{
}
[Kept]
[KeptAttributeAttribute (typeof (TestTypeAttribute))]
[TestType (TestProperty = new object[] { typeof (ImplementationLibrary) })]
public static void Test_2 ()
{
}
[Kept]
[KeptAttributeAttribute (typeof (TestTypeAttribute))]
[TestType (TestField = typeof (SomeGenericType<ImplementationLibrary[]>))]
public static void Test_3 ()
{
}
[Kept]
[KeptAttributeAttribute (typeof (TestTypeAttribute))]
[TestType (TestField = typeof (SomeGenericType<>))]
public static void Test_3a ()
{
}
}
[KeptBaseType (typeof (Attribute))]
public class TestTypeAttribute : Attribute
{
[Kept]
public TestTypeAttribute ()
{
}
[Kept]
public TestTypeAttribute (Type arg)
{
}
[KeptBackingField]
[Kept]
public object TestProperty { get; [Kept] set; }
[Kept]
public object TestField;
}
[Kept]
public class SomeGenericType<T>
{
}
}
|