make switch constant folding a bit stronger, handling a missed case.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126638 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/CodeGen/switch-dce.c b/test/CodeGen/switch-dce.c
index 95c5e03..82b2061 100644
--- a/test/CodeGen/switch-dce.c
+++ b/test/CodeGen/switch-dce.c
@@ -167,7 +167,9 @@
}
}
-
+// CHECK: @test10
+// CHECK-NOT: switch
+// CHECK: ret i32
int test10(void) {
switch(8) {
case 8:
@@ -180,3 +182,17 @@
return 0;
}
+
+// CHECK: @test11
+// CHECK-NOT: switch
+// CHECK: ret void
+void test11() {
+ switch (1) {
+ case 1:
+ break;
+ case 42: ;
+ int x; // eliding var decl?
+ x = 4;
+ break;
+ }
+}