From patchwork Fri Nov 5 12:09:15 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iain Sandoe X-Patchwork-Id: 70257 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 683B81007D1 for ; Fri, 5 Nov 2010 23:09:34 +1100 (EST) Received: (qmail 28213 invoked by alias); 5 Nov 2010 12:09:32 -0000 Received: (qmail 28190 invoked by uid 22791); 5 Nov 2010 12:09:30 -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 c2beaomr08.btconnect.com (HELO mail.btconnect.com) (213.123.26.186) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 05 Nov 2010 12:09:24 +0000 Received: from host81-138-1-83.in-addr.btopenworld.com (EHLO thor.office) ([81.138.1.83]) by c2beaomr08.btconnect.com with ESMTP id ANS48579; Fri, 05 Nov 2010 12:09:19 +0000 (GMT) Message-Id: <7AD7133C-A2FA-4AA9-A8D1-DF3B3ADF89D6@sandoe-acoustics.co.uk> From: IainS To: GCC Patches Mime-Version: 1.0 (Apple Message framework v936) Subject: [Patch, ObjC++, test-suite] Fix encode-3 FAIL on NeXT. Date: Fri, 5 Nov 2010 12:09:15 +0000 Cc: Mike Stump , Nicola Pero X-Mirapoint-IP-Reputation: reputation=Fair-1, source=Queried, refid=tid=0001.0A0B0301.4CD3F3EC.0129, actions=tag X-Junkmail-Signature-Raw: score=unknown, refid=str=0001.0A0B0207.4CD3F3F1.030E, 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 Hi, It seems that the current obj-c++.dg/encode-3.mm "fail" is intentional... ... that is, we intentionally omit the ReadOnly encoding on types when -fnext-runtime is active. This is compatible with the behavior of ObjC++ up to at least XCode 3.2.3/Darwin10. So, it seems that the 'fix' is for the test to check for different output for -fnext-runtime. Shall apply this - or any other thoughts? Iain const char *encode = @encode(long); @@ -44,7 +53,7 @@ int main(void) { if (strcmp (enc2, (const char *)"{Vec=dd" L "q}")) abort (); - if (strcmp (enc3, (const char *)"{?=f[10d]i" L "q{Vec=rcrc" L "q}}")) + if (strcmp (enc3, (const char *) E3)) abort (); return 0; Index: gcc/testsuite/obj-c++.dg/encode-3.mm =================================================================== --- gcc/testsuite/obj-c++.dg/encode-3.mm (revision 166352) +++ gcc/testsuite/obj-c++.dg/encode-3.mm (working copy) @@ -32,6 +32,15 @@ const char *enc3 = @encode(anonymous); #define L "l" #endif +/* Darwin (at least, as of XCode 3.2.3/Darwin10) does not encode the read-only attribute + on types. Arguably, this is a bug, but we are compatible with this when + -fnext-runtime is selected. */ +#ifdef __NEXT_RUNTIME__ +#define E3 "{?=f[10d]i" L "q{Vec=cc" L "q}}" +#else +#define E3 "{?=f[10d]i" L "q{Vec=rcrc" L "q}}" +#endif + int main(void) {