New testcase

llvm-svn: 30683
This commit is contained in:
Chris Lattner 2006-10-01 22:35:45 +00:00
parent 7d19067c42
commit bfc049ae3f
1 changed files with 23 additions and 0 deletions

View File

@ -0,0 +1,23 @@
; RUN: llvm-as < %s | opt -globalsmodref-aa -load-vn -gcse -instcombine | llvm-dis | grep 'ret int 0'
%G = internal global int* null
implementation
void %test() {
%A = malloc int
store int* %A, int** %G
ret void
}
int %test1(int *%P) {
%g1 = load int** %G
%h1 = load int* %g1
; This store cannot alias either G or g1.
store int 123, int* %P
%g2 = load int** %G
%h2 = load int* %g1
%X = sub int %h1, %h2 ;; -> 0
ret int %X
}