Move various XCore tests to FileCheck
authorRichard Osborne <richard@xmos.com>
Tue, 1 Nov 2011 10:41:28 +0000 (10:41 +0000)
committerRichard Osborne <richard@xmos.com>
Tue, 1 Nov 2011 10:41:28 +0000 (10:41 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143457 91177308-0d34-0410-b5e6-96231b3b80d8

17 files changed:
test/CodeGen/XCore/cos.ll
test/CodeGen/XCore/exp.ll
test/CodeGen/XCore/exp2.ll
test/CodeGen/XCore/fneg.ll
test/CodeGen/XCore/getid.ll
test/CodeGen/XCore/load.ll
test/CodeGen/XCore/log.ll
test/CodeGen/XCore/log10.ll
test/CodeGen/XCore/log2.ll
test/CodeGen/XCore/pow.ll
test/CodeGen/XCore/powi.ll
test/CodeGen/XCore/private.ll
test/CodeGen/XCore/sin.ll
test/CodeGen/XCore/sqrt.ll
test/CodeGen/XCore/store.ll
test/CodeGen/XCore/trap.ll
test/CodeGen/XCore/unaligned_store_combine.ll

index 8211f85b9bc29cdde1f12ee5641b07c5028c8198..8bc5e81dba4142d246a2182eb4e8debec29d74ba 100644 (file)
@@ -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
index d23d484ed62e44104143cced48ad9bb261dd8595..f30f72ed9bf30049a99449222766f231568dae0b 100644 (file)
@@ -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
 }
index 4c4d17f4bbf71c2905b586e142a57e4e71585b04..e9ff0a5574892bddf0db2b638b71d359f2472102 100644 (file)
@@ -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
 }
index e3dd3dd45c23bbc6eae214322321310dd9470402..d442a19712f3565e5d37e823134698304d37fa0d 100644 (file)
@@ -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
index ecab65c0e92e2f037b84cc9d0b2cce5b39dfa540..ec46071b546c82fb19e277bc62b8c7330914da08 100644 (file)
@@ -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
 }
index adfea212a27901a3870ceb927a7d2c3ba6c73919..faff03b1e70de923e2843e2f884c53021434d6dc 100644 (file)
@@ -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
index a08471f48e4aeb8ddca0a4d4b4893db85acc586a..e954ab28b28bcbcbc7bbccaee7b5a24939263111 100644 (file)
@@ -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
 }
index a72b8bfaf6b9dab5b5b52ad2d829e16cfb2a06db..88b29b1966423179405c4a61763ab011bb3c596c 100644 (file)
@@ -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
 }
index d257433a01a76e1acb33dc5304ae0433f7ec8075..51993897667f3c2dd788dc0c695ac9357506b842 100644 (file)
@@ -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
 }
index b461185b7fde470e9801c911dbcf7dc057116613..36c7ae82ba5e7fb7c482305996326521af20b957 100644 (file)
@@ -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
 }
index de31cbed00c0655fa386ca3fabd41d61ddfc48f9..3c4f097389f1fa7c204d5afceb880638f1ac8ae3 100644 (file)
@@ -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
 }
index 537d63b903a0492e54c0f1b6937c5b061ce1877a..80b7db4ce3a26c63faae67785df8c331cf213ea6 100644 (file)
@@ -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:
index ced026f1d3e195936947866be4ee9c90c7253dae..09ca852198b9c27d925c6efbac417f76d84f43e4 100644 (file)
@@ -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
 }
index 364d1a14c6ae3ffa83fff0f97953b4be596d1a88..d65a90bb4323e668c594063df190767988f653a4 100644 (file)
@@ -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
 }
index 2213743ff897b535a7b552412e6334b84fe2cfd1..836b1254d67aabc651fdcd6f7575a31526ee34cc 100644 (file)
@@ -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
index 45f886d332aa4a7cbc67de6968cc6ab339a71def..eb71cb6acb6e9c7df54f7f0d4e5c640b332a5c9e 100644 (file)
@@ -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
 }
index 493ca6a975f83abc4da7da572793b27a301b0506..c997b78ee6bdb33e54385e7de6d90147d130f684 100644 (file)
@@ -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