FileCheck-ize these tests. Harden some of them.
authorBill Wendling <isanbard@gmail.com>
Tue, 24 Apr 2012 09:15:38 +0000 (09:15 +0000)
committerBill Wendling <isanbard@gmail.com>
Tue, 24 Apr 2012 09:15:38 +0000 (09:15 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@155432 91177308-0d34-0410-b5e6-96231b3b80d8

28 files changed:
test/Analysis/BasicAA/2003-02-26-AccessSizeTest.ll
test/Analysis/BasicAA/2003-04-22-GEPProblem.ll
test/Analysis/BasicAA/2003-09-19-LocalArgument.ll
test/Analysis/BasicAA/2003-11-04-SimpleCases.ll
test/Analysis/BasicAA/2003-12-11-ConstExprGEP.ll
test/Analysis/BasicAA/2004-07-28-MustAliasbug.ll
test/Analysis/BasicAA/2006-03-03-BadArraySubscript.ll
test/Analysis/BasicAA/2007-01-13-BasePointerBadNoAlias.ll
test/Analysis/BasicAA/2007-08-01-NoAliasAndCalls.ll
test/Analysis/BasicAA/2007-08-01-NoAliasAndGEP.ll
test/Analysis/BasicAA/2007-08-05-GetOverloadedModRef.ll
test/Analysis/BasicAA/2007-10-24-ArgumentsGlobals.ll
test/Analysis/BasicAA/2008-04-15-Byval.ll
test/Analysis/BasicAA/2008-11-23-NoaliasRet.ll
test/Analysis/BasicAA/2009-03-04-GEPNoalias.ll
test/Analysis/BasicAA/2009-10-13-GEP-BaseNoAlias.ll
test/Analysis/BasicAA/2010-09-15-GEP-SignedArithmetic.ll
test/Analysis/BasicAA/byval.ll
test/Analysis/BasicAA/cas.ll
test/Analysis/BasicAA/empty.ll
test/Analysis/BasicAA/full-store-partial-alias.ll
test/Analysis/BasicAA/gcsetest.ll
test/Analysis/BasicAA/no-escape-call.ll
test/Analysis/BasicAA/nocapture.ll
test/Analysis/BasicAA/phi-aa.ll
test/Analysis/BasicAA/phi-and-select.ll
test/Analysis/BasicAA/pure-const-dce.ll
test/Analysis/BasicAA/tailcall-modref.ll

index 1c2d910c10912ce7bca266a37a646b2520b283b4..45f6088eaf0cf6916e82c9270c7170dc18a7bc74 100644 (file)
@@ -2,17 +2,19 @@
 ; is performed.  It is not legal to delete the second load instruction because
 ; the value computed by the first load instruction is changed by the store.
 
-; RUN: opt < %s -basicaa -gvn -instcombine -S | grep DONOTREMOVE
+; RUN: opt < %s -basicaa -gvn -instcombine -S | FileCheck %s
 
 define i32 @test() {
-       %A = alloca i32
-       store i32 0, i32* %A
-    %X = load i32* %A
-    %B = bitcast i32* %A to i8*
-    %C = getelementptr i8* %B, i64 1
-       store i8 1, i8* %C    ; Aliases %A
-    %Y.DONOTREMOVE = load i32* %A
-       %Z = sub i32 %X, %Y.DONOTREMOVE
-    ret i32 %Z
+; CHECK: %Y.DONOTREMOVE = load i32* %A
+; CHECK: %Z = sub i32 0, %Y.DONOTREMOVE
+  %A = alloca i32
+  store i32 0, i32* %A
+  %X = load i32* %A
+  %B = bitcast i32* %A to i8*
+  %C = getelementptr i8* %B, i64 1
+  store i8 1, i8* %C    ; Aliases %A
+  %Y.DONOTREMOVE = load i32* %A
+  %Z = sub i32 %X, %Y.DONOTREMOVE
+  ret i32 %Z
 }
 
index 5d200774da5f02d6ab59eb712d073692e2cc4224..78f74a0abe56eefe59deafee6663def12f9ef102 100644 (file)
@@ -1,15 +1,14 @@
-; RUN: opt < %s -basicaa -gvn -instcombine -S | grep sub
+; RUN: opt < %s -basicaa -gvn -instcombine -S | FileCheck %s
 
 ; BasicAA was incorrectly concluding that P1 and P2 didn't conflict!
 
 define i32 @test(i32 *%Ptr, i64 %V) {
-       %P2 = getelementptr i32* %Ptr, i64 1
-       %P1 = getelementptr i32* %Ptr, i64 %V
-       %X = load i32* %P1
-       store i32 5, i32* %P2
-
-       %Y = load i32* %P1
-
-       %Z = sub i32 %X, %Y
-       ret i32 %Z
+; CHECK: sub i32 %X, %Y
+  %P2 = getelementptr i32* %Ptr, i64 1
+  %P1 = getelementptr i32* %Ptr, i64 %V
+  %X = load i32* %P1
+  store i32 5, i32* %P2
+  %Y = load i32* %P1
+  %Z = sub i32 %X, %Y
+  ret i32 %Z
 }
index 56e3339370135bc999f004619551c66b15868b54..fd4c239bbbee1889351bb50a011bab008b11b740 100644 (file)
@@ -1,6 +1,9 @@
 ; In this test, a local alloca cannot alias an incoming argument.
 
-; RUN: opt < %s -basicaa -gvn -instcombine -S | not grep sub
+; RUN: opt < %s -basicaa -gvn -instcombine -S | FileCheck %s
+
+; CHECK:      define i32 @test
+; CHECK-NEXT: ret i32 0
 
 define i32 @test(i32* %P) {
        %X = alloca i32
index 010a45881039ee7d9e509139c2637f0b99057f27..4b787bf9d0c9813c75dbe71b6fe8a0a5ee33fbe7 100644 (file)
@@ -1,11 +1,13 @@
 ; This testcase consists of alias relations which should be completely
 ; resolvable by basicaa.
 
-; RUN: opt < %s -basicaa -aa-eval -print-may-aliases -disable-output \
-; RUN: |& not grep May:
+; RUN: opt < %s -basicaa -aa-eval -print-may-aliases -disable-output |& FileCheck %s
 
 %T = type { i32, [10 x i8] }
 
+; CHECK:     Function: test
+; CHECK-NOT:   May:
+
 define void @test(%T* %P) {
   %A = getelementptr %T* %P, i64 0
   %B = getelementptr %T* %P, i64 0, i32 0
index ce01db647ffa5517537daf692f8a1a322d246a25..68039fbc0a7d6d145a54dfe887f60a458c209ba8 100644 (file)
@@ -1,13 +1,15 @@
 ; This testcase consists of alias relations which should be completely
 ; resolvable by basicaa, but require analysis of getelementptr constant exprs.
 
-; RUN: opt < %s -basicaa -aa-eval -print-may-aliases -disable-output \
-; RUN: |& not grep May:
+; RUN: opt < %s -basicaa -aa-eval -print-may-aliases -disable-output |& FileCheck %s
 
 %T = type { i32, [10 x i8] }
 
 @G = external global %T
 
+; CHECK:     Function: test
+; CHECK-NOT:   May:
+
 define void @test() {
   %D = getelementptr %T* @G, i64 0, i32 0
   %E = getelementptr %T* @G, i64 0, i32 1, i64 5
index 56e4ed05cefe6ad9291d3ea148701b0cc92372a9..578aa5943cbc82bdb713f9c3c59edfe7af7e4904 100644 (file)
@@ -1,10 +1,11 @@
-; RUN: opt < %s -basicaa -dse -S | grep {store i32 0}
+; RUN: opt < %s -basicaa -dse -S | FileCheck %s
 
 define void @test({i32,i32 }* %P) {
-       %Q = getelementptr {i32,i32}* %P, i32 1
-       %X = getelementptr {i32,i32}* %Q, i32 0, i32 1
-       %Y = getelementptr {i32,i32}* %Q, i32 1, i32 1
-       store i32 0, i32* %X
-       store i32 1, i32* %Y
-       ret void
+; CHECK: store i32 0, i32* %X
+  %Q = getelementptr {i32,i32}* %P, i32 1
+  %X = getelementptr {i32,i32}* %Q, i32 0, i32 1
+  %Y = getelementptr {i32,i32}* %Q, i32 1, i32 1
+  store i32 0, i32* %X
+  store i32 1, i32* %Y
+  ret void
 }
index 83205944727252ef53c9f815eebc9fcaa2278477..c98241e846927b35730e473d4deba496deff7be6 100644 (file)
@@ -1,7 +1,9 @@
-; RUN: opt < %s -basicaa -aa-eval -disable-output |& grep {2 no alias respon}
+; RUN: opt < %s -basicaa -aa-eval -disable-output |& FileCheck %s
 ; TEST that A[1][0] may alias A[0][i].
 target datalayout = "E-p:64:64:64-a0:0:8-f32:32:32-f64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-v64:64:64-v128:128:128"
 
+; CHECK: 2 no alias responses
+
 define void @test(i32 %N) {
 entry:
        %X = alloca [3 x [3 x i32]]             ; <[3 x [3 x i32]]*> [#uses=4]
index 917bf2554dca5f9c47cc40555f9d6bdb30112570..46b6aaf91ac984d4792354eed818d105cc660f12 100644 (file)
@@ -1,9 +1,5 @@
+; RUN: opt < %s -basicaa -gvn -instcombine -S | FileCheck %s
 ; PR1109
-; RUN: opt < %s -basicaa -gvn -instcombine -S | \
-; RUN:   grep {sub i32}
-; RUN: opt < %s -basicaa -gvn -instcombine -S | \
-; RUN:   not grep {ret i32 0}
-; END.
 
 target datalayout = "e-p:32:32"
 target triple = "i686-apple-darwin8"
@@ -20,6 +16,9 @@ target triple = "i686-apple-darwin8"
        %struct.head_type = type { [2 x %struct.LIST], %struct.FIRST_UNION, %struct.SECOND_UNION, %struct.THIRD_UNION, %struct.FOURTH_UNION, %struct.rec*, { %struct.rec* }, %struct.rec*, %struct.rec*, %struct.rec*, %struct.rec*, %struct.rec*, %struct.rec*, %struct.rec*, %struct.rec*, i32 }
        %struct.rec = type { %struct.head_type }
 
+; CHECK: define i32 @test
+; CHECK:   %Z = sub i32 %A, %Q
+; CHECK:   ret i32 %Z
 
 define i32 @test(%struct.closure_type* %tmp18169) {
        %tmp18174 = getelementptr %struct.closure_type* %tmp18169, i32 0, i32 4, i32 0, i32 0           ; <i32*> [#uses=2]
index e6a26e30c0235667aa7c29d23477c7d210993681..b46ee1925ef7dda4c6f6a9eaf446f094bb0d7a3a 100644 (file)
@@ -1,6 +1,7 @@
-; RUN: opt < %s -basicaa -aa-eval -print-all-alias-modref-info -disable-output |& grep {MayAlias:.*i32\\* %., i32\\* %.} | grep {%x} | grep {%y}
+; RUN: opt < %s -basicaa -aa-eval -print-all-alias-modref-info -disable-output |& FileCheck %s
 
-declare i32* @unclear(i32* %a)
+; CHECK: Function: foo
+; CHECK:   MayAlias: i32* %x, i32* %y
 
 define void @foo(i32* noalias %x) {
   %y = call i32* @unclear(i32* %x)
@@ -8,3 +9,5 @@ define void @foo(i32* noalias %x) {
   store i32 0, i32* %y
   ret void
 }
+
+declare i32* @unclear(i32* %a)
index 7f33fa4a2d082087202b8fe765414b537fa07f45..93b277edf6711fc90a2a7eac01681df42236218a 100644 (file)
@@ -1,6 +1,9 @@
-; RUN: opt < %s -basicaa -aa-eval -print-all-alias-modref-info -disable-output |& grep {9 no alias}
-; RUN: opt < %s -basicaa -aa-eval -print-all-alias-modref-info -disable-output |& grep {6 may alias}
-; RUN: opt < %s -basicaa -aa-eval -print-all-alias-modref-info -disable-output |& grep {MayAlias:.*i32\\* %Ipointer, i32\\* %Jpointer}
+; RUN: opt < %s -basicaa -aa-eval -print-all-alias-modref-info -disable-output |& FileCheck %s
+
+; CHECK: Function: foo
+; CHECK:   MayAlias: i32* %Ipointer, i32* %Jpointer
+; CHECK: 9 no alias responses
+; CHECK: 6 may alias responses
 
 define void @foo(i32* noalias %p, i32* noalias %q, i32 %i, i32 %j) {
   %Ipointer = getelementptr i32* %p, i32 %i
index 5b81c17d43a367e4aca7302221a0a40c40c2a3dd..ec0e2bd91413a91cf724242c0d1b2806428f2962 100644 (file)
@@ -1,11 +1,10 @@
+; RUN: opt < %s -basicaa -gvn -instcombine -S | FileCheck %s
 ; PR1600
-; RUN: opt < %s -basicaa -gvn -instcombine -S | \
-; RUN:   grep {ret i32 0}
-; END.
 
 declare i16 @llvm.cttz.i16(i16, i1)
 
 define i32 @test(i32* %P, i16* %Q) {
+; CHECK: ret i32 0
         %A = load i16* %Q               ; <i16> [#uses=1]
         %x = load i32* %P               ; <i32> [#uses=1]
         %B = call i16 @llvm.cttz.i16( i16 %A, i1 true )          ; <i16> [#uses=1]
index 78f24b5e305df9add0cc62e35a89d4d7bbca4ae2..429160ef6d5e20c3f21633e5311a88f37fff897c 100644 (file)
@@ -1,10 +1,12 @@
-; RUN: opt < %s -basicaa -gvn -dce -S | grep tmp7
+; RUN: opt < %s -basicaa -gvn -dce -S | FileCheck %s
 
         %struct.A = type { i32 }
         %struct.B = type { %struct.A }
 @a = global %struct.B zeroinitializer           ; <%struct.B*> [#uses=2]
 
 define i32 @_Z3fooP1A(%struct.A* %b) {
+; CHECK: %tmp7 = load
+; CHECK: ret i32 %tmp7
 entry:
         store i32 1, i32* getelementptr (%struct.B* @a, i32 0, i32 0, i32 0), align 8
         %tmp4 = getelementptr %struct.A* %b, i32 0, i32 0               ;<i32*> [#uses=1]
index 2069401628d2614458ea162830b3c54ddab20ee1..428189a8a8748a4eeb47bb8b16b2134be57993b2 100644 (file)
@@ -1,10 +1,11 @@
-; RUN: opt < %s -std-compile-opts -S | grep store
+; RUN: opt < %s -std-compile-opts -S | FileCheck %s
 ; ModuleID = 'small2.c'
 target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
 target triple = "i386-apple-darwin8"
        %struct.x = type { [4 x i32] }
 
 define void @foo(%struct.x* byval align 4  %X) nounwind  {
+; CHECK: store i32 2, i32* %tmp1
 entry:
        %tmp = getelementptr %struct.x* %X, i32 0, i32 0                ; <[4 x i32]*> [#uses=1]
        %tmp1 = getelementptr [4 x i32]* %tmp, i32 0, i32 3             ; <i32*> [#uses=1]
index c9e553d69476c89087c114ff1622cfdd3d8674ff..e8cf380d6f5f3f3d36029124729cc3d0c4fc0a76 100644 (file)
@@ -1,7 +1,9 @@
-; RUN: opt < %s -basicaa -aa-eval |& grep {1 no alias response}
+; RUN: opt < %s -basicaa -aa-eval -disable-output |& FileCheck %s
 
 declare noalias i32* @_Znwj(i32 %x) nounwind
 
+; CHECK: 1 no alias response
+
 define i32 @foo() {
   %A = call i32* @_Znwj(i32 4)
   %B = call i32* @_Znwj(i32 4)
index 3ab5d03ca8c4fb85aca2886a878c33f246d8358f..add7dee0fe108fc3c5dd6c38a4683c98cf4ca783 100644 (file)
@@ -1,8 +1,9 @@
-; RUN: opt < %s -basicaa -gvn -S | grep load
+; RUN: opt < %s -basicaa -gvn -S | FileCheck %s
 
 declare noalias i32* @noalias()
 
 define i32 @test(i32 %x) {
+; CHECK: load i32* %a
   %a = call i32* @noalias()
   store i32 1, i32* %a
   %b = getelementptr i32* %a, i32 %x
index 17db2fd739ad092208772d1b0440df8625df67d1..a9750d25c6e6e06fb30b9835d6232ea763a604ae 100644 (file)
@@ -1,10 +1,13 @@
-; RUN: opt < %s -basicaa -aa-eval -print-all-alias-modref-info -disable-output |& grep {NoAlias:.*%P,.*@Z}
+; RUN: opt < %s -basicaa -aa-eval -print-all-alias-modref-info -disable-output |& FileCheck %s
 ; If GEP base doesn't alias Z, then GEP doesn't alias Z.
 ; rdar://7282591
 
 @Y = common global i32 0
 @Z = common global i32 0
 
+; CHECK: Function: foo
+; CHECK:   NoAlias: i32* %P, i32* @Z
+
 define void @foo(i32 %cond) nounwind {
 entry:
   %a = alloca i32
index 7b5584e0bd8b1b9f09501e5df09e8495d1467338..e647231de19417e47e3c102c472d118c42129788 100644 (file)
@@ -1,8 +1,10 @@
-; RUN: opt < %s -basicaa -aa-eval -print-all-alias-modref-info -disable-output |& grep {1 partial alias}
+; RUN: opt < %s -basicaa -aa-eval -print-all-alias-modref-info -disable-output |& FileCheck %s
 ; PR7959
 
 target datalayout = "e-p:32:32:32"
 
+; CHECK: 1 partial alias response
+
 define i32 @test(i32* %tab, i32 %indvar) nounwind {
   %tmp31 = mul i32 %indvar, -2
   %tmp32 = add i32 %tmp31, 30
index 2aba7538ed5e485a0f0d4d808d9fac1f3e1a1235..673fee01cc8d4cb110c0b6cc455e8149ab948fbd 100644 (file)
@@ -1,17 +1,17 @@
-; RUN: opt < %s -basicaa -gvn -S | grep {ret i32 1}
+; RUN: opt < %s -basicaa -gvn -S | FileCheck %s
 target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
 target triple = "i686-apple-darwin8"
        %struct.x = type { i32, i32, i32, i32 }
 @g = weak global i32 0         ; <i32*> [#uses=1]
 
 define i32 @foo(%struct.x* byval  %a) nounwind  {
-entry:
-       %tmp1 = tail call i32 (...)* @bar( %struct.x* %a ) nounwind             ; <i32> [#uses=0]
-       %tmp2 = getelementptr %struct.x* %a, i32 0, i32 0               ; <i32*> [#uses=2]
-       store i32 1, i32* %tmp2, align 4
-       store i32 2, i32* @g, align 4
-       %tmp4 = load i32* %tmp2, align 4                ; <i32> [#uses=1]
-       ret i32 %tmp4
+; CHECK: ret i32 1
+  %tmp1 = tail call i32 (...)* @bar( %struct.x* %a ) nounwind          ; <i32> [#uses=0]
+  %tmp2 = getelementptr %struct.x* %a, i32 0, i32 0            ; <i32*> [#uses=2]
+  store i32 1, i32* %tmp2, align 4
+  store i32 2, i32* @g, align 4
+  %tmp4 = load i32* %tmp2, align 4             ; <i32> [#uses=1]
+  ret i32 %tmp4
 }
 
 declare i32 @bar(...)
index 754309cd81bb709b5282f25971d5927cfbff16b6..d0cd9f40ccc2fc60c0a07cb48e6e72ebbcfb16e7 100644 (file)
@@ -1,8 +1,9 @@
-; RUN: opt < %s -basicaa -gvn -instcombine -S | grep {ret i32 0}
+; RUN: opt < %s -basicaa -gvn -instcombine -S | FileCheck %s
 
 @flag0 = internal global i32 zeroinitializer
 @turn = internal global i32 zeroinitializer
 
+; CHECK: ret i32 0
 
 define i32 @main() {
   %a = load i32* @flag0
index 7b06780e6b18fe9bca8594026d0c95d3b17a53c1..25927ebbe19e9ece50b864b9c27b679340308e4d 100644 (file)
@@ -1,8 +1,10 @@
-; RUN: opt < %s -basicaa -aa-eval -print-all-alias-modref-info -disable-output \
-; RUN:   |& grep {NoAlias:     \{\}\\* \[%\]p, \{\}\\* \[%\]q}
+; RUN: opt < %s -basicaa -aa-eval -print-all-alias-modref-info -disable-output |& FileCheck %s
 
 target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
 
+; CHECK:      Function: foo:
+; CHECK-NEXT:   NoAlias: {}* %p, {}* %q
+
 define void @foo({}* %p, {}* %q) {
   store {} {}, {}* %p
   store {} {}, {}* %q
index 4fa6375c14391b0b4de5248871db4c7f39f421b7..2c34fd5f615a5e59c288fdb6081a80e3f4be0e45 100644 (file)
@@ -1,5 +1,5 @@
-; RUN: opt -S -tbaa -basicaa -gvn < %s | grep {ret i32 %}
-; RUN: opt -S -tbaa -gvn < %s | grep {ret i32 0}
+; RUN: opt -S -tbaa -basicaa -gvn < %s | FileCheck -check-prefix=BASICAA %s
+; RUN: opt -S -tbaa -gvn < %s | FileCheck %s
 ; rdar://8875631, rdar://8875069
 
 ; BasicAA should notice that the store stores to the entire %u object,
@@ -14,6 +14,8 @@ target datalayout = "e-p:64:64:64"
 @endianness_test = global i64 1, align 8
 
 define i32 @signbit(double %x) nounwind {
+; BASICAA: ret i32 %tmp5.lobit
+; CHECK:   ret i32 0
 entry:
   %u = alloca %union.anon, align 8
   %tmp9 = getelementptr inbounds %union.anon* %u, i64 0, i32 0
index a903362beb995f3709c76ee2bb83e3d1f4d53e2b..db557b7a248b1c77f7ae883adc27cf278f04adfb 100644 (file)
@@ -2,12 +2,15 @@
 ; disambiguating some obvious cases.  All loads should be removable in 
 ; this testcase.
 
-; RUN: opt < %s -basicaa -gvn -instcombine -dce -S \
-; RUN: | not grep load
+; RUN: opt < %s -basicaa -gvn -instcombine -dce -S | FileCheck %s
 
 @A = global i32 7
 @B = global i32 8
 
+; CHECK:      define i32 @test()
+; CHECK-NEXT:   store i32 123, i32* @B
+; CHECK-NEXT:   ret i32 0
+
 define i32 @test() {
        %A1 = load i32* @A
 
@@ -18,6 +21,14 @@ define i32 @test() {
        ret i32 %X
 }
 
+; CHECK:      define i32 @test2()
+; CHECK-NEXT:   br label %Loop
+; CHECK:      Loop:
+; CHECK-NEXT:   store i32 0, i32* @B
+; CHECK-NEXT:   br i1 true, label %out, label %Loop
+; CHECK:      out:
+; CHECK-NEXT:   ret i32 0
+
 define i32 @test2() {
         %A1 = load i32* @A
         br label %Loop
@@ -36,6 +47,10 @@ out:
 
 declare void @external()
 
+; CHECK:      define i32 @test3()
+; CHECK-NEXT:   call void @external()
+; CHECK-NEXT:   ret i32 7
+
 define i32 @test3() {
        %X = alloca i32
        store i32 7, i32* %X
index ccabce9b7b44b4e555f2a9629463cefcc96e67df..b93db6e0ee7c3d92b180cb7bbf327dfaa77f12a1 100644 (file)
@@ -1,9 +1,10 @@
-; RUN: opt < %s -basicaa -gvn -instcombine -S | grep {ret i1 true}
+; RUN: opt < %s -basicaa -gvn -instcombine -S | FileCheck %s
 ; PR2436
 target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
 target triple = "i386-apple-darwin8"
 
 define i1 @foo(i32 %i) nounwind  {
+; CHECK: ret i1 true
 entry:
        %arr = alloca [10 x i8*]                ; <[10 x i8*]*> [#uses=1]
        %tmp2 = call i8* @getPtr( ) nounwind            ; <i8*> [#uses=2]
index 7970fbb9a03debdb407f923763782d74f5392a1b..a8658ec801acdee29602a4965061004c42d2c851 100644 (file)
@@ -1,8 +1,9 @@
-; RUN: opt < %s -basicaa -gvn -instcombine -S | grep {ret i32 0}
+; RUN: opt < %s -basicaa -gvn -instcombine -S | FileCheck %s
 
 declare i32* @test(i32* nocapture)
 
 define i32 @test2() {
+; CHECK: ret i32 0
        %P = alloca i32
        %Q = call i32* @test(i32* %P)
        %a = load i32* %P
index 50fd5cd22ba6bc85bdd521bac902613ca5909ad2..a1b8d2ce53354d3d34c7e24e5feded9d9a46f1da 100644 (file)
@@ -1,10 +1,12 @@
-; RUN: opt < %s -basicaa -aa-eval -print-all-alias-modref-info -disable-output |& grep {NoAlias:.*%P,.*@Z}
+; RUN: opt < %s -basicaa -aa-eval -print-all-alias-modref-info -disable-output |& FileCheck %s
 ; rdar://7282591
 
 @X = common global i32 0
 @Y = common global i32 0
 @Z = common global i32 0
 
+; CHECK:  NoAlias: i32* %P, i32* @Z
+
 define void @foo(i32 %cond) nounwind {
 entry:
   %"alloca point" = bitcast i32 0 to i32
index 0ed4a2c5a576ac2a06825ece2165d201bfaff30b..f752ab3c3ecae6f5974c66dcbb144529f32e53d6 100644 (file)
@@ -1,8 +1,17 @@
-; RUN: opt < %s -basicaa -aa-eval -print-all-alias-modref-info -disable-output \
-; RUN:   |& grep {NoAlias:     double\\* \[%\]a, double\\* \[%\]b\$} | count 4
+; RUN: opt < %s -basicaa -aa-eval -print-all-alias-modref-info -disable-output |& FileCheck %s
 
 ; BasicAA should detect NoAliases in PHIs and Selects.
 
+; CHECK: Function: foo
+; CHECK:  NoAlias: double* %a, double* %b
+; CHECK: Function: bar
+; CHECK:  NoAlias: double* %a, double* %b
+; CHECK: Function: qux
+; CHECK:  NoAlias: double* %a, double* %b
+; CHECK: Function: fin
+; CHECK:  NoAlias: double* %a, double* %b
+; CHECK: ===== Alias Analysis Evaluator Report =====
+
 ; Two PHIs in the same block.
 define void @foo(i1 %m, double* noalias %x, double* noalias %y) {
 entry:
index 54e6e79a5e508799cd0dbc934ddf3787d0fd3b1d..266e607b21a474887173a05b0e9430b7e6218591 100644 (file)
@@ -1,7 +1,25 @@
-; RUN: opt < %s -basicaa -gvn -S | grep TestConst | count 2
-; RUN: opt < %s -basicaa -gvn -S | grep TestPure  | count 3
-; RUN: opt < %s -basicaa -gvn -S | grep TestNone  | count 4
-@g = global i32 0              ; <i32*> [#uses=1]
+; RUN: opt < %s -basicaa -gvn -S | FileCheck %s
+
+@g = global i32 0
+
+; CHECK:      @test
+; CHECK:      entry
+; CHECK:      %tmp0 = call i32 @TestConst(i32 5) readnone
+; CHECK-NEXT: %tmp1 = call i32 @TestPure(i32 6) readonly
+; CHECK-NEXT: %tmp2 = call i32 @TestNone(i32 7)
+; CHECK-NEXT: store i32 1, i32* @g
+; CHECK-NEXT: %tmp5 = call i32 @TestPure(i32 6) readonly
+; CHECK-NEXT: %tmp7 = call i32 @TestNone(i32 7)
+; CHECK-NEXT: %tmp8 = call i32 @TestNone(i32 7)
+; CHECK-NEXT: %sum0 = add i32 %tmp0, %tmp1
+; CHECK-NEXT: %sum1 = add i32 %sum0, %tmp2
+; CHECK-NEXT: %sum2 = add i32 %sum1, %tmp0
+; CHECK-NEXT: %sum3 = add i32 %sum2, %tmp0
+; CHECK-NEXT: %sum4 = add i32 %sum3, %tmp5
+; CHECK-NEXT: %sum5 = add i32 %sum4, %tmp5
+; CHECK-NEXT: %sum6 = add i32 %sum5, %tmp7
+; CHECK-NEXT: %sum7 = add i32 %sum6, %tmp8
+; CHECK-NEXT: ret i32 %sum7
 
 define i32 @test() {
 entry:
index f7d6c57c1bcd8792a95cacf627c8d9d6fa7c861c..ebeb28c11310c09f0e3d2302b56577caf66cd4cf 100644 (file)
@@ -1,11 +1,7 @@
-; RUN: opt < %s -basicaa -gvn -instcombine |\
-; RUN:   llvm-dis | grep {ret i32 0}
-
-declare void @foo(i32*)
-
-declare void @bar()
+; RUN: opt < %s -basicaa -gvn -instcombine -S | FileCheck %s
 
 define i32 @test() {
+; CHECK: ret i32 0
         %A = alloca i32         ; <i32*> [#uses=3]
         call void @foo( i32* %A )
         %X = load i32* %A               ; <i32> [#uses=1]
@@ -14,3 +10,7 @@ define i32 @test() {
         %Z = sub i32 %X, %Y             ; <i32> [#uses=1]
         ret i32 %Z
 }
+
+declare void @foo(i32*)
+
+declare void @bar()