Properly check linker warnings
authorH.J. Lu <hjl.tools@gmail.com>
Fri, 7 Dec 2012 17:53:04 +0000 (17:53 +0000)
committerH.J. Lu <hjl.tools@gmail.com>
Fri, 7 Dec 2012 17:53:04 +0000 (17:53 +0000)
* lib/ld-lib.exp (run_cc_link_tests): Properly check linker
warnings.

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

index c5126c0..15fb595 100644 (file)
@@ -1,5 +1,10 @@
 2012-12-07  H.J. Lu  <hongjiu.lu@intel.com>
 
+       * lib/ld-lib.exp (run_cc_link_tests): Properly check linker
+       warnings.
+
+2012-12-07  H.J. Lu  <hongjiu.lu@intel.com>
+
        * lib/ld-lib.exp (ar_simple_create): Pass -rc to ar.
 
 2012-12-07  H.J. Lu  <hongjiu.lu@intel.com>
index 4ddb659..f08b9bf 100644 (file)
@@ -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 } {