[binutils-gdb] gas: bpf: actually run the pseudo-C spacing test

Vineet Gupta vineetg@sourceware.org
Thu Sep 10 03:52:16 GMT 2026


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

commit 279b824a7dfe0bc2d1a750d9437c67e85abbf969
Author: Vineet Gupta <vineet.gupta@linux.dev>
Date:   Thu Sep 10 09:14:22 2026 +0530

    gas: bpf: actually run the pseudo-C spacing test
    
    spacing-pseudoc.{s,d} has been present since the pseudo-C dialect tests
    were added, but bpf.exp never had a run_dump_test entry for it, so it has
    never been executed.
    
    Enabling it exposes a second problem: the .d declares -EB while its
    expected encodings are little endian, so the test fails on byte order
    alone.  Every other big endian BPF test carries a -be suffix in its name,
    and this file does not, so -EL is what was meant.
    
    With both fixed the test passes, and the flexible spacing it documents --
    goto+1, goto1 and the same forms inside a conditional jump -- is covered
    from now on.
    
    gas/
            * testsuite/gas/bpf/bpf.exp: Run spacing-pseudoc.
            * testsuite/gas/bpf/spacing-pseudoc.d: Assemble little endian, to
            match the expected encodings and the file name.
    
    Signed-off-by: Vineet Gupta <vineet.gupta@linux.dev>

Diff:
---
 gas/testsuite/gas/bpf/bpf.exp           | 2 ++
 gas/testsuite/gas/bpf/spacing-pseudoc.d | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/gas/testsuite/gas/bpf/bpf.exp b/gas/testsuite/gas/bpf/bpf.exp
index f1932212252..74b0461f0bc 100644
--- a/gas/testsuite/gas/bpf/bpf.exp
+++ b/gas/testsuite/gas/bpf/bpf.exp
@@ -76,6 +76,8 @@ if {[istarget bpf*-*-*]} {
     run_dump_test jcond-be
     run_dump_test jcond-be-pseudoc
 
+    run_dump_test spacing-pseudoc
+
     # Overflow tests
     run_dump_test offset16-overflow
     run_dump_test disp16-overflow
diff --git a/gas/testsuite/gas/bpf/spacing-pseudoc.d b/gas/testsuite/gas/bpf/spacing-pseudoc.d
index 16f5763aeb0..48ea4d9a1a9 100644
--- a/gas/testsuite/gas/bpf/spacing-pseudoc.d
+++ b/gas/testsuite/gas/bpf/spacing-pseudoc.d
@@ -1,4 +1,4 @@
-#as: -EB -mdialect=pseudoc
+#as: -EL -mdialect=pseudoc
 #source: spacing-pseudoc.s
 #objdump: -dr -M hex,pseudoc
 #name: spacing, pseudoc syntax


More information about the Binutils-cvs mailing list