diff mbox

[testsuite] Avoid -Wl,-M,<mapfile> in gcc.target/i386 test summary

Message ID yddwrov65q4.fsf@manam.CeBiTec.Uni-Bielefeld.DE
State New
Headers show

Commit Message

Rainer Orth Nov. 2, 2010, 4:38 p.m. UTC
When using Sun ld, the gcc.target/i386 part of the testsuite is run with
a linker map to remove the capability info emitted by Sun as.
Unfortunately, in the current implementation, the -Wl,-M,<mapfile>
option used is emitted to the gcc.sum (and thus mail-report.log) files,
making it difficult to compare testsuite runs from different trees (like
unmodified mainline and a local tree).

The following patch fixes this by passing the necessary -Wl,-M,<mapfile>
argument not via the flags argument to dg-runtest, but by adding
additional_flags=$clearcap_ldflags to the gcc_target_compile options
argument.  Since I've found no way to get this through the call chain
from dg-runtest -> dg-test -> gcc-dg-test -> gcc-dg-test-1 ->
gcc_target_compile, I've chosen to wrap gcc_target_compile by a function
that does so.

Bootstrapped without regressions on i386-pc-solaris2.11.  Since this
only affects Solaris, I'll commit in a day or two unless someone objects
or comes up with a better solution.

	Rainer


2010-10-30  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	* gcc.target/i386/i386.exp (FLAGS): Remove.
	Wrap gcc_target_compile with $clearcap_ldflags added to options.
diff mbox

Patch

diff -r 1da1ccf26cd6 gcc/testsuite/gcc.target/i386/i386.exp
--- a/gcc/testsuite/gcc.target/i386/i386.exp	Mon Nov 01 21:16:18 2010 +0100
+++ b/gcc/testsuite/gcc.target/i386/i386.exp	Mon Nov 01 21:19:15 2010 +0100
@@ -188,13 +188,24 @@ 
 
 # If the linker used understands -M <mapfile>, pass it to clear hardware
 # capabilities set by the Sun assembler.
-set FLAGS ""
 set clearcap_ldflags "-Wl,-M,$srcdir/$subdir/clearcap.map"
 
 if [check_no_compiler_messages mapfile executable {
 	int main (void) { return 0; }
   } $clearcap_ldflags ] {
-  set FLAGS $clearcap_ldflags
+
+  if { [info procs gcc_target_compile] != [list] \
+	&& [info procs saved_gcc_target_compile] == [list] } {
+    rename gcc_target_compile saved_gcc_target_compile
+
+    proc gcc_target_compile { source dest type options } {
+      global clearcap_ldflags
+      # Always pass -Wl,-M,<mapfile>, but don't let it show up in gcc.sum.
+      lappend options "additional_flags=$clearcap_ldflags"
+
+      return [saved_gcc_target_compile $source $dest $type $options]
+    }
+  }
 }
 
 # If a testcase doesn't have special options, use these.
@@ -221,7 +232,7 @@ 
 set tests [prune $tests $srcdir/$subdir/vect-args.c]
 
 # Main loop.
-dg-runtest $tests $FLAGS $DEFAULT_CFLAGS
+dg-runtest $tests "" $DEFAULT_CFLAGS
 
 # All done.
 dg-finish