Chris Lattner | b363312 | 2006-10-01 22:35:45 +0000 | [diff] [blame^] | 1 | ; RUN: llvm-as < %s | 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 | } |