New d10v tests.

This commit is contained in:
Tom Rix 2002-05-24 03:05:50 +00:00
parent 0db712473f
commit 7f7432881e
87 changed files with 791 additions and 19 deletions

View file

@ -1,3 +1,13 @@
2002-05-23 Tom Rix <trix@redhat.com>
* gas/d10v/d10v.exp: Add instruction packing test.
* gas/d10v/instruction_packing.s : New test.
2002-05-22 Tom Rix <trix@redhat.com>
* gas/d10v/d10v.exp: Renamed from d10.exp. Add address-* tests.
* gas/d10v/address-001.s - address-041.s : New tests.
2002-05-23 H.J. Lu <hjl@gnu.org>
* gas/mips/elf-rel.d: Skip the padding.

View file

@ -0,0 +1,33 @@
#objdump: -D
#name: D10V supported indirect addressing
#as:
.*: +file format elf32-d10v
Disassembly of section .text:
00000000 <main>:
0: 78 02 72 04 ldb r0, @r2 -> ldub r0, @r2
4: 70 02 62 04 ld r0, @r2 -> ld2w r0, @r2
8: 7c 02 68 04 stb r0, @r2 -> st r0, @r2
c: 75 02 60 05 st2w r0, @r2 -> ld r0, @r2\+
10: 71 02 e8 05 ld2w r0, @r2\+ -> st r0, @r2\+
14: 75 02 e4 05 st2w r0, @r2\+ -> ld r0, @r2-
18: 73 02 ec 05 ld2w r0, @r2- -> st r0, @r2-
1c: 77 02 f0 1e st2w r0, @r2- -> ldb r0, @sp
20: 79 0f 60 1e ldub r0, @sp -> ld r0, @sp
24: 71 0f 78 1e ld2w r0, @sp -> stb r0, @sp
28: 74 0f 6a 1e st r0, @sp -> st2w r0, @sp
2c: 70 0f e2 1f ld r0, @sp\+ -> ld2w r0, @sp\+
30: 74 0f ea 1f st r0, @sp\+ -> st2w r0, @sp\+
34: 72 0f e6 1f ld r0, @sp- -> ld2w r0, @sp-
38: 76 0f ee 1f st r0, @-sp -> st2w r0, @-sp
3c: f8 02 80 00 ldb r0, @\(-0x8000, r2\)
40: f9 02 80 00 ldub r0, @\(-0x8000, r2\)
44: f0 02 80 00 ld r0, @\(-0x8000, r2\)
48: f1 02 80 00 ld2w r0, @\(-0x8000, r2\)
4c: fc 02 80 00 stb r0, @\(-0x8000, r2\)
50: f4 02 80 00 st r0, @\(-0x8000, r2\)
54: f5 02 80 00 st2w r0, @\(-0x8000, r2\)
58: 26 0d 5e 00 jmp r13 || nop
Disassembly of section .data:

View file

@ -0,0 +1,78 @@
;;
;; address-001.s
;; Test supported indirect addressing
;;
.text
.global main
main:
;;
;; Indirect
;;
ldb r0,@r2
ldub r0,@r2
ld r0,@r2
ld2w r0,@r2
stb r0,@r2
st r0,@r2
st2w r0,@r2
;;
;; Indirect with post increment
;;
ld r0,@r2+
ld2w r0,@r2+
st r0,@r2+
st2w r0,@r2+
;;
;; Indirect with postdecrement
;;
ld r0,@r2-
ld2w r0,@r2-
st r0,@r2-
st2w r0,@r2-
;;
;; Indirect through stackpointer
;;
ldb r0,@sp
ldub r0,@sp
ld r0,@sp
ld2w r0,@sp
stb r0,@sp
st r0,@sp
st2w r0,@sp
;;
;; Indirect through stackpointer with postincrement
;;
ld r0,@sp+
ld2w r0,@sp+
st r0,@sp+
st2w r0,@sp+
;;
;; Indirect through stackpointer with postdecrement
;;
ld r0,@sp-
ld2w r0,@sp-
;;
;; Indirect through stackpointer with predecrement
;;
st r0,@-sp
st2w r0,@-sp
;;
;; Indirect with displacement
;;
ldb r0,@(0x8000,r2)
ldub r0,@(0x8000,r2)
ld r0,@(0x8000,r2)
ld2w r0,@(0x8000,r2)
stb r0,@(0x8000,r2)
st r0,@(0x8000,r2)
st2w r0,@(0x8000,r2)
jmp r13

View file

@ -0,0 +1,3 @@
.*: Assembler messages:
.*:6: Error: bad opcode or operands
.*:6: Fatal error: can't find opcode

View file

@ -0,0 +1,8 @@
;; Test unsupported indirect addressing
.text
.global main
main:
ldb r0,@r2+
jmp r13

View file

@ -0,0 +1,3 @@
.*: Assembler messages:
.*:6: Error: bad opcode or operands
.*:6: Fatal error: can't find opcode

View file

@ -0,0 +1,8 @@
;; Test unsupported indirect addressing
.text
.global main
main:
ldub r0,@r2+
jmp r13

View file

@ -0,0 +1,3 @@
.*: Assembler messages:
.*:6: Error: bad opcode or operands
.*:6: Fatal error: can't find opcode

View file

@ -0,0 +1,8 @@
;; Test unsupported indirect addressing
.text
.global main
main:
stb r0,@r2+
jmp r13

View file

@ -0,0 +1,3 @@
.*: Assembler messages:
.*:6: Error: bad opcode or operands
.*:6: Fatal error: can't find opcode

View file

@ -0,0 +1,8 @@
;; Test unsupported indirect addressing
.text
.global main
main:
ldb r0,@r2-
jmp r13

View file

@ -0,0 +1,3 @@
.*: Assembler messages:
.*:6: Error: bad opcode or operands
.*:6: Fatal error: can't find opcode

View file

@ -0,0 +1,8 @@
;; Test unsupported indirect addressing
.text
.global main
main:
ldub r0,@r2-
jmp r13

View file

@ -0,0 +1,3 @@
.*: Assembler messages:
.*:6: Error: bad opcode or operands
.*:6: Fatal error: can't find opcode

View file

@ -0,0 +1,8 @@
;; Test unsupported indirect addressing
.text
.global main
main:
stb r0,@r2-
jmp r13

View file

@ -0,0 +1,3 @@
.*: Assembler messages:
.*:6: Error: bad opcode or operands
.*:6: Fatal error: can't find opcode

View file

@ -0,0 +1,8 @@
;; Test unsupported indirect addressing
.text
.global main
main:
ldb r0,@+r2
jmp r13

View file

@ -0,0 +1,3 @@
.*: Assembler messages:
.*:6: Error: bad opcode or operands
.*:6: Fatal error: can't find opcode

View file

@ -0,0 +1,8 @@
;; Test unsupported indirect addressing
.text
.global main
main:
ldub r0,@+r2
jmp r13

View file

@ -0,0 +1,3 @@
.*: Assembler messages:
.*:6: Error: bad opcode or operands
.*:6: Fatal error: can't find opcode

View file

@ -0,0 +1,8 @@
;; Test unsupported indirect addressing
.text
.global main
main:
ld r0,@+r2
jmp r13

View file

@ -0,0 +1,3 @@
.*: Assembler messages:
.*:6: Error: bad opcode or operands
.*:6: Fatal error: can't find opcode

View file

@ -0,0 +1,8 @@
;; Test unsupported indirect addressing
.text
.global main
main:
ld2w r0,@+r2
jmp r13

View file

@ -0,0 +1,3 @@
.*: Assembler messages:
.*:6: Error: bad opcode or operands
.*:6: Fatal error: can't find opcode

View file

@ -0,0 +1,8 @@
;; Test unsupported indirect addressing
.text
.global main
main:
stb r0,@+r2
jmp r13

View file

@ -0,0 +1,3 @@
.*: Assembler messages:
.*:6: Error: bad opcode or operands
.*:6: Fatal error: can't find opcode

View file

@ -0,0 +1,8 @@
;; Test unsupported indirect addressing
.text
.global main
main:
st r0,@+r2
jmp r13

View file

@ -0,0 +1,3 @@
.*: Assembler messages:
.*:6: Error: bad opcode or operands
.*:6: Fatal error: can't find opcode

View file

@ -0,0 +1,8 @@
;; Test unsupported indirect addressing
.text
.global main
main:
st2w r0,@+r2
jmp r13

View file

@ -0,0 +1,3 @@
.*: Assembler messages:
.*:6: Error: bad opcode or operands
.*:6: Fatal error: can't find opcode

View file

@ -0,0 +1,8 @@
;; Test unsupported indirect addressing
.text
.global main
main:
ldb r0,@-r2
jmp r13

View file

@ -0,0 +1,3 @@
.*: Assembler messages:
.*:6: Error: bad opcode or operands
.*:6: Fatal error: can't find opcode

View file

@ -0,0 +1,8 @@
;; Test unsupported indirect addressing
.text
.global main
main:
ldub r0,@-r2
jmp r13

View file

@ -0,0 +1,3 @@
.*: Assembler messages:
.*:6: Error: bad opcode or operands
.*:6: Fatal error: can't find opcode

View file

@ -0,0 +1,8 @@
;; Test unsupported indirect addressing
.text
.global main
main:
ld r0,@-r2
jmp r13

View file

@ -0,0 +1,3 @@
.*: Assembler messages:
.*:6: Error: bad opcode or operands
.*:6: Fatal error: can't find opcode

View file

@ -0,0 +1,8 @@
;; Test unsupported indirect addressing
.text
.global main
main:
ld2w r0,@-r2
jmp r13

View file

@ -0,0 +1,3 @@
.*: Assembler messages:
.*:6: Error: bad opcode or operands
.*:6: Fatal error: can't find opcode

View file

@ -0,0 +1,8 @@
;; Test unsupported indirect addressing
.text
.global main
main:
stb r0,@-r2
jmp r13

View file

@ -0,0 +1,3 @@
.*: Assembler messages:
.*:6: Error: bad opcode or operands
.*:6: Fatal error: can't find opcode

View file

@ -0,0 +1,8 @@
;; Test unsupported indirect addressing
.text
.global main
main:
st r0,@-r2
jmp r13

View file

@ -0,0 +1,3 @@
.*: Assembler messages:
.*:6: Error: bad opcode or operands
.*:6: Fatal error: can't find opcode

View file

@ -0,0 +1,8 @@
;; Test unsupported indirect addressing
.text
.global main
main:
st2w r0,@-r2
jmp r13

View file

@ -0,0 +1,3 @@
.*: Assembler messages:
.*:6: Error: bad opcode or operands
.*:6: Fatal error: can't find opcode

View file

@ -0,0 +1,8 @@
;; Test unsupported indirect addressing
.text
.global main
main:
ldb r0,@sp+
jmp r13

View file

@ -0,0 +1,3 @@
.*: Assembler messages:
.*:6: Error: bad opcode or operands
.*:6: Fatal error: can't find opcode

View file

@ -0,0 +1,8 @@
;; Test unsupported indirect addressing
.text
.global main
main:
ldub r0,@sp+
jmp r13

View file

@ -0,0 +1,3 @@
.*: Assembler messages:
.*:6: Error: bad opcode or operands
.*:6: Fatal error: can't find opcode

View file

@ -0,0 +1,8 @@
;; Test unsupported indirect addressing
.text
.global main
main:
stb r0,@sp+
jmp r13

View file

@ -0,0 +1,3 @@
.*: Assembler messages:
.*:6: Error: bad opcode or operands
.*:6: Fatal error: can't find opcode

View file

@ -0,0 +1,8 @@
;; Test unsupported indirect addressing
.text
.global main
main:
ldb r0,@sp-
jmp r13

View file

@ -0,0 +1,3 @@
.*: Assembler messages:
.*:6: Error: bad opcode or operands
.*:6: Fatal error: can't find opcode

View file

@ -0,0 +1,8 @@
;; Test unsupported indirect addressing
.text
.global main
main:
ldub r0,@sp-
jmp r13

View file

@ -0,0 +1,3 @@
.*: Assembler messages:
.*:6: Error: bad opcode or operands
.*:6: Fatal error: can't find opcode

View file

@ -0,0 +1,8 @@
;; Test unsupported indirect addressing
.text
.global main
main:
stb r0,@sp-
jmp r13

View file

@ -0,0 +1,3 @@
.*: Assembler messages:
.*:6: Error: Unsupported use of sp

View file

@ -0,0 +1,8 @@
;; Test unsupported indirect addressing
.text
.global main
main:
st r0,@sp-
jmp r13

View file

@ -0,0 +1,3 @@
.*: Assembler messages:
.*:6: Error: Unsupported use of sp

View file

@ -0,0 +1,8 @@
;; Test unsupported indirect addressing
.text
.global main
main:
st2w r0,@sp-
jmp r13

View file

@ -0,0 +1,3 @@
.*: Assembler messages:
.*:6: Error: bad opcode or operands
.*:6: Fatal error: can't find opcode

View file

@ -0,0 +1,8 @@
;; Test unsupported indirect addressing
.text
.global main
main:
ldb r0,@+sp
jmp r13

View file

@ -0,0 +1,3 @@
.*: Assembler messages:
.*:6: Error: bad opcode or operands
.*:6: Fatal error: can't find opcode

View file

@ -0,0 +1,8 @@
;; Test unsupported indirect addressing
.text
.global main
main:
ldub r0,@+sp
jmp r13

View file

@ -0,0 +1,3 @@
.*: Assembler messages:
.*:6: Error: bad opcode or operands
.*:6: Fatal error: can't find opcode

View file

@ -0,0 +1,8 @@
;; Test unsupported indirect addressing
.text
.global main
main:
ld r0,@+sp
jmp r13

View file

@ -0,0 +1,3 @@
.*: Assembler messages:
.*:6: Error: bad opcode or operands
.*:6: Fatal error: can't find opcode

View file

@ -0,0 +1,8 @@
;; Test unsupported indirect addressing
.text
.global main
main:
ld2w r0,@+sp
jmp r13

View file

@ -0,0 +1,3 @@
.*: Assembler messages:
.*:6: Error: bad opcode or operands
.*:6: Fatal error: can't find opcode

View file

@ -0,0 +1,8 @@
;; Test unsupported indirect addressing
.text
.global main
main:
stb r0,@+sp
jmp r13

View file

@ -0,0 +1,3 @@
.*: Assembler messages:
.*:6: Error: bad opcode or operands
.*:6: Fatal error: can't find opcode

View file

@ -0,0 +1,8 @@
;; Test unsupported indirect addressing
.text
.global main
main:
st r0,@+sp
jmp r13

View file

@ -0,0 +1,3 @@
.*: Assembler messages:
.*:6: Error: bad opcode or operands
.*:6: Fatal error: can't find opcode

View file

@ -0,0 +1,8 @@
;; Test unsupported indirect addressing
.text
.global main
main:
st2w r0,@+sp
jmp r13

View file

@ -0,0 +1,3 @@
.*: Assembler messages:
.*:6: Error: bad opcode or operands
.*:6: Fatal error: can't find opcode

View file

@ -0,0 +1,8 @@
;; Test unsupported indirect addressing
.text
.global main
main:
ldb r0,@-sp
jmp r13

View file

@ -0,0 +1,3 @@
.*: Assembler messages:
.*:6: Error: bad opcode or operands
.*:6: Fatal error: can't find opcode

View file

@ -0,0 +1,8 @@
;; Test unsupported indirect addressing
.text
.global main
main:
ldub r0,@-sp
jmp r13

View file

@ -0,0 +1,3 @@
.*: Assembler messages:
.*:6: Error: bad opcode or operands
.*:6: Fatal error: can't find opcode

View file

@ -0,0 +1,8 @@
;; Test unsupported indirect addressing
.text
.global main
main:
ld r0,@-sp
jmp r13

View file

@ -0,0 +1,3 @@
.*: Assembler messages:
.*:6: Error: bad opcode or operands
.*:6: Fatal error: can't find opcode

View file

@ -0,0 +1,8 @@
;; Test unsupported indirect addressing
.text
.global main
main:
ld2w r0,@-sp
jmp r13

View file

@ -0,0 +1,3 @@
.*: Assembler messages:
.*:6: Error: bad opcode or operands
.*:6: Fatal error: can't find opcode

View file

@ -0,0 +1,8 @@
;; Test unsupported indirect addressing
.text
.global main
main:
stb r0,@-sp
jmp r13

View file

@ -1,19 +0,0 @@
#
# Driver for D10V assembler testsuite
#
proc run_list_test { name opts } {
global srcdir subdir
set testname "D10V $name"
set file $srcdir/$subdir/$name
gas_run ${name}.s $opts ">&dump.out"
if {[regexp_diff "dump.out" "${file}.l"] } {
fail $testname
verbose "output is [file_contents "dump.out"]" 2
return
}
pass $testname
}
if {[istarget d10v-*-*]} {
run_dump_test "inst"
}

View file

@ -0,0 +1,61 @@
#
# Driver for D10V assembler testsuite
#
proc run_list_test { name opts } {
global srcdir subdir
set testname "D10V $name"
set file $srcdir/$subdir/$name
gas_run ${name}.s $opts ">&dump.out"
if {[regexp_diff "dump.out" "${file}.l"] } {
fail $testname
verbose "output is [file_contents "dump.out"]" 2
return
}
pass $testname
}
if {[istarget d10v-*-*]} {
run_dump_test "inst"
run_dump_test "address-001"
run_list_test "address-002" ""
run_list_test "address-003" ""
run_list_test "address-004" ""
run_list_test "address-005" ""
run_list_test "address-006" ""
run_list_test "address-007" ""
run_list_test "address-008" ""
run_list_test "address-009" ""
run_list_test "address-010" ""
run_list_test "address-011" ""
run_list_test "address-012" ""
run_list_test "address-013" ""
run_list_test "address-014" ""
run_list_test "address-015" ""
run_list_test "address-016" ""
run_list_test "address-017" ""
run_list_test "address-018" ""
run_list_test "address-019" ""
run_list_test "address-020" ""
run_list_test "address-021" ""
run_list_test "address-022" ""
run_list_test "address-023" ""
run_list_test "address-024" ""
run_list_test "address-025" ""
run_list_test "address-026" ""
run_list_test "address-027" ""
run_list_test "address-028" ""
run_list_test "address-029" ""
run_list_test "address-030" ""
run_list_test "address-031" ""
run_list_test "address-032" ""
run_list_test "address-033" ""
run_list_test "address-034" ""
run_list_test "address-035" ""
run_list_test "address-036" ""
run_list_test "address-037" ""
run_list_test "address-038" ""
run_list_test "address-039" ""
run_list_test "address-040" ""
run_list_test "address-041" ""
run_dump_test "instruction_packing"
}

View file

@ -0,0 +1,86 @@
#objdump: -Dr
#name: D10V intruction packing
#as: -W
.*: +file format elf32-d10v
Disassembly of section .text:
00000000 <main>:
0: 2f 00 5e 00 nop || nop
00000004 <FM00_IU_MU>:
4: 30 23 24 02 ld r2, @r3 || sra r0, r1
8: 24 11 a4 02 bra.s 94 <test_end> || sra r0, r1
0000000c <FM00_MU_IU>:
c: 30 23 24 02 ld r2, @r3 || sra r0, r1
10: 24 10 a4 02 bra.s 94 <test_end> || sra r0, r1
00000014 <FM00_IM_MU>:
14: 30 23 02 8a ld r2, @r3 || add r4, r5
18: 24 0f 82 8a bra.s 94 <test_end> || add r4, r5
0000001c <FM00_IM_IU>:
1c: 01 45 24 02 add r4, r5 || sra r0, r1
20: 01 45 2c ce add r4, r5 || mulx a0, r6, r7
00000024 <FM00_MU_IM>:
24: 30 23 02 8a ld r2, @r3 || add r4, r5
28: 24 0d 82 8a bra.s 94 <test_end> || add r4, r5
0000002c <FM00_IU_IM>:
2c: 01 45 24 02 add r4, r5 || sra r0, r1
30: 01 45 2c ce add r4, r5 || mulx a0, r6, r7
00000034 <FM01_IU_MU>:
34: b0 23 24 02 ld r2, @r3 <- sra r0, r1
38: a4 0b a4 02 bra.s 94 <test_end> <- sra r0, r1
0000003c <FM01_MU_IU>:
3c: 70 23 24 02 ld r2, @r3 -> sra r0, r1
40: 64 0a a4 02 bra.s 94 <test_end> -> sra r0, r1
00000044 <FM01_IM_MU>:
44: 41 45 60 46 add r4, r5 -> ld r2, @r3
48: 41 45 48 13 add r4, r5 -> bra.s 94 <test_end>
0000004c <FM01_IM_IU>:
4c: 41 45 24 02 add r4, r5 -> sra r0, r1
50: 41 45 2c ce add r4, r5 -> mulx a0, r6, r7
00000054 <FM01_MU_IM>:
54: 70 23 02 8a ld r2, @r3 -> add r4, r5
58: 64 07 82 8a bra.s 94 <test_end> -> add r4, r5
0000005c <FM01_IU_IM>:
5c: 81 45 24 02 add r4, r5 <- sra r0, r1
60: 81 45 2c ce add r4, r5 <- mulx a0, r6, r7
00000064 <FM10_IU_MU>:
64: 70 23 24 02 ld r2, @r3 -> sra r0, r1
68: 64 05 a4 02 bra.s 94 <test_end> -> sra r0, r1
0000006c <FM10_MU_IU>:
6c: b0 23 24 02 ld r2, @r3 <- sra r0, r1
70: a4 04 a4 02 bra.s 94 <test_end> <- sra r0, r1
00000074 <FM10_IM_MU>:
74: 70 23 02 8a ld r2, @r3 -> add r4, r5
78: 64 03 82 8a bra.s 94 <test_end> -> add r4, r5
0000007c <FM10_IM_IU>:
7c: 81 45 24 02 add r4, r5 <- sra r0, r1
80: 81 45 2c ce add r4, r5 <- mulx a0, r6, r7
00000084 <FM10_MU_IM>:
84: b0 23 02 8a ld r2, @r3 <- add r4, r5
88: a4 01 82 8a bra.s 94 <test_end> <- add r4, r5
0000008c <FM10_IU_IM>:
8c: 92 01 02 8a sra r0, r1 <- add r4, r5
90: 96 67 02 8a mulx a0, r6, r7 <- add r4, r5
00000094 <test_end>:
94: 26 0d 5e 00 jmp r13 || nop
Disassembly of section .data:

View file

@ -0,0 +1,83 @@
;; Test instruction packing
.text
.global main
main:
MU_IU:
nop || nop
FM00_IU_MU:
sra r0,r1 || ld r2,@r3
sra r0,r1 || bra.s test_end
FM00_MU_IU:
ld r2,@r3 || sra r0,r1
bra.s test_end || sra r0,r1
FM00_IM_MU:
add r4,r5 || ld r2,@r3
add r4,r5 || bra.s test_end
FM00_IM_IU:
add r4,r5 || sra r0,r1
add r4,r5 || mulx a0, r6, r7
FM00_MU_IM:
ld r2,@r3 || add r4,r5
bra.s test_end || add r4,r5
FM00_IU_IM:
sra r0,r1 || add r4,r5
mulx a0, r6, r7 || add r4,r5
FM01_IU_MU:
sra r0,r1 -> ld r2,@r3
sra r0,r1 -> bra.s test_end
FM01_MU_IU:
ld r2,@r3 -> sra r0,r1
bra.s test_end -> sra r0,r1
FM01_IM_MU:
add r4,r5 -> ld r2,@r3
add r4,r5 -> bra.s test_end
FM01_IM_IU:
add r4,r5 -> sra r0,r1
add r4,r5 -> mulx a0, r6, r7
FM01_MU_IM:
ld r2,@r3 -> add r4,r5
bra.s test_end -> add r4,r5
FM01_IU_IM:
sra r0,r1 -> add r4,r5
mulx a0, r6, r7 -> add r4,r5
FM10_IU_MU:
sra r0,r1 <- ld r2,@r3
sra r0,r1 <- bra.s test_end
FM10_MU_IU:
ld r2,@r3 <- sra r0,r1
bra.s test_end <- sra r0,r1
FM10_IM_MU:
add r4,r5 <- ld r2,@r3
add r4,r5 <- bra.s test_end
FM10_IM_IU:
add r4,r5 <- sra r0,r1
add r4,r5 <- mulx a0, r6, r7
FM10_MU_IM:
ld r2,@r3 <- add r4,r5
bra.s test_end <- add r4,r5
FM10_IU_IM:
sra r0,r1 <- add r4,r5
mulx a0, r6, r7 <- add r4,r5
test_end:
jmp r13