From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 5892A3858D38 for ; Thu, 17 Aug 2023 07:46:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5892A3858D38 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1692258388; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rFrF9Q8p/7CDGAeukXWwtbwWeHJHZCNjA3OZDranoM4=; b=NYK68eFSqIwXAEEMkFJ8JQEojxkB7cEJG8LsUm0nBhZDBWNjvt7qqppHyjmZO6dO7mAe18 Z21POwEY+6b4+2DNUUQpdAIA7//rh1lOgE4UPRAPgd4haYN6/EyY9+Gl8sKt4GAzH7KfYP Z5p47ShvVvzVz/TQiKhsZIvkuW3yuLQ= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-16-PrDErQiQMLKxe7BevZB12A-1; Thu, 17 Aug 2023 03:46:26 -0400 X-MC-Unique: PrDErQiQMLKxe7BevZB12A-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0E5A780558B; Thu, 17 Aug 2023 07:46:26 +0000 (UTC) Received: from localhost (unknown [10.42.28.201]) by smtp.corp.redhat.com (Postfix) with ESMTP id C87952166B2E; Thu, 17 Aug 2023 07:46:25 +0000 (UTC) From: Jonathan Wakely To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [committed] libstdc++: Fix testsuite no_pch directive Date: Thu, 17 Aug 2023 08:45:05 +0100 Message-ID: <20230817074625.868621-1-jwakely@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,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: A new test I added was failing with -std=gnu++23 because that flag was removed from the test options (but only after checking if it met the c++20 effective target). Tested x86_64-linux. Pushed to trunk. -- >8 -- The { dg-add-options no_pch } directive is supposed to add a macro definition that invalidates the PCH file, and ensures that the #include directives in the test file are processed as written. But the proc that adds the options actually removes all existing options, cancelling out any previous dg-options directive. This means that using no_pch will cause FAILs in a file that relies on other options set by an earlier dg-options. The no_pch directive was added for PR libstdc++/21769 where Janis suggested adding it as return "$flags -D__GLIBCXX__=99999999" but what was actually committed didn't include the $flags so replaced them. Additionally, using no_pch only prevents the precompiled version of from being included, it doesn't prevent the non-precompiled version being included by -include bits/stdc++.h in the test flags. Use regsub to filter that out of the options as well. libstdc++-v3/ChangeLog: * testsuite/lib/dg-options.exp (add_options_for_no_pch): Remove any "-include bits/stdc++.h" from options and add the macro to the existing options instead of replacing them. --- libstdc++-v3/testsuite/lib/dg-options.exp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libstdc++-v3/testsuite/lib/dg-options.exp b/libstdc++-v3/testsuite/lib/dg-options.exp index 73c1552e682..15e34f8a646 100644 --- a/libstdc++-v3/testsuite/lib/dg-options.exp +++ b/libstdc++-v3/testsuite/lib/dg-options.exp @@ -269,8 +269,10 @@ proc dg-require-target-fs-lwt { args } { } proc add_options_for_no_pch { flags } { + # Remove any inclusion of bits/stdc++.h from the options. + regsub -all -- "-include bits/stdc...h" $flags "" flags # This forces any generated and possibly included PCH to be invalid. - return "-D__GLIBCXX__=99999999" + return "$flags -D__GLIBCXX__=99999999" } # Add to FLAGS all the target-specific flags needed for networking. -- 2.41.0