1 /** Test case for case range expressions
8 // case range expressions are a C2y feature
10 // we know that some of the case ranges are empty
11 _Pragma("disable_warning 300")
14 // case range expressions were originally a GNU extension => test GNU-like host compilers, too
15 #if defined(__SDCC) || defined(__GNUC__)
19 for (int n
= 0; n
<= 11; n
++)
21 // switch statement adapted from n3370
27 // case 4 : // error, overlaps 2 ... 5
31 ASSERT (n
>= 2 && n
<= 5);
33 case 6 ... 6: // OK (but questionable)
36 case 8 ... 7: // not a GCC error
39 case 10 ... 4: // not a GCC error despite overlap
43 ASSERT (n
< 1 || n
> 6);