public inbox for libstdc++-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r10-9021] libstdc++: Fix test that fails for targets without __int128 [PR 96042]
@ 2020-11-13 13:11 Jonathan Wakely
  0 siblings, 0 replies; only message in thread
From: Jonathan Wakely @ 2020-11-13 13:11 UTC (permalink / raw)
  To: gcc-cvs, libstdc++-cvs

https://gcc.gnu.org/g:12042aeb9336f20b9225b2e5139e5f6c9bde7642

commit r10-9021-g12042aeb9336f20b9225b2e5139e5f6c9bde7642
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Fri Nov 13 13:04:10 2020 +0000

    libstdc++: Fix test that fails for targets without __int128 [PR 96042]
    
    When backporting this test (and the changes it depends on) I forgot that
    the __max_diff_type and __max_size_type classes are only present on
    trunk, not the gcc-10 branch. That using iota_view<long long, long long>
    oonly works correctly when __int128 is available, so the test fails on
    32-bit targets.
    
    This just skips the failing check.
    
            PR libstdc++/96042
            * testsuite/std/ranges/iota/96042.cc: Only assert that the
            difference type is wider than long long if __int128 is
            supported.

Diff:
---
 libstdc++-v3/testsuite/std/ranges/iota/96042.cc | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/libstdc++-v3/testsuite/std/ranges/iota/96042.cc b/libstdc++-v3/testsuite/std/ranges/iota/96042.cc
index 911663bc413..3ee0639fcd6 100644
--- a/libstdc++-v3/testsuite/std/ranges/iota/96042.cc
+++ b/libstdc++-v3/testsuite/std/ranges/iota/96042.cc
@@ -28,7 +28,8 @@ test01()
 
   // In strict -std=c++20 mode there is no integer wider than long long,
   // so V's difference type is an integer-class type, [iterator.concept.winc].
-  // In practice this is either __int128 or __detail::__max_diff_type.
+  // In practice we use __int128 for this where that type is available,
+  // and cannot meet the requirement otherwise (this is fixed in GCC 11).
   using D = std::ranges::range_difference_t<V>;
   // Ensure that numeric_limits is correctly specialized for the type.
   using L = std::numeric_limits<D>;
@@ -36,7 +37,9 @@ test01()
   static_assert( L::is_signed );
   static_assert( L::is_integer );
   static_assert( L::is_exact );
+#ifdef __SIZEOF_INT128__
   static_assert( L::digits > std::numeric_limits<long long>::digits );
+#endif
   static_assert( L::digits10 == static_cast<int>(L::digits * 0.30103) );
   static_assert( L::min() == (D(1) << L::digits) );
   static_assert( L::max() == ~L::min() );


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-11-13 13:11 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-13 13:11 [gcc r10-9021] libstdc++: Fix test that fails for targets without __int128 [PR 96042] Jonathan Wakely

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).