llvm-6502/test/Analysis/GlobalsModRef/indirect-global.ll
Reid Spencer b477f7dd65 For PR1319:
Upgrade to use new Tcl exec based test harness.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36066 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-15 09:31:07 +00:00

27 lines
486 B
LLVM

; RUN: llvm-upgrade < %s | llvm-as | \
; RUN: opt -globalsmodref-aa -load-vn -gcse -instcombine | llvm-dis | \
; RUN: grep {ret i32 0}
; END.
%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
}