]> git.ipfire.org Git - people/ms/gcc.git/commitdiff
libstdc++: Fix simd test compilation with Clang
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:31:43 +0000 (12:31 +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.

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

index c4d91fa5d2b2d8a872e4e73716c282cc9ae6d536..72af7061c73ecf1763c626cebd172152cc9c26af 100644 (file)
@@ -211,7 +211,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;