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

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

namespace Mono.Linker.Tests.Cases.UnreachableBlock
{
	[SetupCSharpCompilerToUse ("csc")]
	[SetupCompileArgument ("/optimize+")]
	public class MultiStageRemoval
	{
		public static void Main()
		{
			TestMethod_1 ();
			TestMethod_2 ();
		}

		[Kept]
		[ExpectBodyModified]
		static void TestMethod_1 ()
		{
			if (TestProperty_int () == 0)
				NeverReached_1 ();
		}

		[Kept]
		[ExpectBodyModified]
		static void TestMethod_2 ()
		{
			if (TestProperty_bool_twice () >= 0)
				NeverReached_2 ();
		}

		[Kept]
		[ExpectBodyModified]
		static int TestProperty_int ()
		{
			if (Prop > 5) {
				return 11;
			}

			return 0;
		}

		[Kept]
		[ExpectBodyModified]
		static int TestProperty_bool_twice ()
		{
			if (PropBool) {
				return -5;
			}

			if (TestProperty_bool_twice () == 4)
				return -1;

			return 0;
		}        

		[Kept]
		static int Prop {
			[Kept]
			get {
				return 9;
			}
		}

		[Kept]
		static bool PropBool {
			[Kept]
			get {
				return true;
			}
		}        
        
		static void NeverReached_1 ()
		{			
		}

		static void NeverReached_2 ()
		{			
		}        
	}
}