blob: 0ab82aefb8bf3c7a687072392cf3fff9c9bd7d10 [file] [log] [blame]
Reid Spencereacb7022006-12-31 06:02:00 +00001; RUN: llvm-upgrade < %s | llvm-as | \
2; RUN: opt -globalsmodref-aa -load-vn -gcse -instcombine | llvm-dis | \
Reid Spencerb477f7d2007-04-15 09:31:07 +00003; RUN: grep {ret i32 0}
4; END.
Chris Lattnerb3633122006-10-01 22:35:45 +00005%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}