summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
Diffstat (limited to 'clang')
-rw-r--r--clang/lib/CodeGen/CGStmt.cpp4
-rw-r--r--clang/test/CodeGenCXX/switch-case-folding-2.cpp2
2 files changed, 4 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CGStmt.cpp b/clang/lib/CodeGen/CGStmt.cpp
index c7a8cf6a7d5..97755e3906d 100644
--- a/clang/lib/CodeGen/CGStmt.cpp
+++ b/clang/lib/CodeGen/CGStmt.cpp
@@ -883,8 +883,10 @@ void CodeGenFunction::EmitCaseStmt(const CaseStmt &S) {
// when we've constant-folded the switch, are emitting the constant case,
// and part of the constant case includes another case statement. For
// instance: switch (4) { case 4: do { case 5: } while (1); }
- if (!SwitchInsn)
+ if (!SwitchInsn) {
+ EmitStmt(S.getSubStmt());
return;
+ }
// Handle case ranges.
if (S.getRHS()) {
diff --git a/clang/test/CodeGenCXX/switch-case-folding-2.cpp b/clang/test/CodeGenCXX/switch-case-folding-2.cpp
index e1e66cfa3b9..7c0283fa2a5 100644
--- a/clang/test/CodeGenCXX/switch-case-folding-2.cpp
+++ b/clang/test/CodeGenCXX/switch-case-folding-2.cpp
@@ -18,4 +18,4 @@ int main(void) {
return test(5);
}
-// CHECK-NOT: call i32 (i8*, ...)* @printf(
+// CHECK: call i32 (i8*, ...)* @_Z6printfPKcz
OpenPOWER on IntegriCloud