diff options
author | Joseph Tremoulet <jotrem@microsoft.com> | 2016-01-02 15:22:36 +0000 |
---|---|---|
committer | Joseph Tremoulet <jotrem@microsoft.com> | 2016-01-02 15:22:36 +0000 |
commit | 71e5676de4d30bbff60f496912db1036f8956430 (patch) | |
tree | 928521c4b8f8d11220ac7bb0eb856a7e1edcd817 /llvm/test | |
parent | c47c6ac0a51b62f75cdfcd6ea0d2cb4585408fa3 (diff) | |
download | bcm5719-llvm-71e5676de4d30bbff60f496912db1036f8956430.tar.gz bcm5719-llvm-71e5676de4d30bbff60f496912db1036f8956430.zip |
[WinEH] Update catchrets with cloned successors
Summary:
Add a pass to update catchrets when their successors get cloned; the
existing pass doesn't catch these because it walks the funclet whose
blocks are being cloned but the catchret is in a child funclet.
Also update the test for removing incoming PHI values; when the
predecessor is a catchret, the relevant color is the catchret's parentPad,
not its block's color.
Reviewers: andrew.w.kaylor, rnk, majnemer
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D15840
llvm-svn: 256689
Diffstat (limited to 'llvm/test')
-rw-r--r-- | llvm/test/CodeGen/WinEH/wineh-cloning.ll | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/WinEH/wineh-cloning.ll b/llvm/test/CodeGen/WinEH/wineh-cloning.ll index c13e0a16364..3c1793a3bd7 100644 --- a/llvm/test/CodeGen/WinEH/wineh-cloning.ll +++ b/llvm/test/CodeGen/WinEH/wineh-cloning.ll @@ -2,6 +2,7 @@ declare i32 @__CxxFrameHandler3(...) declare i32 @__C_specific_handler(...) +declare void @ProcessCLRException(...) declare void @f() @@ -369,6 +370,50 @@ unreachable: unreachable } +define void @test14() personality void (...)* @ProcessCLRException { +entry: + invoke void @f() + to label %cont unwind label %cleanup +cont: + invoke void @f() + to label %exit unwind label %switch.outer +cleanup: + %cleanpad = cleanuppad within none [] + invoke void @f() [ "funclet" (token %cleanpad) ] + to label %cleanret unwind label %switch.inner +switch.inner: + %cs.inner = catchswitch within %cleanpad [label %pad.inner] unwind to caller +pad.inner: + %cp.inner = catchpad within %cs.inner [i32 1] + catchret from %cp.inner to label %join +cleanret: + cleanupret from %cleanpad unwind to caller +switch.outer: + %cs.outer = catchswitch within none [label %pad.outer] unwind to caller +pad.outer: + %cp.outer = catchpad within %cs.outer [i32 2] + catchret from %cp.outer to label %join +join: + %phi = phi i32 [ 1, %pad.inner ], [ 2, %pad.outer ] + call void @llvm.foo(i32 %phi) + unreachable +exit: + ret void +} +; Both catchrets target %join, but the catchret from %cp.inner +; returns to %cleanpad and the catchret from %cp.outer returns to the +; main function, so %join needs to get cloned and one of the cleanuprets +; needs to be updated to target the clone +; CHECK-LABEL: define void @test14() +; CHECK: catchret from %cp.inner to label %[[Clone1:.+]] +; CHECK: catchret from %cp.outer to label %[[Clone2:.+]] +; CHECK: [[Clone1]]: +; CHECK-NEXT: call void @llvm.foo(i32 1) +; CHECK-NEXT: unreachable +; CHECK: [[Clone2]]: +; CHECK-NEXT: call void @llvm.foo(i32 2) +; CHECK-NEXT: unreachable + ;; Debug info (from test12) ; Make sure the DISubprogram doesn't get cloned |