[eglib] In AIX/generic POSIX, handle null addresses better (#17892)
[mono-project.git] / mcs / tests / test-499.cs
blobf885c89379a1b6d09f845a8c7610ae9700e3fc01
1 using System;
3 class A
5 static int switch1 (ulong a)
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;
20 return 5;
23 static int switch2 (sbyte a)
25 switch (a) {
26 case 0:
27 return 1;
28 case -1:
29 return 2;
32 return 0;
35 static int switch3 (long a)
37 switch (a) {
38 case 0:
39 return 1;
40 case -1:
41 return 2;
44 return 0;
47 static int switch4 (ulong a)
49 switch (a) {
50 case long.MaxValue:
51 goto case ulong.MaxValue;
53 case ulong.MaxValue:
54 return 4;
57 return 0;
60 static int switch5(ulong x)
62 switch (x) {
63 case 0:
64 break;
65 default:
66 return 1;
69 return 2;
72 public static int Main ()
74 if (switch1 (long.MaxValue + (ulong) 1) != 2)
75 return 1;
77 if (switch2 (-1) != 2)
78 return 2;
80 if (switch3 (-1) != 2)
81 return 3;
83 if (switch4 (ulong.MaxValue) != 4)
84 return 4;
86 if (switch4 (long.MaxValue) != 4)
87 return 41;
89 if (switch5 (0) != 2)
90 return 5;
92 Console.WriteLine ("1");
93 return 0;