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 [216.205.24.124]) by sourceware.org (Postfix) with ESMTP id 8452C3857829 for ; Wed, 2 Jun 2021 12:35:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 8452C3857829 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-503-vA4XvQKJPduj0Z2nSIaHIg-1; Wed, 02 Jun 2021 08:35:36 -0400 X-MC-Unique: vA4XvQKJPduj0Z2nSIaHIg-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1742E107ACC7; Wed, 2 Jun 2021 12:35:35 +0000 (UTC) Received: from localhost (unknown [10.33.37.1]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8EB7A61F47; Wed, 2 Jun 2021 12:35:34 +0000 (UTC) Date: Wed, 2 Jun 2021 13:35:33 +0100 From: Jonathan Wakely To: =?iso-8859-1?Q?Fran=E7ois?= Dumont Cc: Jonathan Wakely , libstdc++ , gcc-patches Subject: Re: [PATCH] Hashtable PR96088 Message-ID: References: <7bd748f6-77bd-fdcc-f925-1700ac9da3de@gmail.com> <50b5f8f5-56a3-57a5-2e03-b23118a1a2c5@gmail.com> MIME-Version: 1.0 In-Reply-To: X-Clacks-Overhead: GNU Terry Pratchett X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: multipart/mixed; boundary="InvfL/5FYhuTMdRu" Content-Disposition: inline X-Spam-Status: No, score=-13.8 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_NUMSUBJECT, KAM_SHORT, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libstdc++@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libstdc++ mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jun 2021 12:35:50 -0000 --InvfL/5FYhuTMdRu Content-Type: text/plain; charset=iso-8859-1; format=flowed Content-Disposition: inline Content-Transfer-Encoding: 8bit On 01/06/21 19:10 +0100, Jonathan Wakely wrote: >On 01/06/21 18:47 +0100, Jonathan Wakely wrote: >>On 01/06/21 18:45 +0100, Jonathan Wakely wrote: >>>On 22/05/21 18:35 +0200, François Dumont wrote: >>>>diff --git a/libstdc++-v3/testsuite/23_containers/unordered_set/96088.cc b/libstdc++-v3/testsuite/23_containers/unordered_set/96088.cc >>>>new file mode 100644 >>>>index 00000000000..53bb754dab6 >>>>--- /dev/null >>>>+++ b/libstdc++-v3/testsuite/23_containers/unordered_set/96088.cc >>>>@@ -0,0 +1,271 @@ >>>>+// { dg-do run { target c++11 } } >>>>+ >>>>+// Copyright (C) 2021 Free Software Foundation, Inc. >>>>+// >>>>+// This file is part of the GNU ISO C++ Library. This library is free >>>>+// software; you can redistribute it and/or modify it under the >>>>+// terms of the GNU General Public License as published by the >>>>+// Free Software Foundation; either version 3, or (at your option) >>>>+// any later version. >>>>+ >>>>+// This library is distributed in the hope that it will be useful, >>>>+// but WITHOUT ANY WARRANTY; without even the implied warranty of >>>>+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >>>>+// GNU General Public License for more details. >>>>+ >>>>+// You should have received a copy of the GNU General Public License along >>>>+// with this library; see the file COPYING3. If not see >>>>+// . >>>>+ >>>>+// libstdc++/96088 >>>>+ >>>>+#include >>> >>>This is a c++11 test, but it uses . >>> >>>The test fails for make check RUNTESTFLAGS=--target_board=unix/-std=gnu++11 >>> >>>I assume it should use { target c++17 } instead? >> >>Same for 23_containers/unordered_map/96088.cc > >I've pushed this fix. And this one too. Tested x86_64-linux. --InvfL/5FYhuTMdRu Content-Type: text/x-patch; charset=us-ascii Content-Disposition: attachment; filename="patch.txt" commit 81eab204a56dcd8acb1ca5d7df277437ca07b51a Author: Jonathan Wakely Date: Wed Jun 2 12:33:38 2021 libstdc++: Fix tests for COW std::string [PR 96088] The expected number of allocations is different when copying COW strings. Signed-off-by: Jonathan Wakely libstdc++-v3/ChangeLog: PR libstdc++/96088 * testsuite/23_containers/unordered_map/96088.cc: Adjust expected number of allocations. * testsuite/23_containers/unordered_set/96088.cc: Likewise. diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/96088.cc b/libstdc++-v3/testsuite/23_containers/unordered_map/96088.cc index e552b04f8c8..83ca1c0afd6 100644 --- a/libstdc++-v3/testsuite/23_containers/unordered_map/96088.cc +++ b/libstdc++-v3/testsuite/23_containers/unordered_map/96088.cc @@ -222,7 +222,8 @@ test03() std::vector> v; v.insert(v.end(), lst.begin(), lst.end()); - auto __offset = __gnu_test::counter::count(); + const auto origin = __gnu_test::counter::count(); + { __gnu_test::counter::reset(); std::unordered_map v; v.insert(v.end(), lst.begin(), lst.end()); - auto __offset = __gnu_test::counter::count(); + const auto origin = __gnu_test::counter::count(); + { __gnu_test::counter::reset(); std::unordered_set