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