summaryrefslogtreecommitdiff
path: root/test/SemaCXX/switch.cpp
diff options
context:
space:
mode:
authorRoman Divacky <rdivacky@FreeBSD.org>2009-10-23 14:22:18 +0000
committerRoman Divacky <rdivacky@FreeBSD.org>2009-10-23 14:22:18 +0000
commit73490b890977362d28dd6326843a1ecae413921d (patch)
tree3fdd91eae574e32453a4baf462961c742df2691a /test/SemaCXX/switch.cpp
parenta5f348eb914e67b51914117fac117c18c1f8d650 (diff)
Notes
Diffstat (limited to 'test/SemaCXX/switch.cpp')
-rw-r--r--test/SemaCXX/switch.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/SemaCXX/switch.cpp b/test/SemaCXX/switch.cpp
new file mode 100644
index 0000000000000..b22adb749576a
--- /dev/null
+++ b/test/SemaCXX/switch.cpp
@@ -0,0 +1,15 @@
+// RUN: clang-cc -fsyntax-only -verify %s
+
+void test() {
+ bool x = true;
+ switch (x) { // expected-warning {{bool}}
+ case 0:
+ break;
+ }
+
+ int n = 3;
+ switch (n && 1) { // expected-warning {{bool}}
+ case 1:
+ break;
+ }
+}