Use the llvm-upgrade program to upgrade llvm assembly.
[oota-llvm.git] / test / Analysis / BasicAA / 2003-02-26-AccessSizeTest.ll
1 ; This testcase makes sure that size is taken to account when alias analysis 
2 ; is performed.  It is not legal to delete the second load instruction because
3 ; the value computed by the first load instruction is changed by the store.
4
5 ; RUN: llvm-upgrade < %s | llvm-as | opt -load-vn -gcse -instcombine | llvm-dis | grep DONOTREMOVE
6
7 int %test() {
8         %A = alloca int
9         store int 0, int* %A
10         %X = load int* %A
11         %B = cast int* %A to sbyte*
12         %C = getelementptr sbyte* %B, long 1
13         store sbyte 1, sbyte* %C    ; Aliases %A
14         %Y.DONOTREMOVE = load int* %A
15         %Z = sub int %X, %Y.DONOTREMOVE
16         ret int %Z
17 }
18