]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Fortran: switch test to use issignaling() built-in
authorFrancois-Xavier Coudert <fxcoudert@gcc.gnu.org>
Fri, 5 Jul 2024 22:02:03 +0000 (00:02 +0200)
committerFrancois-Xavier Coudert <fxcoudert@gcc.gnu.org>
Fri, 5 Jul 2024 22:03:27 +0000 (00:03 +0200)
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.

gcc/testsuite/gfortran.dg/ieee/signaling_2.f90
gcc/testsuite/gfortran.dg/ieee/signaling_2_c.c

index 03b04c783ebf157e24ca2c5d952054482ca21601..79a85edefd1eb33dc7f19a8b806ec23177652e68 100644 (file)
@@ -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
index ea7fc0467bd7d7132aa50a0437b7606227d63c73..dde09638c6fb995318a6c6286f46e00cd6e418d9 100644 (file)
@@ -1,8 +1,4 @@
-#define _GNU_SOURCE
-#include <math.h>
-#include <float.h>
-
-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; }