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/binutils-2_26-branch] Update PR ld/12365 test for GCC 6


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

commit b468caefb6767850023aaa1ce90d1ee6ec9c8829
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Tue Mar 1 12:39:49 2016 -0800

    Update PR ld/12365 test for GCC 6
    
    PR ld/12365 test is to verify that linker catches the reference to
    undefined symbol error caused by a GCC bug.  Since the GCC bug has
    been fixed in GCC 6, update the test to verify that there is no
    reference to undefined symbol in executable
    
    Backport from master
    
    	* testsuite/ld-plugin/lto.exp: Update PR ld/12365 test for GCC 6.

Diff:
---
 ld/ChangeLog                   |  7 +++++++
 ld/testsuite/ld-plugin/lto.exp | 13 ++++++++++++-
 2 files changed, 19 insertions(+), 1 deletion(-)

diff --git a/ld/ChangeLog b/ld/ChangeLog
index 4f6abb9..887f435 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,10 @@
+2016-03-01  H.J. Lu  <hongjiu.lu@intel.com>
+
+	Backport from master
+	2016-03-01  H.J. Lu  <hongjiu.lu@intel.com>
+
+	* testsuite/ld-plugin/lto.exp: Update PR ld/12365 test for GCC 6.
+
 2016-02-26  H.J. Lu  <hongjiu.lu@intel.com>
 
 	Backport from master
diff --git a/ld/testsuite/ld-plugin/lto.exp b/ld/testsuite/ld-plugin/lto.exp
index 81e72b4..982ffee 100644
--- a/ld/testsuite/ld-plugin/lto.exp
+++ b/ld/testsuite/ld-plugin/lto.exp
@@ -400,9 +400,20 @@ if { [at_least_gcc_version 4 7] } {
 	   || [istarget "x86_64-*-linux*"]
 	   || [istarget "amd64-*-linux*"]) } {
 	set testname "PR ld/12365"
-	set exec_output [run_host_cmd "$CC" "-O2 -flto -flto-partition=none -fuse-linker-plugin tmpdir/pr12365a.o tmpdir/pr12365b.o tmpdir/pr12365c.o"]
+	set exec_output [run_host_cmd "$CC" "-O2 -flto -flto-partition=none -fuse-linker-plugin -o tmpdir/pr12365 tmpdir/pr12365a.o tmpdir/pr12365b.o tmpdir/pr12365c.o"]
 	if { [ regexp "undefined reference to `my_bcopy'" $exec_output ] } {
+	    # Linker should catch the reference to undefined `my_bcopy'
+	    # error caused by a GCC bug.
 	    pass $testname
+	} elseif { [ string match "" $exec_output ] } {
+	    global READELF
+	    set exec_output [run_host_cmd "$READELF" "-s -W tmpdir/pr12365"]
+	    if { [ regexp "my_bcopy" $exec_output ] } {
+		# Verify that there is no `my_bcopy' symbol in executable.
+		fail $testname
+	    } {
+		pass $testname
+	    }
 	} {
 	    fail $testname
 	}


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