From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x434.google.com (mail-wr1-x434.google.com [IPv6:2a00:1450:4864:20::434]) by sourceware.org (Postfix) with ESMTPS id 10D9F3858C31 for ; Fri, 17 Feb 2023 13:17:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 10D9F3858C31 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=googlemail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=googlemail.com Received: by mail-wr1-x434.google.com with SMTP id a12so1073338wro.7 for ; Fri, 17 Feb 2023 05:17:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20210112; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=OSuxAP0kqErns72az/k3NkFJB3/EvjHuXWFYIrF4m6k=; b=a7FhiULxj/uBt9cty7TxAakhU8v6MCQ6fgq9KOUouvD8f0k6d3Bk9QsyQN7DQvrDLq bY+6D8TuytIShQJqNVOCdk2X7JggqzMdgvibZQNqFvixGf2Lo+6xSLThQHv698gNqt6G CY2/YBMFJ3LqbSEWQjcEcFYxoqIhVOBM0CdDy0HLec+vx/QE6ELCxPPstfqEtbsWgHi0 YDZTIi/Cuh7b7aiTyo858z/TGsKUJZDWZys0hg0UrDV5dBJwsJMfXiUFQnWekboTC0c0 O4aeCkxF/ZCJbBTQWT9Gc70Dxf9BKVyI/qCX11EpyO30dZ7M79GOgmk7R7Er8uuk3sTn EfxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=OSuxAP0kqErns72az/k3NkFJB3/EvjHuXWFYIrF4m6k=; b=4rLJvDi+E0qRdoDo0/f7j7zYUlCBoHytXrHFOZ0EmyJJgffy580GPBjZbFMDwk6nMu qrQZiJduuT8aXgdqUFgiK5gi/Zv8Saas53UcZSROmOx3QtvFjhxq/kKtDswYleFcJRO8 mEeRwKTKOJOdyiyhNKHkvcsVhm2X+u2BPBdvb+CKjTdaeViISS+Nxi/4eAfmu8Uj9iqI xjWhqa9iZPwoMZKKTPfSrx1wqwGQlybOvP//I16U3t8d5fpqL93M6boqTGlfyD/eRL4m reDRLrM2fAQ31jC05nNsK4YGZXEfb9tglOkRbHf+eru1nLAJxvB28HujCL7nK5c8eY4r N0qw== X-Gm-Message-State: AO0yUKWR+7jMJLJJvQ2kzO8nNvfiha/kcjJJYkyzV/gozc4EwHjN7AQ8 sy7MoUoCzDqt4YTdiQHjhz0= X-Google-Smtp-Source: AK7set951oA+jlxa7w92B1MDqUWu0semrklCkKqq5xVeb2IeVub7pDnvu6Z+qeF3pL9W2NaYqadqqw== X-Received: by 2002:adf:e983:0:b0:2c5:85ef:980f with SMTP id h3-20020adfe983000000b002c585ef980fmr4139304wrm.49.1676639854691; Fri, 17 Feb 2023 05:17:34 -0800 (PST) Received: from smtpclient.apple (host81-138-1-83.in-addr.btopenworld.com. [81.138.1.83]) by smtp.googlemail.com with ESMTPSA id s10-20020a5d6a8a000000b002c54c7153f0sm4248128wru.1.2023.02.17.05.17.33 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 17 Feb 2023 05:17:34 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.2\)) Subject: Re: [PR100127] Test for coroutine header in clang-compatible tests From: Iain Sandoe In-Reply-To: Date: Fri, 17 Feb 2023 13:17:33 +0000 Cc: GCC Patches , "ro@cebitec.uni-bielefeld.de" , Mike Stump , Jason Merrill , Nathan Sidwell Content-Transfer-Encoding: quoted-printable Message-Id: References: To: Alexandre Oliva X-Mailer: Apple Mail (2.3696.120.41.1.2) X-Spam-Status: No, score=-8.8 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Hi, > On 17 Feb 2023, at 06:42, Alexandre Oliva via Gcc-patches = wrote: >=20 >=20 > The test is compatible with clang as well as gcc, but ISTM that > testing for the __clang__ macro is just as potentially error-prone as > macros that used to be GCC-specific are now defined in compilers that > aim for GCC compatibility. It remains useful to be able to check tests on both compilers. As a matter of interest, do you know of any other compiler claiming = =E2=80=9C__clang__=E2=80=9D (I have treated that as safe so far). > Use a __has_include feature test instead. I think we need to do #if __has_include() =E2=80=A6 #elif __has_include() =E2=80=A6 because newer clang has the include in the standard place. Iain >=20 > Regstrapped on x86_64-linux-gnu. > Tested on arm-vxworks7 (gcc-12) and arm-eabi (trunk). Ok to install? >=20 > for gcc/testsuite/ChangeLog >=20 > PR c++/100127 > * g++.dg/coroutines/pr100127.C: Test for header rather than > compiler macro. > --- > gcc/testsuite/g++.dg/coroutines/pr100127.C | 2 +- > gcc/testsuite/g++.dg/coroutines/pr100772-a.C | 2 +- > gcc/testsuite/g++.dg/coroutines/pr100772-b.C | 2 +- > 3 files changed, 3 insertions(+), 3 deletions(-) >=20 > diff --git a/gcc/testsuite/g++.dg/coroutines/pr100127.C = b/gcc/testsuite/g++.dg/coroutines/pr100127.C > index 374cd710077af..1eaa72ff0acdd 100644 > --- a/gcc/testsuite/g++.dg/coroutines/pr100127.C > +++ b/gcc/testsuite/g++.dg/coroutines/pr100127.C > @@ -1,4 +1,4 @@ > -#ifdef __clang__ > +#if __has_include() // for __clang__ > #include > namespace std { > using namespace std::experimental; > diff --git a/gcc/testsuite/g++.dg/coroutines/pr100772-a.C = b/gcc/testsuite/g++.dg/coroutines/pr100772-a.C > index a325d384fc390..724c377c82e5b 100644 > --- a/gcc/testsuite/g++.dg/coroutines/pr100772-a.C > +++ b/gcc/testsuite/g++.dg/coroutines/pr100772-a.C > @@ -1,5 +1,5 @@ > // { dg-additional-options "-fsyntax-only " } > -#ifdef __clang__ > +#if __has_include() // for __clang__ > #include > namespace std { > using namespace std::experimental; > diff --git a/gcc/testsuite/g++.dg/coroutines/pr100772-b.C = b/gcc/testsuite/g++.dg/coroutines/pr100772-b.C > index 6cdf8d1e529e5..4cf31e5f9e0c2 100644 > --- a/gcc/testsuite/g++.dg/coroutines/pr100772-b.C > +++ b/gcc/testsuite/g++.dg/coroutines/pr100772-b.C > @@ -1,4 +1,4 @@ > -#ifdef __clang__ > +#if __has_include() // for __clang__ > #include > namespace std { > using namespace std::experimental; >=20 > --=20 > Alexandre Oliva, happy hacker = https://FSFLA.org/blogs/lxo/ > Free Software Activist GNU Toolchain Engineer > Disinformation flourishes because many people care deeply about = injustice > but very few check the facts. Ask me about =