Blame SOURCES/0014-Conditionalize-tests-for-PR-libstdc-98466-on-__LIBST.patch

759f0e
From fa770c25013df537c41d0929c4202b0a774a6a75 Mon Sep 17 00:00:00 2001
759f0e
From: David Malcolm <dmalcolm@redhat.com>
759f0e
Date: Thu, 2 Sep 2021 15:27:59 -0400
759f0e
Subject: [PATCH 14/17] Conditionalize tests for PR libstdc++/98466 on
759f0e
 __LIBSTDCXX_SO_VERSION >= 11
759f0e
759f0e
The tests:
759f0e
  23_containers/deque/debug/98466.cc
759f0e
  23_containers/unordered_map/debug/98466.cc
759f0e
were added upstream 2021-01-01 as part of:
759f0e
  libstdc++: Implement N3644 for _GLIBCXX_DEBUG iterators
759f0e
    https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=05a30af3f237984b4dcf1dbbc17fdac583c46506
759f0e
but fail when run in DTS against a system libstdc++.so
759f0e
from an older GCC.
759f0e
759f0e
In particular, they use the older implementation of _M_can_compare from
759f0e
the dynamic library:
759f0e
759f0e
$ eu-readelf -s 98466.exe | grep can_compare | c++filt
759f0e
   11: 0000000000000000      0 FUNC    GLOBAL DEFAULT    UNDEF __gnu_debug::_Safe_iterator_base::_M_can_compare(__gnu_debug::_Safe_iterator_base const&) const@GLIBCXX_3.4 (4)
759f0e
  157: 0000000000000000      0 FUNC    GLOBAL DEFAULT    UNDEF __gnu_debug::_Safe_iterator_base::_M_can_compare(__gnu_debug::_Safe_iterator_base const&) const@@GLIBCXX_3.4
759f0e
---
759f0e
 .../testsuite/23_containers/deque/debug/98466.cc     |  6 ++++++
759f0e
 .../23_containers/unordered_map/debug/98466.cc       | 12 ++++++++++++
759f0e
 2 files changed, 18 insertions(+)
759f0e
759f0e
diff --git a/libstdc++-v3/testsuite/23_containers/deque/debug/98466.cc b/libstdc++-v3/testsuite/23_containers/deque/debug/98466.cc
759f0e
index c2d793374..e92d719bf 100644
759f0e
--- a/libstdc++-v3/testsuite/23_containers/deque/debug/98466.cc
759f0e
+++ b/libstdc++-v3/testsuite/23_containers/deque/debug/98466.cc
759f0e
@@ -26,11 +26,17 @@ void test01()
759f0e
 {
759f0e
   typedef typename __gnu_debug::deque<int>::iterator It;
759f0e
   It it = It();
759f0e
+  // Fixed upstream in GCC 11
759f0e
+#if __LIBSTDCXX_SO_VERSION >= 11
759f0e
   VERIFY( it == it );
759f0e
+#endif
759f0e
 
759f0e
   typedef typename __gnu_debug::deque<int>::const_iterator Cit;
759f0e
   Cit cit = Cit();
759f0e
+  // Fixed upstream in GCC 11
759f0e
+#if __LIBSTDCXX_SO_VERSION >= 11
759f0e
   VERIFY( cit == cit );
759f0e
+#endif
759f0e
 }
759f0e
 
759f0e
 int main()
759f0e
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/debug/98466.cc b/libstdc++-v3/testsuite/23_containers/unordered_map/debug/98466.cc
759f0e
index cc22b9ff8..3a1b6cd32 100644
759f0e
--- a/libstdc++-v3/testsuite/23_containers/unordered_map/debug/98466.cc
759f0e
+++ b/libstdc++-v3/testsuite/23_containers/unordered_map/debug/98466.cc
759f0e
@@ -25,16 +25,28 @@
759f0e
 void test01()
759f0e
 {
759f0e
   __gnu_debug::unordered_map<int, int>::iterator it{};
759f0e
+  // Fixed upstream in GCC 11
759f0e
+#if __LIBSTDCXX_SO_VERSION >= 11
759f0e
   VERIFY( it == it );
759f0e
+#endif
759f0e
 
759f0e
   __gnu_debug::unordered_map<int, int>::const_iterator cit{};
759f0e
+  // Fixed upstream in GCC 11
759f0e
+#if __LIBSTDCXX_SO_VERSION >= 11
759f0e
   VERIFY( cit == cit );
759f0e
+#endif
759f0e
 
759f0e
   __gnu_debug::unordered_map<int, int>::local_iterator lit{};
759f0e
+  // Fixed upstream in GCC 11
759f0e
+#if __LIBSTDCXX_SO_VERSION >= 11
759f0e
   VERIFY( lit == lit );
759f0e
+#endif
759f0e
 
759f0e
   __gnu_debug::unordered_map<int, int>::const_local_iterator clit{};
759f0e
+  // Fixed upstream in GCC 11
759f0e
+#if __LIBSTDCXX_SO_VERSION >= 11
759f0e
   VERIFY( clit == clit );
759f0e
+#endif
759f0e
 }
759f0e
 
759f0e
 int main()
759f0e
-- 
759f0e
2.31.1
759f0e