summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Osborne <richard@xmos.com>2011-11-01 10:41:28 +0000
committerRichard Osborne <richard@xmos.com>2011-11-01 10:41:28 +0000
commit8591b6b0ab3e95b4865397543b11ccc16edd5203 (patch)
treeb8cca4cc83442b0abd753cb81f1885e7b5950e44
parentfec80c6ad2b178363fccf31046956ce11808c289 (diff)
downloadbcm5719-llvm-8591b6b0ab3e95b4865397543b11ccc16edd5203.tar.gz
bcm5719-llvm-8591b6b0ab3e95b4865397543b11ccc16edd5203.zip
Move various XCore tests to FileCheck
llvm-svn: 143457
-rw-r--r--llvm/test/CodeGen/XCore/cos.ll8
-rw-r--r--llvm/test/CodeGen/XCore/exp.ll8
-rw-r--r--llvm/test/CodeGen/XCore/exp2.ll8
-rw-r--r--llvm/test/CodeGen/XCore/fneg.ll4
-rw-r--r--llvm/test/CodeGen/XCore/getid.ll6
-rw-r--r--llvm/test/CodeGen/XCore/load.ll20
-rw-r--r--llvm/test/CodeGen/XCore/log.ll8
-rw-r--r--llvm/test/CodeGen/XCore/log10.ll8
-rw-r--r--llvm/test/CodeGen/XCore/log2.ll8
-rw-r--r--llvm/test/CodeGen/XCore/pow.ll8
-rw-r--r--llvm/test/CodeGen/XCore/powi.ll8
-rw-r--r--llvm/test/CodeGen/XCore/private.ll12
-rw-r--r--llvm/test/CodeGen/XCore/sin.ll8
-rw-r--r--llvm/test/CodeGen/XCore/sqrt.ll8
-rw-r--r--llvm/test/CodeGen/XCore/store.ll16
-rw-r--r--llvm/test/CodeGen/XCore/trap.ll7
-rw-r--r--llvm/test/CodeGen/XCore/unaligned_store_combine.ll7
17 files changed, 92 insertions, 60 deletions
diff --git a/llvm/test/CodeGen/XCore/cos.ll b/llvm/test/CodeGen/XCore/cos.ll
index 8211f85b9bc..8bc5e81dba4 100644
--- a/llvm/test/CodeGen/XCore/cos.ll
+++ b/llvm/test/CodeGen/XCore/cos.ll
@@ -1,15 +1,17 @@
-; RUN: llc < %s -march=xcore > %t1.s
-; RUN: grep "bl cosf" %t1.s | count 1
-; RUN: grep "bl cos" %t1.s | count 2
+; RUN: llc < %s -march=xcore | FileCheck %s
declare double @llvm.cos.f64(double)
define double @test(double %F) {
+; CHECK: test:
+; CHECK: bl cos
%result = call double @llvm.cos.f64(double %F)
ret double %result
}
declare float @llvm.cos.f32(float)
+; CHECK: testf:
+; CHECK: bl cosf
define float @testf(float %F) {
%result = call float @llvm.cos.f32(float %F)
ret float %result
diff --git a/llvm/test/CodeGen/XCore/exp.ll b/llvm/test/CodeGen/XCore/exp.ll
index d23d484ed62..f30f72ed9bf 100644
--- a/llvm/test/CodeGen/XCore/exp.ll
+++ b/llvm/test/CodeGen/XCore/exp.ll
@@ -1,9 +1,9 @@
-; RUN: llc < %s -march=xcore > %t1.s
-; RUN: grep "bl expf" %t1.s | count 1
-; RUN: grep "bl exp" %t1.s | count 2
+; RUN: llc < %s -march=xcore | FileCheck %s
declare double @llvm.exp.f64(double)
define double @test(double %F) {
+; CHECK: test:
+; CHECK: bl exp
%result = call double @llvm.exp.f64(double %F)
ret double %result
}
@@ -11,6 +11,8 @@ define double @test(double %F) {
declare float @llvm.exp.f32(float)
define float @testf(float %F) {
+; CHECK: testf:
+; CHECK: bl expf
%result = call float @llvm.exp.f32(float %F)
ret float %result
}
diff --git a/llvm/test/CodeGen/XCore/exp2.ll b/llvm/test/CodeGen/XCore/exp2.ll
index 4c4d17f4bbf..e9ff0a55748 100644
--- a/llvm/test/CodeGen/XCore/exp2.ll
+++ b/llvm/test/CodeGen/XCore/exp2.ll
@@ -1,9 +1,9 @@
-; RUN: llc < %s -march=xcore > %t1.s
-; RUN: grep "bl exp2f" %t1.s | count 1
-; RUN: grep "bl exp2" %t1.s | count 2
+; RUN: llc < %s -march=xcore | FileCheck %s
declare double @llvm.exp2.f64(double)
define double @test(double %F) {
+; CHECK: test:
+; CHECK: bl exp2
%result = call double @llvm.exp2.f64(double %F)
ret double %result
}
@@ -11,6 +11,8 @@ define double @test(double %F) {
declare float @llvm.exp2.f32(float)
define float @testf(float %F) {
+; CHECK: testf:
+; CHECK: bl exp2f
%result = call float @llvm.exp2.f32(float %F)
ret float %result
}
diff --git a/llvm/test/CodeGen/XCore/fneg.ll b/llvm/test/CodeGen/XCore/fneg.ll
index e3dd3dd45c2..d442a19712f 100644
--- a/llvm/test/CodeGen/XCore/fneg.ll
+++ b/llvm/test/CodeGen/XCore/fneg.ll
@@ -1,6 +1,8 @@
-; RUN: llc < %s -march=xcore | grep "xor" | count 1
+; RUN: llc < %s -march=xcore | FileCheck %s
define i1 @test(double %F) nounwind {
entry:
+; CHECK: test:
+; CHECK: xor
%0 = fsub double -0.000000e+00, %F
%1 = fcmp olt double 0.000000e+00, %0
ret i1 %1
diff --git a/llvm/test/CodeGen/XCore/getid.ll b/llvm/test/CodeGen/XCore/getid.ll
index ecab65c0e92..ec46071b546 100644
--- a/llvm/test/CodeGen/XCore/getid.ll
+++ b/llvm/test/CodeGen/XCore/getid.ll
@@ -1,8 +1,10 @@
-; RUN: llc < %s -march=xcore > %t1.s
-; RUN: grep "get r11, id" %t1.s | count 1
+; RUN: llc < %s -march=xcore | FileCheck %s
declare i32 @llvm.xcore.getid()
define i32 @test() {
+; CHECK: test:
+; CHECK: get r11, id
+; CHECK-NEXT: mov r0, r11
%result = call i32 @llvm.xcore.getid()
ret i32 %result
}
diff --git a/llvm/test/CodeGen/XCore/load.ll b/llvm/test/CodeGen/XCore/load.ll
index adfea212a27..faff03b1e70 100644
--- a/llvm/test/CodeGen/XCore/load.ll
+++ b/llvm/test/CodeGen/XCore/load.ll
@@ -1,15 +1,9 @@
-; RUN: llc < %s -march=xcore > %t1.s
-; RUN: not grep add %t1.s
-; RUN: not grep ldaw %t1.s
-; RUN: not grep lda16 %t1.s
-; RUN: not grep zext %t1.s
-; RUN: not grep sext %t1.s
-; RUN: grep "ldw" %t1.s | count 2
-; RUN: grep "ld16s" %t1.s | count 1
-; RUN: grep "ld8u" %t1.s | count 1
+; RUN: llc < %s -march=xcore | FileCheck %s
define i32 @load32(i32* %p, i32 %offset) nounwind {
entry:
+; CHECK: load32:
+; CHECK: ldw r0, r0[r1]
%0 = getelementptr i32* %p, i32 %offset
%1 = load i32* %0, align 4
ret i32 %1
@@ -17,6 +11,8 @@ entry:
define i32 @load32_imm(i32* %p) nounwind {
entry:
+; CHECK: load32_imm:
+; CHECK: ldw r0, r0[11]
%0 = getelementptr i32* %p, i32 11
%1 = load i32* %0, align 4
ret i32 %1
@@ -24,6 +20,9 @@ entry:
define i32 @load16(i16* %p, i32 %offset) nounwind {
entry:
+; CHECK: load16:
+; CHECK: ld16s r0, r0[r1]
+; CHECK-NOT: sext
%0 = getelementptr i16* %p, i32 %offset
%1 = load i16* %0, align 2
%2 = sext i16 %1 to i32
@@ -32,6 +31,9 @@ entry:
define i32 @load8(i8* %p, i32 %offset) nounwind {
entry:
+; CHECK: load8:
+; CHECK: ld8u r0, r0[r1]
+; CHECK-NOT: zext
%0 = getelementptr i8* %p, i32 %offset
%1 = load i8* %0, align 1
%2 = zext i8 %1 to i32
diff --git a/llvm/test/CodeGen/XCore/log.ll b/llvm/test/CodeGen/XCore/log.ll
index a08471f48e4..e954ab28b28 100644
--- a/llvm/test/CodeGen/XCore/log.ll
+++ b/llvm/test/CodeGen/XCore/log.ll
@@ -1,9 +1,9 @@
-; RUN: llc < %s -march=xcore > %t1.s
-; RUN: grep "bl logf" %t1.s | count 1
-; RUN: grep "bl log" %t1.s | count 2
+; RUN: llc < %s -march=xcore | FileCheck %s
declare double @llvm.log.f64(double)
define double @test(double %F) {
+; CHECK: test:
+; CHECK: bl log
%result = call double @llvm.log.f64(double %F)
ret double %result
}
@@ -11,6 +11,8 @@ define double @test(double %F) {
declare float @llvm.log.f32(float)
define float @testf(float %F) {
+; CHECK: testf:
+; CHECK: bl logf
%result = call float @llvm.log.f32(float %F)
ret float %result
}
diff --git a/llvm/test/CodeGen/XCore/log10.ll b/llvm/test/CodeGen/XCore/log10.ll
index a72b8bfaf6b..88b29b19664 100644
--- a/llvm/test/CodeGen/XCore/log10.ll
+++ b/llvm/test/CodeGen/XCore/log10.ll
@@ -1,9 +1,9 @@
-; RUN: llc < %s -march=xcore > %t1.s
-; RUN: grep "bl log10f" %t1.s | count 1
-; RUN: grep "bl log10" %t1.s | count 2
+; RUN: llc < %s -march=xcore | FileCheck %s
declare double @llvm.log10.f64(double)
define double @test(double %F) {
+; CHECK: test:
+; CHECK: bl log10
%result = call double @llvm.log10.f64(double %F)
ret double %result
}
@@ -11,6 +11,8 @@ define double @test(double %F) {
declare float @llvm.log10.f32(float)
define float @testf(float %F) {
+; CHECK: testf:
+; CHECK: bl log10f
%result = call float @llvm.log10.f32(float %F)
ret float %result
}
diff --git a/llvm/test/CodeGen/XCore/log2.ll b/llvm/test/CodeGen/XCore/log2.ll
index d257433a01a..51993897667 100644
--- a/llvm/test/CodeGen/XCore/log2.ll
+++ b/llvm/test/CodeGen/XCore/log2.ll
@@ -1,9 +1,9 @@
-; RUN: llc < %s -march=xcore > %t1.s
-; RUN: grep "bl log2f" %t1.s | count 1
-; RUN: grep "bl log2" %t1.s | count 2
+; RUN: llc < %s -march=xcore | FileCheck %s
declare double @llvm.log2.f64(double)
define double @test(double %F) {
+; CHECK: test:
+; CHECK: bl log2
%result = call double @llvm.log2.f64(double %F)
ret double %result
}
@@ -11,6 +11,8 @@ define double @test(double %F) {
declare float @llvm.log2.f32(float)
define float @testf(float %F) {
+; CHECK: testf:
+; CHECK: bl log2f
%result = call float @llvm.log2.f32(float %F)
ret float %result
}
diff --git a/llvm/test/CodeGen/XCore/pow.ll b/llvm/test/CodeGen/XCore/pow.ll
index b461185b7fd..36c7ae82ba5 100644
--- a/llvm/test/CodeGen/XCore/pow.ll
+++ b/llvm/test/CodeGen/XCore/pow.ll
@@ -1,9 +1,9 @@
-; RUN: llc < %s -march=xcore > %t1.s
-; RUN: grep "bl powf" %t1.s | count 1
-; RUN: grep "bl pow" %t1.s | count 2
+; RUN: llc < %s -march=xcore | FileCheck %s
declare double @llvm.pow.f64(double, double)
define double @test(double %F, double %power) {
+; CHECK: test:
+; CHECK: bl pow
%result = call double @llvm.pow.f64(double %F, double %power)
ret double %result
}
@@ -11,6 +11,8 @@ define double @test(double %F, double %power) {
declare float @llvm.pow.f32(float, float)
define float @testf(float %F, float %power) {
+; CHECK: testf:
+; CHECK: bl powf
%result = call float @llvm.pow.f32(float %F, float %power)
ret float %result
}
diff --git a/llvm/test/CodeGen/XCore/powi.ll b/llvm/test/CodeGen/XCore/powi.ll
index de31cbed00c..3c4f097389f 100644
--- a/llvm/test/CodeGen/XCore/powi.ll
+++ b/llvm/test/CodeGen/XCore/powi.ll
@@ -1,9 +1,9 @@
-; RUN: llc < %s -march=xcore > %t1.s
-; RUN: grep "bl __powidf2" %t1.s | count 1
-; RUN: grep "bl __powisf2" %t1.s | count 1
+; RUN: llc < %s -march=xcore | FileCheck %s
declare double @llvm.powi.f64(double, i32)
define double @test(double %F, i32 %power) {
+; CHECK: test:
+; CHECK: bl __powidf2
%result = call double @llvm.powi.f64(double %F, i32 %power)
ret double %result
}
@@ -11,6 +11,8 @@ define double @test(double %F, i32 %power) {
declare float @llvm.powi.f32(float, i32)
define float @testf(float %F, i32 %power) {
+; CHECK: testf:
+; CHECK: bl __powisf2
%result = call float @llvm.powi.f32(float %F, i32 %power)
ret float %result
}
diff --git a/llvm/test/CodeGen/XCore/private.ll b/llvm/test/CodeGen/XCore/private.ll
index 537d63b903a..80b7db4ce3a 100644
--- a/llvm/test/CodeGen/XCore/private.ll
+++ b/llvm/test/CodeGen/XCore/private.ll
@@ -1,19 +1,21 @@
; Test to make sure that the 'private' is used correctly.
;
-; RUN: llc < %s -march=xcore > %t
-; RUN: grep .Lfoo: %t
-; RUN: grep bl.*\.Lfoo %t
-; RUN: grep .Lbaz: %t
-; RUN: grep ldw.*\.Lbaz %t
+; RUN: llc < %s -march=xcore | FileCheck %s
define private void @foo() {
+; CHECK: .Lfoo:
ret void
}
@baz = private global i32 4
define i32 @bar() {
+; CHECK: bar:
+; CHECK: bl .Lfoo
+; CHECK: ldw r0, dp[.Lbaz]
call void @foo()
%1 = load i32* @baz, align 4
ret i32 %1
}
+
+; CHECK: .Lbaz:
diff --git a/llvm/test/CodeGen/XCore/sin.ll b/llvm/test/CodeGen/XCore/sin.ll
index ced026f1d3e..09ca852198b 100644
--- a/llvm/test/CodeGen/XCore/sin.ll
+++ b/llvm/test/CodeGen/XCore/sin.ll
@@ -1,9 +1,9 @@
-; RUN: llc < %s -march=xcore > %t1.s
-; RUN: grep "bl sinf" %t1.s | count 1
-; RUN: grep "bl sin" %t1.s | count 2
+; RUN: llc < %s -march=xcore | FileCheck %s
declare double @llvm.sin.f64(double)
define double @test(double %F) {
+; CHECK: test:
+; CHECK: bl sin
%result = call double @llvm.sin.f64(double %F)
ret double %result
}
@@ -11,6 +11,8 @@ define double @test(double %F) {
declare float @llvm.sin.f32(float)
define float @testf(float %F) {
+; CHECK: testf:
+; CHECK: bl sinf
%result = call float @llvm.sin.f32(float %F)
ret float %result
}
diff --git a/llvm/test/CodeGen/XCore/sqrt.ll b/llvm/test/CodeGen/XCore/sqrt.ll
index 364d1a14c6a..d65a90bb432 100644
--- a/llvm/test/CodeGen/XCore/sqrt.ll
+++ b/llvm/test/CodeGen/XCore/sqrt.ll
@@ -1,9 +1,9 @@
-; RUN: llc < %s -march=xcore > %t1.s
-; RUN: grep "bl sqrtf" %t1.s | count 1
-; RUN: grep "bl sqrt" %t1.s | count 2
+; RUN: llc < %s -march=xcore | FileCheck %s
declare double @llvm.sqrt.f64(double)
define double @test(double %F) {
+; CHECK: test:
+; CHECK: bl sqrt
%result = call double @llvm.sqrt.f64(double %F)
ret double %result
}
@@ -11,6 +11,8 @@ define double @test(double %F) {
declare float @llvm.sqrt.f32(float)
define float @testf(float %F) {
+; CHECK: testf:
+; CHECK: bl sqrtf
%result = call float @llvm.sqrt.f32(float %F)
ret float %result
}
diff --git a/llvm/test/CodeGen/XCore/store.ll b/llvm/test/CodeGen/XCore/store.ll
index 2213743ff89..836b1254d67 100644
--- a/llvm/test/CodeGen/XCore/store.ll
+++ b/llvm/test/CodeGen/XCore/store.ll
@@ -1,13 +1,9 @@
-; RUN: llc < %s -march=xcore > %t1.s
-; RUN: not grep add %t1.s
-; RUN: not grep ldaw %t1.s
-; RUN: not grep lda16 %t1.s
-; RUN: grep "stw" %t1.s | count 2
-; RUN: grep "st16" %t1.s | count 1
-; RUN: grep "st8" %t1.s | count 1
+; RUN: llc < %s -march=xcore | FileCheck %s
define void @store32(i32* %p, i32 %offset, i32 %val) nounwind {
entry:
+; CHECK: store32:
+; CHECK: stw r2, r0[r1]
%0 = getelementptr i32* %p, i32 %offset
store i32 %val, i32* %0, align 4
ret void
@@ -15,6 +11,8 @@ entry:
define void @store32_imm(i32* %p, i32 %val) nounwind {
entry:
+; CHECK: store32_imm:
+; CHECK: stw r1, r0[11]
%0 = getelementptr i32* %p, i32 11
store i32 %val, i32* %0, align 4
ret void
@@ -22,6 +20,8 @@ entry:
define void @store16(i16* %p, i32 %offset, i16 %val) nounwind {
entry:
+; CHECK: store16:
+; CHECK: st16 r2, r0[r1]
%0 = getelementptr i16* %p, i32 %offset
store i16 %val, i16* %0, align 2
ret void
@@ -29,6 +29,8 @@ entry:
define void @store8(i8* %p, i32 %offset, i8 %val) nounwind {
entry:
+; CHECK: store8:
+; CHECK: st8 r2, r0[r1]
%0 = getelementptr i8* %p, i32 %offset
store i8 %val, i8* %0, align 1
ret void
diff --git a/llvm/test/CodeGen/XCore/trap.ll b/llvm/test/CodeGen/XCore/trap.ll
index 45f886d332a..eb71cb6acb6 100644
--- a/llvm/test/CodeGen/XCore/trap.ll
+++ b/llvm/test/CodeGen/XCore/trap.ll
@@ -1,8 +1,9 @@
-; RUN: llc < %s -march=xcore > %t1.s
-; RUN: grep "ecallf" %t1.s | count 1
-; RUN: grep "ldc" %t1.s | count 1
+; RUN: llc < %s -march=xcore | FileCheck %s
define i32 @test() noreturn nounwind {
entry:
+; CHECK: test:
+; CHECK: ldc
+; CHECK: ecallf
tail call void @llvm.trap( )
unreachable
}
diff --git a/llvm/test/CodeGen/XCore/unaligned_store_combine.ll b/llvm/test/CodeGen/XCore/unaligned_store_combine.ll
index 493ca6a975f..c997b78ee6b 100644
--- a/llvm/test/CodeGen/XCore/unaligned_store_combine.ll
+++ b/llvm/test/CodeGen/XCore/unaligned_store_combine.ll
@@ -1,11 +1,12 @@
-; RUN: llc < %s -march=xcore > %t1.s
-; RUN: grep "bl memmove" %t1.s | count 1
-; RUN: grep "ldc r., 8" %t1.s | count 1
+; RUN: llc < %s -march=xcore | FileCheck %s
; Unaligned load / store pair. Should be combined into a memmove
; of size 8
define void @f(i64* %dst, i64* %src) nounwind {
entry:
+; CHECK: f:
+; CHECK: ldc r2, 8
+; CHECK: bl memmove
%0 = load i64* %src, align 1
store i64 %0, i64* %dst, align 1
ret void
OpenPOWER on IntegriCloud