PR target/83368
[official-gcc.git] / gcc / testsuite / c-c++-common / Wimplicit-fallthrough-25.c
blobf62287885eeb9d4ca9d441c8d30ad9c5a616759a
1 /* { dg-do compile } */
2 /* { dg-options "-Wextra" } */
4 void bar (int);
6 void
7 foo (int i)
9 switch (i)
11 case 1: /* { dg-warning "this statement may \[fla\]* through" "" { target *-*-* } .+1 } */
12 bar (1);
13 case 2: /* { dg-warning "this statement may \[fla\]* through" "" { target *-*-* } .+1 } */
14 bar (2);
15 /* Some comment. */
16 case 3: /* { dg-warning "this statement may \[fla\]* through" "" { target *-*-* } .+1 } */
17 bar (3);
18 /* Here we really do want to fALl tHRoUgh and we mean it! */
19 case 4: /* { dg-bogus "this statement may \[fla\]* through" "" { target *-*-* } .+1 } */
20 bar (4);
21 /* Intentionally fall through. */
22 case 5: /* { dg-bogus "this statement may \[fla\]* through" "" { target *-*-* } .+1 } */
23 bar (5);
24 /* FALLTHROUGH */
25 case 6: /* { dg-bogus "this statement may \[fla\]* through" "" { target *-*-* } .+1 } */
26 bar (6);
27 __attribute__((fallthrough));
28 case 7: /* { dg-bogus "this statement may \[fla\]* through" "" { target *-*-* } .+1 } */
29 bar (7);
30 default:
31 break;