summaryrefslogtreecommitdiffstats
path: root/clang/test/Sema/switch.c
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/Sema/switch.c')
-rw-r--r--clang/test/Sema/switch.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/test/Sema/switch.c b/clang/test/Sema/switch.c
index ef2e4c5d9b7..63ffed18e31 100644
--- a/clang/test/Sema/switch.c
+++ b/clang/test/Sema/switch.c
@@ -288,3 +288,12 @@ void test17(int x) {
case 0: return;
}
}
+
+int test18() {
+ enum { A, B } a;
+ switch (a) {
+ case A: return 0;
+ case B: return 1;
+ default: return 2; // expected-warning {{default is unreachable as all enumeration values are accounted for}}
+ }
+}
OpenPOWER on IntegriCloud