]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
testsuite: Fix issues with simulator testing in guality, simulate-thread tests
authorHans-Peter Nilsson <hp@axis.com>
Tue, 20 Jan 2026 18:20:39 +0000 (19:20 +0100)
committerHans-Peter Nilsson <hp@gcc.gnu.org>
Thu, 22 Jan 2026 22:38:49 +0000 (23:38 +0100)
The guality and simulate-thread tests expect a native gdb to
run.  That's native as in "<simulator-command-name> gdb
<prog-to-test>", not as in "<cross-name-gdb> <prog-to-test>"
(or even a cross gdb connecting to a native gdb-stub).  Such
a beast does not currently exist.

Before r16-6780-g620c85fb709d27, there was an early exit for
"remote targets" such as simulator targets in gdb-test.  No
test attempting to run a "native" gdb was applied to a
simulator target.

There's a wart in dejagnu sim_exec (up to and including
1.6.3 and unreleased sources as of 2026-01-20) that, instead
of returning [list -1 "error message"], it (also) calls
perror and thus a log for a test-run gets spurious lines
saying "ERROR: Remote execution for simulators not
implemented." That effectively breaks the useful quality for
such logs, that lines matching "^ERROR:" are only caused by
testsuite framework errors, like syntax errors in dg-clauses
in the test-cases.

Further, trying like gdb-test does, to execute remote_expect
for a remote_spawn:ed (sim_spawn:ed) "<simulator-command>
gdb <prog-to-test>", will for unknown reasons, hang each
test-case until it times out, despite the simulator, as
expected, immediately exiting with
e.g. '<simulator-command-name>: can't open "gdb": No such
file or directory'.

Better exit early for simulators for these parts of the
testsuite, like before r16-6780-g620c85fb709d27, but with
the early exit moved nearby those for other early exits for
specific targets, instead of e.g. inside gdb-test.

* g++.dg/guality/guality.exp, gcc.dg/guality/guality.exp,
gcc.dg/simulate-thread/simulate-thread.exp,
g++.dg/simulate-thread/simulate-thread.exp,
gfortran.dg/guality/guality.exp: Exit early for simulators.

gcc/testsuite/g++.dg/guality/guality.exp
gcc/testsuite/g++.dg/simulate-thread/simulate-thread.exp
gcc/testsuite/gcc.dg/guality/guality.exp
gcc/testsuite/gcc.dg/simulate-thread/simulate-thread.exp
gcc/testsuite/gfortran.dg/guality/guality.exp

index 695ed02b89bb732c3c27e877754de5a6daa6bb5e..a46f8465a33c5ea7c391c813df6d62e14f0609f7 100644 (file)
@@ -8,6 +8,10 @@ if { [istarget *-*-darwin*] } {
     return
 }
 
+if { [check_effective_target_simulator] } {
+    return
+}
+
 if { [istarget hppa*-*-hpux*] } {
     return
 }
index 29d5bfc75d704dac02e17edc45d147695ed58652..2dc5decd5eacd95d90bf3add68c35db5102b5af0 100644 (file)
@@ -21,6 +21,10 @@ load_lib g++-dg.exp
 load_lib gcc-simulate-thread.exp
 load_lib torture-options.exp
 
+if { [check_effective_target_simulator] } {
+    return
+}
+
 dg-init
 torture-init
 set-torture-options [list \
index 4d342aa51658edf616359cf530956062dace2cec..5c892c15479f941b84e28aaa53f5055b1fa606ee 100644 (file)
@@ -8,6 +8,10 @@ if { [istarget *-*-darwin*] } {
     return
 }
 
+if { [check_effective_target_simulator] } {
+    return
+}
+
 if { [istarget hppa*-*-hpux*] } {
     return
 }
index 9090d5d3796a86c07d150e2cd8f1979ce0978309..8664019d88a46e793672c71f1a380105c3704333 100644 (file)
@@ -20,6 +20,10 @@ load_lib gcc-dg.exp
 load_lib gcc-simulate-thread.exp
 load_lib torture-options.exp
 
+if { [check_effective_target_simulator] } {
+    return
+}
+
 if { [istarget "powerpc-ibm-aix*"] } {
     set torture_execute_xfail "powerpc-ibm-aix*"
     return
index 3ee157abf7b37e1945b170a937379d6e80cfdd37..dddbe8b02f5642f4d7a13d4c29e8a0d6e2981b9e 100644 (file)
@@ -8,6 +8,10 @@ if { [istarget *-*-darwin*] } {
   return
 }
 
+if { [check_effective_target_simulator] } {
+    return
+}
+
 if { [istarget hppa*-*-hpux*] } {
     return
 }