[binutils-gdb] ld testsuite output files

Alan Modra amodra@sourceware.org
Thu Aug 29 11:45:55 GMT 2024


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=9459f695d3b79ac5509d8da8b1f4f7d68d91e840

commit 9459f695d3b79ac5509d8da8b1f4f7d68d91e840
Author: Alan Modra <amodra@gmail.com>
Date:   Thu Aug 29 12:00:17 2024 +0930

    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:
---
 ld/testsuite/lib/ld-lib.exp | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

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


More information about the Binutils-cvs mailing list