Fix bootstrap failure for bare metal due to autoconf link tests
[official-gcc.git] / gcc / testsuite / c-c++-common / Wimplicit-fallthrough-36.c
blob1821e48b92869df50267f003f8e51d5938246029
1 /* PR c/79153 */
2 /* { dg-do compile } */
3 /* { dg-options "-Wimplicit-fallthrough" } */
5 int
6 test (int v1, int v2)
8 switch (v1)
10 case 3:
11 switch (v2) /* { dg-warning "this statement may fall through" } */
13 case 1:
14 return 28;
15 case 2:
16 return 38;
17 case 3:
18 return 88;
19 default:
20 break;
22 case 4: /* { dg-message "here" } */
23 return 168;
24 case 5:
25 switch (v2) /* { dg-warning "this statement may fall through" } */
27 case 4:
28 break;
29 case 5:
30 return 38;
31 case 6:
32 return 88;
34 case 6: /* { dg-message "here" } */
35 return 169;
36 case 7:
37 switch (v2) /* { dg-warning "this statement may fall through" } */
39 case 7:
40 return 38;
41 case 8:
42 return 88;
44 case 8: /* { dg-message "here" } */
45 return 170;
46 case 9:
47 switch (v2) /* { dg-bogus "this statement may fall through" } */
49 case 9:
50 return 38;
51 case 10:
52 return 88;
53 default:
54 return 89;
56 case 10:
57 return 171;
58 case 11:
59 switch (v2) /* { dg-bogus "this statement may fall through" } */
61 case -__INT_MAX__ - 1 ... 31:
62 return 38;
63 case 32:
64 return 88;
65 case 33 ... __INT_MAX__:
66 return 89;
68 case 12:
69 return 172;
71 return -1;