]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
ld testsuite output files
authorAlan Modra <amodra@gmail.com>
Thu, 29 Aug 2024 02:30:17 +0000 (12:00 +0930)
committerAlan Modra <amodra@gmail.com>
Thu, 29 Aug 2024 11:35:57 +0000 (21:05 +0930)
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.

ld/testsuite/lib/ld-lib.exp

index 5d5905dc260ee7616de81ed903c29be341f6c02d..c540940670d1549a70a5a019a125c0363b19c246 100644 (file)
@@ -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