Check ld_compile return status
authorAlan Modra <amodra@gmail.com>
Tue, 3 Jan 2017 12:30:30 +0000 (23:00 +1030)
committerAlan Modra <amodra@gmail.com>
Tue, 3 Jan 2017 12:34:48 +0000 (23:04 +1030)
* testsuite/lib/ld-lib.exp (run_ld_link_exec_tests): Do not
allow test to continue after compilation errors.
(run_cc_link_tests): Likewise.

ld/ChangeLog
ld/testsuite/lib/ld-lib.exp

index 1b0e4e0437ddf7f64c090fb078d313025e5432f5..b6a82847daa0ce0f2f469c08100922e5ab083987 100644 (file)
@@ -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.
index f8d5ec6a059bf76395a99c3290b8834133654f38..5ca700bf27a99fe6bc6a6d1f8353cc7dab8685f0 100644 (file)
@@ -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.