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

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