[runtime] Avoid indirection when building MonoContext on darwin
[mono.git] / mcs / tests / test-499.cs
1 using System;
2
3 class A
4 {
5         static int switch1 (ulong a)
6         {
7                 switch (a) {
8                 case long.MaxValue - 1:
9                         return 1;
10                 case long.MaxValue + (ulong) 1:
11                         return 2;
12                 case long.MaxValue + (ulong) 2:
13                         return 3;
14                 case long.MaxValue + (ulong) 3:
15                         break;
16                 default:
17                         return 4;
18                 }
19
20                 return 5;
21         }
22
23         static int switch2 (sbyte a)
24         {
25                 switch (a) {
26                 case 0:
27                         return 1;
28                 case -1:
29                         return 2;
30                 }
31
32                 return 0;
33         }
34
35         static int switch3 (long a)
36         {
37                 switch (a) {
38                 case 0:
39                         return 1;
40                 case -1:
41                         return 2;
42                 }
43
44                 return 0;
45         }
46
47         static int switch4 (ulong a)
48         {
49                 switch (a) {
50                 case long.MaxValue:
51                         goto case ulong.MaxValue;
52
53                 case ulong.MaxValue:
54                         return 4;
55                 }
56
57                 return 0;
58         }
59
60         static int switch5(ulong x)
61         {
62                 switch (x) {
63                 case 0:
64                         break;
65                 default:
66                         return 1;
67                 }
68
69                 return 2;
70         }
71
72         public static int Main ()
73         {
74                 if (switch1 (long.MaxValue + (ulong) 1) != 2)
75                         return 1;
76
77                 if (switch2 (-1) != 2)
78                         return 2;
79
80                 if (switch3 (-1) != 2)
81                         return 3;
82
83                 if (switch4 (ulong.MaxValue) != 4)
84                         return 4;
85
86                 if (switch4 (long.MaxValue) != 4)
87                         return 41;
88
89                 if (switch5 (0) != 2)
90                         return 5;
91
92                 Console.WriteLine ("1");
93                 return 0;
94         }
95 }