From: Francois-Xavier Coudert Date: Fri, 5 Jul 2024 22:02:03 +0000 (+0200) Subject: Fortran: switch test to use issignaling() built-in X-Git-Tag: basepoints/gcc-16~7687 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=eec30733bba305b02ba3c368289ef935f17c87e6;p=thirdparty%2Fgcc.git Fortran: switch test to use issignaling() built-in The macro may not be present in all libc's, but the built-in is always available. gcc/testsuite/ChangeLog: * gfortran.dg/ieee/signaling_2.f90: Adjust test. * gfortran.dg/ieee/signaling_2_c.c: Adjust test. --- diff --git a/gcc/testsuite/gfortran.dg/ieee/signaling_2.f90 b/gcc/testsuite/gfortran.dg/ieee/signaling_2.f90 index 03b04c783ebf..79a85edefd1e 100644 --- a/gcc/testsuite/gfortran.dg/ieee/signaling_2.f90 +++ b/gcc/testsuite/gfortran.dg/ieee/signaling_2.f90 @@ -1,9 +1,6 @@ ! { dg-do run { target { ! ia32 } } } ! x87 / x86-32 ABI is unsuitable for signaling NaNs ! -! { dg-require-effective-target issignaling } */ -! The companion C source needs access to the issignaling macro. -! ! { dg-additional-sources signaling_2_c.c } ! { dg-additional-options "-w" } ! The -w option is needed to make cc1 not report a warning for diff --git a/gcc/testsuite/gfortran.dg/ieee/signaling_2_c.c b/gcc/testsuite/gfortran.dg/ieee/signaling_2_c.c index ea7fc0467bd7..dde09638c6fb 100644 --- a/gcc/testsuite/gfortran.dg/ieee/signaling_2_c.c +++ b/gcc/testsuite/gfortran.dg/ieee/signaling_2_c.c @@ -1,8 +1,4 @@ -#define _GNU_SOURCE -#include -#include - -int isnansf (float x) { return issignaling (x) ? 1 : 0; } -int isnans (double x) { return issignaling (x) ? 1 : 0; } -int isnansl (long double x) { return issignaling (x) ? 1 : 0; } +int isnansf (float x) { return __builtin_issignaling (x) ? 1 : 0; } +int isnans (double x) { return __builtin_issignaling (x) ? 1 : 0; } +int isnansl (long double x) { return __builtin_issignaling (x) ? 1 : 0; }