From: Nelson Chu <nelsonc1225@sourceware.org>
To: binutils-cvs@sourceware.org
Subject: [binutils-gdb] RISC-V: Add partial instruction display tests
Date: Thu, 9 Jan 2025 02:11:31 +0000 (GMT) [thread overview]
Message-ID: <20250109021131.532823858C60@sourceware.org> (raw)
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=b5e40fa57215854e567f5eb8895e893e47a06c8e
commit b5e40fa57215854e567f5eb8895e893e47a06c8e
Author: Charlie Jenkins <charlie@rivosinc.com>
Date: Tue Jan 7 13:35:45 2025 -0800
RISC-V: Add partial instruction display tests
When objdump is specified with a stop address that ends up in the middle
of an instruction, the partial instruction is expected to be displayed.
These three tests check that the partial instruction is correctly
displayed when there are 1, 2, or 3 bytes of the instruction dumped.
Signed-off-by: Charlie Jenkins <charlie@rivosinc.com>
Diff:
---
gas/testsuite/gas/riscv/dis-partial-insn-byte.d | 11 +++++++++++
gas/testsuite/gas/riscv/dis-partial-insn-short.d | 11 +++++++++++
gas/testsuite/gas/riscv/dis-partial-insn-word.d | 11 +++++++++++
gas/testsuite/gas/riscv/dis-partial-insn.s | 2 ++
4 files changed, 35 insertions(+)
diff --git a/gas/testsuite/gas/riscv/dis-partial-insn-byte.d b/gas/testsuite/gas/riscv/dis-partial-insn-byte.d
new file mode 100644
index 00000000000..f8c149ca881
--- /dev/null
+++ b/gas/testsuite/gas/riscv/dis-partial-insn-byte.d
@@ -0,0 +1,11 @@
+#as:
+#source: dis-partial-insn.s
+#objdump: --start-address 0 --stop-address 1 -d
+
+.*:[ ]+file format .*
+
+
+Disassembly of section .text:
+
+0+000 <target>:
+[ ]+0:[ ]+13[ ]+.byte[ ]+0x13
diff --git a/gas/testsuite/gas/riscv/dis-partial-insn-short.d b/gas/testsuite/gas/riscv/dis-partial-insn-short.d
new file mode 100644
index 00000000000..4a7d6d98b82
--- /dev/null
+++ b/gas/testsuite/gas/riscv/dis-partial-insn-short.d
@@ -0,0 +1,11 @@
+#as:
+#source: dis-partial-insn.s
+#objdump: --start-address 0 --stop-address 2 -d
+
+.*:[ ]+file format .*
+
+
+Disassembly of section .text:
+
+0+000 <target>:
+[ ]+0:[ ]+0013[ ]+.short[ ]+0x0013
diff --git a/gas/testsuite/gas/riscv/dis-partial-insn-word.d b/gas/testsuite/gas/riscv/dis-partial-insn-word.d
new file mode 100644
index 00000000000..2f52153075e
--- /dev/null
+++ b/gas/testsuite/gas/riscv/dis-partial-insn-word.d
@@ -0,0 +1,11 @@
+#as:
+#source: dis-partial-insn.s
+#objdump: --start-address 0 --stop-address 3 -d
+
+.*:[ ]+file format .*
+
+
+Disassembly of section .text:
+
+0+000 <target>:
+[ ]+0:[ ]+000013[ ]+.word[ ]+0x000013
diff --git a/gas/testsuite/gas/riscv/dis-partial-insn.s b/gas/testsuite/gas/riscv/dis-partial-insn.s
new file mode 100644
index 00000000000..99456883315
--- /dev/null
+++ b/gas/testsuite/gas/riscv/dis-partial-insn.s
@@ -0,0 +1,2 @@
+target:
+ nop
reply other threads:[~2025-01-09 2:11 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250109021131.532823858C60@sourceware.org \
--to=nelsonc1225@sourceware.org \
--cc=binutils-cvs@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).