2 /* { dg-options "-O0" } */
4 extern void abort (void);
5 extern void exit (int);
7 /* Check that out-of-bounds case warnings work in the case that the
8 testing expression is promoted. */
10 foo1 (unsigned char i
)
14 case -1: /* { dg-warning "case label value is less than minimum value for type" } */
16 case 256: /* { dg-warning "case label value exceeds maximum value for type" } */
23 /* Like above, but for case ranges that need to be satured. */
25 foo2 (unsigned char i
)
29 case -1 ... 1: /* { dg-warning "lower value in case label range less than minimum value for type" } */
31 case 254 ... 256: /* { dg-warning "upper value in case label range exceeds maximum value for type" } */