mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-25 17:20:48 +00:00
Fix test cases to use FileCheck.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145716 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -1,19 +1,22 @@
|
|||||||
; RUN: llc < %s -march=mips -o %t
|
; RUN: llc -march=mips < %s | FileCheck %s
|
||||||
; RUN: grep subu %t | count 2
|
|
||||||
; RUN: grep addu %t | count 4
|
|
||||||
|
|
||||||
target datalayout =
|
|
||||||
"e-p:32:32:32-i1:8:8-i8:8:32-i16:16:32-i32:32:32-i64:32:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64"
|
|
||||||
target triple = "mipsallegrexel-unknown-psp-elf"
|
|
||||||
|
|
||||||
define i64 @add64(i64 %u, i64 %v) nounwind {
|
define i64 @add64(i64 %u, i64 %v) nounwind {
|
||||||
entry:
|
entry:
|
||||||
%tmp2 = add i64 %u, %v
|
; CHECK: addu
|
||||||
|
; CHECK: sltu
|
||||||
|
; CHECK: addu
|
||||||
|
; CHECK: addu
|
||||||
|
%tmp2 = add i64 %u, %v
|
||||||
ret i64 %tmp2
|
ret i64 %tmp2
|
||||||
}
|
}
|
||||||
|
|
||||||
define i64 @sub64(i64 %u, i64 %v) nounwind {
|
define i64 @sub64(i64 %u, i64 %v) nounwind {
|
||||||
entry:
|
entry:
|
||||||
|
; CHECK: sub64
|
||||||
|
; CHECK: subu
|
||||||
|
; CHECK: sltu
|
||||||
|
; CHECK: addu
|
||||||
|
; CHECK: subu
|
||||||
%tmp2 = sub i64 %u, %v
|
%tmp2 = sub i64 %u, %v
|
||||||
ret i64 %tmp2
|
ret i64 %tmp2
|
||||||
}
|
}
|
||||||
|
@@ -1,17 +1,18 @@
|
|||||||
; RUN: llc < %s -march=mips | grep {sw.*(\$4)} | count 3
|
; RUN: llc -march=mips < %s | FileCheck %s
|
||||||
|
|
||||||
target datalayout = "e-p:32:32:32-i1:8:8-i8:8:32-i16:16:32-i32:32:32-i64:32:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64"
|
%struct.sret0 = type { i32, i32, i32 }
|
||||||
target triple = "mipsallegrexel-unknown-psp-elf"
|
|
||||||
%struct.sret0 = type { i32, i32, i32 }
|
|
||||||
|
|
||||||
define void @test0(%struct.sret0* noalias sret %agg.result, i32 %dummy) nounwind {
|
define void @test0(%struct.sret0* noalias sret %agg.result, i32 %dummy) nounwind {
|
||||||
entry:
|
entry:
|
||||||
getelementptr %struct.sret0* %agg.result, i32 0, i32 0 ; <i32*>:0 [#uses=1]
|
; CHECK: sw ${{[0-9]+}}, {{[0-9]+}}($4)
|
||||||
store i32 %dummy, i32* %0, align 4
|
; CHECK: sw ${{[0-9]+}}, {{[0-9]+}}($4)
|
||||||
getelementptr %struct.sret0* %agg.result, i32 0, i32 1 ; <i32*>:1 [#uses=1]
|
; CHECK: sw ${{[0-9]+}}, {{[0-9]+}}($4)
|
||||||
store i32 %dummy, i32* %1, align 4
|
getelementptr %struct.sret0* %agg.result, i32 0, i32 0 ; <i32*>:0 [#uses=1]
|
||||||
getelementptr %struct.sret0* %agg.result, i32 0, i32 2 ; <i32*>:2 [#uses=1]
|
store i32 %dummy, i32* %0, align 4
|
||||||
store i32 %dummy, i32* %2, align 4
|
getelementptr %struct.sret0* %agg.result, i32 0, i32 1 ; <i32*>:1 [#uses=1]
|
||||||
ret void
|
store i32 %dummy, i32* %1, align 4
|
||||||
|
getelementptr %struct.sret0* %agg.result, i32 0, i32 2 ; <i32*>:2 [#uses=1]
|
||||||
|
store i32 %dummy, i32* %2, align 4
|
||||||
|
ret void
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,16 +1,17 @@
|
|||||||
; RUN: llc < %s -march=mips | grep trunc.w.s | count 3
|
; RUN: llc -march=mips < %s | FileCheck %s
|
||||||
|
|
||||||
target datalayout = "e-p:32:32:32-i1:8:8-i8:8:32-i16:16:32-i32:32:32-i64:32:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64"
|
|
||||||
target triple = "mipsallegrexel-unknown-psp-elf"
|
|
||||||
|
|
||||||
define i32 @fptoint(float %a) nounwind {
|
define i32 @fptoint(float %a) nounwind {
|
||||||
entry:
|
entry:
|
||||||
fptosi float %a to i32 ; <i32>:0 [#uses=1]
|
; CHECK: trunc.w.s
|
||||||
ret i32 %0
|
fptosi float %a to i32 ; <i32>:0 [#uses=1]
|
||||||
|
ret i32 %0
|
||||||
}
|
}
|
||||||
|
|
||||||
define i32 @fptouint(float %a) nounwind {
|
define i32 @fptouint(float %a) nounwind {
|
||||||
entry:
|
entry:
|
||||||
fptoui float %a to i32 ; <i32>:0 [#uses=1]
|
; CHECK: fptouint
|
||||||
ret i32 %0
|
; CHECK: trunc.w.s
|
||||||
|
; CHECK: trunc.w.s
|
||||||
|
fptoui float %a to i32 ; <i32>:0 [#uses=1]
|
||||||
|
ret i32 %0
|
||||||
}
|
}
|
||||||
|
@@ -1,12 +1,13 @@
|
|||||||
; RUN: llc < %s -march=mips -o %t
|
; RUN: llc -march=mips < %s | FileCheck %s
|
||||||
; RUN: grep {CPI\[01\]_\[01\]:} %t | count 2
|
|
||||||
; RUN: grep {.rodata.cst4,"aM",@progbits} %t | count 1
|
|
||||||
target datalayout = "e-p:32:32:32-i1:8:8-i8:8:32-i16:16:32-i32:32:32-i64:32:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64"
|
|
||||||
target triple = "mipsallegrexel-unknown-psp-elf"
|
|
||||||
|
|
||||||
define float @F(float %a) nounwind {
|
define float @F(float %a) nounwind {
|
||||||
|
; CHECK: .rodata.cst4,"aM",@progbits
|
||||||
entry:
|
entry:
|
||||||
fadd float %a, 0x4011333340000000 ; <float>:0 [#uses=1]
|
; CHECK: ($CPI0_{{[0-1]}})
|
||||||
fadd float %0, 0x4010666660000000 ; <float>:1 [#uses=1]
|
; CHECK: ($CPI0_{{[0,1]}})
|
||||||
ret float %1
|
; CHECK: ($CPI0_{{[0,1]}})
|
||||||
|
; CHECK: ($CPI0_{{[0,1]}})
|
||||||
|
fadd float %a, 0x4011333340000000 ; <float>:0 [#uses=1]
|
||||||
|
fadd float %0, 0x4010666660000000 ; <float>:1 [#uses=1]
|
||||||
|
ret float %1
|
||||||
}
|
}
|
||||||
|
@@ -1,17 +1,15 @@
|
|||||||
; RUN: llc < %s -march=mips -o %t
|
; RUN: llc -march=mips < %s | FileCheck %s
|
||||||
; RUN: grep mfhi %t | count 1
|
|
||||||
; RUN: grep mflo %t | count 1
|
|
||||||
; RUN: grep multu %t | count 1
|
|
||||||
|
|
||||||
target datalayout = "e-p:32:32:32-i1:8:8-i8:8:32-i16:16:32-i32:32:32-i64:32:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64"
|
%struct.DWstruct = type { i32, i32 }
|
||||||
target triple = "mipsallegrexel-unknown-psp-elf"
|
|
||||||
%struct.DWstruct = type { i32, i32 }
|
|
||||||
|
|
||||||
define i32 @A0(i32 %u, i32 %v) nounwind {
|
define i32 @A0(i32 %u, i32 %v) nounwind {
|
||||||
entry:
|
entry:
|
||||||
%asmtmp = tail call %struct.DWstruct asm "multu $2,$3", "={lo},={hi},d,d"( i32 %u, i32 %v ) nounwind
|
; CHECK: multu
|
||||||
%asmresult = extractvalue %struct.DWstruct %asmtmp, 0
|
; CHECK: mflo
|
||||||
%asmresult1 = extractvalue %struct.DWstruct %asmtmp, 1 ; <i32> [#uses=1]
|
; CHECK: mfhi
|
||||||
|
%asmtmp = tail call %struct.DWstruct asm "multu $2,$3", "={lo},={hi},d,d"( i32 %u, i32 %v ) nounwind
|
||||||
|
%asmresult = extractvalue %struct.DWstruct %asmtmp, 0
|
||||||
|
%asmresult1 = extractvalue %struct.DWstruct %asmtmp, 1 ; <i32> [#uses=1]
|
||||||
%res = add i32 %asmresult, %asmresult1
|
%res = add i32 %asmresult, %asmresult1
|
||||||
ret i32 %res
|
ret i32 %res
|
||||||
}
|
}
|
||||||
|
@@ -1,18 +1,15 @@
|
|||||||
; RUN: llc < %s -march=mips -o %t
|
; RUN: llc -march=mips < %s | FileCheck %s
|
||||||
; RUN: grep mtc1 %t | count 1
|
|
||||||
; RUN: grep mfc1 %t | count 1
|
|
||||||
|
|
||||||
target datalayout = "e-p:32:32:32-i1:8:8-i8:8:32-i16:16:32-i32:32:32-i64:32:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64"
|
|
||||||
target triple = "mipsallegrexel-unknown-psp-elf"
|
|
||||||
|
|
||||||
define float @A(i32 %u) nounwind {
|
define float @A(i32 %u) nounwind {
|
||||||
entry:
|
entry:
|
||||||
bitcast i32 %u to float
|
; CHECK: mtc1
|
||||||
ret float %0
|
bitcast i32 %u to float
|
||||||
|
ret float %0
|
||||||
}
|
}
|
||||||
|
|
||||||
define i32 @B(float %u) nounwind {
|
define i32 @B(float %u) nounwind {
|
||||||
entry:
|
entry:
|
||||||
bitcast float %u to i32
|
; CHECK: mfc1
|
||||||
ret i32 %0
|
bitcast float %u to i32
|
||||||
|
ret i32 %0
|
||||||
}
|
}
|
||||||
|
@@ -1,17 +1,15 @@
|
|||||||
; RUN: llc < %s -march=mips | grep {subu.*sp} | count 2
|
; RUN: llc -march=mips < %s | FileCheck %s
|
||||||
; RUN: llc < %s -march=mips -regalloc=basic | grep {subu.*sp} | count 2
|
|
||||||
|
|
||||||
target datalayout = "e-p:32:32:32-i1:8:8-i8:8:32-i16:16:32-i32:32:32-i64:32:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64"
|
|
||||||
target triple = "mipsallegrexel-unknown-psp-elf"
|
|
||||||
|
|
||||||
define i32 @twoalloca(i32 %size) nounwind {
|
define i32 @twoalloca(i32 %size) nounwind {
|
||||||
entry:
|
entry:
|
||||||
alloca i8, i32 %size ; <i8*>:0 [#uses=1]
|
; CHECK: subu ${{[0-9]+}}, $sp
|
||||||
alloca i8, i32 %size ; <i8*>:1 [#uses=1]
|
; CHECK: subu ${{[0-9]+}}, $sp
|
||||||
call i32 @foo( i8* %0 ) nounwind ; <i32>:2 [#uses=1]
|
alloca i8, i32 %size ; <i8*>:0 [#uses=1]
|
||||||
call i32 @foo( i8* %1 ) nounwind ; <i32>:3 [#uses=1]
|
alloca i8, i32 %size ; <i8*>:1 [#uses=1]
|
||||||
add i32 %3, %2 ; <i32>:4 [#uses=1]
|
call i32 @foo( i8* %0 ) nounwind ; <i32>:2 [#uses=1]
|
||||||
ret i32 %4
|
call i32 @foo( i8* %1 ) nounwind ; <i32>:3 [#uses=1]
|
||||||
|
add i32 %3, %2 ; <i32>:4 [#uses=1]
|
||||||
|
ret i32 %4
|
||||||
}
|
}
|
||||||
|
|
||||||
declare i32 @foo(i8*)
|
declare i32 @foo(i8*)
|
||||||
|
@@ -1,11 +1,9 @@
|
|||||||
; RUN: llc < %s -march=mips | grep clz | count 1
|
; RUN: llc -march=mips < %s | FileCheck %s
|
||||||
|
|
||||||
target datalayout = "e-p:32:32:32-i1:8:8-i8:8:32-i16:16:32-i32:32:32-i64:32:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64"
|
|
||||||
target triple = "mipsallegrexel-unknown-psp-elf"
|
|
||||||
|
|
||||||
define i32 @A0(i32 %u) nounwind {
|
define i32 @A0(i32 %u) nounwind {
|
||||||
entry:
|
entry:
|
||||||
call i32 @llvm.ctlz.i32( i32 %u )
|
; CHECK: clz
|
||||||
|
call i32 @llvm.ctlz.i32( i32 %u )
|
||||||
ret i32 %0
|
ret i32 %0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,19 +1,20 @@
|
|||||||
; Test to make sure that the 'private' is used correctly.
|
; Test to make sure that the 'private' is used correctly.
|
||||||
;
|
;
|
||||||
; RUN: llc < %s -march=mips > %t
|
; RUN: llc -march=mips < %s | FileCheck %s
|
||||||
; RUN: grep \\\$foo: %t
|
|
||||||
; RUN: grep call.*\\\$foo %t
|
|
||||||
; RUN: grep \\\$baz: %t
|
|
||||||
; RUN: grep lw.*\\\$baz %t
|
|
||||||
|
|
||||||
define private void @foo() {
|
define private void @foo() {
|
||||||
ret void
|
; CHECK: foo:
|
||||||
|
ret void
|
||||||
}
|
}
|
||||||
|
|
||||||
@baz = private global i32 4
|
@baz = private global i32 4
|
||||||
|
|
||||||
define i32 @bar() {
|
define i32 @bar() {
|
||||||
call void @foo()
|
; CHECK: bar:
|
||||||
%1 = load i32* @baz, align 4
|
; CHECK: call16($foo)
|
||||||
ret i32 %1
|
; CHECK: lw $[[R0:[0-9]+]], %got($baz)($
|
||||||
|
; CHECK: lw ${{[0-9]+}}, %lo($baz)($[[R0]])
|
||||||
|
call void @foo()
|
||||||
|
%1 = load i32* @baz, align 4
|
||||||
|
ret i32 %1
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user