summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/array-bounds.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2011-03-04 01:03:41 +0000
committerTed Kremenek <kremenek@apple.com>2011-03-04 01:03:41 +0000
commitbe52871b1a2e449312983085788b47610081f9a2 (patch)
tree6cef627dedb2693d967c517b102512f7949ec6ba /clang/test/SemaCXX/array-bounds.cpp
parentc332e727b4dd8e749ba4fb6b68dc5a0682d3d053 (diff)
downloadbcm5719-llvm-be52871b1a2e449312983085788b47610081f9a2.tar.gz
bcm5719-llvm-be52871b1a2e449312983085788b47610081f9a2.zip
Correctly handle nested switch statements in CFGBuilder when on switch statement has a condition that evaluates to a constant.
llvm-svn: 126977
Diffstat (limited to 'clang/test/SemaCXX/array-bounds.cpp')
-rw-r--r--clang/test/SemaCXX/array-bounds.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/array-bounds.cpp b/clang/test/SemaCXX/array-bounds.cpp
index 5db9c1f6c98..62b4d520cc7 100644
--- a/clang/test/SemaCXX/array-bounds.cpp
+++ b/clang/test/SemaCXX/array-bounds.cpp
@@ -147,3 +147,16 @@ void test_switch() {
}
}
+// Test nested switch statements.
+enum enumA { enumA_A, enumA_B, enumA_C, enumA_D, enumA_E };
+enum enumB { enumB_X, enumB_Y, enumB_Z };
+static enum enumB myVal = enumB_X;
+void test_nested_switch()
+{
+ switch (enumA_E) { // expected-warning {{no case matching constant}}
+ switch (myVal) { // expected-warning {{enumeration values 'enumB_X' and 'enumB_Z' not handled in switch}}
+ case enumB_Y: ;
+ }
+ }
+}
+
OpenPOWER on IntegriCloud