From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2181) id D0D273858D38; Thu, 17 Aug 2023 07:45:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D0D273858D38 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1692258304; bh=efS+tp0IcACgC22tPs6+2zGkWw3wNkryllGp26sDfAw=; h=From:To:Subject:Date:From; b=uxpTlu7zFVnp8T7hMvSHP+iCdR5B2v8sInNN+2YpNq9dD0QUCp6OIO8B5OI6R2dQ3 lIIt7WQTRCaDy1WG+Wdp24/7XXyBpvHrU9yO5ra3r2BGdKsdtlLXS1NhSNbP9KkiBF LGzKEWSlipT/KZbgVgWdTx1UgphAc6zOrtjiKrV0= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Jonathan Wakely To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org Subject: [gcc r14-3276] libstdc++: Fix testsuite no_pch directive X-Act-Checkin: gcc X-Git-Author: Jonathan Wakely X-Git-Refname: refs/heads/master X-Git-Oldrev: c6259c4975e84b30d7de1f64afaece614d7c4500 X-Git-Newrev: 91315f23ba127ea4d1a584023bae34e143f6eb8c Message-Id: <20230817074504.D0D273858D38@sourceware.org> Date: Thu, 17 Aug 2023 07:45:04 +0000 (GMT) List-Id: https://gcc.gnu.org/g:91315f23ba127ea4d1a584023bae34e143f6eb8c commit r14-3276-g91315f23ba127ea4d1a584023bae34e143f6eb8c Author: Jonathan Wakely Date: Wed Aug 16 21:46:05 2023 +0100 libstdc++: Fix testsuite no_pch directive 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. Diff: --- 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 73c1552e682d..15e34f8a6461 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.