diff options
Diffstat (limited to 'gcc/testsuite/gcc.dg/switch-9.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/switch-9.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/switch-9.c b/gcc/testsuite/gcc.dg/switch-9.c new file mode 100644 index 000000000..2ae89d095 --- /dev/null +++ b/gcc/testsuite/gcc.dg/switch-9.c @@ -0,0 +1,25 @@ +/* PR middle-end/18859 */ +/* { dg-do compile } */ +/* { dg-options "" } */ + +void foo(int a) +{ + switch (a) + { + case 0 ... -1: /* { dg-warning "empty range" } */ + a = a+2; + break; + + case 1 ... 2: + a = 0; + break; + + case 3 ... 4: + a = 1; + break; + + case 5 ... 6: + a = 0; + break; + } +} |