Bug 12572

Summary: FAIL: debug_msg.sh
Product: binutils Reporter: H.J. Lu <hjl.tools>
Component: goldAssignee: Ian Lance Taylor <ian>
Status: RESOLVED FIXED    
Severity: normal CC: jyasskin
Priority: P2    
Version: 2.22   
Target Milestone: ---   
Host: Target:
Build: Last reconfirmed:
Attachments: Fix the debug_msg.sh test.

Description H.J. Lu 2011-03-11 18:42:32 UTC
On Fedora 14/x86-64, I got

FAIL: debug_msg.sh (exit: 1)
============================

Did not find expected error in debug_msg.err:
   odr_violation2.cc:9
Comment 1 Jeffrey Yasskin 2011-03-11 19:18:55 UTC
Created attachment 5296 [details]
Fix the debug_msg.sh test.

I can reproduce this by switching from Ubuntu Lucid's native gcc-4.4.3 to gcc-4.6-svn, probably because they optimize different instructions into the front of Ordering::operator(). One fix is to add a comment just before that function, so that all its line numbers are two digits, which will cause detect_odr_violations() to sort a consistent line into the first place, regardless of gcc optimizes it.

Here's a patch that passes with both gcc-4.4.3 and gcc-4.6-svn.
Comment 2 Sourceware Commits 2011-03-11 21:42:15 UTC
CVSROOT:	/cvs/src
Module name:	src
Changes by:	ian@sourceware.org	2011-03-11 21:42:12

Modified files:
	gold           : ChangeLog 
	gold/testsuite : debug_msg.sh odr_violation2.cc 

Log message:
	PR gold/12572
	* testsuite/odr_violation2.cc: Add comment to make all error line
	numbers double digits.
	* testsuite/debug_msg.sh: Adjust expected errors.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gold/ChangeLog.diff?cvsroot=src&r1=1.704&r2=1.705
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gold/testsuite/debug_msg.sh.diff?cvsroot=src&r1=1.11&r2=1.12
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gold/testsuite/odr_violation2.cc.diff?cvsroot=src&r1=1.3&r2=1.4
Comment 3 Ian Lance Taylor 2011-03-11 21:42:53 UTC
Should be fixed now.