Welcome to mirror list, hosted at ThFree Co, Russian Federation.

CopyWithLinkedWillHaveAttributeDepsKept.cs « References « Mono.Linker.Tests.Cases « test - github.com/mono/linker.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 7184ea0d11b07380ebb70233fac30fe742098c66 (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
using System;
using Mono.Linker.Tests.Cases.Expectations.Assertions;
using Mono.Linker.Tests.Cases.Expectations.Metadata;
using Mono.Linker.Tests.Cases.References.Dependencies;

namespace Mono.Linker.Tests.Cases.References
{
	[SetupLinkerArgument ("--used-attrs-only", "true")]
	[SetupLinkerAction ("copy", "test")]
	[SetupCompileBefore ("linked.dll", new[] { typeof (WithLinked_Attrs) })]

	[KeptMember (".ctor()")]
	[KeptMemberInAssembly ("linked.dll", typeof (WithLinked_Attrs.TypeAttribute), ".ctor()")]
	[KeptMemberInAssembly ("linked.dll", typeof (WithLinked_Attrs.FieldAttribute), ".ctor()")]
	[KeptMemberInAssembly ("linked.dll", typeof (WithLinked_Attrs.PropertyAttribute), ".ctor()")]
	[KeptMemberInAssembly ("linked.dll", typeof (WithLinked_Attrs.EventAttribute), ".ctor()")]
	[KeptMemberInAssembly ("linked.dll", typeof (WithLinked_Attrs.MethodAttribute), ".ctor()")]
	[KeptMemberInAssembly ("linked.dll", typeof (WithLinked_Attrs.ParameterAttribute), ".ctor()")]
	[KeptTypeInAssembly ("linked.dll", typeof (WithLinked_Attrs.FooEnum))]
	[KeptTypeInAssembly ("linked.dll", typeof (WithLinked_Attrs.MethodWithEnumValueAttribute))]
	public class CopyWithLinkedWillHaveAttributeDepsKept
	{
		public static void Main ()
		{
		}

		[Kept]
		[KeptMember (".ctor()")]
		[KeptAttributeAttribute (typeof (WithLinked_Attrs.TypeAttribute))]
		[WithLinked_Attrs.Type]
		class Foo
		{
			[Kept]
			[KeptAttributeAttribute (typeof (WithLinked_Attrs.FieldAttribute))]
			[WithLinked_Attrs.Field]
			private static int Field;

			[Kept]
			[KeptBackingField]
			[KeptAttributeAttribute (typeof (WithLinked_Attrs.PropertyAttribute))]
			[WithLinked_Attrs.Property]
			private static int Property {
				[Kept]
				get;
				[Kept]
				set;
			}

			[Kept]
			[KeptAttributeAttribute (typeof (WithLinked_Attrs.EventAttribute))]
			[KeptBackingField]
			[KeptEventAddMethod]
			[KeptEventRemoveMethod]
			[WithLinked_Attrs.Event]
			public event EventHandler Event;

			[Kept]
			[KeptAttributeAttribute (typeof (WithLinked_Attrs.MethodAttribute))]
			[WithLinked_Attrs.Method]
			static void Method ()
			{
			}

			[Kept]
			[KeptAttributeAttribute (typeof (WithLinked_Attrs.MethodWithEnumValueAttribute))]
			[WithLinked_Attrs.MethodWithEnumValue (WithLinked_Attrs.FooEnum.Three, typeof (WithLinked_Attrs))]
			static void MethodWithEnum ()
			{
			}

			[Kept]
			static void MethodWithParameter ([KeptAttributeAttribute (typeof (WithLinked_Attrs.ParameterAttribute))] [WithLinked_Attrs.Parameter] int arg)
			{
			}
		}
	}
}