[PATCH v2 1/2] gas: bpf: actually run the pseudo-C spacing test

Vineet Gupta vineet.gupta@linux.dev
Mon Aug 24 21:41:37 GMT 2026


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.
---
 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 f19322122527..74b0461f0bcb 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 16f5763aeb00..48ea4d9a1a92 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
-- 
2.53.0-Meta



More information about the bpf mailing list