From patchwork Sat Nov 6 11:39:21 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iain Sandoe X-Patchwork-Id: 70326 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 D8068B70F4 for ; Sat, 6 Nov 2010 22:39:57 +1100 (EST) Received: (qmail 4063 invoked by alias); 6 Nov 2010 11:39:55 -0000 Received: (qmail 4055 invoked by uid 22791); 6 Nov 2010 11:39:54 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE X-Spam-Check-By: sourceware.org Received: from c2bthomr09.btconnect.com (HELO mail.btconnect.com) (213.123.20.127) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 06 Nov 2010 11:39:48 +0000 Received: from host81-138-1-83.in-addr.btopenworld.com (EHLO thor.office) ([81.138.1.83]) by c2bthomr09.btconnect.com with ESMTP id APJ88648; Sat, 06 Nov 2010 11:39:39 +0000 (GMT) Cc: "Joseph S. Myers" , GCC Patches Message-Id: <19648239-C129-4EAB-A749-840E6225351E@sandoe-acoustics.co.uk> From: IainS To: Mike Stump In-Reply-To: <1083DCF6-0D11-4B3B-B675-97961F69AA04@sandoe-acoustics.co.uk> Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: Remove WORD_SWITCH_TAKES_ARG (Darwin testers useful) Date: Sat, 6 Nov 2010 11:39:21 +0000 References: <20101105130501.GA23644@bromo.med.uc.edu> <7CA521D5-49DD-4197-ABA6-3FFEB419C3C2@sandoe-acoustics.co.uk> <1083DCF6-0D11-4B3B-B675-97961F69AA04@sandoe-acoustics.co.uk> X-Mirapoint-IP-Reputation: reputation=Fair-1, source=Queried, refid=tid=0001.0A0B0301.4CD53E6A.0101, actions=tag X-Junkmail-Signature-Raw: score=unknown, refid=str=0001.0A0B020A.4CD53E7C.0073, ss=1, fgs=0, ip=0.0.0.0, so=2010-07-22 22:03:31, dmn=2009-09-10 00:05:08, mode=single engine 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 5 Nov 2010, at 15:24, IainS wrote: > > On 5 Nov 2010, at 15:10, Mike Stump wrote: > >> On Nov 5, 2010, at 7:24 AM, IainS wrote: >>> Additionally, I made a trivial example using the "-sectcreate" >>> option - which produced the expected output. >> >> Using gcc -v -segaddr bla on the gcc line is the other test to >> try... If ld gets a -segaddr bla option, its fine. > > Yep, that one works too. > I guess we could construct some kind of darwin-specific test but it > would really require inspecting the output of otool - since we need > post-linker output to check. > (and there's no mechanism in the test-suite to do that AFAIK). The testsuite has a nop test already that checks the command line doesn't fail ---- But, it is possible to do at least a rudimentary functionality test for segaddr. (It would be possible to do something similar with sectcreate - however, dg-additional-files doesn't seem to work for the non-remote case.) Should we apply something like this as a backstop? Iain + return 0; +} Index: gcc/testsuite/gcc.dg/darwin-segaddr.c =================================================================== --- gcc/testsuite/gcc.dg/darwin-segaddr.c (revision 0) +++ gcc/testsuite/gcc.dg/darwin-segaddr.c (revision 0) @@ -0,0 +1,19 @@ +/* Check that -segaddr gets through and works. */ +/* { dg-do run { target *-*-darwin* } } */ +/* { dg-options "-O0 -segaddr __TEST 0x200000" { target { *-*-darwin* && { ! lp64 } } } } */ +/* { dg-options "-O0 -segaddr __TEST 0x110000000" { target { *-*- darwin* && lp64 } } } */ + +extern void abort (); + +int t __attribute__((section("__TEST,__test"))); + +int main (void) +{ +#ifdef __LP64__ + if ((unsigned long long) &t != 0x110000000ULL) +#else + if ((unsigned long) &t != 0x200000UL) +#endif + abort ();