diff options
Diffstat (limited to 'test/SemaCXX/switch.cpp')
-rw-r--r-- | test/SemaCXX/switch.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/SemaCXX/switch.cpp b/test/SemaCXX/switch.cpp new file mode 100644 index 0000000..b22adb7 --- /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; + } +} |