[llvm-commits] CVS: llvm/test/Regression/Analysis/GlobalsModRef/indirect-global.ll

Chris Lattner sabre at nondot.org
Sun Oct 1 15:35:59 PDT 2006



Changes in directory llvm/test/Regression/Analysis/GlobalsModRef:

indirect-global.ll added (r1.1)
---
Log message:

New testcase


---
Diffs of the changes:  (+23 -0)

 indirect-global.ll |   23 +++++++++++++++++++++++
 1 files changed, 23 insertions(+)


Index: llvm/test/Regression/Analysis/GlobalsModRef/indirect-global.ll
diff -c /dev/null llvm/test/Regression/Analysis/GlobalsModRef/indirect-global.ll:1.1
*** /dev/null	Sun Oct  1 17:35:55 2006
--- llvm/test/Regression/Analysis/GlobalsModRef/indirect-global.ll	Sun Oct  1 17:35:45 2006
***************
*** 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
+ }






More information about the llvm-commits mailing list