From patchwork Wed May 1 10:01:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathaniel Shead X-Patchwork-Id: 89229 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D63EF385ED7A for ; Wed, 1 May 2024 10:02:21 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-pf1-x42a.google.com (mail-pf1-x42a.google.com [IPv6:2607:f8b0:4864:20::42a]) by sourceware.org (Postfix) with ESMTPS id EF963384AB4E for ; Wed, 1 May 2024 10:01:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org EF963384AB4E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org EF963384AB4E Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::42a ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1714557697; cv=none; b=RCeaKNjvTctU+Jm7ev9913VxQhS/sqYmQURl8aZa5aqP9yKHWfSeqzHB5OA9xYfKuePVKI93y4PQ/KPBQ8VSQrFKd+LkNvpnYNUG8XmfMtXlqcV1sil6N4V5+Si7xuMBRNUg6F96rFPAsYvQhQYvVPGM9EIDsYslX68wZRQAf54= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1714557697; c=relaxed/simple; bh=+147HyMVZioO99NDgu86wR/d0yhTiKbDyUtuyAXfLW0=; h=DKIM-Signature:Message-ID:Date:From:To:Subject:MIME-Version; b=xf3vGnhNeJk7tNMVJwinZBmrx6oiMy0v7dAus0T9Y9FPWvxEZ0/SpK58EF5ofAL+CpmnpxUo1MDaDbY7NKg7QNwq6Jju4BcAgSz8Z+nFTggd0lo9iNxI5NHV3+faOzb4Jo+8H4YjJTqvME5XNEhye1ZJTre7kriUwCG0295FlSg= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pf1-x42a.google.com with SMTP id d2e1a72fcca58-6ecff9df447so6399241b3a.1 for ; Wed, 01 May 2024 03:01:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714557695; x=1715162495; darn=gcc.gnu.org; h=in-reply-to:content-disposition:mime-version:references:subject:cc :to:from:date:message-id:from:to:cc:subject:date:message-id:reply-to; bh=d2AycY8Yl6THFUfRa4smnXUAtFBkc6BF0vNfeyj119w=; b=lrx7T8J4b92kaN2hCwmVPrg7N3Jt8gnNyy+jbT+XKOAMjCFn16b9RoQrTQVOOz/JDZ d8MKbfxq+9sASTIDmEHvNOzaTkE+YOOe352sc86MzwqRJ2IROiocoQRQR/zfUpYxWdl8 Gr/jpdX+uZbUkchwzGWP0jqA8xlyBgJw0BF75zXnHX1G+jqiwDlEw08+Ft6MT5PZevcp nXf8nI/rvqRGlQ6r9XoRwAVjMrccSwdf0AKxhGjUIvneuaW6mU6VZtvBXJYp40xi0USw AHgoC2neNFXk/QcGaKPyXNAXxqwz/imSbeid/8efFDIhFIUizMv9cpzVqqY2kOmrKCOg MZPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714557695; x=1715162495; h=in-reply-to:content-disposition:mime-version:references:subject:cc :to:from:date:message-id:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=d2AycY8Yl6THFUfRa4smnXUAtFBkc6BF0vNfeyj119w=; b=VYTTm8s1yVE3/FHvVH8e/qo4jwixdVD+S9VRlpnk67Xx5vgbds+8dd8jywpeVAf5z6 n0gjNJckLneNoGJvbcep2iYe+vJG3tnwUu/EqX5THZ9zoc9rJ7IrMh8nerOxcoa6VuiA /NMNxyuGjY8ryecMRrLXWRvGUCDVoZgzz3wO3LYQXgJUH3tlGwUy2ZI45miJTq48cIBc X5dIxJozVQdSFFF/9Mw8imTh9g8yJbuwDEZDn3GW0pDDG9n4neZNEaSpl4sOqpsiFl4F m04KqejxNvkzpI6Y3nS4615sJAbkuHttZkACEH1h8CCw2nMRr264Cy5qj+N5XWUqn37t O6Pg== X-Gm-Message-State: AOJu0YxwoMytZfjXMCNbu7qJND2uvM0bjy4KXU9Xa+xvdrxXNAKW4qJz nFcaDoxMx392f1pTYVvmMKxAsfAD2DZQiWvrclpCh9tfM471cIcGrGeVXA== X-Google-Smtp-Source: AGHT+IEjlzT/TMJLUAnYK32PQ+LO0Xkjru7ldpg+v5YjKKwgMga+wv0WKmG/9UZsxvkvnu6EjuD02g== X-Received: by 2002:a05:6a00:3923:b0:6ed:21bc:ed8c with SMTP id fh35-20020a056a00392300b006ed21bced8cmr2144268pfb.18.1714557694863; Wed, 01 May 2024 03:01:34 -0700 (PDT) Received: from Thaum. (121-44-11-123.tpgi.com.au. [121.44.11.123]) by smtp.gmail.com with ESMTPSA id gm15-20020a056a00640f00b006f416953eeesm2425502pfb.101.2024.05.01.03.01.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 May 2024 03:01:34 -0700 (PDT) Message-ID: <663212fe.050a0220.da6fc.9353@mx.google.com> X-Google-Original-Message-ID: Date: Wed, 1 May 2024 20:01:29 +1000 From: Nathaniel Shead To: gcc-patches@gcc.gnu.org Cc: Jason Merrill , Nathan Sidwell , Patrick Palka Subject: [PATCH 4/4] c++: Add new xtreme-header testcase for GMF discarding References: <66321257.170a0220.326c5.1f68@mx.google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <66321257.170a0220.326c5.1f68@mx.google.com> X-Spam-Status: No, score=-11.9 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 X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk? Another thought would be to replace xtreme-header.h with so that we don't need to keep it up-to-date in the future. But this patch just does the obviously correct thing. -- >8 -- This new testcase helps verify that the issues discovered in PR114630 with GMF entries being inappropriately emitted into the module CMI don't regress, at least for the kinds of code used in the standard library headers. This also updates the base xtreme-header.h file to include new header files that are now available. gcc/testsuite/ChangeLog: * g++.dg/modules/xtreme-header.h: Update. * g++.dg/modules/xtreme-header-8.C: New test. Signed-off-by: Nathaniel Shead --- .../g++.dg/modules/xtreme-header-8.C | 9 +++++++ gcc/testsuite/g++.dg/modules/xtreme-header.h | 24 ++++++++++++------- 2 files changed, 25 insertions(+), 8 deletions(-) create mode 100644 gcc/testsuite/g++.dg/modules/xtreme-header-8.C diff --git a/gcc/testsuite/g++.dg/modules/xtreme-header-8.C b/gcc/testsuite/g++.dg/modules/xtreme-header-8.C new file mode 100644 index 00000000000..b0d0ae87534 --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/xtreme-header-8.C @@ -0,0 +1,9 @@ +// { dg-additional-options "-fmodules-ts -fdump-lang-module" } +// { dg-module-cmi empty } + +module; +#include "xtreme-header.h" +export module empty; + +// The whole GMF should be discarded here +// { dg-final { scan-lang-dump "Wrote 0 clusters" module } } diff --git a/gcc/testsuite/g++.dg/modules/xtreme-header.h b/gcc/testsuite/g++.dg/modules/xtreme-header.h index 3147aaf00f4..8d95218755a 100644 --- a/gcc/testsuite/g++.dg/modules/xtreme-header.h +++ b/gcc/testsuite/g++.dg/modules/xtreme-header.h @@ -89,7 +89,6 @@ // C++20 #if __cplusplus > 201703 -#if 1 #include #include #include @@ -98,6 +97,7 @@ #if __cpp_coroutines #include #endif +#include #include #include #include @@ -106,24 +106,32 @@ #include #include #include -#if 0 -// Unimplemented -#include -#endif -#endif #endif // C++23 #if __cplusplus > 202002L #include +#include +#include #include #include +#include #if 0 // Unimplemented #include #include -#include #include -#include +#endif +#endif + +// C++26 +#if __cplusplus > 202302L +#if 0 +// Unimplemented +#include +#include +#include +#include +#include #endif #endif