1 ; RUN: opt < %s -instcombine -mem2reg -S | \
2 ; RUN: not grep "i32 1"
4 ; When propagating the load through the select, make sure that the load is
5 ; inserted where the original load was, not where the select is. Not doing
6 ; so could produce incorrect results!
8 define i32 @test(i1 %C) {
9 %X = alloca i32 ; <i32*> [#uses=3]
10 %X2 = alloca i32 ; <i32*> [#uses=2]
13 %Y = select i1 %C, i32* %X, i32* %X2 ; <i32*> [#uses=1]
15 %Z = load i32, i32* %Y ; <i32> [#uses=1]