aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.dg/switch-7.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/gcc.dg/switch-7.c')
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/switch-7.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/switch-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/switch-7.c
new file mode 100644
index 000000000..29cb82569
--- /dev/null
+++ b/gcc-4.9/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 "range expressions in switch statements are non-standard" } */
+ }
+}