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.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/clang/test/Sema/switch.c b/clang/test/Sema/switch.c
index fd8e0464be6..63e5fe33b7d 100644
--- a/clang/test/Sema/switch.c
+++ b/clang/test/Sema/switch.c
@@ -48,5 +48,15 @@ void test4()
case 0 && g() ... 1 || g():
break;
}
+
+ switch (1) {
+ case g() && 0: // expected-error {{case label does not reduce to an integer constant}}
+ break;
+ }
+
+ switch (1) {
+ case 0 ... g() || 1: // expected-error {{case label does not reduce to an integer constant}}
+ break;
+ }
}
OpenPOWER on IntegriCloud