summaryrefslogtreecommitdiff
path: root/test/CodeGen/XCore
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2012-04-14 13:54:10 +0000
committerDimitry Andric <dim@FreeBSD.org>2012-04-14 13:54:10 +0000
commit63faed5b8e4f2755f127fcb8aa440480c0649327 (patch)
tree19c69a04768629f2d440944b71cbe90adae0b615 /test/CodeGen/XCore
parentd4c8b5d2e851b0e8a063c6bf8543a4823a26c15a (diff)
Notes
Diffstat (limited to 'test/CodeGen/XCore')
-rw-r--r--test/CodeGen/XCore/2011-08-01-DynamicAllocBug.ll4
-rw-r--r--test/CodeGen/XCore/cos.ll16
-rw-r--r--test/CodeGen/XCore/dg.exp5
-rw-r--r--test/CodeGen/XCore/exp.ll16
-rw-r--r--test/CodeGen/XCore/exp2.ll16
-rw-r--r--test/CodeGen/XCore/float-intrinsics.ll171
-rw-r--r--test/CodeGen/XCore/fneg.ll4
-rw-r--r--test/CodeGen/XCore/getid.ll6
-rw-r--r--test/CodeGen/XCore/global_negative_offset.ll25
-rw-r--r--test/CodeGen/XCore/ladd_lsub_combine.ll2
-rw-r--r--test/CodeGen/XCore/licm-ldwcp.ll2
-rw-r--r--test/CodeGen/XCore/lit.local.cfg6
-rw-r--r--test/CodeGen/XCore/load.ll20
-rw-r--r--test/CodeGen/XCore/log.ll16
-rw-r--r--test/CodeGen/XCore/log10.ll16
-rw-r--r--test/CodeGen/XCore/log2.ll16
-rw-r--r--test/CodeGen/XCore/pow.ll16
-rw-r--r--test/CodeGen/XCore/powi.ll16
-rw-r--r--test/CodeGen/XCore/private.ll12
-rw-r--r--test/CodeGen/XCore/scavenging.ll48
-rw-r--r--test/CodeGen/XCore/sin.ll16
-rw-r--r--test/CodeGen/XCore/sqrt.ll16
-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
25 files changed, 272 insertions, 223 deletions
diff --git a/test/CodeGen/XCore/2011-08-01-DynamicAllocBug.ll b/test/CodeGen/XCore/2011-08-01-DynamicAllocBug.ll
index 7d6d7bac3d6e..84e21e46348d 100644
--- a/test/CodeGen/XCore/2011-08-01-DynamicAllocBug.ll
+++ b/test/CodeGen/XCore/2011-08-01-DynamicAllocBug.ll
@@ -16,5 +16,5 @@ allocas:
; CHECK: f:
; CHECK: ldaw [[REGISTER:r[0-9]+]], {{r[0-9]+}}[-r1]
; CHECK: set sp, [[REGISTER]]
-; CHECK extsp 1
-; CHECK bl g
+; CHECK: extsp 1
+; CHECK: bl g
diff --git a/test/CodeGen/XCore/cos.ll b/test/CodeGen/XCore/cos.ll
deleted file mode 100644
index 8211f85b9bc2..000000000000
--- a/test/CodeGen/XCore/cos.ll
+++ /dev/null
@@ -1,16 +0,0 @@
-; RUN: llc < %s -march=xcore > %t1.s
-; RUN: grep "bl cosf" %t1.s | count 1
-; RUN: grep "bl cos" %t1.s | count 2
-declare double @llvm.cos.f64(double)
-
-define double @test(double %F) {
- %result = call double @llvm.cos.f64(double %F)
- ret double %result
-}
-
-declare float @llvm.cos.f32(float)
-
-define float @testf(float %F) {
- %result = call float @llvm.cos.f32(float %F)
- ret float %result
-}
diff --git a/test/CodeGen/XCore/dg.exp b/test/CodeGen/XCore/dg.exp
deleted file mode 100644
index 7110eabb3a53..000000000000
--- a/test/CodeGen/XCore/dg.exp
+++ /dev/null
@@ -1,5 +0,0 @@
-load_lib llvm.exp
-
-if { [llvm_supports_target XCore] } {
- RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,c,cpp}]]
-}
diff --git a/test/CodeGen/XCore/exp.ll b/test/CodeGen/XCore/exp.ll
deleted file mode 100644
index d23d484ed62e..000000000000
--- a/test/CodeGen/XCore/exp.ll
+++ /dev/null
@@ -1,16 +0,0 @@
-; RUN: llc < %s -march=xcore > %t1.s
-; RUN: grep "bl expf" %t1.s | count 1
-; RUN: grep "bl exp" %t1.s | count 2
-declare double @llvm.exp.f64(double)
-
-define double @test(double %F) {
- %result = call double @llvm.exp.f64(double %F)
- ret double %result
-}
-
-declare float @llvm.exp.f32(float)
-
-define float @testf(float %F) {
- %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
deleted file mode 100644
index 4c4d17f4bbf7..000000000000
--- a/test/CodeGen/XCore/exp2.ll
+++ /dev/null
@@ -1,16 +0,0 @@
-; RUN: llc < %s -march=xcore > %t1.s
-; RUN: grep "bl exp2f" %t1.s | count 1
-; RUN: grep "bl exp2" %t1.s | count 2
-declare double @llvm.exp2.f64(double)
-
-define double @test(double %F) {
- %result = call double @llvm.exp2.f64(double %F)
- ret double %result
-}
-
-declare float @llvm.exp2.f32(float)
-
-define float @testf(float %F) {
- %result = call float @llvm.exp2.f32(float %F)
- ret float %result
-}
diff --git a/test/CodeGen/XCore/float-intrinsics.ll b/test/CodeGen/XCore/float-intrinsics.ll
new file mode 100644
index 000000000000..69a40f3c79bf
--- /dev/null
+++ b/test/CodeGen/XCore/float-intrinsics.ll
@@ -0,0 +1,171 @@
+; RUN: llc < %s -march=xcore | FileCheck %s
+declare double @llvm.cos.f64(double)
+declare double @llvm.exp.f64(double)
+declare double @llvm.exp2.f64(double)
+declare double @llvm.log.f64(double)
+declare double @llvm.log10.f64(double)
+declare double @llvm.log2.f64(double)
+declare double @llvm.pow.f64(double, double)
+declare double @llvm.powi.f64(double, i32)
+declare double @llvm.sin.f64(double)
+declare double @llvm.sqrt.f64(double)
+
+define double @cos(double %F) {
+; CHECK: cos:
+; CHECK: bl cos
+ %result = call double @llvm.cos.f64(double %F)
+ ret double %result
+}
+
+declare float @llvm.cos.f32(float)
+
+; CHECK: cosf:
+; CHECK: bl cosf
+define float @cosf(float %F) {
+ %result = call float @llvm.cos.f32(float %F)
+ ret float %result
+}
+
+define double @exp(double %F) {
+; CHECK: exp:
+; CHECK: bl exp
+ %result = call double @llvm.exp.f64(double %F)
+ ret double %result
+}
+
+declare float @llvm.exp.f32(float)
+
+define float @expf(float %F) {
+; CHECK: expf:
+; CHECK: bl expf
+ %result = call float @llvm.exp.f32(float %F)
+ ret float %result
+}
+
+define double @exp2(double %F) {
+; CHECK: exp2:
+; CHECK: bl exp2
+ %result = call double @llvm.exp2.f64(double %F)
+ ret double %result
+}
+
+declare float @llvm.exp2.f32(float)
+
+define float @exp2f(float %F) {
+; CHECK: exp2f:
+; CHECK: bl exp2f
+ %result = call float @llvm.exp2.f32(float %F)
+ ret float %result
+}
+
+define double @log(double %F) {
+; CHECK: log:
+; CHECK: bl log
+ %result = call double @llvm.log.f64(double %F)
+ ret double %result
+}
+
+declare float @llvm.log.f32(float)
+
+define float @logf(float %F) {
+; CHECK: logf:
+; CHECK: bl logf
+ %result = call float @llvm.log.f32(float %F)
+ ret float %result
+}
+
+define double @log10(double %F) {
+; CHECK: log10:
+; CHECK: bl log10
+ %result = call double @llvm.log10.f64(double %F)
+ ret double %result
+}
+
+declare float @llvm.log10.f32(float)
+
+define float @log10f(float %F) {
+; CHECK: log10f:
+; CHECK: bl log10f
+ %result = call float @llvm.log10.f32(float %F)
+ ret float %result
+}
+
+define double @log2(double %F) {
+; CHECK: log2:
+; CHECK: bl log2
+ %result = call double @llvm.log2.f64(double %F)
+ ret double %result
+}
+
+declare float @llvm.log2.f32(float)
+
+define float @log2f(float %F) {
+; CHECK: log2f:
+; CHECK: bl log2f
+ %result = call float @llvm.log2.f32(float %F)
+ ret float %result
+}
+
+define double @pow(double %F, double %power) {
+; CHECK: pow:
+; CHECK: bl pow
+ %result = call double @llvm.pow.f64(double %F, double %power)
+ ret double %result
+}
+
+declare float @llvm.pow.f32(float, float)
+
+define float @powf(float %F, float %power) {
+; CHECK: powf:
+; CHECK: bl powf
+ %result = call float @llvm.pow.f32(float %F, float %power)
+ ret float %result
+}
+
+define double @powi(double %F, i32 %power) {
+; CHECK: powi:
+; CHECK: bl __powidf2
+ %result = call double @llvm.powi.f64(double %F, i32 %power)
+ ret double %result
+}
+
+declare float @llvm.powi.f32(float, i32)
+
+define float @powif(float %F, i32 %power) {
+; CHECK: powif:
+; CHECK: bl __powisf2
+ %result = call float @llvm.powi.f32(float %F, i32 %power)
+ ret float %result
+}
+
+define double @sin(double %F) {
+; CHECK: sin:
+; CHECK: bl sin
+ %result = call double @llvm.sin.f64(double %F)
+ ret double %result
+}
+
+declare float @llvm.sin.f32(float)
+
+define float @sinf(float %F) {
+; CHECK: sinf:
+; CHECK: bl sinf
+ %result = call float @llvm.sin.f32(float %F)
+ ret float %result
+}
+
+define double @sqrt(double %F) {
+; CHECK: sqrt:
+; CHECK: bl sqrt
+ %result = call double @llvm.sqrt.f64(double %F)
+ ret double %result
+}
+
+declare float @llvm.sqrt.f32(float)
+
+define float @sqrtf(float %F) {
+; CHECK: sqrtf:
+; CHECK: bl sqrtf
+ %result = call float @llvm.sqrt.f32(float %F)
+ ret float %result
+}
diff --git a/test/CodeGen/XCore/fneg.ll b/test/CodeGen/XCore/fneg.ll
index e3dd3dd45c23..d442a19712f3 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 ecab65c0e92e..ec46071b546c 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/global_negative_offset.ll b/test/CodeGen/XCore/global_negative_offset.ll
new file mode 100644
index 000000000000..0328fb0460f3
--- /dev/null
+++ b/test/CodeGen/XCore/global_negative_offset.ll
@@ -0,0 +1,25 @@
+; RUN: llc < %s -march=xcore | FileCheck %s
+
+; Don't fold negative offsets into cp / dp accesses to avoid a relocation
+; error if the address + addend is less than the start of the cp / dp.
+
+@a = external constant [0 x i32], section ".cp.rodata"
+@b = external global [0 x i32]
+
+define i32 *@f() nounwind {
+entry:
+; CHECK: f:
+; CHECK: ldaw r11, cp[a]
+; CHECK: sub r0, r11, 4
+ %0 = getelementptr [0 x i32]* @a, i32 0, i32 -1
+ ret i32* %0
+}
+
+define i32 *@g() nounwind {
+entry:
+; CHECK: g:
+; CHECK: ldaw [[REG:r[0-9]+]], dp[b]
+; CHECK: sub r0, [[REG]], 4
+ %0 = getelementptr [0 x i32]* @b, i32 0, i32 -1
+ ret i32* %0
+}
diff --git a/test/CodeGen/XCore/ladd_lsub_combine.ll b/test/CodeGen/XCore/ladd_lsub_combine.ll
index a693ee22291a..cd89966bcde7 100644
--- a/test/CodeGen/XCore/ladd_lsub_combine.ll
+++ b/test/CodeGen/XCore/ladd_lsub_combine.ll
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | llc -march=xcore | FileCheck %s
+; RUN: llc -march=xcore < %s | FileCheck %s
; Only needs one ladd
define i64 @f1(i32 %x, i32 %y) nounwind {
diff --git a/test/CodeGen/XCore/licm-ldwcp.ll b/test/CodeGen/XCore/licm-ldwcp.ll
index 4884f70e736b..794c6bb64e39 100644
--- a/test/CodeGen/XCore/licm-ldwcp.ll
+++ b/test/CodeGen/XCore/licm-ldwcp.ll
@@ -13,6 +13,6 @@ entry:
br label %bb
bb: ; preds = %bb, %entry
- volatile store i32 525509670, i32* %p, align 4
+ store volatile i32 525509670, i32* %p, align 4
br label %bb
}
diff --git a/test/CodeGen/XCore/lit.local.cfg b/test/CodeGen/XCore/lit.local.cfg
new file mode 100644
index 000000000000..f8726af57f79
--- /dev/null
+++ b/test/CodeGen/XCore/lit.local.cfg
@@ -0,0 +1,6 @@
+config.suffixes = ['.ll', '.c', '.cpp']
+
+targets = set(config.root.targets_to_build.split())
+if not 'XCore' in targets:
+ config.unsupported = True
+
diff --git a/test/CodeGen/XCore/load.ll b/test/CodeGen/XCore/load.ll
index adfea212a279..faff03b1e70d 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
deleted file mode 100644
index a08471f48e4a..000000000000
--- a/test/CodeGen/XCore/log.ll
+++ /dev/null
@@ -1,16 +0,0 @@
-; RUN: llc < %s -march=xcore > %t1.s
-; RUN: grep "bl logf" %t1.s | count 1
-; RUN: grep "bl log" %t1.s | count 2
-declare double @llvm.log.f64(double)
-
-define double @test(double %F) {
- %result = call double @llvm.log.f64(double %F)
- ret double %result
-}
-
-declare float @llvm.log.f32(float)
-
-define float @testf(float %F) {
- %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
deleted file mode 100644
index a72b8bfaf6b9..000000000000
--- a/test/CodeGen/XCore/log10.ll
+++ /dev/null
@@ -1,16 +0,0 @@
-; RUN: llc < %s -march=xcore > %t1.s
-; RUN: grep "bl log10f" %t1.s | count 1
-; RUN: grep "bl log10" %t1.s | count 2
-declare double @llvm.log10.f64(double)
-
-define double @test(double %F) {
- %result = call double @llvm.log10.f64(double %F)
- ret double %result
-}
-
-declare float @llvm.log10.f32(float)
-
-define float @testf(float %F) {
- %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
deleted file mode 100644
index d257433a01a7..000000000000
--- a/test/CodeGen/XCore/log2.ll
+++ /dev/null
@@ -1,16 +0,0 @@
-; RUN: llc < %s -march=xcore > %t1.s
-; RUN: grep "bl log2f" %t1.s | count 1
-; RUN: grep "bl log2" %t1.s | count 2
-declare double @llvm.log2.f64(double)
-
-define double @test(double %F) {
- %result = call double @llvm.log2.f64(double %F)
- ret double %result
-}
-
-declare float @llvm.log2.f32(float)
-
-define float @testf(float %F) {
- %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
deleted file mode 100644
index b461185b7fde..000000000000
--- a/test/CodeGen/XCore/pow.ll
+++ /dev/null
@@ -1,16 +0,0 @@
-; RUN: llc < %s -march=xcore > %t1.s
-; RUN: grep "bl powf" %t1.s | count 1
-; RUN: grep "bl pow" %t1.s | count 2
-declare double @llvm.pow.f64(double, double)
-
-define double @test(double %F, double %power) {
- %result = call double @llvm.pow.f64(double %F, double %power)
- ret double %result
-}
-
-declare float @llvm.pow.f32(float, float)
-
-define float @testf(float %F, float %power) {
- %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
deleted file mode 100644
index de31cbed00c0..000000000000
--- a/test/CodeGen/XCore/powi.ll
+++ /dev/null
@@ -1,16 +0,0 @@
-; RUN: llc < %s -march=xcore > %t1.s
-; RUN: grep "bl __powidf2" %t1.s | count 1
-; RUN: grep "bl __powisf2" %t1.s | count 1
-declare double @llvm.powi.f64(double, i32)
-
-define double @test(double %F, i32 %power) {
- %result = call double @llvm.powi.f64(double %F, i32 %power)
- ret double %result
-}
-
-declare float @llvm.powi.f32(float, i32)
-
-define float @testf(float %F, i32 %power) {
- %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 537d63b903a0..80b7db4ce3a2 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/scavenging.ll b/test/CodeGen/XCore/scavenging.ll
index 3181e96116b6..5b612d0f9b59 100644
--- a/test/CodeGen/XCore/scavenging.ll
+++ b/test/CodeGen/XCore/scavenging.ll
@@ -18,32 +18,32 @@ entry:
%x = alloca [100 x i32], align 4 ; <[100 x i32]*> [#uses=2]
%0 = load i32* @size, align 4 ; <i32> [#uses=1]
%1 = alloca i32, i32 %0, align 4 ; <i32*> [#uses=1]
- %2 = volatile load i32* @g0, align 4 ; <i32> [#uses=1]
- %3 = volatile load i32* @g1, align 4 ; <i32> [#uses=1]
- %4 = volatile load i32* @g2, align 4 ; <i32> [#uses=1]
- %5 = volatile load i32* @g3, align 4 ; <i32> [#uses=1]
- %6 = volatile load i32* @g4, align 4 ; <i32> [#uses=1]
- %7 = volatile load i32* @g5, align 4 ; <i32> [#uses=1]
- %8 = volatile load i32* @g6, align 4 ; <i32> [#uses=1]
- %9 = volatile load i32* @g7, align 4 ; <i32> [#uses=1]
- %10 = volatile load i32* @g8, align 4 ; <i32> [#uses=1]
- %11 = volatile load i32* @g9, align 4 ; <i32> [#uses=1]
- %12 = volatile load i32* @g10, align 4 ; <i32> [#uses=1]
- %13 = volatile load i32* @g11, align 4 ; <i32> [#uses=2]
+ %2 = load volatile i32* @g0, align 4 ; <i32> [#uses=1]
+ %3 = load volatile i32* @g1, align 4 ; <i32> [#uses=1]
+ %4 = load volatile i32* @g2, align 4 ; <i32> [#uses=1]
+ %5 = load volatile i32* @g3, align 4 ; <i32> [#uses=1]
+ %6 = load volatile i32* @g4, align 4 ; <i32> [#uses=1]
+ %7 = load volatile i32* @g5, align 4 ; <i32> [#uses=1]
+ %8 = load volatile i32* @g6, align 4 ; <i32> [#uses=1]
+ %9 = load volatile i32* @g7, align 4 ; <i32> [#uses=1]
+ %10 = load volatile i32* @g8, align 4 ; <i32> [#uses=1]
+ %11 = load volatile i32* @g9, align 4 ; <i32> [#uses=1]
+ %12 = load volatile i32* @g10, align 4 ; <i32> [#uses=1]
+ %13 = load volatile i32* @g11, align 4 ; <i32> [#uses=2]
%14 = getelementptr [100 x i32]* %x, i32 0, i32 50 ; <i32*> [#uses=1]
store i32 %13, i32* %14, align 4
- volatile store i32 %13, i32* @g11, align 4
- volatile store i32 %12, i32* @g10, align 4
- volatile store i32 %11, i32* @g9, align 4
- volatile store i32 %10, i32* @g8, align 4
- volatile store i32 %9, i32* @g7, align 4
- volatile store i32 %8, i32* @g6, align 4
- volatile store i32 %7, i32* @g5, align 4
- volatile store i32 %6, i32* @g4, align 4
- volatile store i32 %5, i32* @g3, align 4
- volatile store i32 %4, i32* @g2, align 4
- volatile store i32 %3, i32* @g1, align 4
- volatile store i32 %2, i32* @g0, align 4
+ store volatile i32 %13, i32* @g11, align 4
+ store volatile i32 %12, i32* @g10, align 4
+ store volatile i32 %11, i32* @g9, align 4
+ store volatile i32 %10, i32* @g8, align 4
+ store volatile i32 %9, i32* @g7, align 4
+ store volatile i32 %8, i32* @g6, align 4
+ store volatile i32 %7, i32* @g5, align 4
+ store volatile i32 %6, i32* @g4, align 4
+ store volatile i32 %5, i32* @g3, align 4
+ store volatile i32 %4, i32* @g2, align 4
+ store volatile i32 %3, i32* @g1, align 4
+ store volatile i32 %2, i32* @g0, align 4
%x1 = getelementptr [100 x i32]* %x, i32 0, i32 0 ; <i32*> [#uses=1]
call void @g(i32* %x1, i32* %1) nounwind
ret void
diff --git a/test/CodeGen/XCore/sin.ll b/test/CodeGen/XCore/sin.ll
deleted file mode 100644
index ced026f1d3e1..000000000000
--- a/test/CodeGen/XCore/sin.ll
+++ /dev/null
@@ -1,16 +0,0 @@
-; RUN: llc < %s -march=xcore > %t1.s
-; RUN: grep "bl sinf" %t1.s | count 1
-; RUN: grep "bl sin" %t1.s | count 2
-declare double @llvm.sin.f64(double)
-
-define double @test(double %F) {
- %result = call double @llvm.sin.f64(double %F)
- ret double %result
-}
-
-declare float @llvm.sin.f32(float)
-
-define float @testf(float %F) {
- %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
deleted file mode 100644
index 364d1a14c6ae..000000000000
--- a/test/CodeGen/XCore/sqrt.ll
+++ /dev/null
@@ -1,16 +0,0 @@
-; RUN: llc < %s -march=xcore > %t1.s
-; RUN: grep "bl sqrtf" %t1.s | count 1
-; RUN: grep "bl sqrt" %t1.s | count 2
-declare double @llvm.sqrt.f64(double)
-
-define double @test(double %F) {
- %result = call double @llvm.sqrt.f64(double %F)
- ret double %result
-}
-
-declare float @llvm.sqrt.f32(float)
-
-define float @testf(float %F) {
- %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 2213743ff897..836b1254d67a 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 45f886d332aa..eb71cb6acb6e 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 493ca6a975f8..c997b78ee6bd 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