From: Hans-Peter Nilsson Date: Tue, 20 Jan 2026 18:20:39 +0000 (+0100) Subject: testsuite: Fix issues with simulator testing in guality, simulate-thread tests X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=62c33661c076f739df3923c5a3ecf7d66d648591;p=thirdparty%2Fgcc.git testsuite: Fix issues with simulator testing in guality, simulate-thread tests The guality and simulate-thread tests expect a native gdb to run. That's native as in " gdb ", not as in " " (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) " gdb ", will for unknown reasons, hang each test-case until it times out, despite the simulator, as expected, immediately exiting with e.g. ': 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. --- diff --git a/gcc/testsuite/g++.dg/guality/guality.exp b/gcc/testsuite/g++.dg/guality/guality.exp index 695ed02b89b..a46f8465a33 100644 --- a/gcc/testsuite/g++.dg/guality/guality.exp +++ b/gcc/testsuite/g++.dg/guality/guality.exp @@ -8,6 +8,10 @@ if { [istarget *-*-darwin*] } { return } +if { [check_effective_target_simulator] } { + return +} + if { [istarget hppa*-*-hpux*] } { return } diff --git a/gcc/testsuite/g++.dg/simulate-thread/simulate-thread.exp b/gcc/testsuite/g++.dg/simulate-thread/simulate-thread.exp index 29d5bfc75d7..2dc5decd5ea 100644 --- a/gcc/testsuite/g++.dg/simulate-thread/simulate-thread.exp +++ b/gcc/testsuite/g++.dg/simulate-thread/simulate-thread.exp @@ -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 \ diff --git a/gcc/testsuite/gcc.dg/guality/guality.exp b/gcc/testsuite/gcc.dg/guality/guality.exp index 4d342aa5165..5c892c15479 100644 --- a/gcc/testsuite/gcc.dg/guality/guality.exp +++ b/gcc/testsuite/gcc.dg/guality/guality.exp @@ -8,6 +8,10 @@ if { [istarget *-*-darwin*] } { return } +if { [check_effective_target_simulator] } { + return +} + if { [istarget hppa*-*-hpux*] } { return } diff --git a/gcc/testsuite/gcc.dg/simulate-thread/simulate-thread.exp b/gcc/testsuite/gcc.dg/simulate-thread/simulate-thread.exp index 9090d5d3796..8664019d88a 100644 --- a/gcc/testsuite/gcc.dg/simulate-thread/simulate-thread.exp +++ b/gcc/testsuite/gcc.dg/simulate-thread/simulate-thread.exp @@ -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 diff --git a/gcc/testsuite/gfortran.dg/guality/guality.exp b/gcc/testsuite/gfortran.dg/guality/guality.exp index 3ee157abf7b..dddbe8b02f5 100644 --- a/gcc/testsuite/gfortran.dg/guality/guality.exp +++ b/gcc/testsuite/gfortran.dg/guality/guality.exp @@ -8,6 +8,10 @@ if { [istarget *-*-darwin*] } { return } +if { [check_effective_target_simulator] } { + return +} + if { [istarget hppa*-*-hpux*] } { return }