[2/4] x86-64: conditionalize tests using --32

Message ID da25f556-06a6-9b64-f333-04953812fcaa@suse.com
State Unresolved
Headers
Series x86: (mostly) testsuite adjustments |

Checks

Context Check Description
snail/binutils-gdb-check warning Git am fail log

Commit Message

Jan Beulich May 19, 2023, 1:51 p.m. UTC
  Using this option doesn't really work when no support for any 32-bit
target was configured in (as is the case for at least cloudabi and
rdos).
  

Patch

--- a/gas/testsuite/gas/i386/x86-64.exp
+++ b/gas/testsuite/gas/i386/x86-64.exp
@@ -33,6 +33,14 @@  if { ![gas_64_check] } then {
     return
 }
 
+proc gas_32_check { } {
+    global NM
+    global NMFLAGS
+
+    set status [gas_host_run "$NM $NMFLAGS --help" ""]
+    return [regexp "targets:.*i386" [lindex $status 1]];
+}
+
 global ASFLAGS
 set old_ASFLAGS "$ASFLAGS"
 set ASFLAGS "$ASFLAGS --64 --defsym x86_64=1 --strip-local-absolute"
@@ -579,8 +587,10 @@  if [is_elf_format] then {
     run_dump_test "mixed-mode-reloc64"
     run_dump_test "rela"
     run_dump_test "x86-64-ifunc"
-    run_dump_test "x86-64-opcode-inval"
-    run_dump_test "x86-64-opcode-inval-intel"
+    if { [gas_32_check] } then {
+	run_dump_test "x86-64-opcode-inval"
+	run_dump_test "x86-64-opcode-inval-intel"
+    }
     run_dump_test "intel-got64"
     run_dump_test "x86-64-localpic"
     run_dump_test "debug1"