Use the llvm-upgrade program to upgrade llvm assembly.
[oota-llvm.git] / test / Analysis / GlobalsModRef / indirect-global.ll
1 ; RUN: llvm-upgrade < %s | llvm-as | opt -globalsmodref-aa -load-vn -gcse -instcombine | llvm-dis | grep 'ret int 0'
2 %G = internal global int* null
3
4 implementation
5
6 void %test() {
7         %A = malloc int
8         store int* %A, int** %G
9         ret void
10 }
11
12 int %test1(int *%P) {
13         %g1 = load int** %G
14         %h1 = load int* %g1
15
16         ; This store cannot alias either G or g1.
17         store int 123, int* %P
18
19         %g2 = load int** %G
20         %h2 = load int* %g1
21         %X = sub int %h1, %h2   ;; -> 0
22         ret int %X
23 }