From patchwork Mon Oct 11 16:56:54 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rainer Orth X-Patchwork-Id: 67447 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 C6832B6EEE for ; Tue, 12 Oct 2010 03:57:12 +1100 (EST) Received: (qmail 7573 invoked by alias); 11 Oct 2010 16:57:08 -0000 Received: (qmail 7562 invoked by uid 22791); 11 Oct 2010 16:57:06 -0000 X-SWARE-Spam-Status: No, hits=-1.9 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, 11 Oct 2010 16:56:59 +0000 Received: from localhost (localhost.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) by smtp-relay.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTP id 7E081A1A; Mon, 11 Oct 2010 18:56:57 +0200 (CEST) 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 i8UQsdt2Rzs4; Mon, 11 Oct 2010 18:56:55 +0200 (CEST) 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 5A8F1A19; Mon, 11 Oct 2010 18:56:55 +0200 (CEST) Received: (from ro@localhost) by manam.CeBiTec.Uni-Bielefeld.DE (8.14.4+Sun/8.14.4/Submit) id o9BGusRV023256; Mon, 11 Oct 2010 18:56:54 +0200 (MEST) From: Rainer Orth To: gcc-patches@gcc.gnu.org Cc: Diego Novillo , Dave Korn Subject: [testsuite, lto] Allow target selector for dg-extra-ld-options (PR testsuite/45851) Date: Mon, 11 Oct 2010 18:56:54 +0200 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 Dave reported that my patch to add -pthread to gcc.dg/lto/20090210 broke the test on cygwin since dg-extra-ld-options doesn't take a target selector. Well, it does now: tested with runtest with and without --target i386-pc-solaris2.8 on i386-pc-solaris2.11 to make sure that -pthread is only added in the first case. One might consider adding it to dg-suppress-ld-options for reasons of symmetry, but unless it has real uses, this could be delayed just as well. Dave, could you please test this on cygwin to make sure it fixes the bug? Ok for mainline if that passes? Thanks. Rainer 2010-10-09 Rainer Orth gcc/testsuite: PR testsuite/45851 * lib/lto.exp (lto-get-options-main): Support optional target selector for dg-extra-ld-options. gcc: PR testsuite/45851 * doc/sourcebuild.texi (LTO Testing, dg-extra-ld-options): Document optional target selector. diff -r a2813a6bf404 gcc/doc/sourcebuild.texi --- a/gcc/doc/sourcebuild.texi Sat Oct 09 17:29:59 2010 +0200 +++ b/gcc/doc/sourcebuild.texi Sat Oct 09 19:02:44 2010 +0200 @@ -2300,7 +2300,7 @@ to override @var{LTO_OPTIONS}. Each test will be compiled and run with each of these sets of options. -@item @{ dg-extra-ld-options @var{options} @} +@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} @} diff -r a2813a6bf404 gcc/testsuite/lib/lto.exp --- a/gcc/testsuite/lib/lto.exp Sat Oct 09 17:29:59 2010 +0200 +++ b/gcc/testsuite/lib/lto.exp Sat Oct 09 19:02:44 2010 +0200 @@ -277,8 +277,17 @@ warning "lto.exp does not support dg-lto-do $dgdo" } } elseif { ![string compare "dg-extra-ld-options" $cmd] } { - set dg-extra-ld-options [lindex $op 2] - verbose "dg-extra-ld-options for main is ${dg-extra-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-extra-ld-options [lindex $op 2] + verbose \ + "dg-extra-ld-options for main is ${dg-extra-ld-options}" + } + } } elseif { ![string compare "dg-suppress-ld-options" $cmd] } { set dg-suppress-ld-options [lindex $op 2] verbose \