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 } .-1 } */
15 /* { dg-warning "ignored" "" { target c++ } .-2 } */
19 /* { dg-warning "empty declaration" "" { target c } .-1 } */
20 /* { dg-warning "ignored" "" { target c++ } .-2 } */
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 } .-1 } */
28 /* { dg-warning "not followed" "" { target *-*-* } .-2 } */
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 *-*-* } .-1 } */
47 __attribute__((unused
, fallthrough
)); /* { dg-warning "attribute ignored" } */
50 __attribute__((fallthrough
, unused
)); /* { dg-warning "attribute ignored" } */