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

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