summaryrefslogtreecommitdiff
path: root/test
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
commit70ad3951e419ee0f1a612cab2f206e4478b757b5 (patch)
treea1a52c9cb5ada0d7a3b46ec67f54752a5f9a1f8b /test
parentce7de9f36dd2bce82010bd5a1178efbcb1efabe7 (diff)
downloadllvm-70ad3951e419ee0f1a612cab2f206e4478b757b5.tar.gz
llvm-70ad3951e419ee0f1a612cab2f206e4478b757b5.tar.bz2
llvm-70ad3951e419ee0f1a612cab2f206e4478b757b5.tar.xz
Move various XCore tests to FileCheck
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143457 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/CodeGen/XCore/cos.ll8
-rw-r--r--test/CodeGen/XCore/exp.ll8
-rw-r--r--test/CodeGen/XCore/exp2.ll8
-rw-r--r--test/CodeGen/XCore/fneg.ll4
-rw-r--r--test/CodeGen/XCore/getid.ll6
-rw-r--r--test/CodeGen/XCore/load.ll20
-rw-r--r--test/CodeGen/XCore/log.ll8
-rw-r--r--test/CodeGen/XCore/log10.ll8
-rw-r--r--test/CodeGen/XCore/log2.ll8
-rw-r--r--test/CodeGen/XCore/pow.ll8
-rw-r--r--test/CodeGen/XCore/powi.ll8
-rw-r--r--test/CodeGen/XCore/private.ll12
-rw-r--r--test/CodeGen/XCore/sin.ll8
-rw-r--r--test/CodeGen/XCore/sqrt.ll8
-rw-r--r--test/CodeGen/XCore/store.ll16
-rw-r--r--test/CodeGen/XCore/trap.ll7
-rw-r--r--test/CodeGen/XCore/unaligned_store_combine.ll7
17 files changed, 92 insertions, 60 deletions
diff --git a/test/CodeGen/XCore/cos.ll b/test/CodeGen/XCore/cos.ll
index 8211f85b9b..8bc5e81dba 100644
--- a/test/CodeGen/XCore/cos.ll
+++ b/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/test/CodeGen/XCore/exp.ll b/test/CodeGen/XCore/exp.ll
index d23d484ed6..f30f72ed9b 100644
--- a/test/CodeGen/XCore/exp.ll
+++ b/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/test/CodeGen/XCore/exp2.ll b/test/CodeGen/XCore/exp2.ll
index 4c4d17f4bb..e9ff0a5574 100644
--- a/test/CodeGen/XCore/exp2.ll
+++ b/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/test/CodeGen/XCore/fneg.ll b/test/CodeGen/XCore/fneg.ll
index e3dd3dd45c..d442a19712 100644
--- a/test/CodeGen/XCore/fneg.ll
+++ b/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/test/CodeGen/XCore/getid.ll b/test/CodeGen/XCore/getid.ll
index ecab65c0e9..ec46071b54 100644
--- a/test/CodeGen/XCore/getid.ll
+++ b/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/test/CodeGen/XCore/load.ll b/test/CodeGen/XCore/load.ll
index adfea212a2..faff03b1e7 100644
--- a/test/CodeGen/XCore/load.ll
+++ b/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/test/CodeGen/XCore/log.ll b/test/CodeGen/XCore/log.ll
index a08471f48e..e954ab28b2 100644
--- a/test/CodeGen/XCore/log.ll
+++ b/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/test/CodeGen/XCore/log10.ll b/test/CodeGen/XCore/log10.ll
index a72b8bfaf6..88b29b1966 100644
--- a/test/CodeGen/XCore/log10.ll
+++ b/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/test/CodeGen/XCore/log2.ll b/test/CodeGen/XCore/log2.ll
index d257433a01..5199389766 100644
--- a/test/CodeGen/XCore/log2.ll
+++ b/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/test/CodeGen/XCore/pow.ll b/test/CodeGen/XCore/pow.ll
index b461185b7f..36c7ae82ba 100644
--- a/test/CodeGen/XCore/pow.ll
+++ b/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/test/CodeGen/XCore/powi.ll b/test/CodeGen/XCore/powi.ll
index de31cbed00..3c4f097389 100644
--- a/test/CodeGen/XCore/powi.ll
+++ b/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/test/CodeGen/XCore/private.ll b/test/CodeGen/XCore/private.ll
index 537d63b903..80b7db4ce3 100644
--- a/test/CodeGen/XCore/private.ll
+++ b/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/test/CodeGen/XCore/sin.ll b/test/CodeGen/XCore/sin.ll
index ced026f1d3..09ca852198 100644
--- a/test/CodeGen/XCore/sin.ll
+++ b/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/test/CodeGen/XCore/sqrt.ll b/test/CodeGen/XCore/sqrt.ll
index 364d1a14c6..d65a90bb43 100644
--- a/test/CodeGen/XCore/sqrt.ll
+++ b/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/test/CodeGen/XCore/store.ll b/test/CodeGen/XCore/store.ll
index 2213743ff8..836b1254d6 100644
--- a/test/CodeGen/XCore/store.ll
+++ b/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/test/CodeGen/XCore/trap.ll b/test/CodeGen/XCore/trap.ll
index 45f886d332..eb71cb6acb 100644
--- a/test/CodeGen/XCore/trap.ll
+++ b/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/test/CodeGen/XCore/unaligned_store_combine.ll b/test/CodeGen/XCore/unaligned_store_combine.ll
index 493ca6a975..c997b78ee6 100644
--- a/test/CodeGen/XCore/unaligned_store_combine.ll
+++ b/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