diff mbox

[testsuite,lto] Allow target selector for dg-suppress-ld-options

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

Commit Message

Rainer Orth Nov. 8, 2010, 4:06 p.m. UTC
As promised in this thread

	[testsuite, lto] Allow target selector for dg-extra-ld-options (PR testsuite/45851)
        http://gcc.gnu.org/ml/gcc-patches/2010-10/msg00943.html

here's the corresponding patch to support a target selector for
dg-suppress-ld-options, too.

Bootstrapped without regressions on i386-pc-solaris2.11.  Since the
target selector is currently unused, I've modified
gfortran.dg/lto/20100110-1_0.f90 to read

! { dg-suppress-ld-options "-O1" { target i?86-*-solaris2.11 } }

and invoked runtest like this:

$ runtest --tool gfortran lto.exp=20100110-1_0.f90
$ runtest --tool gfortran --target i386-pc-solaris2.10 lto.exp=20100110-1_0.f90      

In the first case, -O1 was omitted as expected, in the second, it was
not.

Ok for mainline?

	Rainer


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

	gcc/testsuite:
	* lib/lto.exp (lto-get-options-main): Support optional target
	selector for dg-suppress-ld-options.

	gcc:
	* doc/sourcebuild.texi (LTO Testing, dg-suppress-ld-options):
	Document optional target selector.

Comments

Diego Novillo Nov. 11, 2010, 1:18 p.m. UTC | #1
On 10-11-08 11:06 , Rainer Orth wrote:

> 2010-10-30  Rainer Orth<ro@CeBiTec.Uni-Bielefeld.DE>
>
> 	gcc/testsuite:
> 	* lib/lto.exp (lto-get-options-main): Support optional target
> 	selector for dg-suppress-ld-options.
>
> 	gcc:
> 	* doc/sourcebuild.texi (LTO Testing, dg-suppress-ld-options):
> 	Document optional target selector.

OK.


Diego.
diff mbox

Patch

diff -r 3048db040dd6 gcc/doc/sourcebuild.texi
--- a/gcc/doc/sourcebuild.texi	Fri Oct 29 17:12:46 2010 +0000
+++ b/gcc/doc/sourcebuild.texi	Sat Oct 30 11:52:58 2010 +0200
@@ -2302,7 +2302,7 @@ 
 @item @{ dg-extra-ld-options @var{options} [@{ target @var{selector} @}]@}
 This directive adds @var{options} to the linker options used.
 
-@item @{ dg-suppress-ld-options @var{options} @}
+@item @{ dg-suppress-ld-options @var{options} [@{ target @var{selector} @}]@}
 This directive removes @var{options} from the set of linker options used.
 @end table
 
diff -r 3048db040dd6 gcc/testsuite/lib/lto.exp
--- a/gcc/testsuite/lib/lto.exp	Fri Oct 29 17:12:46 2010 +0000
+++ b/gcc/testsuite/lib/lto.exp	Sat Oct 30 11:52:58 2010 +0200
@@ -309,9 +309,17 @@ 
 		}
 	    }
 	} elseif { ![string compare "dg-suppress-ld-options" $cmd] } {
-	    set dg-suppress-ld-options [lindex $op 2]
-	    verbose \
-	      "dg-suppress-ld-options for main is ${dg-suppress-ld-options}"
+	    if { [llength $op] > 4 } {
+		error "[lindex $op 0]: too many arguments"
+	    } else {
+		if { [llength $op] == 3
+		     || ([llength $op] > 3
+			 && [dg-process-target [lindex $op 3]] == "S") } {
+		    set dg-suppress-ld-options [lindex $op 2]
+		    verbose \
+			"dg-suppress-ld-options for main is ${dg-suppress-ld-options}"
+		}
+	    }
 	} elseif { ![string compare "dg-final" $cmd] } {
 	    if { [llength $op] > 3 } {
 		error "[lindex $op 0]: too many arguments"