From patchwork Sat Nov 11 00:45:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Wakely X-Patchwork-Id: 164050 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:d256:0:b0:430:37f2:e94a with SMTP id bx22csp1254008vqb; Fri, 10 Nov 2023 18:06:44 -0800 (PST) X-Google-Smtp-Source: AGHT+IHzoHBHI/xK6RSd80h4OMhJyMb8GF1lCJUzt5202JzNeoXJg3UTpRpRHAiXdg5o7p+yMFAM X-Received: by 2002:ac8:5a43:0:b0:418:1235:5c84 with SMTP id o3-20020ac85a43000000b0041812355c84mr6436054qta.10.1699668404560; Fri, 10 Nov 2023 18:06:44 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1699668404; cv=pass; d=google.com; s=arc-20160816; b=VRGihqiNbsqaovb8gcBCYJ1TfMhGXI67F+n/qvoswsQVqmuvXxC0g4ILYWeAdkelx5 6j1jdA9iNucZp+9qkpk/8VF3oN946spnb/02vF+Tk1aNyy1F00NqvFD1R9HO9LC3EeWT u8ciWs1wswxt7ypRfMffE/NbEOtX/nJwvO72VVce+Xu+5igJ8ngqppSaY9S1g4WaaWoH 1/hxHC05+XVk3mvaK1/8UdW/LS+eeFWs6DAoCWchoUxIwxl9jPBKQlOPCsnC5CESXaD+ VAb+s+TnnD7YsQPZ4NYLpS+nIENnkLB7ROGXiRjYZEQWJyHwyHydZTWEItyllw7Q0eBr wzeQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:to:from:dkim-signature :arc-filter:dmarc-filter:delivered-to; bh=avSdC1t9IiGXGHknIXwcWnPPb39R/o1LrK+XvweOcyI=; fh=sJ+2/4g29YdyXkoRrFZSpsL2zxijepB7X/1rB0LDDh8=; b=YCLm0EjleMSIKTFbl4hSV9Zx5AyGOm7INafyvedFly3O+SUCxvUE1m+CcdFplW167S k4rN1YKbFc1Xrg4OT/2IUht9Ape/lVES3GVkfTzHLSdT2rqXqZX5PDvXOgjpQOI/Ynzx 8f1a1bJpXqnRs8sfzKrL3mu14hFaczIIDY9/snofzSGxYVEXcp2y3NU0MrSN1c7MRiwq 9GaDk7VpAhJKRNksFWM4oYFaMDM4rz0OyhSlWp0mjYmWGzpRPUTbPnhMwlGekv52oquO F3mmf2VnzFaYBP8Sh687WyNezyw4IImj1IPsr9otyzjgip5OrEJfyxEMXQ/4t/eWZRr4 ni9A== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="D//3KTD2"; arc=pass (i=1); 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=redhat.com Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id m7-20020a05622a054700b00417f5c86182si678698qtx.333.2023.11.10.18.06.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Nov 2023 18:06:44 -0800 (PST) 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=@redhat.com header.s=mimecast20190719 header.b="D//3KTD2"; arc=pass (i=1); 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=redhat.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 23114395441D for ; Sat, 11 Nov 2023 00:46:11 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org 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 192CE38279A9 for ; Sat, 11 Nov 2023 00:45:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 192CE38279A9 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 192CE38279A9 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1699663519; cv=none; b=dtAIWsyv+ERWanNmfNQ2ki8J2nVOtaGdlpsCyS3g0OT/eeCqCBs1KiSahZ0tR31nLDlgww2IVXZ2Z+ocbNn/FXob3SgD36MrQccc2ZGgY4eIGvyLN2cvbpG8jcg1Lj4zWTgFYlBBJvDKF4PBLPU7Mr5qshyQpQB6+bQRgERvMq8= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1699663519; c=relaxed/simple; bh=yVe2GXLN+Gezw7s2tVefOMqenkNilZzEao/K4DIO7JE=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=vUSdI/l1mhC3EIdCiHPoTqk62Fmibj9HL5JsSSnDi4gSNHJJjOKshkvco9C9uFIsXkruDSkLmbIPU1cq5FolhQZuHtil//QOjMbAHOr7des6HOELSIficGOB8yS1fl+2QBobT8MZ5m3WeqjxIwi5ER8/xV0yPMQ6NMpwCpq88R8= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1699663512; 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=avSdC1t9IiGXGHknIXwcWnPPb39R/o1LrK+XvweOcyI=; b=D//3KTD2MeNvQ6zMbeaUhw2WI+n/oPRDQ+WFLCbeahulsLjNV2ciku04H2jeMBTwjh7q2q O5dTBKnlBc0Yt0utwAVhf1aN9wpJC5auOo4MjyeFCoU8jx7GGhdI9wsjmhzp588Jq1RqeH T9uUl7r0vnz5tyzDrShgTDvhD6Wvulc= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-532-h5wqAv8BOsy48btiN-dflQ-1; Fri, 10 Nov 2023 19:45:11 -0500 X-MC-Unique: h5wqAv8BOsy48btiN-dflQ-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 2A139803C98; Sat, 11 Nov 2023 00:45:11 +0000 (UTC) Received: from localhost (unknown [10.42.28.3]) by smtp.corp.redhat.com (Postfix) with ESMTP id E7A002166B26; Sat, 11 Nov 2023 00:45:10 +0000 (UTC) From: Jonathan Wakely To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [committed] libstdc++: Fix broken tests for Date: Sat, 11 Nov 2023 00:45:06 +0000 Message-ID: <20231111004510.78546-1-jwakely@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.6 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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, KAM_SHORT, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, 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.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782231496899086726 X-GMAIL-MSGID: 1782231496899086726 Tested x86_64-linux. Pushed to trunk. -- >8 -- When I added these tests I gave them .h file extensions, so they've never been run. They need to use the no_pch option, so that they only test the header and don't get via . libstdc++-v3/ChangeLog: * testsuite/26_numerics/headers/complex.h/std_c++11.h: Moved to... * testsuite/26_numerics/headers/complex.h/std_c++11.cc: ...here. * testsuite/26_numerics/headers/complex.h/std_c++98.h: Moved to... * testsuite/26_numerics/headers/complex.h/std_c++98.cc: ...here. Check macro first and then #undef. * testsuite/26_numerics/headers/complex.h/std_gnu++11.h: Moved to... * testsuite/26_numerics/headers/complex.h/std_gnu++11.cc: ...here. --- .../complex.h/{std_c++11.h => std_c++11.cc} | 4 +++- .../complex.h/{std_c++98.h => std_c++98.cc} | 14 ++++++++------ .../complex.h/{std_gnu++11.h => std_gnu++11.cc} | 3 ++- 3 files changed, 13 insertions(+), 8 deletions(-) rename libstdc++-v3/testsuite/26_numerics/headers/complex.h/{std_c++11.h => std_c++11.cc} (91%) rename libstdc++-v3/testsuite/26_numerics/headers/complex.h/{std_c++98.h => std_c++98.cc} (87%) rename libstdc++-v3/testsuite/26_numerics/headers/complex.h/{std_gnu++11.h => std_gnu++11.cc} (95%) diff --git a/libstdc++-v3/testsuite/26_numerics/headers/complex.h/std_c++11.h b/libstdc++-v3/testsuite/26_numerics/headers/complex.h/std_c++11.cc similarity index 91% rename from libstdc++-v3/testsuite/26_numerics/headers/complex.h/std_c++11.h rename to libstdc++-v3/testsuite/26_numerics/headers/complex.h/std_c++11.cc index f74b13498d7..5cac1218163 100644 --- a/libstdc++-v3/testsuite/26_numerics/headers/complex.h/std_c++11.h +++ b/libstdc++-v3/testsuite/26_numerics/headers/complex.h/std_c++11.cc @@ -15,7 +15,9 @@ // with this library; see the file COPYING3. If not see // . -// { dg-options "-std=c++11" } +// { dg-do compile { target c++11 } } +// { dg-add-options strict_std } +// { dg-add-options no_pch } #include diff --git a/libstdc++-v3/testsuite/26_numerics/headers/complex.h/std_c++98.h b/libstdc++-v3/testsuite/26_numerics/headers/complex.h/std_c++98.cc similarity index 87% rename from libstdc++-v3/testsuite/26_numerics/headers/complex.h/std_c++98.h rename to libstdc++-v3/testsuite/26_numerics/headers/complex.h/std_c++98.cc index 79facef8d5b..4c9bd6e6a08 100644 --- a/libstdc++-v3/testsuite/26_numerics/headers/complex.h/std_c++98.h +++ b/libstdc++-v3/testsuite/26_numerics/headers/complex.h/std_c++98.cc @@ -15,13 +15,19 @@ // with this library; see the file COPYING3. If not see // . -// { dg-options "-std=c++98" } +// { dg-do compile { target c++98_only } } +// { dg-add-options strict_std } +// { dg-add-options no_pch } #include -// Should be equivalent to C99 , not C++ +// Should be equivalent to C99 , not C++ +#ifndef complex +# error "'complex' is not defined as a macro by for -std=c++98" +#endif namespace std { +#undef complex struct complex; } @@ -49,7 +55,3 @@ namespace test using ::creal; } #endif - -#ifndef complex -# error "'complex' is not defined as a macro by for -std=c++98" -#endif diff --git a/libstdc++-v3/testsuite/26_numerics/headers/complex.h/std_gnu++11.h b/libstdc++-v3/testsuite/26_numerics/headers/complex.h/std_gnu++11.cc similarity index 95% rename from libstdc++-v3/testsuite/26_numerics/headers/complex.h/std_gnu++11.h rename to libstdc++-v3/testsuite/26_numerics/headers/complex.h/std_gnu++11.cc index 20c55a5944e..4a6fc00d390 100644 --- a/libstdc++-v3/testsuite/26_numerics/headers/complex.h/std_gnu++11.h +++ b/libstdc++-v3/testsuite/26_numerics/headers/complex.h/std_gnu++11.cc @@ -15,7 +15,8 @@ // with this library; see the file COPYING3. If not see // . -// { dg-options "-std=gnu++11" } +// { dg-do compile { target c++11 } } +// { dg-add-options no_pch } #include