summaryrefslogtreecommitdiff
path: root/test/Transforms
diff options
context:
space:
mode:
authorEd Schouten <ed@FreeBSD.org>2009-06-14 09:23:33 +0000
committerEd Schouten <ed@FreeBSD.org>2009-06-14 09:23:33 +0000
commit600c6fa13de5c407dc36dbb0ab73807868741ae0 (patch)
tree49817b316c4fdaa56d9d16ebf2555303d1a990e0 /test/Transforms
parent93338c197185f946619794ce011ec27b5b6250e2 (diff)
Notes
Diffstat (limited to 'test/Transforms')
-rw-r--r--test/Transforms/IndVarSimplify/2003-09-23-NotAtTop.ll2
-rw-r--r--test/Transforms/IndVarSimplify/masked-iv.ll24
-rw-r--r--test/Transforms/InstCombine/2009-06-11-StoreAddrSpace.ll7
-rw-r--r--test/Transforms/InstCombine/fsub-fsub.ll8
-rw-r--r--test/Transforms/MergeFunc/fold-weak.ll4
5 files changed, 43 insertions, 2 deletions
diff --git a/test/Transforms/IndVarSimplify/2003-09-23-NotAtTop.ll b/test/Transforms/IndVarSimplify/2003-09-23-NotAtTop.ll
index d70e604979787..b4a2c50618944 100644
--- a/test/Transforms/IndVarSimplify/2003-09-23-NotAtTop.ll
+++ b/test/Transforms/IndVarSimplify/2003-09-23-NotAtTop.ll
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | opt -indvars | llvm-dis | %prcontext Loop: 1 | grep %indvar
+; RUN: llvm-as < %s | opt -indvars | llvm-dis | %prcontext ^Loop: 1 | grep %Canonical
; The indvar simplification code should ensure that the first PHI in the block
; is the canonical one!
diff --git a/test/Transforms/IndVarSimplify/masked-iv.ll b/test/Transforms/IndVarSimplify/masked-iv.ll
new file mode 100644
index 0000000000000..c7583c9655a88
--- /dev/null
+++ b/test/Transforms/IndVarSimplify/masked-iv.ll
@@ -0,0 +1,24 @@
+; RUN: llvm-as < %s | opt -indvars | llvm-dis | grep trunc | count 1
+
+; Indvars should do the IV arithmetic in the canonical IV type (i64),
+; and only use one truncation.
+
+define void @foo(i64* %A, i64* %B, i64 %n, i64 %a, i64 %s) nounwind {
+entry:
+ %t0 = icmp sgt i64 %n, 0 ; <i1> [#uses=1]
+ br i1 %t0, label %bb.preheader, label %return
+
+bb.preheader: ; preds = %entry
+ br label %bb
+
+bb: ; preds = %bb, %bb.preheader
+ %i.01 = phi i64 [ %t6, %bb ], [ %a, %bb.preheader ] ; <i64> [#uses=3]
+ %t1 = and i64 %i.01, 255 ; <i64> [#uses=1]
+ %t2 = getelementptr i64* %A, i64 %t1 ; <i64*> [#uses=1]
+ store i64 %i.01, i64* %t2, align 8
+ %t6 = add i64 %i.01, %s ; <i64> [#uses=1]
+ br label %bb
+
+return: ; preds = %entry
+ ret void
+}
diff --git a/test/Transforms/InstCombine/2009-06-11-StoreAddrSpace.ll b/test/Transforms/InstCombine/2009-06-11-StoreAddrSpace.ll
new file mode 100644
index 0000000000000..e86fed3c36442
--- /dev/null
+++ b/test/Transforms/InstCombine/2009-06-11-StoreAddrSpace.ll
@@ -0,0 +1,7 @@
+; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep store
+; PR4366
+
+define void @a() {
+ store i32 0, i32 addrspace(1)* null
+ ret void
+}
diff --git a/test/Transforms/InstCombine/fsub-fsub.ll b/test/Transforms/InstCombine/fsub-fsub.ll
new file mode 100644
index 0000000000000..ab70479204b17
--- /dev/null
+++ b/test/Transforms/InstCombine/fsub-fsub.ll
@@ -0,0 +1,8 @@
+; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep fsub | count 2
+; PR4374
+
+define float @func(float %a, float %b) nounwind {
+ %tmp3 = fsub float %a, %b
+ %tmp4 = fsub float -0.000000e+00, %tmp3
+ ret float %tmp4
+}
diff --git a/test/Transforms/MergeFunc/fold-weak.ll b/test/Transforms/MergeFunc/fold-weak.ll
index d98fde0228fb3..cea49fb1ceca5 100644
--- a/test/Transforms/MergeFunc/fold-weak.ll
+++ b/test/Transforms/MergeFunc/fold-weak.ll
@@ -1,4 +1,6 @@
-; RUN: llvm-as < %s | opt -mergefunc | llvm-dis | grep {alias weak} | count 2
+; RUN: llvm-as < %s | opt -mergefunc | llvm-dis > %t
+; RUN: grep {define weak} %t | count 2
+; RUN: grep {call} %t | count 2
define weak i32 @sum(i32 %x, i32 %y) {
%sum = add i32 %x, %y