|
|
56505a |
From 992665eab6c48d6a4819f42509346d24b277485d Mon Sep 17 00:00:00 2001
|
|
|
56505a |
From: David Malcolm <dmalcolm@redhat.com>
|
|
|
56505a |
Date: Thu, 2 Sep 2021 16:17:29 -0400
|
|
|
56505a |
Subject: [PATCH 15/17] Conditionalize test for PR libstdc++/87135 on
|
|
|
56505a |
__LIBSTDCXX_SO_VERSION >= 9
|
|
|
56505a |
|
|
|
56505a |
This VERIFY was added upstream 2018-09-18 as part of:
|
|
|
56505a |
re PR libstdc++/87135 ([C++17] unordered containers violate iterator validity requirements)
|
|
|
56505a |
https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=a521e62615e439aea7502a52fd0f8a21eaa6304f
|
|
|
56505a |
|
|
|
56505a |
but fails when run in DTS against a system libstdc++.so from an older GCC.
|
|
|
56505a |
|
|
|
56505a |
In particular, rehash from the header is using
|
|
|
56505a |
std::__detail::_Prime_rehash_policy::_M_next_bkt
|
|
|
56505a |
from the system .so:
|
|
|
56505a |
|
|
|
56505a |
12: 0000000000000000 0 FUNC GLOBAL DEFAULT UNDEF std::__detail::_Prime_rehash_policy::_M_next_bkt(unsigned long) const@GLIBCXX_3.4.18 (5)
|
|
|
56505a |
225: 0000000000000000 0 FUNC GLOBAL DEFAULT UNDEF std::__detail::_Prime_rehash_policy::_M_next_bkt(unsigned long) const@@GLIBCXX_3.4.18
|
|
|
56505a |
---
|
|
|
56505a |
.../23_containers/unordered_map/modifiers/reserve.cc | 4 ++++
|
|
|
56505a |
1 file changed, 4 insertions(+)
|
|
|
56505a |
|
|
|
56505a |
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/modifiers/reserve.cc b/libstdc++-v3/testsuite/23_containers/unordered_map/modifiers/reserve.cc
|
|
|
56505a |
index 58c8924b9..4c79ec2e6 100644
|
|
|
56505a |
--- a/libstdc++-v3/testsuite/23_containers/unordered_map/modifiers/reserve.cc
|
|
|
56505a |
+++ b/libstdc++-v3/testsuite/23_containers/unordered_map/modifiers/reserve.cc
|
|
|
56505a |
@@ -46,7 +46,11 @@ void test01()
|
|
|
56505a |
|
|
|
56505a |
// As long as we insert less than the reserved number of elements we
|
|
|
56505a |
// shouldn't experiment any rehash.
|
|
|
56505a |
+
|
|
|
56505a |
+ // Fixed upstream in GCC 9
|
|
|
56505a |
+#if __LIBSTDCXX_SO_VERSION >= 9
|
|
|
56505a |
VERIFY( m.bucket_count() == bkts );
|
|
|
56505a |
+#endif
|
|
|
56505a |
|
|
|
56505a |
VERIFY( m.load_factor() <= m.max_load_factor() );
|
|
|
56505a |
}
|
|
|
56505a |
--
|
|
|
56505a |
2.31.1
|
|
|
56505a |
|