diff options
author | Nuno Lopes <nunoplopes@sapo.pt> | 2012-07-02 16:14:47 +0000 |
---|---|---|
committer | Nuno Lopes <nunoplopes@sapo.pt> | 2012-07-02 16:14:47 +0000 |
commit | 4ccb89c71fdc3d33681e292f42e49d8527cb9d7f (patch) | |
tree | 32988cc59767aebf772cd70e7dee44b33a9aa321 /test | |
parent | dbd0f69e546bbf29e4bebb5618acb321365dd4f5 (diff) | |
download | external_llvm-4ccb89c71fdc3d33681e292f42e49d8527cb9d7f.zip external_llvm-4ccb89c71fdc3d33681e292f42e49d8527cb9d7f.tar.gz external_llvm-4ccb89c71fdc3d33681e292f42e49d8527cb9d7f.tar.bz2 |
fix the regression I introduced in r159385 (it's necessary to update PHI nodes in unwind BB
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159534 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r-- | test/Transforms/SimplifyCFG/invoke.ll | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/test/Transforms/SimplifyCFG/invoke.ll b/test/Transforms/SimplifyCFG/invoke.ll index 18c6b8e..ddced6b 100644 --- a/test/Transforms/SimplifyCFG/invoke.ll +++ b/test/Transforms/SimplifyCFG/invoke.ll @@ -4,6 +4,8 @@ target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f3 declare i32 @__gxx_personality_v0(...) declare void @__cxa_call_unexpected(i8*) declare i32 @read_only() nounwind readonly +declare i32 @nounwind_fn() nounwind +declare i32 @fn() ; CHECK: @f1 @@ -82,3 +84,34 @@ lpad: tail call void @__cxa_call_unexpected(i8* %1) noreturn nounwind unreachable } + +; CHECK: @f5 +define i32 @f5(i1 %cond, i8* %a, i8* %b) { +entry: + br i1 %cond, label %x, label %y + +x: +; CHECK: invoke i32 @fn() + %call = invoke i32 @fn() + to label %cont unwind label %lpad + +y: +; CHECK: call i32 @nounwind_fn() + %call2 = invoke i32 @nounwind_fn() + to label %cont unwind label %lpad + +cont: +; CHECK: phi i32 +; CHECK: ret i32 %phi + %phi = phi i32 [%call, %x], [%call2, %y] + ret i32 %phi + +lpad: +; CHECK-NOT: phi + %phi2 = phi i8* [%a, %x], [%b, %y] + %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) + filter [0 x i8*] zeroinitializer +; CHECK: __cxa_call_unexpected(i8* %a) + tail call void @__cxa_call_unexpected(i8* %phi2) noreturn nounwind + unreachable +} |