]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
testsuite: require c99_runtime for ldexp optimizations
authorAlexandre Oliva <oliva@adacore.com>
Wed, 21 Jan 2026 03:29:44 +0000 (00:29 -0300)
committerAlexandre Oliva <oliva@gnu.org>
Wed, 21 Jan 2026 03:29:44 +0000 (00:29 -0300)
ldexpf and ldexpl are only optimized as expected when the target libc
is known to have C99 support, so don't expect those optimizations when
HAVE_C99_RUNTIME is not set by builtins-config.h.

for  gcc/testsuite/ChangeLog

* gcc.dg/tree-ssa/ldexp.c: Require HAVE_C99_RUNTIME to test
ldexpf and ldexpl.

gcc/testsuite/gcc.dg/tree-ssa/ldexp.c

index 92bcf588b16ac7963f4f440baa2d0fa6332818c4..98395f9da767470e139c73e62e2b54c04a3d925a 100644 (file)
@@ -3,6 +3,8 @@
 
 /* { dg-final { scan-assembler-not "\tfmul\t" } } */
 
+#include "../builtins-config.h"
+
 #define TEST(TYPE, BUILTIN, CONST, NAME)                       \
   TYPE test_##NAME##_1(TYPE a, int i)                          \
   {                                                            \
@@ -28,5 +30,9 @@
   }
 
 TEST(double, ldexp, 8.0, double_ldexp)
+#ifdef HAVE_C99_RUNTIME
+/* If libc is not known to have these functions, introduced in C99, the
+   compiler won't optimize them.  */
 TEST(float, ldexpf, 8.0f, float_ldexp)
 TEST(long double, ldexpl, 8.0L, long_ldexp)
+#endif