aboutsummaryrefslogtreecommitdiff
path: root/gas/testsuite
diff options
context:
space:
mode:
authorPatrick O'Neill <patrick@rivosinc.com>2022-01-21 09:22:46 -0800
committerNelson Chu <nelson.chu@sifive.com>2022-02-23 19:45:52 +0800
commite4028336b19998e74a51dd0918a8b3922e08a537 (patch)
tree4c350a0187b397546a7a109acb0e1163e563e2b5 /gas/testsuite
parentdf0a549ebdae74ef9d233243b869d424e6a33c73 (diff)
downloadgdb-e4028336b19998e74a51dd0918a8b3922e08a537.zip
gdb-e4028336b19998e74a51dd0918a8b3922e08a537.tar.gz
gdb-e4028336b19998e74a51dd0918a8b3922e08a537.tar.bz2
RISC-V: PR28733, add missing extension info to 'unrecognized opcode' error
Currently we report errors as "unrecognized opcode `fence.i'" when the opcode isn't part of the selected extensions. This patch expands that error message to include the missing extension information. For example, now the error message would be "unrecognized opcode `fence.i', extension `zifencei' required". If the opcode is not a part of any extension, the error message reverts to "unrecognized opcode `<op statement>'". Signed-off-by: Patrick O'Neill <patrick@rivosinc.com> bfd/ pr 28733 * elfxx-riscv.c (riscv_multi_subset_supports_ext): New function, used to return the extension string for each INSN_CLASS_*. * elfxx-riscv.h: Added extern riscv_multi_subset_supports_ext. gas/ pr 28733 * config/tc-riscv.c (struct riscv_ip_error): New structure, contains information about errors that occur within the riscv_ip. (riscv_ip): Use struct riscv_ip_error to report more detailed errors. * testsuite/gas/riscv/c-fld-fsd-fail.l: Updated. * testsuite/gas/riscv/march-imply-i2p1-01.: Likewise.
Diffstat (limited to 'gas/testsuite')
-rw-r--r--gas/testsuite/gas/riscv/c-fld-fsd-fail.l4
-rw-r--r--gas/testsuite/gas/riscv/march-imply-i2p1-01.l40
2 files changed, 22 insertions, 22 deletions
diff --git a/gas/testsuite/gas/riscv/c-fld-fsd-fail.l b/gas/testsuite/gas/riscv/c-fld-fsd-fail.l
index 7d99abb..b701fac 100644
--- a/gas/testsuite/gas/riscv/c-fld-fsd-fail.l
+++ b/gas/testsuite/gas/riscv/c-fld-fsd-fail.l
@@ -1,3 +1,3 @@
.*: Assembler messages:
-.*: Error: unrecognized opcode `fld fa0,0\(a0\)'
-.*: Error: unrecognized opcode `fsd fa0,0\(a0\)'
+.*: Error: unrecognized opcode `fld fa0,0\(a0\)', extension `d' required
+.*: Error: unrecognized opcode `fsd fa0,0\(a0\)', extension `d' required
diff --git a/gas/testsuite/gas/riscv/march-imply-i2p1-01.l b/gas/testsuite/gas/riscv/march-imply-i2p1-01.l
index b54d4ae..7fbee14 100644
--- a/gas/testsuite/gas/riscv/march-imply-i2p1-01.l
+++ b/gas/testsuite/gas/riscv/march-imply-i2p1-01.l
@@ -1,21 +1,21 @@
.*Assembler messages:
-.*Error: unrecognized opcode `csrr t0,ustatus'
-.*Error: unrecognized opcode `csrwi ustatus,0x0'
-.*Error: unrecognized opcode `csrsi ustatus,0x0'
-.*Error: unrecognized opcode `csrci ustatus,0x0'
-.*Error: unrecognized opcode `csrw ustatus,t0'
-.*Error: unrecognized opcode `csrw ustatus,0x0'
-.*Error: unrecognized opcode `csrs ustatus,t0'
-.*Error: unrecognized opcode `csrs ustatus,0x0'
-.*Error: unrecognized opcode `csrc ustatus,t0'
-.*Error: unrecognized opcode `csrc ustatus,0x0'
-.*Error: unrecognized opcode `csrrwi t0,ustatus,0x0'
-.*Error: unrecognized opcode `csrrsi t0,ustatus,0x0'
-.*Error: unrecognized opcode `csrrci t0,ustatus,0x0'
-.*Error: unrecognized opcode `csrrw t0,ustatus,t0'
-.*Error: unrecognized opcode `csrrw t0,ustatus,0x0'
-.*Error: unrecognized opcode `csrrs t0,ustatus,t0'
-.*Error: unrecognized opcode `csrrs t0,ustatus,0x0'
-.*Error: unrecognized opcode `csrrc t0,ustatus,t0'
-.*Error: unrecognized opcode `csrrc t0,ustatus,0x0'
-.*Error: unrecognized opcode `fence.i'
+.*Error: unrecognized opcode `csrr t0,ustatus', extension `zicsr' required
+.*Error: unrecognized opcode `csrwi ustatus,0x0', extension `zicsr' required
+.*Error: unrecognized opcode `csrsi ustatus,0x0', extension `zicsr' required
+.*Error: unrecognized opcode `csrci ustatus,0x0', extension `zicsr' required
+.*Error: unrecognized opcode `csrw ustatus,t0', extension `zicsr' required
+.*Error: unrecognized opcode `csrw ustatus,0x0', extension `zicsr' required
+.*Error: unrecognized opcode `csrs ustatus,t0', extension `zicsr' required
+.*Error: unrecognized opcode `csrs ustatus,0x0', extension `zicsr' required
+.*Error: unrecognized opcode `csrc ustatus,t0', extension `zicsr' required
+.*Error: unrecognized opcode `csrc ustatus,0x0', extension `zicsr' required
+.*Error: unrecognized opcode `csrrwi t0,ustatus,0x0', extension `zicsr' required
+.*Error: unrecognized opcode `csrrsi t0,ustatus,0x0', extension `zicsr' required
+.*Error: unrecognized opcode `csrrci t0,ustatus,0x0', extension `zicsr' required
+.*Error: unrecognized opcode `csrrw t0,ustatus,t0', extension `zicsr' required
+.*Error: unrecognized opcode `csrrw t0,ustatus,0x0', extension `zicsr' required
+.*Error: unrecognized opcode `csrrs t0,ustatus,t0', extension `zicsr' required
+.*Error: unrecognized opcode `csrrs t0,ustatus,0x0', extension `zicsr' required
+.*Error: unrecognized opcode `csrrc t0,ustatus,t0', extension `zicsr' required
+.*Error: unrecognized opcode `csrrc t0,ustatus,0x0', extension `zicsr' required
+.*Error: unrecognized opcode `fence.i', extension `zifencei' required