summaryrefslogtreecommitdiff
path: root/clang/test/SemaCXX/gnu-case-ranges.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/SemaCXX/gnu-case-ranges.cpp')
-rw-r--r--clang/test/SemaCXX/gnu-case-ranges.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/gnu-case-ranges.cpp b/clang/test/SemaCXX/gnu-case-ranges.cpp
new file mode 100644
index 0000000..b082e3a
--- /dev/null
+++ b/clang/test/SemaCXX/gnu-case-ranges.cpp
@@ -0,0 +1,24 @@
+// RUN: %clang_cc1 -verify -Wno-covered-switch-default %s
+
+enum E {
+ one,
+ two,
+ three,
+ four
+};
+
+
+int test(enum E e)
+{
+ switch (e)
+ {
+ case one:
+ return 7;
+ case two ... two + 1:
+ return 42;
+ case four:
+ return 25;
+ default:
+ return 0;
+ }
+}