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

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