Message ID | 20230710203326.79631-1-polacek@redhat.com |
---|---|
State | Accepted |
Headers |
Return-Path: <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a6b2:0:b0:3e4:2afc:c1 with SMTP id c18csp57756vqm; Mon, 10 Jul 2023 13:34:31 -0700 (PDT) X-Google-Smtp-Source: APBJJlEJTRIN/zGLcHO7wwZKIfg0106nQZjGmbLlY3xgWs9iWUuzZTkC3zErIaPs1D40ESklyXou X-Received: by 2002:a17:906:c3a4:b0:988:fa98:2e7f with SMTP id t36-20020a170906c3a400b00988fa982e7fmr9763163ejz.38.1689021271426; Mon, 10 Jul 2023 13:34:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689021271; cv=none; d=google.com; s=arc-20160816; b=gkoACmkn0gtop6SC9dioXM0Rx1kjurNQzcOCpLz/yrxtdHjQrKFOlxR8QO0mKblAAk VV4TIr8P8e37LwpAMgdWzHePm9ZGLtd8uEYN/rEHN6ZvtKvYGuggWy1P5NNa2bOfAIWo 1sHYf3luap7Ex8I+AaBqdmG2pdQgZ8eYvF8fjp+L+a5CagK2edz2DnqT4JH9tUPo6tQa ziL0Q2kT/mIINxZlIUcSXpG91vEtfGQbml8ynOt99Mw0YxxWeh8V1lxag40JtXS1h4Q2 qaHjrtlQsX65PgAosh0FTDXP7E+OqYOAJsvlMfInugi+68cQRS7Y2uOS19uyUkMwXF3W T92A== 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:to :dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=vZjb8b7ttjVS6x7R1IRTMJCiJYwrYr+GUvXNVun9hrk=; fh=LhZO9pMPOi1tY+F1GG63CMMkQgIGz7A30W2SCNvT/p8=; b=RVyjhcjIHDY3286QZ7IHMyzwILBXTTdacW43/uYB+1iQxiNOckExzoWqs3huiADZEs 2hwdXuiLFJdXIsy5KapNr+xvO+f4M1qiKnY4cNprNzNBkpMvrm+iNr67UC7JOKG5Qpxq VJhfNK9QQDUQIzuUSD4lIgnwEBq7acG1VqVAw+zSrDKhRa9vSPt5nVvJXS7CCaPESz6q AsHyQA4DjL8iMFDTmh6ZXSpaPhOzRr2PlP73Dum6hoHe5yM6AZxg9zpu3Sel6+/GwKj5 5QUXgzTdx2VcTfTYW75whn95uCT4SN/6ZDU7lHDx7vAaD3XRyD0rEY0qpvzKX7sfrNbp /ZSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=O534bHmJ; 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 t2-20020a1709063e4200b0098d1c816d43si378404eji.85.2023.07.10.13.34.31 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jul 2023 13:34:31 -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=O534bHmJ; 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 2E9253857004 for <ouuuleilei@gmail.com>; Mon, 10 Jul 2023 20:34:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2E9253857004 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1689021262; bh=vZjb8b7ttjVS6x7R1IRTMJCiJYwrYr+GUvXNVun9hrk=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=O534bHmJ/nfdrIFrowBwCoDgoNU8HL6S2P2+gjoSJmMs+QX0IzRO2rzSL8iv6A5gc zd6p1MXpOS9XUbvMJjMNXMNuRl15qrrp9DaA9gevELiMzQzA3vF3FKXZWmprqGBYSY /LLUak9FnlE8JERQe4i5Q+VKOciIUb4rI/Wjk8/E= 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.129.124]) by sourceware.org (Postfix) with ESMTPS id 71A743857729 for <gcc-patches@gcc.gnu.org>; Mon, 10 Jul 2023 20:33:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 71A743857729 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-161--MTANAojMvSirGtiyCnXLQ-1; Mon, 10 Jul 2023 16:33:36 -0400 X-MC-Unique: -MTANAojMvSirGtiyCnXLQ-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 45F143C0FC86 for <gcc-patches@gcc.gnu.org>; Mon, 10 Jul 2023 20:33:36 +0000 (UTC) Received: from pdp-11.redhat.com (unknown [10.22.9.15]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2EB832166B26 for <gcc-patches@gcc.gnu.org>; Mon, 10 Jul 2023 20:33:36 +0000 (UTC) To: GCC Patches <gcc-patches@gcc.gnu.org> Subject: [PATCH] testsuite: fix allocator-opt1.C FAIL with old ABI Date: Mon, 10 Jul 2023 16:33:26 -0400 Message-ID: <20230710203326.79631-1-polacek@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-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true X-Spam-Status: No, score=-12.4 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, 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 <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe> List-Archive: <https://gcc.gnu.org/pipermail/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-request@gcc.gnu.org?subject=help> List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> From: Marek Polacek via Gcc-patches <gcc-patches@gcc.gnu.org> Reply-To: Marek Polacek <polacek@redhat.com> Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1771067168477530281 X-GMAIL-MSGID: 1771067168477530281 |
Series |
testsuite: fix allocator-opt1.C FAIL with old ABI
|
|
Checks
Context | Check | Description |
---|---|---|
snail/gcc-patch-check | success | Github commit url |
Commit Message
Marek Polacek
July 10, 2023, 8:33 p.m. UTC
Running $ make check-g++ RUNTESTFLAGS='--target_board=unix\{-D_GLIBCXX_USE_CXX11_ABI=0,\} dg.exp=allocator-opt1.C' yields: FAIL: g++.dg/tree-ssa/allocator-opt1.C -std=c++98 scan-tree-dump-times gimple "struct allocator D" 1 FAIL: g++.dg/tree-ssa/allocator-opt1.C -std=c++14 scan-tree-dump-times gimple "struct allocator D" 1 FAIL: g++.dg/tree-ssa/allocator-opt1.C -std=c++17 scan-tree-dump-times gimple "struct allocator D" 1 FAIL: g++.dg/tree-ssa/allocator-opt1.C -std=c++20 scan-tree-dump-times gimple "struct allocator D" 1 === g++ Summary for unix/-D_GLIBCXX_USE_CXX11_ABI=0 === === g++ Summary for unix === because in the old ABI we get two "struct allocator D". This patch follows r14-658 although I'm not quite sure I follow the logic there. Tested on x86_64-pc-linux-gnu, ok for trunk? gcc/testsuite/ChangeLog: * g++.dg/tree-ssa/allocator-opt1.C: Force _GLIBCXX_USE_CXX11_ABI to 1. --- gcc/testsuite/g++.dg/tree-ssa/allocator-opt1.C | 10 ++++++++++ 1 file changed, 10 insertions(+) base-commit: 2d7c95e31431a297060c94697af84f498abf97a2
Comments
Ping. On Mon, Jul 10, 2023 at 04:33:26PM -0400, Marek Polacek via Gcc-patches wrote: > Running > $ make check-g++ RUNTESTFLAGS='--target_board=unix\{-D_GLIBCXX_USE_CXX11_ABI=0,\} dg.exp=allocator-opt1.C' > yields: > > FAIL: g++.dg/tree-ssa/allocator-opt1.C -std=c++98 scan-tree-dump-times gimple "struct allocator D" 1 > FAIL: g++.dg/tree-ssa/allocator-opt1.C -std=c++14 scan-tree-dump-times gimple "struct allocator D" 1 > FAIL: g++.dg/tree-ssa/allocator-opt1.C -std=c++17 scan-tree-dump-times gimple "struct allocator D" 1 > FAIL: g++.dg/tree-ssa/allocator-opt1.C -std=c++20 scan-tree-dump-times gimple "struct allocator D" 1 > > === g++ Summary for unix/-D_GLIBCXX_USE_CXX11_ABI=0 === > > === g++ Summary for unix === > > because in the old ABI we get two "struct allocator D". This patch > follows r14-658 although I'm not quite sure I follow the logic there. > > Tested on x86_64-pc-linux-gnu, ok for trunk? > > gcc/testsuite/ChangeLog: > > * g++.dg/tree-ssa/allocator-opt1.C: Force _GLIBCXX_USE_CXX11_ABI to 1. > --- > gcc/testsuite/g++.dg/tree-ssa/allocator-opt1.C | 10 ++++++++++ > 1 file changed, 10 insertions(+) > > diff --git a/gcc/testsuite/g++.dg/tree-ssa/allocator-opt1.C b/gcc/testsuite/g++.dg/tree-ssa/allocator-opt1.C > index e8394c7ad70..9f13eedb604 100644 > --- a/gcc/testsuite/g++.dg/tree-ssa/allocator-opt1.C > +++ b/gcc/testsuite/g++.dg/tree-ssa/allocator-opt1.C > @@ -5,8 +5,18 @@ > // Currently the dump doesn't print the allocator template arg in this context. > // { dg-final { scan-tree-dump-times "struct allocator D" 1 "gimple" } } > > +// In the pre-C++11 ABI we get two allocator variables. > +#undef _GLIBCXX_USE_CXX11_ABI > +#define _GLIBCXX_USE_CXX11_ABI 1 > + > +// When the library is not dual-ABI and defaults to old just compile > +// an empty TU > +#if _GLIBCXX_USE_CXX11_ABI > + > #include <string> > void f (const char *p) > { > std::string lst[] = { p, p, p, p }; > } > + > +#endif > > base-commit: 2d7c95e31431a297060c94697af84f498abf97a2 > -- > 2.41.0 > Marek
On Wed, Jul 19, 2023 at 03:22:10PM -0400, Marek Polacek wrote: > Ping. > > On Mon, Jul 10, 2023 at 04:33:26PM -0400, Marek Polacek via Gcc-patches wrote: > > Running > > $ make check-g++ RUNTESTFLAGS='--target_board=unix\{-D_GLIBCXX_USE_CXX11_ABI=0,\} dg.exp=allocator-opt1.C' > > yields: > > > > FAIL: g++.dg/tree-ssa/allocator-opt1.C -std=c++98 scan-tree-dump-times gimple "struct allocator D" 1 > > FAIL: g++.dg/tree-ssa/allocator-opt1.C -std=c++14 scan-tree-dump-times gimple "struct allocator D" 1 > > FAIL: g++.dg/tree-ssa/allocator-opt1.C -std=c++17 scan-tree-dump-times gimple "struct allocator D" 1 > > FAIL: g++.dg/tree-ssa/allocator-opt1.C -std=c++20 scan-tree-dump-times gimple "struct allocator D" 1 I just pushed the patch after fixing it and adding a new comment: -- >8 -- Running $ make check-g++ RUNTESTFLAGS='--target_board=unix\{-D_GLIBCXX_USE_CXX11_ABI=0,\} dg.exp=allocator-opt1.C' yields: FAIL: g++.dg/tree-ssa/allocator-opt1.C -std=c++98 scan-tree-dump-times gimple "struct allocator D" 1 FAIL: g++.dg/tree-ssa/allocator-opt1.C -std=c++14 scan-tree-dump-times gimple "struct allocator D" 1 FAIL: g++.dg/tree-ssa/allocator-opt1.C -std=c++17 scan-tree-dump-times gimple "struct allocator D" 1 FAIL: g++.dg/tree-ssa/allocator-opt1.C -std=c++20 scan-tree-dump-times gimple "struct allocator D" 1 === g++ Summary for unix/-D_GLIBCXX_USE_CXX11_ABI=0 === === g++ Summary for unix === because in the old ABI we get two "struct allocator D". This patch follows r14-658 although I'm not quite sure I follow the logic there. gcc/testsuite/ChangeLog: * g++.dg/tree-ssa/allocator-opt1.C: Force _GLIBCXX_USE_CXX11_ABI to 1. --- gcc/testsuite/g++.dg/tree-ssa/allocator-opt1.C | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/gcc/testsuite/g++.dg/tree-ssa/allocator-opt1.C b/gcc/testsuite/g++.dg/tree-ssa/allocator-opt1.C index e8394c7ad70..51c470dee37 100644 --- a/gcc/testsuite/g++.dg/tree-ssa/allocator-opt1.C +++ b/gcc/testsuite/g++.dg/tree-ssa/allocator-opt1.C @@ -5,8 +5,20 @@ // Currently the dump doesn't print the allocator template arg in this context. // { dg-final { scan-tree-dump-times "struct allocator D" 1 "gimple" } } +// In the pre-C++11 ABI we get two allocator variables. +#undef _GLIBCXX_USE_CXX11_ABI +#define _GLIBCXX_USE_CXX11_ABI 1 + #include <string> + +// When the library is not dual-ABI and defaults to old just compile +// an empty TU. NB: We test _GLIBCXX_USE_CXX11_ABI again because the +// #include above might have undef'd _GLIBCXX_USE_CXX11_ABI. +#if _GLIBCXX_USE_CXX11_ABI + void f (const char *p) { std::string lst[] = { p, p, p, p }; } + +#endif base-commit: 506f068e7d01ad2fb107185b8fb204a0ec23785c
diff --git a/gcc/testsuite/g++.dg/tree-ssa/allocator-opt1.C b/gcc/testsuite/g++.dg/tree-ssa/allocator-opt1.C index e8394c7ad70..9f13eedb604 100644 --- a/gcc/testsuite/g++.dg/tree-ssa/allocator-opt1.C +++ b/gcc/testsuite/g++.dg/tree-ssa/allocator-opt1.C @@ -5,8 +5,18 @@ // Currently the dump doesn't print the allocator template arg in this context. // { dg-final { scan-tree-dump-times "struct allocator D" 1 "gimple" } } +// In the pre-C++11 ABI we get two allocator variables. +#undef _GLIBCXX_USE_CXX11_ABI +#define _GLIBCXX_USE_CXX11_ABI 1 + +// When the library is not dual-ABI and defaults to old just compile +// an empty TU +#if _GLIBCXX_USE_CXX11_ABI + #include <string> void f (const char *p) { std::string lst[] = { p, p, p, p }; } + +#endif