summaryrefslogtreecommitdiff
path: root/test/CodeGen/WinEH
diff options
context:
space:
mode:
authorJoseph Tremoulet <jotrem@microsoft.com>2015-09-27 01:47:46 +0000
committerJoseph Tremoulet <jotrem@microsoft.com>2015-09-27 01:47:46 +0000
commit8a43b3fad98540d6a25e85eccee11ae2d82733f3 (patch)
treea7ede5790e038ab7cdf3ac041f7850e7706c1466 /test/CodeGen/WinEH
parent2b4fa2c3e789aaca2a938037e736dc72ed2c48b1 (diff)
[EH] Create removeUnwindEdge utility
Summary: Factor the code that rewrites invokes to calls and rewrites WinEH terminators to their "unwind to caller" equivalents into a helper in Utils/Local, and use it in the three places I'm aware of that need to do this. Reviewers: andrew.w.kaylor, majnemer, rnk Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D13152 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248677 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/WinEH')
-rw-r--r--test/CodeGen/WinEH/wineh-cloning.ll31
1 files changed, 31 insertions, 0 deletions
diff --git a/test/CodeGen/WinEH/wineh-cloning.ll b/test/CodeGen/WinEH/wineh-cloning.ll
index 4500f96e6f6..1ed71ef8375 100644
--- a/test/CodeGen/WinEH/wineh-cloning.ll
+++ b/test/CodeGen/WinEH/wineh-cloning.ll
@@ -421,3 +421,34 @@ unreachable:
; CHECK-NEXT: catchendpad unwind to caller
; CHECK: exit:
; CHECK-NEXT: ret void
+
+define void @test11() personality i32 (...)* @__CxxFrameHandler3 {
+entry:
+ invoke void @f()
+ to label %exit unwind label %cleanup.outer
+cleanup.outer:
+ %outer = cleanuppad []
+ invoke void @f()
+ to label %outer.cont unwind label %cleanup.inner
+outer.cont:
+ br label %merge
+cleanup.inner:
+ %inner = cleanuppad []
+ br label %merge
+merge:
+ invoke void @f()
+ to label %unreachable unwind label %merge.end
+unreachable:
+ unreachable
+merge.end:
+ cleanupendpad %outer unwind to caller
+exit:
+ ret void
+}
+; merge.end will get cloned for outer and inner, but is implausible
+; from inner, so the invoke @f() in inner's copy of merge should be
+; rewritten to call @f()
+; CHECK-LABEL: define void @test11()
+; CHECK: %inner = cleanuppad []
+; CHECK-NEXT: call void @f()
+; CHECK-NEXT: unreachable