diff options
author | dim <dim@FreeBSD.org> | 2012-04-14 14:01:31 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2012-04-14 14:01:31 +0000 |
commit | 50b73317314e889cf39c7b1d6cbf419fa7502f22 (patch) | |
tree | be1815eb79b42ff482a8562b13c2dcbf0c5dcbee /test/CodeGen/switch-dce.c | |
parent | dc04cb328508e61aad809d9b53b12f9799a00e7d (diff) | |
download | FreeBSD-src-50b73317314e889cf39c7b1d6cbf419fa7502f22.zip FreeBSD-src-50b73317314e889cf39c7b1d6cbf419fa7502f22.tar.gz |
Vendor import of clang trunk r154661:
http://llvm.org/svn/llvm-project/cfe/trunk@r154661
Diffstat (limited to 'test/CodeGen/switch-dce.c')
-rw-r--r-- | test/CodeGen/switch-dce.c | 31 |
1 files changed, 9 insertions, 22 deletions
diff --git a/test/CodeGen/switch-dce.c b/test/CodeGen/switch-dce.c index bbb5f7e..a18d3bc 100644 --- a/test/CodeGen/switch-dce.c +++ b/test/CodeGen/switch-dce.c @@ -216,32 +216,19 @@ void test12() { } } - -// rdar://9289524 - Check that the empty cases don't produce an empty block. +// Verify that case 42 only calls test14 once. // CHECK: @test13 -// CHECK: switch -// CHECK: i32 42, label [[EPILOG:%[0-9.a-z]+]] -// CHECK: i32 11, label [[EPILOG]] +// CHECK: call void @test13(i32 97) +// CHECK-NEXT: br label %[[EPILOG2:[0-9.a-z]+]] +// CHECK: [[EPILOG2]] +// CHECK-NEXT: br label [[EPILOG:%[0-9.a-z]+]] +// CHECK: call void @test13(i32 42) +// CHECK-NEXT: br label [[EPILOG]] void test13(int x) { switch (x) { - case 42: break; // No empty block please. - case 11: break; // No empty block please. - default: test13(42); break; - } -} - - -// Verify that case 42 only calls test14 once. -// CHECK: @test14 -// CHECK: call void @test14(i32 97) -// CHECK-NEXT: br label [[EPILOG2:%[0-9.a-z]+]] -// CHECK: call void @test14(i32 42) -// CHECK-NEXT: br label [[EPILOG2]] -void test14(int x) { - switch (x) { - case 42: test14(97); // fallthrough + case 42: test13(97); // fallthrough case 11: break; - default: test14(42); break; + default: test13(42); break; } } |