blob: d0f79c12ea8f7cedee4169551d120c2a6f6d442c [file] [log] [blame]
Reid Spencer69ccadd2006-12-02 04:23:10 +00001; RUN: llvm-upgrade < %s | llvm-as | opt -globalsmodref-aa -load-vn -gcse -instcombine | llvm-dis | grep 'ret int 0'
Chris Lattnerb3633122006-10-01 22:35:45 +00002%G = internal global int* null
3
4implementation
5
6void %test() {
7 %A = malloc int
8 store int* %A, int** %G
9 ret void
10}
11
12int %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}