From patchwork Thu Jul 20 03:22:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Lewis Hyatt X-Patchwork-Id: 122960 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c923:0:b0:3e4:2afc:c1 with SMTP id j3csp2855899vqt; Wed, 19 Jul 2023 20:23:40 -0700 (PDT) X-Google-Smtp-Source: APBJJlH4TZb7U9XCuMujTRBqAqCTrRIHQHly9yJydXJyn3lDwRZ7qikjaX+94hOy4mUkOebMlArl X-Received: by 2002:a17:907:3f17:b0:975:63f4:46 with SMTP id hq23-20020a1709073f1700b0097563f40046mr1581745ejc.57.1689823420425; Wed, 19 Jul 2023 20:23:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689823420; cv=none; d=google.com; s=arc-20160816; b=qBc3cBzGbAb1LTjdyqdeEYPjCgdeYzY5PocUpFnph5M6am23wbbh/iy1WCm5fGNtZj H1tHjK+TtxGCqodIS+4kQKMpoHSVq652hnRuG48bolkBoEss9wT5gAlj0+SPSFMAVtU8 hjnKwL21BR9GXK7FHVZeHEYko9duZqCI5jb4+lFm3tNByy/VPw5qCgJo704LBz6499p7 dxjtZoVs7NpeolWFNOWTzZNB9VhteqpJ9rfmBCJPDquw30nL+EBiNRhlS3ELcg4xOr5S eJVDj5N+vhZ6MXvDNpPErRS8bdnRr2J1JOLhyqARndI9REW/YLl2CLHH8ZtWhfUNb+oC tSBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:message-id:date:subject:cc :to:dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=OwktZeQuEoCCedkhYXOS+gKdYdzUc6g5q2OVpx+hmAk=; fh=wlHZTSNW7/4EYN5u8pUcMCC4EnvpuC+CP8elcLyuXvM=; b=LdIIdeaTS2g5lapkdyT+4qpN3muhUxtYNj8HRB6RtHxGczEvlnZMAmnUQO2h+5hgVr QeTSEmYnGSEgJIAIEYgeWG66UzogVh7YianhD5180b9hHOyM7lOW7qvbRs3HCvs40P8n NXiLIVXvJ31BkaIbR8bVx8/bBg2Z9W5KaEiaOFcIRHJ0fqHN2jGEO4EkUjWI6lzhlgax Cci09l7suOwSJG0N0Rn9sNz+CBKddx4H1tptJx5zI2O5uzibOxGd51SCiiBlTSCO4Xcg rzwxiNPdSfyzWTydhCW3ZIWDseloxhPBIGxVosPi9nfWGjYyj7IRFHF3e5VfkerUgTh1 oKMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=mhSsb8nG; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id lz26-20020a170906fb1a00b0099364d9f0e5si22917ejb.485.2023.07.19.20.23.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Jul 2023 20:23:40 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=mhSsb8nG; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 36CCB385773F for ; Thu, 20 Jul 2023 03:23:39 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 36CCB385773F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1689823419; bh=OwktZeQuEoCCedkhYXOS+gKdYdzUc6g5q2OVpx+hmAk=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=mhSsb8nGK694ja842PTr5ZFZPNCWF2F9/EZlkWegj7zRG1cSONKliwIyfVEzE4Vyu c5wX7ReEia7XoMDkDeEx+m67r8hUje50RP4La5DeunuopMvYmsjPExKPHtNnDmSrwr /MV7gvujTiYgRuHZeeDwxKdcCHqyvZxwQLQyV+Ck= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-qv1-xf36.google.com (mail-qv1-xf36.google.com [IPv6:2607:f8b0:4864:20::f36]) by sourceware.org (Postfix) with ESMTPS id EF73D3856DC7 for ; Thu, 20 Jul 2023 03:22:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org EF73D3856DC7 Received: by mail-qv1-xf36.google.com with SMTP id 6a1803df08f44-635eedf073eso2715376d6.2 for ; Wed, 19 Jul 2023 20:22:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689823374; x=1690428174; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=OwktZeQuEoCCedkhYXOS+gKdYdzUc6g5q2OVpx+hmAk=; b=SzKLK4YlF2Hgi1vnDRr2t91U2WcQ0A0WtNpFpBb0yDD6C4nn5Bl2K3nW4Qb5umheoj ldw5QIWVW2mFPqo7w+nCFfo91nvB+Jr6HgxcDjLZBoKYIVcJsYRNaDDiUazyYfZscA1t jPUCnhFgLjngBcE6QiA2JKCozBls7GRwfe/LNjhz6M6mF7dLIJvaNewWYrb+Xu/vouj9 qyLY650PVYFpJzXOdL1BmYAljHf+i5mPFfgtNcsWlepqQD2P5M9tSuOqf0qqSb1MehN4 3ziYu4FqwXXoiFXhDKMH+dvYurldEn7LxG9W8hAqGYvkdM7o8z0QFkaERKKWFQbm3PCm /Gkg== X-Gm-Message-State: ABy/qLb38QsAtxfM5sE6wAcWYiLe3z/1uXB+j+OPoDapO7WWIOOV+t1f oLMUI5zIhf+VCQ2reHFIpVSFqT9+Me0= X-Received: by 2002:a05:6214:2af:b0:634:d868:f0d5 with SMTP id m15-20020a05621402af00b00634d868f0d5mr17733280qvv.9.1689823374030; Wed, 19 Jul 2023 20:22:54 -0700 (PDT) Received: from localhost.localdomain (96-67-140-173-static.hfc.comcastbusiness.net. [96.67.140.173]) by smtp.gmail.com with ESMTPSA id o11-20020a0cf4cb000000b00635fc10afd6sm29678qvm.70.2023.07.19.20.22.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Jul 2023 20:22:53 -0700 (PDT) To: gcc-patches@gcc.gnu.org Cc: Lewis Hyatt Subject: [committed] testsuite: Fix C++ UDL tests failing on 32-bit arch [PR103902] Date: Wed, 19 Jul 2023 23:22:43 -0400 Message-Id: <20230720032243.3643540-1-lhyatt@gmail.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Spam-Status: No, score=-3038.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, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Lewis Hyatt via Gcc-patches From: Lewis Hyatt Reply-To: Lewis Hyatt Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1771908282659073176 X-GMAIL-MSGID: 1771908282659073176 These tests need to use "size_t" rather than "unsigned long" for the user-defined literal function arguments. gcc/testsuite/ChangeLog: PR preprocessor/103902 * g++.dg/cpp0x/udlit-extended-id-1.C: Change "unsigned long" to "size_t" throughout. * g++.dg/cpp0x/udlit-extended-id-3.C: Likewise. --- Notes: Hello- As noted on the PR, these newly added tests fail on 32-bit architectures because they said "unsigned long" where they are supposed to say "size_t". Committed this fix as obvious. -Lewis gcc/testsuite/g++.dg/cpp0x/udlit-extended-id-1.C | 9 +++++---- gcc/testsuite/g++.dg/cpp0x/udlit-extended-id-3.C | 6 ++++-- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/gcc/testsuite/g++.dg/cpp0x/udlit-extended-id-1.C b/gcc/testsuite/g++.dg/cpp0x/udlit-extended-id-1.C index 5ea5ef09db6..c7091e9e8a2 100644 --- a/gcc/testsuite/g++.dg/cpp0x/udlit-extended-id-1.C +++ b/gcc/testsuite/g++.dg/cpp0x/udlit-extended-id-1.C @@ -1,6 +1,7 @@ // { dg-do run { target c++11 } } // { dg-additional-options "-Wno-error=normalized" } #include +#include using namespace std; constexpr unsigned long long operator "" _π (unsigned long long x) @@ -21,22 +22,22 @@ char x2[2_Π2]; static_assert (sizeof x1 == 3, "test1"); static_assert (sizeof x2 == 8, "test2"); -const char * operator "" _1σ (const char *s, unsigned long) +const char * operator "" _1σ (const char *s, size_t) { return s + 1; } -const char * operator ""_Σ2 (const char *s, unsigned long) +const char * operator ""_Σ2 (const char *s, size_t) { return s + 2; } -const char * operator "" _\U000000e61 (const char *s, unsigned long) +const char * operator "" _\U000000e61 (const char *s, size_t) { return "ae"; } -const char* operator ""_\u01532 (const char *s, unsigned long) +const char* operator ""_\u01532 (const char *s, size_t) { return "oe"; } diff --git a/gcc/testsuite/g++.dg/cpp0x/udlit-extended-id-3.C b/gcc/testsuite/g++.dg/cpp0x/udlit-extended-id-3.C index 11292e476e3..cb8a957947a 100644 --- a/gcc/testsuite/g++.dg/cpp0x/udlit-extended-id-3.C +++ b/gcc/testsuite/g++.dg/cpp0x/udlit-extended-id-3.C @@ -1,9 +1,11 @@ // { dg-do compile { target c++11 } } +#include +using namespace std; // Check that we do not look for poisoned identifier when it is a suffix. int _ħ; #pragma GCC poison _ħ -const char * operator ""_ħ (const char *, unsigned long); // { dg-bogus "poisoned" } +const char * operator ""_ħ (const char *, size_t); // { dg-bogus "poisoned" } bool operator ""_ħ (unsigned long long x); // { dg-bogus "poisoned" } bool b = 1_ħ; // { dg-bogus "poisoned" } const char *x = "hbar"_ħ; // { dg-bogus "poisoned" } @@ -11,5 +13,5 @@ const char *x = "hbar"_ħ; // { dg-bogus "poisoned" } /* Ideally, we should not warn here either, but this is not implemented yet. This syntax has been deprecated for C++23. */ #pragma GCC poison _ħ2 -const char * operator "" _ħ2 (const char *, unsigned long); // { dg-bogus "poisoned" "" { xfail *-*-*} } +const char * operator "" _ħ2 (const char *, size_t); // { dg-bogus "poisoned" "" { xfail *-*-*} } const char *x2 = "hbar2"_ħ2; // { dg-bogus "poisoned" }