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

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