blob: b8aa33f9204c025d1f2bd1e0d5530ae588f98b7e (
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
|
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 ("LibraryWithType.dll", new [] { typeof(TypeDefinedInReference) })]
[SetupCompileBefore ("LibraryWithAttribute.dll", new [] { typeof(AttributeDefinedInReference) })]
[KeptTypeInAssembly ("LibraryWithType.dll", typeof (TypeDefinedInReference))]
[RemovedMemberInAssembly ("LibraryWithType.dll", typeof (TypeDefinedInReference), "Unused()")]
[KeptMemberInAssembly ("LibraryWithAttribute.dll", typeof (AttributeDefinedInReference), ".ctor()")]
[KeptMemberInAssembly ("LibraryWithAttribute.dll", typeof (AttributeDefinedInReference), "FieldType")]
public class OnlyTypeUsedInAssemblyIsTypeOnAttributeFieldOnMethod
{
public static void Main ()
{
var foo = new Foo ();
foo.Method ();
}
[Kept]
[KeptMember (".ctor()")]
class Foo {
[Kept]
[KeptAttributeAttribute (typeof (AttributeDefinedInReference))]
[AttributeDefinedInReference (FieldType = typeof(TypeDefinedInReference))]
public void Method ()
{
}
}
}
}
|