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

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