]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Mark gencanon_eng_neg test as unsupported if __float128 is not available.
authorTomasz Kamiński <tkaminsk@redhat.com>
Thu, 14 May 2026 07:46:14 +0000 (09:46 +0200)
committerTomasz Kamiński <tkaminsk@redhat.com>
Thu, 14 May 2026 09:27:23 +0000 (11:27 +0200)
As DejaGnu reads all lines, the { dg-error } still expected error,
even if the code was removed by preprocessor checks.

libstdc++-v3/ChangeLog:

* testsuite/26_numerics/random/uniform_real_distribution/operators/gencanon_eng_neg.cc:
Removed preprocessor checks, add dg-require-effective-target.

Reviewed-by: Jonathan Wakely <jwakely@redhat.com>
Signed-off-by: Tomasz Kamiński <tkaminsk@redhat.com>
libstdc++-v3/testsuite/26_numerics/random/uniform_real_distribution/operators/gencanon_eng_neg.cc

index 8b241fee7edf0b97850562958f7abb56af5694ab..e3b4540bf2b610b5d6bb401139a35289900cc5ba 100644 (file)
@@ -1,4 +1,7 @@
 // { dg-do compile { target { c++11 } } }
+// { dg-require-effective-target __float128 }
+// { dg-require-effective-target base_quadfloat_support }
+// { dg-add-options __float128 }
 
 #include <random>
 #include <cstdint>
@@ -45,13 +48,12 @@ test_pow2()
 
 int main()
 {
-// For 128bit floating points, generator emitting a range, which size is 
-// not power of two, but of width of B bits, such that for any N:
-// N * B < 113 (bits in ieee128)
-// (N+1) * B > 128
-// are not supported, as they would require integer with more than 127 bits.
-#ifndef _GLIBCXX_GENERATE_CANONICAL_STRICT
-#  ifdef __SIZEOF_FLOAT128__
+  // For 128bit floating points, generator emitting a range, which size is 
+  // not power of two, but of width of B bits, such that for any N:
+  // N * B < 113 (bits in ieee128)
+  // (N+1) * B > 128
+  // are not supported, as they would require integer with more than 127 bits.
+
   // N == 3: B in [43, 57)
   test_non_pow2<__float128, 42>(); // 3 calls
   test_non_pow2<__float128, 43>(); // { dg-error "from here" }
@@ -81,8 +83,6 @@ int main()
   test_non_pow2<__float128, 22>(); // { dg-error "from here" }
   test_non_pow2<__float128, 23>(); // 5 calls
   test_pow2<__float128, 22>();
-#  endif
-#endif 
 }
 
 // { dg-prune-output "no type named 'type' in 'struct std::__detail::_Select_uint_least_t" }