From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) by sourceware.org (Postfix) with ESMTPS id 84E51385141D; Mon, 28 Dec 2020 18:39:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 84E51385141D Received: by mail-wm1-x331.google.com with SMTP id v14so203149wml.1; Mon, 28 Dec 2020 10:39:27 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=JpRauX987AbfiETIwuBtHxh3buncbYo3p38XwM7guCg=; b=Hb55ekb2le1m2LEzgth+E+VMi0ljyaH04pkQTmm5X5leYy5r7KZdxffgijqhbwqHIS 6clWdBhQG9qmEy2o7bXtcRTzL/1NlPsesr9ky3q1DJN0bHh3M7YrJ9ay6D2vpldC3zv4 OKiNTnGBU7p/0x4aeSH/bLv9y3B9aYdLUCaAgDrw2tp8JrhiSbyWlxLfCQIeBvCBTl4j zEG8ePAXcT0uFL0qburf18TuOI9HQgtR1dNmPI0cvtI1BexbTvdttWzg1g65tWKwfQ2n 6qJnT7Z4G7dEvKA/KH9u4QvAlJXgpHtwnHRJvErWvzygcXYjllDpEgn9NIG375OtW6DT Tr2A== X-Gm-Message-State: AOAM533RpHqmGzagc9N1nljO/6EgpGa1Bq5W6IbGNCPb8oOfmIu5Y+Yo RZK7xwHpfSeq9Q3ozQZeIr+qlKpXmK4= X-Google-Smtp-Source: ABdhPJxi3xMhxJCj3aSMoIEgt61/uDSjAO0E7JCYVM8tZ9JcswObOKzyfK59OnaDaLs6iq1oQcz3Xg== X-Received: by 2002:a7b:c770:: with SMTP id x16mr174415wmk.139.1609180766554; Mon, 28 Dec 2020 10:39:26 -0800 (PST) Received: from [10.21.4.25] ([109.190.253.11]) by smtp.googlemail.com with ESMTPSA id n9sm56847694wrq.41.2020.12.28.10.39.24 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 28 Dec 2020 10:39:25 -0800 (PST) Subject: Re: Split wchars tests from the normal variant To: Alexandre Oliva , libstdc++@gcc.gnu.org Cc: gcc-patches@gcc.gnu.org, Corentin Gay References: From: =?UTF-8?Q?Fran=c3=a7ois_Dumont?= Message-ID: <9f028d7d-05c9-ff15-1496-cc31ac67886a@gmail.com> Date: Mon, 28 Dec 2020 19:39:23 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: fr X-Spam-Status: No, score=-10.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, KAM_SHORT, NICE_REPLY_A, RCVD_IN_ABUSEAT, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libstdc++@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libstdc++ mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Dec 2020 18:39:29 -0000 On 22/12/20 10:27 pm, Alexandre Oliva wrote: > This change extracts apart the wchar specific parts of character > conversion tests to allow conditonalizating these parts on actual > wchar support while applying the rest more generally. > > This turned out useful during our work on the libstdc++ support > for VxWorks, to expose the problematic areas more precisely. > > Regstrapped on x86_64-linux-gnu, and tested with -x-arm-wrs-vxworks7r2. > Ok to install? (dg-requires-wchars is added by another patch by > Corentin, that I posted a few minutes ago) > > While updating Corentin's patch for mainline, I brought over to the > split-out test even the preprocessor conditional that is present in the > current version of the test, but required/implied by dg-requires-wchars. > Maybe that's excessive. Maybe the whole patch is excessive, given that > conditional, but I didn't want to just drop it without asking for > others' thoughts. > > > from Corentin Gay > for libstdc++-v3/ChangeLog > > * testsuite/20_util/from_chars/1_neg.cc: Split wchar specific > part into... > * testsuite/20_util/from_chars/1_neg_wchar.cc: ... new file. > --- > libstdc++-v3/testsuite/20_util/from_chars/1_neg.cc | 8 ----- > .../testsuite/20_util/from_chars/1_neg_wchar.cc | 35 ++++++++++++++++++++ > 2 files changed, 35 insertions(+), 8 deletions(-) > create mode 100644 libstdc++-v3/testsuite/20_util/from_chars/1_neg_wchar.cc > > diff --git a/libstdc++-v3/testsuite/20_util/from_chars/1_neg.cc b/libstdc++-v3/testsuite/20_util/from_chars/1_neg.cc > index 0d2fe2b3e6594..a84b0f5efb075 100644 > --- a/libstdc++-v3/testsuite/20_util/from_chars/1_neg.cc > +++ b/libstdc++-v3/testsuite/20_util/from_chars/1_neg.cc > @@ -23,14 +23,6 @@ > void > test01(const char* first, const char* last) > { > -#if _GLIBCXX_USE_WCHAR_T > - wchar_t wc; > -#else > - enum W { } wc; > -#endif > - std::from_chars(first, last, wc); // { dg-error "no matching" } > - std::from_chars(first, last, wc, 10); // { dg-error "no matching" } > - > char16_t c16; > std::from_chars(first, last, c16); // { dg-error "no matching" } > std::from_chars(first, last, c16, 10); // { dg-error "no matching" } > diff --git a/libstdc++-v3/testsuite/20_util/from_chars/1_neg_wchar.cc b/libstdc++-v3/testsuite/20_util/from_chars/1_neg_wchar.cc > new file mode 100644 > index 0000000000000..2d736a28a2da7 > --- /dev/null > +++ b/libstdc++-v3/testsuite/20_util/from_chars/1_neg_wchar.cc AFAIK _neg should be last. Using wchar_t_neg.cc should even make the dg-require-wchars useless here. > @@ -0,0 +1,35 @@ > +// Copyright (C) 2017-2018 Free Software Foundation, Inc. > +// > +// This file is part of the GNU ISO C++ Library. This library is free > +// software; you can redistribute it and/or modify it under the > +// terms of the GNU General Public License as published by the > +// Free Software Foundation; either version 3, or (at your option) > +// any later version. > + > +// This library is distributed in the hope that it will be useful, > +// but WITHOUT ANY WARRANTY; without even the implied warranty of > +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > +// GNU General Public License for more details. > + > +// You should have received a copy of the GNU General Public License along > +// with this library; see the file COPYING3. If not see > +// . > + > +// { dg-options "-std=gnu++17" } > +// { dg-do compile { target c++17 } } > +// { dg-require-wchars {} } > + > +#include > + > +void > +test01(const char* first, const char* last) > +{ > +#if _GLIBCXX_USE_WCHAR_T > + wchar_t wc; > +#else > + enum W { } wc; > +#endif Maybe you could simplify this as _GLIBCXX_USE_WCHAR_T is != 0. > + > + std::from_chars(first, last, wc); // { dg-error "no matching" } > + std::from_chars(first, last, wc, 10); // { dg-error "no matching" } > +} >