From patchwork Mon Feb 9 17:50:07 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wahab X-Patchwork-Id: 438017 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]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 87F2E14017E for ; Tue, 10 Feb 2015 04:52:28 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:cc:subject:references :in-reply-to:content-type; q=dns; s=default; b=xLv9eBf6JdMoFjR2X wcbIdDHL71fmgIywEl7OpcDsTUxz4pwaznEaWRh4K7IhoemCpYYoJY2HLthjFpyq LXBgS1xEe8ywm6+e3VVrtMe8uRZRBHAyqO8QtgRK4DM/HOjom6/2GfqtRoO3CTL5 aZRyynctjs4vNVM9i/3if+sdBw= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:cc:subject:references :in-reply-to:content-type; s=default; bh=PmwvxWgxH06qLC6TfL6MggE TSxI=; b=qx6yBsGcenj+iXaXCPDErtyvQGzICs5z/H5oVfpMdXLsegO/k/QF702 6PH0bD4pxi+qQI8IMJ2J51cNSocBFfZu6/x6kSr8qcA3pt3p1uMZLxe+r6bMGyeE xrPJ21ATrpGwtmkBOEuug7yPlPjze5NwNBowaMfHnGk36Lrrke3g= Received: (qmail 2878 invoked by alias); 9 Feb 2015 17:50:15 -0000 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 Received: (qmail 2790 invoked by uid 89); 9 Feb 2015 17:50:13 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL, BAYES_00, SPF_PASS autolearn=ham version=3.3.2 X-HELO: service87.mimecast.com Received: from service87.mimecast.com (HELO service87.mimecast.com) (91.220.42.44) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 09 Feb 2015 17:50:11 +0000 Received: from cam-owa2.Emea.Arm.com (fw-tnat.cambridge.arm.com [217.140.96.140]) by service87.mimecast.com; Mon, 09 Feb 2015 17:50:08 +0000 Received: from e106327-lin.cambridge.arm.com ([10.1.255.212]) by cam-owa2.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.3959); Mon, 9 Feb 2015 17:50:07 +0000 Message-ID: <54D8F34F.1070209@arm.com> Date: Mon, 09 Feb 2015 17:50:07 +0000 From: Matthew Wahab User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: gcc-patches CC: libstdc++ , Jonathan Wakely Subject: Re: [PATCH][libstdc++][Testsuite] isctype test fails for newlib. References: <54CF9C84.4020706@arm.com> <54CFA31F.9020601@oracle.com> <54D0A034.1040306@arm.com> <54D0A291.4010702@oracle.com> <54D0A5B1.2000806@arm.com> <54D8992B.6060707@arm.com> In-Reply-To: X-MC-Unique: 115020917500801501 X-IsSubscribed: yes On 09/02/15 13:18, Hans-Peter Nilsson wrote: > On Mon, 9 Feb 2015, Matthew Wahab wrote: >> On 07/02/15 00:11, Jonathan Wakely wrote: >>> Any idea why HP still sees the tests fail? See comment 8 at >>> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64467#c8 >> >> It looks like he's found the problem: that _NEWLIB_ is a recent addition that >> isn't in the version he's using. I'll try replacing _NEWLIB_ with >> _NEWLIB_VERSION_ as suggested. > > (Careful with that macro spelling, if nothing else.) > > Better to use existing mechanisms and stop playing with > target-related macros. Add this at the top (see other > placements of dg-options) and replace "#if defined (__NEWLIB__)" > with "#ifdef NEWLINE_IN_CLASS_BLANK": > > // { dg-options "-DNEWLINE_IN_CLASS_BLANK" { target newlib } } > Attached a patch to replace the test for macro __NEWLIB__ with a test for macro NEWLINE_IN_CLASS_BLANK, defined by { dg-additional-options "-DNEWLINE_IN_CLASS_BLANK" { target newlib } } Tested with check-target-libstdc++-v3, with the modified tests, for arm-none-eabi and aarch64-none-linux-gnu. Does this look ok to commit? Matthew libstdc++-v3/testsuite/ 2015-02-09 Matthew Wahab * 28_regex/traits/char/isctype.cc (test01): Replace test for __NEWLIB__ macro with a dejagnu set macro. * 28_regex/traits/wchar_t/isctype.cc (test01): Likewise. diff --git a/libstdc++-v3/testsuite/28_regex/traits/char/isctype.cc b/libstdc++-v3/testsuite/28_regex/traits/char/isctype.cc index 7c47045..b6fd6ff 100644 --- a/libstdc++-v3/testsuite/28_regex/traits/char/isctype.cc +++ b/libstdc++-v3/testsuite/28_regex/traits/char/isctype.cc @@ -1,5 +1,6 @@ // { dg-do run } // { dg-options "-std=gnu++11" } +// { dg-additional-options "-DNEWLINE_IN_CLASS_BLANK" { target newlib } } // // 2010-06-23 Stephen M. Webb @@ -53,8 +54,8 @@ test01() VERIFY(!t.isctype('_', t.lookup_classname(range(digit)))); VERIFY( t.isctype(' ', t.lookup_classname(range(blank)))); VERIFY( t.isctype('\t', t.lookup_classname(range(blank)))); -#if defined (__NEWLIB__) - /* newlib includes '\n' in class 'blank'. +#if defined (NEWLINE_IN_CLASS_BLANK) + /* On some targets, '\n' is in class 'blank'. See https://gcc.gnu.org/ml/gcc-patches/2015-02/msg00059.html. */ VERIFY( t.isctype('\n', t.lookup_classname(range(blank)))); #else diff --git a/libstdc++-v3/testsuite/28_regex/traits/wchar_t/isctype.cc b/libstdc++-v3/testsuite/28_regex/traits/wchar_t/isctype.cc index 1b3d69a..9ba609c 100644 --- a/libstdc++-v3/testsuite/28_regex/traits/wchar_t/isctype.cc +++ b/libstdc++-v3/testsuite/28_regex/traits/wchar_t/isctype.cc @@ -1,5 +1,6 @@ // { dg-do run } // { dg-options "-std=gnu++11" } +// { dg-additional-options "-DNEWLINE_IN_CLASS_BLANK" { target newlib } } // Copyright (C) 2010-2015 Free Software Foundation, Inc. // @@ -51,7 +52,7 @@ test01() VERIFY( t.isctype(L' ', t.lookup_classname(range(blank)))); VERIFY( t.isctype(L'\t', t.lookup_classname(range(blank)))); #if defined (__NEWLIB__) - /* newlib includes '\n' in class 'blank'. + /* On some targets, '\n' is in class 'blank'. See https://gcc.gnu.org/ml/gcc-patches/2015-02/msg00059.html. */ VERIFY( t.isctype(L'\n', t.lookup_classname(range(blank)))); #else