Blame SOURCES/0015-Conditionalize-test-for-PR-libstdc-87135-on-__LIBSTD.patch

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