From 064cb4c80760c133a569c4f45d8d63616972f35b Mon Sep 17 00:00:00 2001 From: Owen Anderson Date: Fri, 3 Sep 2010 18:33:08 +0000 Subject: [PATCH] Add a test for PR4413, which was apparently fixed at some point in the past. llvm-svn: 112987 --- llvm/test/Transforms/InstCombine/phi.ll | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/llvm/test/Transforms/InstCombine/phi.ll b/llvm/test/Transforms/InstCombine/phi.ll index fc321e968224..c6c3f2ff6a68 100644 --- a/llvm/test/Transforms/InstCombine/phi.ll +++ b/llvm/test/Transforms/InstCombine/phi.ll @@ -402,3 +402,24 @@ if.else: ; preds = %entry store i32 %tmp5, i32* %res br label %if.end } + +; PR4413 +declare i32 @ext() +; CHECK: @test17 +define i32 @test17(i1 %a) { +entry: + br i1 %a, label %bb1, label %bb2 + +bb1: ; preds = %entry + %0 = tail call i32 @ext() ; [#uses=1] + br label %bb2 + +bb2: ; preds = %bb1, %entry + %cond = phi i1 [ true, %bb1 ], [ false, %entry ] ; [#uses=1] +; CHECK-NOT: %val = phi i32 [ %0, %bb1 ], [ 0, %entry ] + %val = phi i32 [ %0, %bb1 ], [ 0, %entry ] ; [#uses=1] + %res = select i1 %cond, i32 %val, i32 0 ; [#uses=1] +; CHECK: ret i32 %cond + ret i32 %res +} +