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

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