aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--test/Transforms/IndVarSimplify/addrec-gep.ll10
-rw-r--r--test/Transforms/IndVarSimplify/preserve-gep-loop-variant.ll8
-rw-r--r--test/Transforms/IndVarSimplify/preserve-gep-nested.ll21
-rw-r--r--test/Transforms/IndVarSimplify/preserve-gep-remainder.ll4
-rw-r--r--test/Transforms/IndVarSimplify/preserve-gep.ll8
5 files changed, 26 insertions, 25 deletions
diff --git a/test/Transforms/IndVarSimplify/addrec-gep.ll b/test/Transforms/IndVarSimplify/addrec-gep.ll
index 58cba60..9e8b528 100644
--- a/test/Transforms/IndVarSimplify/addrec-gep.ll
+++ b/test/Transforms/IndVarSimplify/addrec-gep.ll
@@ -1,8 +1,8 @@
-; RUN: opt < %s -indvars -S > %t
-; RUN: grep getelementptr %t | count 1
-; RUN: grep {mul .*, 37} %t | count 1
-; RUN: grep {add .*, 5203} %t | count 1
-; RUN: not grep cast %t
+; RUN: opt < %s -indvars -S -enable-iv-rewrite | FileCheck %s
+; CHECK: getelementptr
+; CHECK: mul {{.*}}, 37
+; CHECK: add {{.*}}, 5203
+; CHECK-NOT: cast
; This test tests several things. The load and store should use the
; same address instead of having it computed twice, and SCEVExpander should
diff --git a/test/Transforms/IndVarSimplify/preserve-gep-loop-variant.ll b/test/Transforms/IndVarSimplify/preserve-gep-loop-variant.ll
index 26f05c4..66a1ab5 100644
--- a/test/Transforms/IndVarSimplify/preserve-gep-loop-variant.ll
+++ b/test/Transforms/IndVarSimplify/preserve-gep-loop-variant.ll
@@ -1,7 +1,7 @@
-; RUN: opt < %s -indvars -S > %t
-; RUN: not grep inttoptr %t
-; RUN: not grep ptrtoint %t
-; RUN: grep scevgep %t
+; RUN: opt < %s -indvars -S -enable-iv-rewrite | FileCheck %s
+; CHECK-NOT: {{inttoptr|ptrtoint}}
+; CHECK: scevgep
+; CHECK-NOT: {{inttoptr|ptrtoint}}
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-n:32:64"
; Indvars shouldn't need inttoptr/ptrtoint to expand an address here.
diff --git a/test/Transforms/IndVarSimplify/preserve-gep-nested.ll b/test/Transforms/IndVarSimplify/preserve-gep-nested.ll
index b41de58..613e30f 100644
--- a/test/Transforms/IndVarSimplify/preserve-gep-nested.ll
+++ b/test/Transforms/IndVarSimplify/preserve-gep-nested.ll
@@ -1,15 +1,16 @@
-; RUN: opt < %s -indvars -S > %t
-; Exactly one getelementptr for each load+store.
-; RUN: grep getelementptr %t | count 6
-; Each getelementptr using %struct.Q* %s as a base and not i8*.
-; RUN: grep {getelementptr \[%\]struct\\.Q\\* \[%\]s,} %t | count 6
+; RUN: opt < %s -indvars -S -enable-iv-rewrite | FileCheck %s
; No explicit integer multiplications!
-; RUN: not grep {= mul} %t
; No i8* arithmetic or pointer casting anywhere!
-; RUN: not grep {i8\\*} %t
-; RUN: not grep bitcast %t
-; RUN: not grep inttoptr %t
-; RUN: not grep ptrtoint %t
+; CHECK-NOT: = {{= mul|i8\*|bitcast|inttoptr|ptrtoint}}
+; Exactly one getelementptr for each load+store.
+; Each getelementptr using %struct.Q* %s as a base and not i8*.
+; CHECK: getelementptr %struct.Q* %s,
+; CHECK: getelementptr %struct.Q* %s,
+; CHECK: getelementptr %struct.Q* %s,
+; CHECK: getelementptr %struct.Q* %s,
+; CHECK: getelementptr %struct.Q* %s,
+; CHECK: getelementptr %struct.Q* %s,
+; CHECK-NOT: = {{= mul|i8\*|bitcast|inttoptr|ptrtoint}}
; FIXME: This test should pass with or without TargetData. Until opt
; supports running tests without targetdata, just hardware this in.
diff --git a/test/Transforms/IndVarSimplify/preserve-gep-remainder.ll b/test/Transforms/IndVarSimplify/preserve-gep-remainder.ll
index ca0c399..a4b1d78 100644
--- a/test/Transforms/IndVarSimplify/preserve-gep-remainder.ll
+++ b/test/Transforms/IndVarSimplify/preserve-gep-remainder.ll
@@ -1,5 +1,5 @@
-; RUN: opt < %s -indvars -S \
-; RUN: | grep {\[%\]p.2.ip.1 = getelementptr \\\[3 x \\\[3 x double\\\]\\\]\\* \[%\]p, i64 2, i64 \[%\]tmp, i64 1}
+; RUN: opt < %s -indvars -S -enable-iv-rewrite | FileCheck %s
+; CHECK: %p.2.ip.1 = getelementptr [3 x [3 x double]]* %p, i64 2, i64 %tmp, i64 1
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-n:32:64"
; Indvars shouldn't expand this to
diff --git a/test/Transforms/IndVarSimplify/preserve-gep.ll b/test/Transforms/IndVarSimplify/preserve-gep.ll
index 82eda03..f970826 100644
--- a/test/Transforms/IndVarSimplify/preserve-gep.ll
+++ b/test/Transforms/IndVarSimplify/preserve-gep.ll
@@ -1,7 +1,7 @@
-; RUN: opt < %s -indvars -S > %t
-; RUN: not grep ptrtoint %t
-; RUN: not grep inttoptr %t
-; RUN: grep getelementptr %t | count 1
+; RUN: opt < %s -indvars -S -enable-iv-rewrite | FileCheck %s
+; CHECK-NOT: {{ptrtoint|inttoptr}}
+; CHECK: getelementptr
+; CHECK-NOT: {{ptrtoint|inttoptr|getelementptr}}
; Indvars shouldn't leave getelementptrs expanded out as
; inttoptr+ptrtoint in its output in common cases.