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

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