annotate gcc/testsuite/c-c++-common/Wimplicit-fallthrough-29.c @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /* { dg-do compile } */
kono
parents:
diff changeset
2 /* { dg-options "-Wimplicit-fallthrough=3" } */
kono
parents:
diff changeset
3
kono
parents:
diff changeset
4 void bar (int);
kono
parents:
diff changeset
5
kono
parents:
diff changeset
6 void
kono
parents:
diff changeset
7 foo (int i)
kono
parents:
diff changeset
8 {
kono
parents:
diff changeset
9 switch (i)
kono
parents:
diff changeset
10 {
kono
parents:
diff changeset
11 case 1: /* { dg-warning "this statement may \[fla\]* through" "" { target *-*-* } .+1 } */
kono
parents:
diff changeset
12 bar (1);
kono
parents:
diff changeset
13 case 2: /* { dg-warning "this statement may \[fla\]* through" "" { target *-*-* } .+1 } */
kono
parents:
diff changeset
14 bar (2);
kono
parents:
diff changeset
15 /* Some comment. */
kono
parents:
diff changeset
16 case 3: /* { dg-warning "this statement may \[fla\]* through" "" { target *-*-* } .+1 } */
kono
parents:
diff changeset
17 bar (3);
kono
parents:
diff changeset
18 /* Here we really do want to fALl tHRoUgh and we mean it! */
kono
parents:
diff changeset
19 case 4: /* { dg-bogus "this statement may \[fla\]* through" "" { target *-*-* } .+1 } */
kono
parents:
diff changeset
20 bar (4);
kono
parents:
diff changeset
21 /* Intentionally fall through. */
kono
parents:
diff changeset
22 case 5: /* { dg-bogus "this statement may \[fla\]* through" "" { target *-*-* } .+1 } */
kono
parents:
diff changeset
23 bar (5);
kono
parents:
diff changeset
24 /* FALLTHROUGH */
kono
parents:
diff changeset
25 case 6: /* { dg-bogus "this statement may \[fla\]* through" "" { target *-*-* } .+1 } */
kono
parents:
diff changeset
26 bar (6);
kono
parents:
diff changeset
27 __attribute__((fallthrough));
kono
parents:
diff changeset
28 case 7: /* { dg-bogus "this statement may \[fla\]* through" "" { target *-*-* } .+1 } */
kono
parents:
diff changeset
29 bar (7);
kono
parents:
diff changeset
30 default:
kono
parents:
diff changeset
31 break;
kono
parents:
diff changeset
32 }
kono
parents:
diff changeset
33 }