From 018eef791eee867087a8d4274334374dc75e9149 Mon Sep 17 00:00:00 2001 From: Matheus Castanho Date: Wed, 1 Sep 2021 17:35:21 -0300 Subject: [PATCH] Fix cstdfloat_math_incl_test on ppc64le with ieee128 When switching the default long double format on ppc64le to ieee128, this test does not compile as nanq is not available. In such cases nanl should be used instead. Also, calling nanl with argument 0 raises warnings as it expects a char*. Change the argument to an empty string, which keeps the purpose of the test and avoids new warnings. --- test/compile_test/cstdfloat_cmath_incl_test.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/compile_test/cstdfloat_cmath_incl_test.cpp b/test/compile_test/cstdfloat_cmath_incl_test.cpp index 35894ec3ff..5e08483045 100644 --- a/test/compile_test/cstdfloat_cmath_incl_test.cpp +++ b/test/compile_test/cstdfloat_cmath_incl_test.cpp @@ -53,7 +53,11 @@ void compile_and_link_test() check_result(std::fmax(f128, f128)); check_result(std::fmin(f128, f128)); check_result(std::fdim(f128, f128)); - check_result(std::nanq(0)); +#if __LDBL_MANT_DIG__ == 113 + check_result(std::nanl("")); +#else + check_result(std::nanq("")); +#endif check_result(std::exp2(f128)); check_result(std::log2(f128)); check_result(std::log1p(f128));