This is the mail archive of the binutils-cvs@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] Check ld_compile return status


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

commit a44d0bd787e4fdf2424583508f407bafa139ed8a
Author: Alan Modra <amodra@gmail.com>
Date:   Tue Jan 3 23:00:30 2017 +1030

    Check ld_compile return status
    
    	* testsuite/lib/ld-lib.exp (run_ld_link_exec_tests): Do not
    	allow test to continue after compilation errors.
    	(run_cc_link_tests): Likewise.

Diff:
---
 ld/ChangeLog                |  6 ++++++
 ld/testsuite/lib/ld-lib.exp | 24 ++++++++++++++++++++----
 2 files changed, 26 insertions(+), 4 deletions(-)

diff --git a/ld/ChangeLog b/ld/ChangeLog
index 1b0e4e0..b6a8284 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,9 @@
+2017-01-03  Alan Modra  <amodra@gmail.com>
+
+	* testsuite/lib/ld-lib.exp (run_ld_link_exec_tests): Do not
+	allow test to continue after compilation errors.
+	(run_cc_link_tests): Likewise.
+
 2017-01-03  Dimitar Dimitrov  <dimitar@dinux.eu>
 
 	* Makefile.am (ALL_EMULATION_SOURCES): Add epruelf.c.
diff --git a/ld/testsuite/lib/ld-lib.exp b/ld/testsuite/lib/ld-lib.exp
index f8d5ec6..5ca700b 100644
--- a/ld/testsuite/lib/ld-lib.exp
+++ b/ld/testsuite/lib/ld-lib.exp
@@ -1414,10 +1414,18 @@ proc run_ld_link_exec_tests { ldtests args } {
 	    # incorrect section attributes and the assembler will warn
 	    # them.
 	    if { [ string match "c++" $lang ] } {
-		ld_compile "$CXX -c $CXXFLAGS $cflags" $srcdir/$subdir/$src_file $objfile
+		set cmd "$CXX -c $CXXFLAGS $cflags"
 	    } else {
-		ld_compile "$CC -c $CFLAGS $cflags" $srcdir/$subdir/$src_file $objfile
+		set cmd "$CC -c $CFLAGS $cflags"
 	    }
+	    if ![ld_compile $cmd $srcdir/$subdir/$src_file $objfile] {
+		set failed 1
+		break
+	    }
+	}
+	if { $failed != 0 } {
+	    unresolved $testname
+	    continue
 	}
 
 	if { [ string match "c++" $lang ] } {
@@ -1549,10 +1557,18 @@ proc run_cc_link_tests { ldtests } {
 	    # incorrect section attributes and the assembler will warn
 	    # them.
 	    if { [ string match "c++" $lang ] } {
-		ld_compile "$CXX -c $CXXFLAGS $cflags" $srcdir/$subdir/$src_file $objfile
+		set cmd "$CXX -c $CXXFLAGS $cflags"
 	    } else {
-		ld_compile "$CC -c $CFLAGS $cflags" $srcdir/$subdir/$src_file $objfile
+		set cmd "$CC -c $CFLAGS $cflags"
 	    }
+	    if ![ld_compile $cmd $srcdir/$subdir/$src_file $objfile] {
+		set failed 1
+		break
+	    }
+	}
+	if { $failed != 0 } {
+	    unresolved $testname
+	    continue
 	}
 
 	# Clear error and warning counts.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]