Reapply 239795 - [InstCombine] Propagate non-null facts to call parameters
[oota-llvm.git] / test / Transforms / Mem2Reg / 2003-04-24-MultipleIdenticalSuccessors.ll
1 ; Mem2reg used to only add one incoming value to a PHI node, even if it had
2 ; multiple incoming edges from a block.
3 ;
4 ; RUN: opt < %s -mem2reg -disable-output
5
6 define i32 @test(i1 %c1, i1 %c2) {
7         %X = alloca i32         ; <i32*> [#uses=2]
8         br i1 %c1, label %Exit, label %B2
9 B2:             ; preds = %0
10         store i32 2, i32* %X
11         br i1 %c2, label %Exit, label %Exit
12 Exit:           ; preds = %B2, %B2, %0
13         %Y = load i32, i32* %X          ; <i32> [#uses=1]
14         ret i32 %Y
15 }
16