From 741e01282880b5fd10c43ad74445bb5825e95197 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Fri, 7 Dec 2012 17:53:04 +0000 Subject: [PATCH] Properly check linker warnings * lib/ld-lib.exp (run_cc_link_tests): Properly check linker warnings. --- ld/testsuite/ChangeLog | 5 +++++ ld/testsuite/lib/ld-lib.exp | 17 +++++++++++------ 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog index c5126c01b31..15fb59535a0 100644 --- a/ld/testsuite/ChangeLog +++ b/ld/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2012-12-07 H.J. Lu + + * lib/ld-lib.exp (run_cc_link_tests): Properly check linker + warnings. + 2012-12-07 H.J. Lu * lib/ld-lib.exp (ar_simple_create): Pass -rc to ar. diff --git a/ld/testsuite/lib/ld-lib.exp b/ld/testsuite/lib/ld-lib.exp index 4ddb659bc1f..f08b9bf241c 100644 --- a/ld/testsuite/lib/ld-lib.exp +++ b/ld/testsuite/lib/ld-lib.exp @@ -1407,21 +1407,26 @@ proc run_cc_link_tests { ldtests } { } else { set failed 0 } - } elseif { ![ld_simple_link $cc_cmd $binfile "-L$srcdir/$subdir $ldflags $objfiles"] } { + } else { + if { ![ld_simple_link $cc_cmd $binfile "-L$srcdir/$subdir $ldflags $objfiles"] } { + set failed 1 + } else { + set failed 0 + } + # Check if exec_output is expected. if { $warnings != "" } then { verbose -log "returned with: <$exec_output>, expected: <$warnings>" if { [regexp $warnings $exec_output] } then { - set failed 0 + set failed 2 } else { set failed 1 } - } else { + } + + if { $failed == 1 } { fail $testname - set failed 1 } - } else { - set failed 0 } if { $failed == 0 } { -- 2.30.2