2 /* { dg-do compile } */
3 /* { dg-options "-Wall -Wextra -Wpedantic" } */
9 __attribute__((fallthrough
)) int j
= 0; /* { dg-warning "ignored|attribute not followed" } */
12 __attribute__((fallthrough
)); /* { dg-error "invalid use" } */
14 __attribute__((fallthrough
)); /* { dg-error "invalid use" } */
17 __attribute__((fallthrough
)); /* { dg-warning "statement will never" } */
20 __attribute__((fallthrough
));
22 if (i
) /* { dg-warning "statement may fall through" } */
25 __attribute__((fallthrough
));
28 __attribute__((fallthrough
));
33 __attribute__((fallthrough
)); /* { dg-warning "not preceding" } */
34 __attribute__((fallthrough
));
37 __attribute__((fallthrough
));
39 if (i
) /* { dg-warning "statement may fall through" } */
43 __attribute__((fallthrough
));
48 __attribute__((fallthrough
));
51 bar (7); /* { dg-warning "statement may fall through" } */
56 __attribute__((fallthrough
)); /* { dg-error "invalid use" } */