diff options
| author | Chris Lattner <sabre@nondot.org> | 2011-04-17 00:54:30 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2011-04-17 00:54:30 +0000 |
| commit | bc204c8043167f52f6b7f7498f33fe2efc0c1854 (patch) | |
| tree | 65d629963f4cec36e9f6db5fba961366377d1cd1 /clang/test/CodeGen | |
| parent | 30107ed600da4cd3a5bbb5d70cd6e97b618fff38 (diff) | |
| download | bcm5719-llvm-bc204c8043167f52f6b7f7498f33fe2efc0c1854.tar.gz bcm5719-llvm-bc204c8043167f52f6b7f7498f33fe2efc0c1854.zip | |
implement rdar://9289524 - case followed immediately by break results in empty IR block,
a -O0 code quality issue.
llvm-svn: 129652
Diffstat (limited to 'clang/test/CodeGen')
| -rw-r--r-- | clang/test/CodeGen/switch-dce.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/clang/test/CodeGen/switch-dce.c b/clang/test/CodeGen/switch-dce.c index a03c4001d3d..07a5eba2360 100644 --- a/clang/test/CodeGen/switch-dce.c +++ b/clang/test/CodeGen/switch-dce.c @@ -216,3 +216,18 @@ void test12() { } } + +// rdar://9289524 - Check that the empty cases don't produce an empty block. +// CHECK: @test13 +// CHECK: switch +// CHECK: i32 42, label %sw.epilog +// CHECK: i32 11, label %sw.epilog +// CHECK: sw.epilog: +// CHECK: ret void +void test13(int x) { + switch (x) { + case 42: break; // No empty block please. + case 11: break; // No empty block please. + default: test13(42); break; + } +} |

