From patchwork Wed Aug 18 08:25:26 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iain Sandoe X-Patchwork-Id: 62011 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 F1F82B70E1 for ; Wed, 18 Aug 2010 18:26:19 +1000 (EST) Received: (qmail 3835 invoked by alias); 18 Aug 2010 08:26:16 -0000 Received: (qmail 3795 invoked by uid 22791); 18 Aug 2010 08:26:14 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE, TW_FN, TW_GD X-Spam-Check-By: sourceware.org Received: from c2bthomr13.btconnect.com (HELO c2bthomr13.btconnect.com) (213.123.20.131) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 18 Aug 2010 08:26:09 +0000 Received: from thor.office (host81-138-1-83.in-addr.btopenworld.com [81.138.1.83]) by c2bthomr13.btconnect.com with ESMTP id FUI27940; Wed, 18 Aug 2010 09:25:27 +0100 (BST) X-Mirapoint-IP-Reputation: reputation=Fair-1, source=Queried, refid=0001.0A0B0302.4C6B98F7.0114, actions=tag Cc: Richard Henderson , Jack Howarth , gcc-patches@gcc.gnu.org, mikestump@comcast.net Message-Id: From: IainS To: Mark Mitchell In-Reply-To: <4C6AD01B.9030301@codesourcery.com> Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: [PATCH] PR debug/42487, xfail scan-assembler on DW_AT_ranges in gcc.dg/debug/dwarf2/aranges-fnsec-1.c for darwin Date: Wed, 18 Aug 2010 09:25:26 +0100 References: <20100816233214.GA16983@bromo.med.uc.edu> <4C69CB1B.2000903@redhat.com> <4C6AA5D5.3020101@codesourcery.com> <20100817151625.GB22189@bromo.med.uc.edu> <4C6AAA3F.7090602@redhat.com> <20100817154853.GA22485@bromo.med.uc.edu> <4C6AB18C.1010904@redhat.com> <4C6AD01B.9030301@codesourcery.com> 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 On 17 Aug 2010, at 19:08, Mark Mitchell wrote: > IainS wrote: > >>> Iain explained this one -- .subsections_via_symbols allows many >>> of the -function-sections type tests to succeed. So, I'm really >>> not sure how to proceed. Mark? > > Iain's version is fine by me. well I took three "fine by me"s to be approval, so ... (after checking that the test correctly unsupports on darwin and that it still runs OK on x86_64-unk-linux-gnu) I applied the following as r163326, cheers, Iain testsuite: PR debug/42487 * lib/target-supports.exp (check_effective_target_function_sections): New. * gcc.dg/debug/dwarf2/aranges-fnsec-1.c: Check that the target supports function sections before proceding. # code, 0 otherwise. Index: gcc/testsuite/gcc.dg/debug/dwarf2/aranges-fnsec-1.c =================================================================== --- gcc/testsuite/gcc.dg/debug/dwarf2/aranges-fnsec-1.c (revision 163325) +++ gcc/testsuite/gcc.dg/debug/dwarf2/aranges-fnsec-1.c (working copy) @@ -2,6 +2,7 @@ text section if nothing went in there. */ /* Origin: Joseph Myers */ /* { dg-do compile } */ +/* { dg-require-effective-target function_sections } */ /* { dg-options "-gdwarf-2 -ffunction-sections -w -dA" } */ /* { dg-final { scan-assembler-not "\\.Letext0-\\.Ltext0" } } */ /* { dg-final { scan-assembler-not "\\.Ltext0\[^\n\r\]*Offset 0x0" } } */ Index: gcc/testsuite/lib/target-supports.exp =================================================================== --- gcc/testsuite/lib/target-supports.exp (revision 163325) +++ gcc/testsuite/lib/target-supports.exp (working copy) @@ -623,6 +623,20 @@ proc check_effective_target_tls_runtime {} { }] } +# Return 1 if -ffunction-sections is supported, 0 otherwise. + +proc check_effective_target_function_sections {} { + # Darwin has its own scheme and silently accepts -ffunction- sections. + global target_triplet + if { [regexp ".*-.*-darwin.*" $target_triplet] } { + return 0 + } + + return [check_no_compiler_messages functionsections assembly { + void foo (void) { } + } "-ffunction-sections"] +} + # Return 1 if compilation with -fgraphite is error-free for trivial