Fix InstCombine/2007-10-31-StringCrash.ll by removing an obvious
[oota-llvm.git] / test / Transforms / InstCombine / 2004-09-20-BadLoadCombine.llx
1 ; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine -mem2reg | llvm-dis | \
2 ; RUN:   not grep {int 1}
3
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!
7
8 implementation
9
10 int %test(bool %C) {
11         %X = alloca int
12         %X2 = alloca int
13         store int 1, int* %X
14         store int 2, int* %X2
15
16         %Y = select bool %C, int* %X, int* %X2
17         store int 3, int* %X
18         %Z = load int* %Y
19         ret int %Z
20 }
21