[binutils-gdb] Arm: correct macro use in gas testsuite

Jan Beulich jbeulich@sourceware.org
Fri Jul 19 09:57:18 GMT 2024


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=cfa18744d435b55bbbbc5ef1ae1df67e84aa1777

commit cfa18744d435b55bbbbc5ef1ae1df67e84aa1777
Author: Jan Beulich <jbeulich@suse.com>
Date:   Fri Jul 19 11:55:54 2024 +0200

    Arm: correct macro use in gas testsuite
    
    The way the inner macro invocations are written doesn't quite work as
    expected (and would actually break subsequently): Due to overly
    aggressive removal of whitespace by the scrubber, the incoming \sym and
    \offset arguments actually get concatenated; an empty 3rd argument is
    being passed to ldrtest2. That just so happened to work as intended; any
    use of \offset alone would have exposed the problem. Quote the 3rd
    argument, thus retaining enough whitespace to be independent of scrubber
    internals.

Diff:
---
 gas/testsuite/gas/arm/group-reloc-ldrs-encoding-bad.s | 2 +-
 gas/testsuite/gas/arm/group-reloc-ldrs.s              | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/gas/testsuite/gas/arm/group-reloc-ldrs-encoding-bad.s b/gas/testsuite/gas/arm/group-reloc-ldrs-encoding-bad.s
index ac7a90f0e9e..7799bf114bd 100644
--- a/gas/testsuite/gas/arm/group-reloc-ldrs-encoding-bad.s
+++ b/gas/testsuite/gas/arm/group-reloc-ldrs-encoding-bad.s
@@ -14,7 +14,7 @@
 
 	.macro ldrtest load store sym offset
 
-	ldrtest2 \load \sym \offset
+	ldrtest2 \load \sym "\offset"
 
 	\store	r0, [r0, #:pc_g1:(\sym \offset)]
 	\store	r0, [r0, #:pc_g2:(\sym \offset)]
diff --git a/gas/testsuite/gas/arm/group-reloc-ldrs.s b/gas/testsuite/gas/arm/group-reloc-ldrs.s
index fa74e7eabe0..96655e14d98 100644
--- a/gas/testsuite/gas/arm/group-reloc-ldrs.s
+++ b/gas/testsuite/gas/arm/group-reloc-ldrs.s
@@ -14,7 +14,7 @@
 
 	.macro ldrtest load store sym offset
 
-	ldrtest2 \load \sym \offset
+	ldrtest2 \load \sym "\offset"
 
 	\store	r0, [r0, #:pc_g1:(\sym \offset)]
 	\store	r0, [r0, #:pc_g2:(\sym \offset)]


More information about the Binutils-cvs mailing list