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 c5126c01b31c818c489d985ed3318f8a4e910ba9..15fb59535a06e72fb9807fa7d4d494a189d30c9f 100644 (file)
@@ -1,3 +1,8 @@
+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.
index 4ddb659bc1fb04470cb68f9f11abb33b67e2168e..f08b9bf241ca706fe165e06545a271f2b6cd83a5 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 } {
This page took 0.025718 seconds and 4 git commands to generate.