Debian Codegraph @

gcc/testsuite/gdc.test/fail_compilation/switches.d

raw
1 /*
2 TEST_OUTPUT:
3 ---
4 fail_compilation/switches.d(14): Error: `case 2` not found
5 fail_compilation/switches.d(25): Error: no `case` statement following `goto case;`
6 ---
7 */
8
9 void test1(int i)
10 {
11 switch (i)
12 {
13 case 1:
14 goto case 2;
15 defaut:
16 break;
17 }
18 }
19
20 void test2(int i)
21 {
22 switch (i)
23 {
24 case 1:
25 goto case;
26 defaut:
27 break;
28 }
29 }