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

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