From patchwork Mon Nov 8 16:06:15 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rainer Orth X-Patchwork-Id: 70428 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 5BC0FB7107 for ; Tue, 9 Nov 2010 03:06:34 +1100 (EST) Received: (qmail 32480 invoked by alias); 8 Nov 2010 16:06:28 -0000 Received: (qmail 32459 invoked by uid 22791); 8 Nov 2010 16:06:25 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL, BAYES_00, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from snape.CeBiTec.Uni-Bielefeld.DE (HELO smtp-relay.CeBiTec.Uni-Bielefeld.DE) (129.70.160.84) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 08 Nov 2010 16:06:20 +0000 Received: from localhost (localhost.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) by smtp-relay.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTP id 2130A510; Mon, 8 Nov 2010 17:06:18 +0100 (CET) Received: from smtp-relay.CeBiTec.Uni-Bielefeld.DE ([127.0.0.1]) by localhost (malfoy.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) (amavisd-new, port 10024) with LMTP id p-krhVZ1QNgZ; Mon, 8 Nov 2010 17:06:15 +0100 (CET) Received: from manam.CeBiTec.Uni-Bielefeld.DE (manam.CeBiTec.Uni-Bielefeld.DE [129.70.161.120]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp-relay.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTPS id A96C350E; Mon, 8 Nov 2010 17:06:15 +0100 (CET) Received: (from ro@localhost) by manam.CeBiTec.Uni-Bielefeld.DE (8.14.4+Sun/8.14.4/Submit) id oA8G6FLT004281; Mon, 8 Nov 2010 17:06:15 +0100 (MET) From: Rainer Orth To: gcc-patches@gcc.gnu.org Cc: Richard Guenther Subject: [testsuite, lto] Allow target selector for dg-suppress-ld-options Date: Mon, 08 Nov 2010 17:06:15 +0100 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (usg-unix-v) MIME-Version: 1.0 X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org 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 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. 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"