2 /* { dg-do compile } */
3 /* { dg-options "-Wall -Wextra -Wpedantic -Wno-unused -Wno-implicit-fallthrough" } */
13 __attribute__((used
));
14 /* { dg-warning "empty declaration" "" { target c } 13 } */
15 /* { dg-warning "ignored" "" { target c++ } 13 } */
19 /* { dg-warning "empty declaration" "" { target c } 18 } */
20 /* { dg-warning "ignored" "" { target c++ } 18 } */
23 __attribute__((fallthrough
)) /* { dg-warning "not followed" "" { target c } } */
24 case 4: /* { dg-error "expected" } */
26 __attribute__((fallthrough
)) 1;
27 /* { dg-error "expected" "" { target c } 26 } */
28 /* { dg-warning "not followed" "" { target *-*-* } 26 } */
31 __attribute__((fallthrough
)) int i
; /* { dg-warning "ignored|not followed" } */
34 __attribute__((fallthrough ("x"))); /* { dg-warning "specified with a parameter" } */
37 __attribute__((fallthrough
, fallthrough
)); /* { dg-warning "attribute specified multiple times" } */
40 __attribute__((fallthrough
));
42 __attribute__((fallthrough
));
43 /* { dg-warning "not preceding" "" { target *-*-* } 42 } */
47 __attribute__((unused
, fallthrough
)); /* { dg-warning "attribute ignored" } */
50 __attribute__((fallthrough
, unused
)); /* { dg-warning "attribute ignored" } */