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

Message ID 20260824214138.3964162-2-vineet.gupta@linux.dev
State New
Headers
Series bpf: fix gotol with a signed offset, and run the spacing test |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_binutils_build--master-arm success Build passed
linaro-tcwg-bot/tcwg_binutils_build--master-aarch64 success Build passed
linaro-tcwg-bot/tcwg_binutils_check--master-arm success Test passed
linaro-tcwg-bot/tcwg_binutils_check--master-aarch64 success Test passed

Commit Message

Vineet Gupta Aug. 24, 2026, 9:41 p.m. UTC
  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(-)
  

Patch

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