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

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

namespace Mono.Linker.Tests.Cases.Substitutions
{
	[SetupLinkerSubstitutionFile ("SubstitutionsErrorCases.xml")]

	[ExpectedWarning ("IL2010", "TestMethod_1", "stub", FileName = "SubstitutionsErrorCases.xml")]
	[ExpectedWarning ("IL2011", "TestMethod_2", "noaction", FileName = "SubstitutionsErrorCases.xml")]
	[ExpectedWarning ("IL2013", "SubstitutionsErrorCases::InstanceField", FileName = "SubstitutionsErrorCases.xml")]
	[ExpectedWarning ("IL2014", "SubstitutionsErrorCases::IntField", FileName = "SubstitutionsErrorCases.xml")]
	[ExpectedWarning ("IL2015", "SubstitutionsErrorCases::IntField", "NonNumber", FileName = "SubstitutionsErrorCases.xml")]
	[ExpectedWarning ("IL2007", "NonExistentAssembly", FileName = "SubstitutionsErrorCases.xml")]

	[KeptMember (".ctor()")]
	class SubstitutionsErrorCases
	{
		public static void Main ()
		{
			TestMethod_1 ();
			TestMethod_2 ();

			var instance = new SubstitutionsErrorCases ();
			instance.InstanceField = 42;
			IntField = 42;
		}

		[Kept]
		public static int TestMethod_1 () { return 42; }

		[Kept]
		public static int TestMethod_2 () { return 42; }

		[Kept]
		public int InstanceField;

		[Kept]
		public static int IntField;
	}
}