[1/2] RISC-V: test for expected / no unexpected symbols

Message ID 5003cbd5-448c-7f39-5219-ae3bfe50504f@suse.com
State Accepted
Headers
Series RISC-V/gas: re-work register named symbols avoidance logic |

Checks

Context Check Description
snail/binutils-gdb-check success Github commit url

Commit Message

Jan Beulich Feb. 13, 2023, 8:02 a.m. UTC
  Both the temporary workaround for PR/gas 29940 and the existing special
casing of GPRs in my_getSmallExpression() aren't really tested anywhere
(i.e. with the workarounds remove testing would still succeed). Nor is
there any test for uses of symbols with names matching GPRs, where such
is permitted. Before altering how this is to be dealt with, install two
testcases covering the expected behavior. (For now this includes only
known affected insns; re-ordering of entries in riscv_opcodes[] could,
however, yield more of them.)
  

Patch

--- /dev/null
+++ b/gas/testsuite/gas/riscv/reg-syms.d
@@ -0,0 +1,6 @@ 
+#as: -march=rv32i
+#nm: --
+
+0+ t start
+ +U x2
+ +U x4
--- /dev/null
+++ b/gas/testsuite/gas/riscv/reg-syms.s
@@ -0,0 +1,8 @@ 
+	.text
+start:
+	and	x8, x8, x1
+	j	x2
+	jal	x3, x4
+	sll	x1, x1, x5
+	sra	x8, x8, x6
+	srl	x8, x8, x7
--- /dev/null
+++ b/gas/testsuite/gas/riscv/reg-syms-C.d
@@ -0,0 +1,4 @@ 
+#as: -march=rv32ic
+#source: reg-syms.s
+#nm: --
+#dump: reg-syms.d