blob: 0ab82aefb8bf3c7a687072392cf3fff9c9bd7d10 [file] [log] [blame]
Dan Gohmanf17a25c2007-07-18 16:29:46 +00001; RUN: llvm-upgrade < %s | llvm-as | \
2; RUN: opt -globalsmodref-aa -load-vn -gcse -instcombine | llvm-dis | \
3; RUN: grep {ret i32 0}
4; END.
5%G = internal global int* null
6
7implementation
8
9void %test() {
10 %A = malloc int
11 store int* %A, int** %G
12 ret void
13}
14
15int %test1(int *%P) {
16 %g1 = load int** %G
17 %h1 = load int* %g1
18
19 ; This store cannot alias either G or g1.
20 store int 123, int* %P
21
22 %g2 = load int** %G
23 %h2 = load int* %g1
24 %X = sub int %h1, %h2 ;; -> 0
25 ret int %X
26}