blob: bb75732bebb0826c61e7ec3330fb4de4ec670f1f [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 | \
3; RUN: grep 'ret i32 0'
Chris Lattnerb3633122006-10-01 22:35:45 +00004%G = internal global int* null
5
6implementation
7
8void %test() {
9 %A = malloc int
10 store int* %A, int** %G
11 ret void
12}
13
14int %test1(int *%P) {
15 %g1 = load int** %G
16 %h1 = load int* %g1
17
18 ; This store cannot alias either G or g1.
19 store int 123, int* %P
20
21 %g2 = load int** %G
22 %h2 = load int* %g1
23 %X = sub int %h1, %h2 ;; -> 0
24 ret int %X
25}