summaryrefslogtreecommitdiff
path: root/test/Analysis
diff options
context:
space:
mode:
Diffstat (limited to 'test/Analysis')
-rw-r--r--test/Analysis/BasicAA/2006-03-03-BadArraySubscript.ll1
-rw-r--r--test/Analysis/BasicAA/2009-10-13-AtomicModRef.ll1
-rw-r--r--test/Analysis/BasicAA/featuretest.ll1
-rw-r--r--test/Analysis/BasicAA/global-size.ll1
-rw-r--r--test/Analysis/BasicAA/modref.ll3
-rw-r--r--test/Analysis/BasicAA/phi-and-select.ll73
-rw-r--r--test/Analysis/BasicAA/store-promote.ll1
-rw-r--r--test/Analysis/LoopInfo/2003-05-15-NestingProblem.ll2
-rw-r--r--test/Analysis/ScalarEvolution/2007-11-18-OrInstruction.ll5
-rw-r--r--test/Analysis/ScalarEvolution/2008-07-29-SGTTripCount.ll5
-rw-r--r--test/Analysis/ScalarEvolution/2008-07-29-SMinExpr.ll6
-rw-r--r--test/Analysis/ScalarEvolution/2008-08-04-IVOverflow.ll4
-rw-r--r--test/Analysis/ScalarEvolution/2008-08-04-LongAddRec.ll4
-rw-r--r--test/Analysis/ScalarEvolution/2009-05-09-PointerEdgeCount.ll1
14 files changed, 99 insertions, 9 deletions
diff --git a/test/Analysis/BasicAA/2006-03-03-BadArraySubscript.ll b/test/Analysis/BasicAA/2006-03-03-BadArraySubscript.ll
index 5d08312791f20..49327acdae0e5 100644
--- a/test/Analysis/BasicAA/2006-03-03-BadArraySubscript.ll
+++ b/test/Analysis/BasicAA/2006-03-03-BadArraySubscript.ll
@@ -1,5 +1,6 @@
; RUN: opt < %s -aa-eval -disable-output |& grep {2 no alias respon}
; 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"
define void @test(i32 %N) {
entry:
diff --git a/test/Analysis/BasicAA/2009-10-13-AtomicModRef.ll b/test/Analysis/BasicAA/2009-10-13-AtomicModRef.ll
index 5ea26e76a6af1..64754712d43a7 100644
--- a/test/Analysis/BasicAA/2009-10-13-AtomicModRef.ll
+++ b/test/Analysis/BasicAA/2009-10-13-AtomicModRef.ll
@@ -1,4 +1,5 @@
; RUN: opt -gvn -instcombine -S < %s | FileCheck %s
+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"
declare i8 @llvm.atomic.load.add.i8.p0i8(i8*, i8)
diff --git a/test/Analysis/BasicAA/featuretest.ll b/test/Analysis/BasicAA/featuretest.ll
index 737ee45350347..50dc8864ac9b0 100644
--- a/test/Analysis/BasicAA/featuretest.ll
+++ b/test/Analysis/BasicAA/featuretest.ll
@@ -2,6 +2,7 @@
; determine, as noted in the comments.
; RUN: opt < %s -basicaa -gvn -instcombine -dce -S | not grep REMOVE
+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"
@Global = external global { i32 }
diff --git a/test/Analysis/BasicAA/global-size.ll b/test/Analysis/BasicAA/global-size.ll
index 0a643d4d080d0..b9cbbcc59ef64 100644
--- a/test/Analysis/BasicAA/global-size.ll
+++ b/test/Analysis/BasicAA/global-size.ll
@@ -2,6 +2,7 @@
; the global.
; RUN: opt < %s -basicaa -gvn -instcombine -S | not grep load
+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"
@B = global i16 8 ; <i16*> [#uses=2]
diff --git a/test/Analysis/BasicAA/modref.ll b/test/Analysis/BasicAA/modref.ll
index 69b60d7c297c5..02db861c609fe 100644
--- a/test/Analysis/BasicAA/modref.ll
+++ b/test/Analysis/BasicAA/modref.ll
@@ -1,4 +1,5 @@
; RUN: opt < %s -basicaa -gvn -dse -S | FileCheck %s
+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"
declare void @llvm.memset.i32(i8*, i8, i32, i32)
declare void @llvm.memset.i8(i8*, i8, i8, i32)
@@ -88,4 +89,4 @@ define void @test3a(i8* %P, i8 %X) {
call void @llvm.lifetime.end(i64 10, i8* %P)
ret void
; CHECK: ret void
-} \ No newline at end of file
+}
diff --git a/test/Analysis/BasicAA/phi-and-select.ll b/test/Analysis/BasicAA/phi-and-select.ll
new file mode 100644
index 0000000000000..c69e824035a8c
--- /dev/null
+++ b/test/Analysis/BasicAA/phi-and-select.ll
@@ -0,0 +1,73 @@
+; RUN: opt < %s -aa-eval -print-all-alias-modref-info -disable-output \
+; RUN: |& grep {NoAlias: double\\* \[%\]a, double\\* \[%\]b\$} | count 4
+
+; BasicAA should detect NoAliases in PHIs and Selects.
+
+; Two PHIs in the same block.
+define void @foo(i1 %m, double* noalias %x, double* noalias %y) {
+entry:
+ br i1 %m, label %true, label %false
+
+true:
+ br label %exit
+
+false:
+ br label %exit
+
+exit:
+ %a = phi double* [ %x, %true ], [ %y, %false ]
+ %b = phi double* [ %x, %false ], [ %y, %true ]
+ volatile store double 0.0, double* %a
+ volatile store double 1.0, double* %b
+ ret void
+}
+
+; Two selects with the same condition.
+define void @bar(i1 %m, double* noalias %x, double* noalias %y) {
+entry:
+ %a = select i1 %m, double* %x, double* %y
+ %b = select i1 %m, double* %y, double* %x
+ volatile store double 0.000000e+00, double* %a
+ volatile store double 1.000000e+00, double* %b
+ ret void
+}
+
+; Two PHIs with disjoint sets of inputs.
+define void @qux(i1 %m, double* noalias %x, double* noalias %y,
+ i1 %n, double* noalias %v, double* noalias %w) {
+entry:
+ br i1 %m, label %true, label %false
+
+true:
+ br label %exit
+
+false:
+ br label %exit
+
+exit:
+ %a = phi double* [ %x, %true ], [ %y, %false ]
+ br i1 %n, label %ntrue, label %nfalse
+
+ntrue:
+ br label %nexit
+
+nfalse:
+ br label %nexit
+
+nexit:
+ %b = phi double* [ %v, %ntrue ], [ %w, %nfalse ]
+ volatile store double 0.0, double* %a
+ volatile store double 1.0, double* %b
+ ret void
+}
+
+; Two selects with disjoint sets of arms.
+define void @fin(i1 %m, double* noalias %x, double* noalias %y,
+ i1 %n, double* noalias %v, double* noalias %w) {
+entry:
+ %a = select i1 %m, double* %x, double* %y
+ %b = select i1 %n, double* %v, double* %w
+ volatile store double 0.000000e+00, double* %a
+ volatile store double 1.000000e+00, double* %b
+ ret void
+}
diff --git a/test/Analysis/BasicAA/store-promote.ll b/test/Analysis/BasicAA/store-promote.ll
index d8e7c75142a2a..33d0f3a5449b9 100644
--- a/test/Analysis/BasicAA/store-promote.ll
+++ b/test/Analysis/BasicAA/store-promote.ll
@@ -3,6 +3,7 @@
; two pointers, then the load should be hoisted, and the store sunk.
; RUN: opt < %s -basicaa -licm -S | FileCheck %s
+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"
@A = global i32 7 ; <i32*> [#uses=3]
@B = global i32 8 ; <i32*> [#uses=2]
diff --git a/test/Analysis/LoopInfo/2003-05-15-NestingProblem.ll b/test/Analysis/LoopInfo/2003-05-15-NestingProblem.ll
index 617c23f8e86f0..9355aeea54968 100644
--- a/test/Analysis/LoopInfo/2003-05-15-NestingProblem.ll
+++ b/test/Analysis/LoopInfo/2003-05-15-NestingProblem.ll
@@ -2,7 +2,7 @@
; not a child of the loopentry.6 loop.
;
; RUN: opt < %s -analyze -loops | \
-; RUN: grep {^ Loop at depth 4 containing: %loopentry.7<header><latch><exit>}
+; RUN: grep {^ Loop at depth 4 containing: %loopentry.7<header><latch><exiting>}
define void @getAndMoveToFrontDecode() {
br label %endif.2
diff --git a/test/Analysis/ScalarEvolution/2007-11-18-OrInstruction.ll b/test/Analysis/ScalarEvolution/2007-11-18-OrInstruction.ll
index 2b3c982d6b127..27fe714089be8 100644
--- a/test/Analysis/ScalarEvolution/2007-11-18-OrInstruction.ll
+++ b/test/Analysis/ScalarEvolution/2007-11-18-OrInstruction.ll
@@ -1,4 +1,4 @@
-; RUN: opt < %s -analyze -scalar-evolution -disable-output | grep -e {--> %b}
+; RUN: opt < %s -analyze -scalar-evolution -disable-output | FileCheck %s
; PR1810
define void @fun() {
@@ -16,3 +16,6 @@ body:
exit:
ret void
}
+
+; CHECK: --> %b
+
diff --git a/test/Analysis/ScalarEvolution/2008-07-29-SGTTripCount.ll b/test/Analysis/ScalarEvolution/2008-07-29-SGTTripCount.ll
index 97d0640c6c585..37b5b94b8448f 100644
--- a/test/Analysis/ScalarEvolution/2008-07-29-SGTTripCount.ll
+++ b/test/Analysis/ScalarEvolution/2008-07-29-SGTTripCount.ll
@@ -1,6 +1,5 @@
; RUN: opt < %s -analyze -scalar-evolution -disable-output \
-; RUN: -scalar-evolution-max-iterations=0 | \
-; RUN: grep -F "backedge-taken count is (-1 + (-1 * %j))"
+; RUN: -scalar-evolution-max-iterations=0 | FileCheck %s
; PR2607
define i32 @_Z1aj(i32 %j) nounwind {
@@ -25,3 +24,5 @@ return: ; preds = %return.loopexit, %entry
ret i32 %i.0.lcssa
}
+; CHECK: backedge-taken count is (-1 + (-1 * %j))
+
diff --git a/test/Analysis/ScalarEvolution/2008-07-29-SMinExpr.ll b/test/Analysis/ScalarEvolution/2008-07-29-SMinExpr.ll
index 7f4de91733365..d54b3b4e9ce70 100644
--- a/test/Analysis/ScalarEvolution/2008-07-29-SMinExpr.ll
+++ b/test/Analysis/ScalarEvolution/2008-07-29-SMinExpr.ll
@@ -1,6 +1,5 @@
; RUN: opt < %s -analyze -scalar-evolution -disable-output \
-; RUN: -scalar-evolution-max-iterations=0 | \
-; RUN: grep -F "backedge-taken count is (-2147483632 + ((-1 + (-1 * %x)) smax (-1 + (-1 * %y))))"
+; RUN: -scalar-evolution-max-iterations=0 | FileCheck %s
; PR2607
define i32 @b(i32 %x, i32 %y) nounwind {
@@ -22,3 +21,6 @@ afterfor: ; preds = %forinc, %entry
%j.0.lcssa = phi i32 [ -2147483632, %entry ], [ %dec, %forinc ]
ret i32 %j.0.lcssa
}
+
+; CHECK: backedge-taken count is (-2147483632 + ((-1 + (-1 * %x)) smax (-1 + (-1 * %y))))
+
diff --git a/test/Analysis/ScalarEvolution/2008-08-04-IVOverflow.ll b/test/Analysis/ScalarEvolution/2008-08-04-IVOverflow.ll
index fa09895eac326..06200ae06ef65 100644
--- a/test/Analysis/ScalarEvolution/2008-08-04-IVOverflow.ll
+++ b/test/Analysis/ScalarEvolution/2008-08-04-IVOverflow.ll
@@ -1,5 +1,5 @@
; RUN: opt < %s -analyze -scalar-evolution -disable-output \
-; RUN: -scalar-evolution-max-iterations=0 | grep -F "Exits: 20028"
+; RUN: -scalar-evolution-max-iterations=0 | FileCheck %s
; PR2621
define i32 @a() nounwind {
@@ -23,3 +23,5 @@ bb2:
ret i32 %4
}
+; CHECK: Exits: 20028
+
diff --git a/test/Analysis/ScalarEvolution/2008-08-04-LongAddRec.ll b/test/Analysis/ScalarEvolution/2008-08-04-LongAddRec.ll
index 5a28117eb60b1..f3c703afab62c 100644
--- a/test/Analysis/ScalarEvolution/2008-08-04-LongAddRec.ll
+++ b/test/Analysis/ScalarEvolution/2008-08-04-LongAddRec.ll
@@ -1,5 +1,5 @@
; RUN: opt < %s -analyze -scalar-evolution -disable-output \
-; RUN: -scalar-evolution-max-iterations=0 | grep -F "Exits: -19168"
+; RUN: -scalar-evolution-max-iterations=0 | FileCheck %s
; PR2621
define i32 @a() nounwind {
@@ -54,3 +54,5 @@ bb2: ; preds = %bb1
ret i32 %19
}
+; CHECK: Exits: -19168
+
diff --git a/test/Analysis/ScalarEvolution/2009-05-09-PointerEdgeCount.ll b/test/Analysis/ScalarEvolution/2009-05-09-PointerEdgeCount.ll
index 6ed261481e2d2..e81530e1b9c26 100644
--- a/test/Analysis/ScalarEvolution/2009-05-09-PointerEdgeCount.ll
+++ b/test/Analysis/ScalarEvolution/2009-05-09-PointerEdgeCount.ll
@@ -1,5 +1,6 @@
; RUN: opt < %s -analyze -scalar-evolution -disable-output | grep {count is 2}
; PR3171
+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"
%struct.Foo = type { i32 }
%struct.NonPod = type { [2 x %struct.Foo] }