summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/switch-warn-3.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/switch-warn-3.c')
-rw-r--r--gcc/testsuite/gcc.dg/switch-warn-3.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/switch-warn-3.c b/gcc/testsuite/gcc.dg/switch-warn-3.c
new file mode 100644
index 000000000..e13b4f58a
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/switch-warn-3.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-Wswitch-enum" } */
+
+enum a { a0, a1, a2, a3 };
+
+int error(enum a aa)
+{
+ switch ( aa )
+ {
+ case a0 ... a3:
+ return 1;
+ }
+ return 0;
+}