From patchwork Sat Nov 13 12:58:17 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iain Sandoe X-Patchwork-Id: 71048 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 3C752B7119 for ; Sat, 13 Nov 2010 23:59:11 +1100 (EST) Received: (qmail 28902 invoked by alias); 13 Nov 2010 12:59:09 -0000 Received: (qmail 28891 invoked by uid 22791); 13 Nov 2010 12:59:08 -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 c2beaomr06.btconnect.com (HELO mail.btconnect.com) (213.123.26.184) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 13 Nov 2010 12:58:21 +0000 Received: from host81-138-1-83.in-addr.btopenworld.com (EHLO thor.office) ([81.138.1.83]) by c2beaomr06.btconnect.com with ESMTP id AXA58482; Sat, 13 Nov 2010 12:58:18 +0000 (GMT) Message-Id: <36F51F41-3149-45F7-AF3A-D4AFAB10FD2F@sandoe-acoustics.co.uk> From: IainS To: GCC Patches In-Reply-To: Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: Remove WORD_SWITCH_TAKES_ARG (Darwin testers useful) Date: Sat, 13 Nov 2010 12:58:17 +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> <19648239-C129-4EAB-A749-840E6225351E@sandoe-acoustics.co.uk> X-Mirapoint-IP-Reputation: reputation=Fair-1, source=Queried, refid=tid=0001.0A0B0301.4CDE8B69.01F1, actions=TAG X-Junkmail-Signature-Raw: score=unknown, refid=str=0001.0A0B0201.4CDE8B6A.0179, 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 8 Nov 2010, at 22:04, Mike Stump wrote: > On Nov 6, 2010, at 4:39 AM, IainS wrote: >> 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? > > Well, if you're going to write a testcase, it's hard to say no... added as r166705 cheers Iain Index: gcc/testsuite/ChangeLog =================================================================== --- gcc/testsuite/ChangeLog (revision 166703) +++ gcc/testsuite/ChangeLog (working copy) @@ -1,3 +1,7 @@ +2010-11-13 Iain Sandoe + + * gcc.dg/darwin-segaddr.c: New test for multiple argument c/l switch. + 2010-11-13 Tobias Burnus PR fortran/45742 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 (); + return 0; +}