Make tests register allocation independent again.
[oota-llvm.git] / test / Analysis / GlobalsModRef / indirect-global.ll
index 206955eba75210390185ebf70e2d08a1e0c58b7e..1eab0bc2081157c0d1afd074c9890da61fbfa17e 100644 (file)
@@ -1,23 +1,20 @@
-; RUN: llvm-as < %s | opt -globalsmodref-aa -load-vn -gcse -instcombine | llvm-dis | grep 'ret int 0'
-%G = internal global int* null
+; RUN: opt < %s -basicaa -globalsmodref-aa -gvn -instcombine -S | \
+; RUN:   grep {ret i32 0}
 
-implementation
+@G = internal global i32* null         ; <i32**> [#uses=3]
 
-void %test() {
-       %A = malloc int
-       store int* %A, int** %G
+define void @test() {
+       %A = malloc i32         ; <i32*> [#uses=1]
+       store i32* %A, i32** @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
+define i32 @test1(i32* %P) {
+       %g1 = load i32** @G             ; <i32*> [#uses=2]
+       %h1 = load i32* %g1             ; <i32> [#uses=1]
+       store i32 123, i32* %P
+       %g2 = load i32** @G             ; <i32*> [#uses=0]
+       %h2 = load i32* %g1             ; <i32> [#uses=1]
+       %X = sub i32 %h1, %h2           ; <i32> [#uses=1]
+       ret i32 %X
 }