]> granicus.if.org Git - clang/commitdiff
output body of folded case again.
authorFariborz Jahanian <fjahanian@apple.com>
Tue, 17 Jan 2012 23:55:19 +0000 (23:55 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Tue, 17 Jan 2012 23:55:19 +0000 (23:55 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148361 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGStmt.cpp
test/CodeGenCXX/switch-case-folding-2.cpp

index c7a8cf6a7d5edd969f955d8051c8a4eda454556d..97755e3906d8dd2f2edc095832544d323cca311c 100644 (file)
@@ -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()) {
index e1e66cfa3b9ca87c2c5c86c0b2ff96665a65df8e..7c0283fa2a52956373c4684618871fad18b6244e 100644 (file)
@@ -18,4 +18,4 @@ int main(void) {
  return test(5);
 }
 
-// CHECK-NOT: call i32 (i8*, ...)* @printf(
+// CHECK: call i32 (i8*, ...)* @_Z6printfPKcz