From: Alan Modra Date: Thu, 29 Aug 2024 02:30:17 +0000 (+0930) Subject: ld testsuite output files X-Git-Tag: gdb-16-branchpoint~1040 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9459f695d3b79ac5509d8da8b1f4f7d68d91e840;p=thirdparty%2Fbinutils-gdb.git ld testsuite output files In many cases the output of one run_cc_link_tests test is used as input for another test. I hit a case where some system change caused errors when compiling object files, but the old .so output from a previous test run was still there, and then was used in following tests. * testsuite/lib/ld-lib.exp (run_ld_link_tests): Delete output file before building. (run_ld_link_exec_tests, run_cc_link_tests): Likewise. --- diff --git a/ld/testsuite/lib/ld-lib.exp b/ld/testsuite/lib/ld-lib.exp index 5d5905dc260..c540940670d 100644 --- a/ld/testsuite/lib/ld-lib.exp +++ b/ld/testsuite/lib/ld-lib.exp @@ -488,6 +488,11 @@ proc run_ld_link_tests { ldtests args } { set maybe_failed 0 set ld_output "" + # Don't leave previous output around + if { $binfile ne "tmpdir/" } { + remote_file host delete $binfile + } + # Add -fno-lto. LTO should be tested explicitly by $cflags. if {[check_lto_available]} { set cflags "-fno-lto $cflags" @@ -706,6 +711,11 @@ proc run_ld_link_exec_tests { ldtests args } { set objfiles {} set failed 0 + # Don't leave previous output around + if { $binfile ne "tmpdir/" } { + remote_file host delete $binfile + } + if { ![check_compiler_available] } { unsupported $testname continue @@ -875,6 +885,11 @@ proc run_cc_link_tests { ldtests } { set check_ld(terminal) 0 set check_ld(source) "" + # Don't leave previous output around + if { $binfile ne "tmpdir/" } { + remote_file host delete $binfile + } + if { ![check_compiler_available] } { unsupported $testname continue