This is the mail archive of the binutils@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]

Fix PR15227, plugin pr12942 testcase


I can reproduce pr15227 by simply building binutils without -g,
so modify the expected output to suit ld errors emitted for objects
compiled without debug info.

	PR ld/15227
	* ld-plugin/lto.exp (PR ld/12942 (3)): Remove file name and
	line number from regexp.
	(PR ld/15146 (2)): Similarly.
	* ld-plugin/pr12942a.cc (main): Use __builtin_abort.

Index: ld/testsuite/ld-plugin/lto.exp
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-plugin/lto.exp,v
retrieving revision 1.7
diff -u -p -r1.7 lto.exp
--- ld/testsuite/ld-plugin/lto.exp	30 Mar 2013 10:14:15 -0000	1.7
+++ ld/testsuite/ld-plugin/lto.exp	3 Apr 2013 09:01:30 -0000
@@ -295,7 +295,7 @@ if { [is_elf_format]
     run_cc_link_tests $lto_link_elf_tests
     set testname "PR ld/15146 (2)"
     set exec_output [run_host_cmd "$CC" "$gcc_gas_flag $gcc_ld_flag -O2 -flto -fuse-linker-plugin -Wl,-rpath-link,. -Wl,--no-copy-dt-needed-entries -Wl,--no-as-needed tmpdir/pr15146d.o tmpdir/pr15146c.so"]
-    if { [ regexp "ltrans.o: undefined reference to symbol 'xxx'" $exec_output ] } {
+    if { [ regexp "undefined reference to symbol 'xxx'" $exec_output ] } {
 	pass $testname
     } {
 	fail $testname
@@ -314,7 +314,7 @@ if {![string match "" $catch_output]} {
 # Check expected LTO linker errors.
 set testname "PR ld/12942 (3)"
 set exec_output [run_host_cmd "$CXX" "$gcc_gas_flag $gcc_ld_flag -O2 -flto -fuse-linker-plugin tmpdir/pr12942b.o tmpdir/pr12942a.o"]
-if { [ regexp "pr12942a.h:7: undefined reference to `link_error\\(\\)'" $exec_output ] } {
+if { [ regexp "undefined reference to `link_error\\(\\)'" $exec_output ] } {
     pass $testname
 } {
     fail $testname
Index: ld/testsuite/ld-plugin/pr12942a.cc
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-plugin/pr12942a.cc,v
retrieving revision 1.1
diff -u -p -r1.1 pr12942a.cc
--- ld/testsuite/ld-plugin/pr12942a.cc	7 Dec 2012 19:23:50 -0000	1.1
+++ ld/testsuite/ld-plugin/pr12942a.cc	3 Apr 2013 09:01:30 -0000
@@ -1,15 +1,13 @@
 #include <stdio.h>
 #include "pr12942a.h"
 
-extern "C" void abort ();
-
 test_t b(void);
 
 int
 main(void)
 {
   if (test != b ())
-    abort ();
+    __builtin_abort ();
 
   printf ("OK\n");
   return 0;

-- 
Alan Modra
Australia Development Lab, IBM


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