2018-05-15 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gcc.dg / Wswitch-enum-2.c
blob6b5ca1d307d15a1d4e2e28dda05880d84736a005
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -Wswitch-enum" } */
4 typedef enum { a = 2 } T;
6 int main()
8 T x = a;
9 switch(x)
11 case a ... 3: /* { dg-warning "case value '3' not in enumerated" "3" } */
12 break;
14 switch(x)
16 case 1 ... a: /* { dg-warning "case value '1' not in enumerated" "1" } */
17 break;
19 return 0;