]> git.ipfire.org Git - people/ms/gcc.git/commitdiff
libstdc++: Fix simd test compilation with Clang releases/gcc-11
authorMatthias Kretz <m.kretz@gsi.de>
Thu, 23 Feb 2023 13:45:07 +0000 (14:45 +0100)
committerMatthias Kretz <m.kretz@gsi.de>
Tue, 21 Mar 2023 11:34:03 +0000 (12:34 +0100)
Signed-off-by: Matthias Kretz <m.kretz@gsi.de>
libstdc++-v3/ChangeLog:

* testsuite/experimental/simd/tests/operators.cc: Clang doesn't
define __GCC_IEC_559. Use __STDC_IEC_559__ instead.

(cherry picked from commit 25db59017f2e216a76c8a0fe4814568135f19f9a)

libstdc++-v3/testsuite/experimental/simd/tests/operators.cc

index 171bae5b05eb3e4a3acdd9f26ed707b98958aafc..d0f5a1e5ce16c34a4e0ed380d913ba538ed3dada 100644 (file)
@@ -223,7 +223,14 @@ template <typename V>
     }
 
     // divides
-    constexpr bool is_iec559 = __GCC_IEC_559 >= 2;
+    constexpr bool is_iec559 =
+#ifdef __GCC_IEC_559
+      __GCC_IEC_559 >= 2;
+#elif defined __STDC_IEC_559__
+      true;
+#else
+      false;
+#endif
     if constexpr (std::is_floating_point_v<T> && !is_iec559)
       { // avoid testing subnormals and expect minor deltas for non-IEC559 float
        V x = 2;