From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 82634 invoked by alias); 6 Mar 2017 14:17:52 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 82620 invoked by uid 89); 6 Mar 2017 14:17:52 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.9 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:2897, H*Ad:U*ro X-HELO: mailapp01.imgtec.com Received: from mailapp01.imgtec.com (HELO mailapp01.imgtec.com) (195.59.15.196) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 06 Mar 2017 14:17:50 +0000 Received: from hhmail02.hh.imgtec.org (unknown [10.100.10.20]) by Forcepoint Email with ESMTPS id 0665C51A860D5; Mon, 6 Mar 2017 14:17:45 +0000 (GMT) Received: from HHMAIL-X.hh.imgtec.org (10.100.10.113) by hhmail02.hh.imgtec.org (10.100.10.20) with Microsoft SMTP Server (TLS) id 14.3.294.0; Mon, 6 Mar 2017 14:17:48 +0000 Received: from hhmail02.hh.imgtec.org ([fe80::5400:d33e:81a4:f775]) by HHMAIL-X.hh.imgtec.org ([fe80::3509:b0ce:371:2b%18]) with mapi id 14.03.0294.000; Mon, 6 Mar 2017 14:17:48 +0000 From: Toma Tabacu To: "gcc-patches@gcc.gnu.org" CC: Matthew Fortune , "catherine_moore@mentor.com" , "Rainer Orth (ro@CeBiTec.Uni-Bielefeld.DE)" Subject: [PATCH,testsuite] Add check_effective_target_rdynamic and use it in g++.dg/lto/pr69589_0.C. Date: Mon, 06 Mar 2017 14:17:00 -0000 Message-ID: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-IsSubscribed: yes X-SW-Source: 2017-03/txt/msg00258.txt.bz2 Hi, g++.dg/lto/pr69589_0.C is currently failing for mips-mti-elf with the follo= wing error: xg++: error: unrecognized command line option '-rdynamic' However, it passes just fine for mips-mti-linux-gnu. I think that we should skip this test for mips-mti-elf. This patch achieves this by adding support for check_effective_target_rdyna= mic and then using it in g++.dg/lto/pr69589_0.C. This patch also removes the existing dg-skip-if, as it is made redundant by= the effective target check. The latter is also more convenient, as we won't hav= e to keep tweaking the dg-skip-if for failing targets anymore. This is similar to my recent check_effective_target_gettimeofday patch, which was greatly improved by Rainer Orth's review. Tested with mips-mti-elf and mips-mti-linux-gnu. Does this look good ? Regards, Toma gcc/ * doc/sourcebuild.texi (Effective-Target Keywords, Other attributes): Document rdynamic. gcc/testsuite/ * g++.dg/lto/pr69589_0.C: Add dg-require-effective-target for rdynamic. Remove dg-skip-if for targets which don't support -rdynamic. * lib/target-supports.exp (check_effective_target_rdynamic): New proc. diff --git a/gcc/doc/sourcebuild.texi b/gcc/doc/sourcebuild.texi index 0dc4348..d75e078 100644 --- a/gcc/doc/sourcebuild.texi +++ b/gcc/doc/sourcebuild.texi @@ -2065,6 +2065,9 @@ Target supports @option{-mpe-aligned-commons}. @item pie Target supports @option{-pie}, @option{-fpie} and @option{-fPIE}. =20 +@item rdynamic +Target supports @option{-rdynamic}. + @item section_anchors Target supports section anchors. =20 diff --git a/gcc/testsuite/g++.dg/lto/pr69589_0.C b/gcc/testsuite/g++.dg/lt= o/pr69589_0.C index 11766f1..599d5d4 100644 --- a/gcc/testsuite/g++.dg/lto/pr69589_0.C +++ b/gcc/testsuite/g++.dg/lto/pr69589_0.C @@ -1,7 +1,7 @@ // { dg-lto-do link } // { dg-lto-options "-O2 -rdynamic" } // { dg-extra-ld-options "-r -nostdlib" } -// { dg-skip-if "Skip targets without -rdynamic support" { arm*-none-eabi = aarch64*-*-elf nios2-*-elf } { "*" } { "" } } +// { dg-require-effective-target rdynamic } =20 #pragma GCC visibility push(hidden) struct A { int &operator[] (long); }; diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/targ= et-supports.exp index 2766af4..f46f0ba 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -1484,6 +1484,16 @@ proc check_effective_target_static_libgfortran { } { } "-static"] } =20 +# Return 1 if we can use the -rdynamic option, 0 otherwise. +# +# When the target name changes, replace the cached result. + +proc check_effective_target_rdynamic { } { + return [check_no_compiler_messages rdynamic executable { + int main() { return 0; } + } "-rdynamic"] +} + # Return 1 if cilk-plus is supported by the target, 0 otherwise. =20=20 proc check_effective_target_cilkplus { } {