]> git.ipfire.org Git - people/ms/gcc.git/commitdiff
libstdc++: Fix simd test compilation with Clang releases/gcc-12
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:33:33 +0000 (12:33 +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 eeb2be26213e71009985794515446848e813ffe3..020b6ee521a244e02947acac720e26938b813591 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;