Skip to content

Commit 405e9d1

Browse files
committed
RISC-V: Better support for long instructions (tests)
This commit tests both (assembler and disassembler) fixes of "Better support for long instructions". gas/ChangeLog: * testsuite/gas/riscv/insn.s: Add testcases such that big number handling is required and should be disassembled as long ".byte" sequence with correct instruction bits. * testsuite/gas/riscv/insn.d: Likewise. * testsuite/gas/riscv/insn-na.d: Likewise. * testsuite/gas/riscv/insn-dwarf.d: Likewise.
1 parent 634001b commit 405e9d1

File tree

4 files changed

+48
-1
lines changed

4 files changed

+48
-1
lines changed

gas/testsuite/gas/riscv/insn-dwarf.d

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,5 +74,13 @@ insn.s +69 +0xf6.*
7474
insn.s +70 +0xfe.*
7575
insn.s +71 +0x108.*
7676
insn.s +72 +0x114.*
77-
insn.s +- +0x12a
77+
insn.s +74 +0x12a.*
78+
insn.s +75 +0x134.*
79+
insn.s +76 +0x13e.*
80+
insn.s +77 +0x154.*
81+
insn.s +78 +0x16a.*
82+
insn.s +79 +0x180.*
83+
insn.s +80 +0x196.*
84+
insn.s +81 +0x1ac.*
85+
insn.s +- +0x1c2
7886
#pass

gas/testsuite/gas/riscv/insn-na.d

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,3 +73,11 @@ Disassembly of section .text:
7373
[^:]+:[ ]+007f 0000 0000 0000 0000[ ]+[._a-z].*
7474
[^:]+:[ ]+0000107f 00000000 00000000[ ]+[._a-z].*
7575
[^:]+:[ ]+607f 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000[ ]+[._a-z].*
76+
[^:]+:[ ]+007f 0000 0000 0000 8000[ ]+\.byte[ ]+0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80
77+
[^:]+:[ ]+007f 0000 0000 0000 8000[ ]+\.byte[ ]+0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80
78+
[^:]+:[ ]+607f 89ab 4567 0123 3210 7654 ba98 fedc 0000 0000 0000[ ]+\.byte[ ]+0x7f, 0x60, 0xab, 0x89, 0x67, 0x45, 0x23, 0x01, 0x10, 0x32, 0x54, 0x76, 0x98, 0xba, 0xdc, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
79+
[^:]+:[ ]+607f 89ab 4567 0123 3210 7654 ba98 fedc 0000 0000 0000[ ]+\.byte[ ]+0x7f, 0x60, 0xab, 0x89, 0x67, 0x45, 0x23, 0x01, 0x10, 0x32, 0x54, 0x76, 0x98, 0xba, 0xdc, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
80+
[^:]+:[ ]+607f 33cc 55aa cdef 89ab 4567 0123 3210 7654 ba98 00dc[ ]+\.byte[ ]+0x7f, 0x60, 0xcc, 0x33, 0xaa, 0x55, 0xef, 0xcd, 0xab, 0x89, 0x67, 0x45, 0x23, 0x01, 0x10, 0x32, 0x54, 0x76, 0x98, 0xba, 0xdc, 0x00
81+
[^:]+:[ ]+607f 33cc 55aa cdef 89ab 4567 0123 3210 7654 ba98 00dc[ ]+\.byte[ ]+0x7f, 0x60, 0xcc, 0x33, 0xaa, 0x55, 0xef, 0xcd, 0xab, 0x89, 0x67, 0x45, 0x23, 0x01, 0x10, 0x32, 0x54, 0x76, 0x98, 0xba, 0xdc, 0x00
82+
[^:]+:[ ]+607f 33cc 55aa cdef 89ab 4567 0123 3210 7654 ba98 fedc[ ]+\.byte[ ]+0x7f, 0x60, 0xcc, 0x33, 0xaa, 0x55, 0xef, 0xcd, 0xab, 0x89, 0x67, 0x45, 0x23, 0x01, 0x10, 0x32, 0x54, 0x76, 0x98, 0xba, 0xdc, 0xfe
83+
[^:]+:[ ]+607f 33cc 55aa cdef 89ab 4567 0123 3210 7654 ba98 fedc[ ]+\.byte[ ]+0x7f, 0x60, 0xcc, 0x33, 0xaa, 0x55, 0xef, 0xcd, 0xab, 0x89, 0x67, 0x45, 0x23, 0x01, 0x10, 0x32, 0x54, 0x76, 0x98, 0xba, 0xdc, 0xfe

gas/testsuite/gas/riscv/insn.d

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,3 +92,25 @@ Disassembly of section .text:
9292
[^:]+:[ ]+607f 0000 0000 0000[ ]+[._a-z].*
9393
[^:]+:[ ]+0000 0000 0000 0000 ?
9494
[^:]+:[ ]+0000 0000 0000 ?
95+
[^:]+:[ ]+007f 0000 0000 0000[ ]+\.byte[ ]+0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80
96+
[^:]+:[ ]+8000 ?
97+
[^:]+:[ ]+007f 0000 0000 0000[ ]+\.byte[ ]+0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80
98+
[^:]+:[ ]+8000 ?
99+
[^:]+:[ ]+607f 89ab 4567 0123[ ]+\.byte[ ]+0x7f, 0x60, 0xab, 0x89, 0x67, 0x45, 0x23, 0x01, 0x10, 0x32, 0x54, 0x76, 0x98, 0xba, 0xdc, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
100+
[^:]+:[ ]+3210 7654 ba98 fedc ?
101+
[^:]+:[ ]+0000 0000 0000 ?
102+
[^:]+:[ ]+607f 89ab 4567 0123[ ]+\.byte[ ]+0x7f, 0x60, 0xab, 0x89, 0x67, 0x45, 0x23, 0x01, 0x10, 0x32, 0x54, 0x76, 0x98, 0xba, 0xdc, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
103+
[^:]+:[ ]+3210 7654 ba98 fedc ?
104+
[^:]+:[ ]+0000 0000 0000 ?
105+
[^:]+:[ ]+607f 33cc 55aa cdef[ ]+\.byte[ ]+0x7f, 0x60, 0xcc, 0x33, 0xaa, 0x55, 0xef, 0xcd, 0xab, 0x89, 0x67, 0x45, 0x23, 0x01, 0x10, 0x32, 0x54, 0x76, 0x98, 0xba, 0xdc, 0x00
106+
[^:]+:[ ]+89ab 4567 0123 3210 ?
107+
[^:]+:[ ]+7654 ba98 00dc ?
108+
[^:]+:[ ]+607f 33cc 55aa cdef[ ]+\.byte[ ]+0x7f, 0x60, 0xcc, 0x33, 0xaa, 0x55, 0xef, 0xcd, 0xab, 0x89, 0x67, 0x45, 0x23, 0x01, 0x10, 0x32, 0x54, 0x76, 0x98, 0xba, 0xdc, 0x00
109+
[^:]+:[ ]+89ab 4567 0123 3210 ?
110+
[^:]+:[ ]+7654 ba98 00dc ?
111+
[^:]+:[ ]+607f 33cc 55aa cdef[ ]+\.byte[ ]+0x7f, 0x60, 0xcc, 0x33, 0xaa, 0x55, 0xef, 0xcd, 0xab, 0x89, 0x67, 0x45, 0x23, 0x01, 0x10, 0x32, 0x54, 0x76, 0x98, 0xba, 0xdc, 0xfe
112+
[^:]+:[ ]+89ab 4567 0123 3210 ?
113+
[^:]+:[ ]+7654 ba98 fedc ?
114+
[^:]+:[ ]+607f 33cc 55aa cdef[ ]+\.byte[ ]+0x7f, 0x60, 0xcc, 0x33, 0xaa, 0x55, 0xef, 0xcd, 0xab, 0x89, 0x67, 0x45, 0x23, 0x01, 0x10, 0x32, 0x54, 0x76, 0x98, 0xba, 0xdc, 0xfe
115+
[^:]+:[ ]+89ab 4567 0123 3210 ?
116+
[^:]+:[ ]+7654 ba98 fedc ?

gas/testsuite/gas/riscv/insn.s

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,3 +70,12 @@ target:
7070
.insn 10, 0x007f
7171
.insn 12, 0x107f
7272
.insn 22, 0x607f
73+
74+
.insn 0x8000000000000000007f
75+
.insn 10, 0x8000000000000000007f
76+
.insn 0x000000000000fedcba98765432100123456789ab607f
77+
.insn 22, 0x000000000000fedcba98765432100123456789ab607f
78+
.insn 0x00dcba98765432100123456789abcdef55aa33cc607f
79+
.insn 22, 0x00dcba98765432100123456789abcdef55aa33cc607f
80+
.insn 0xfedcba98765432100123456789abcdef55aa33cc607f
81+
.insn 22, 0xfedcba98765432100123456789abcdef55aa33cc607f

0 commit comments

Comments
 (0)