[mono/tests] Fix out of tree build.
[mono-project.git] / mcs / tests / test-876.cs
blobf7e373e69d05186ad550bdd30da8c654fd7fb9fd
1 using System;
3 class T
5 public static int Main ()
7 Test1 ();
8 Test2 ();
9 Test3 (0, 1);
10 Test4 ();
11 Test5 ();
13 switch (1) {
14 case 1:
15 return 0;
16 default:
17 break;
21 static void Test1 ()
23 int g = 9;
25 switch (g) {
26 case 4:
27 return;
28 case 5:
29 goto A;
32 switch (g) {
33 case 9:
34 break;
37 return;
40 static void Test2 ()
42 int a,b;
43 int g = 9;
44 if (g > 0) {
45 a = 1;
46 goto X;
47 } else {
48 b = 2;
49 goto Y;
53 Console.WriteLine (a);
54 return;
56 Console.WriteLine (b);
57 return;
60 static uint Test3 (int self, uint data)
62 uint rid;
63 switch (self) {
64 case 0:
65 rid = 2;
66 switch (data & 3) {
67 case 0:
68 goto ret;
69 default:
70 goto exit;
72 default:
73 goto exit;
75 ret:
76 return rid;
77 exit:
78 return 0;
81 static void Test4 ()
83 bool v;
84 try {
85 throw new NotImplementedException ();
86 } catch (System.Exception) {
87 v = false;
90 Console.WriteLine (v);
93 static void Test5 ()
95 int i = 8;
96 switch (10) {
97 case 5:
98 if (i != 10)
99 throw new ApplicationException ();
101 Console.WriteLine (5);
102 break;
103 case 10:
104 i = 10;
105 Console.WriteLine (10);
106 goto default;
107 default:
108 Console.WriteLine ("default");
109 goto case 5;