diff options
Diffstat (limited to 'gcc/testsuite/gcc.dg/switch-7.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/switch-7.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/switch-7.c b/gcc/testsuite/gcc.dg/switch-7.c new file mode 100644 index 0000000..d3fdfb4 --- /dev/null +++ b/gcc/testsuite/gcc.dg/switch-7.c @@ -0,0 +1,14 @@ +/* Test diagnostics for switch statements and labels therein. Test + for case ranges with -pedantic-errors. */ +/* Origin: Joseph Myers <joseph@codesourcery.com> */ +/* { dg-do compile } */ +/* { dg-options "-pedantic-errors" } */ + +void +f (int a) +{ + switch (a) + { + case 0 ... 0: ; /* { dg-error "error: range expressions in switch statements are non-standard" } */ + } +} |