diff options
| author | David Majnemer <david.majnemer@gmail.com> | 2015-10-27 22:43:56 +0000 |
|---|---|---|
| committer | David Majnemer <david.majnemer@gmail.com> | 2015-10-27 22:43:56 +0000 |
| commit | 492937095f32aaf07125c22350c4cf2d31d33fca (patch) | |
| tree | 25a427cd6b6f7edd82195b31c0b71eb5e7b18443 /llvm/test/Transforms/SimplifyCFG | |
| parent | af383ff70c30b422d919210cfd7e6a61e62405b9 (diff) | |
| download | bcm5719-llvm-492937095f32aaf07125c22350c4cf2d31d33fca.tar.gz bcm5719-llvm-492937095f32aaf07125c22350c4cf2d31d33fca.zip | |
[SimplifyCFG] Don't DCE catchret because the successor is unreachable
CatchReturnInst has side-effects: it runs a destructor. This destructor
could conceivably run forever/call exit/etc. and should not be removed.
llvm-svn: 251461
Diffstat (limited to 'llvm/test/Transforms/SimplifyCFG')
| -rw-r--r-- | llvm/test/Transforms/SimplifyCFG/wineh-unreachable.ll | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/llvm/test/Transforms/SimplifyCFG/wineh-unreachable.ll b/llvm/test/Transforms/SimplifyCFG/wineh-unreachable.ll index 7db883b2412..31d567f6492 100644 --- a/llvm/test/Transforms/SimplifyCFG/wineh-unreachable.ll +++ b/llvm/test/Transforms/SimplifyCFG/wineh-unreachable.ll @@ -86,3 +86,23 @@ unreachable.unwind: cleanuppad [] unreachable } + +; CHECK-LABEL: define void @test5() +define void @test5() personality i8* bitcast (void ()* @Personality to i8*) { +entry: + invoke void @f() + to label %exit unwind label %catch.pad + +catch.pad: + %catch = catchpad [] + to label %catch.body unwind label %catch.end + +catch.body: + catchret %catch to label %exit + +catch.end: + catchendpad unwind to caller + +exit: + unreachable +} |

