Skip analyzer strndup test on hppa*-*-hpux*
[official-gcc.git] / gcc / testsuite / gcc.dg / c23-float-5.c
blob9c2f1bdc7a4e1e375fe199eb1d04225ddbb95a59
1 /* Test NAN macro. Runtime exceptions test, to verify NaN is quiet
2 not signaling. */
3 /* { dg-do run } */
4 /* { dg-require-effective-target fenv_exceptions } */
5 /* { dg-options "-std=c23 -pedantic-errors" } */
6 /* { dg-add-options ieee } */
8 #include <fenv.h>
9 #include <float.h>
11 /* This should be defined if and only if quiet NaNs are supported for
12 type float. If the testsuite gains effective-target support for
13 targets not supporting NaNs, or not supporting them for all types,
14 this test should only be run for targets supporting quiet NaNs for
15 float. */
16 #ifndef NAN
17 #error "NAN undefined"
18 #endif
20 volatile float f = NAN;
22 extern void abort (void);
23 extern void exit (int);
25 int
26 main (void)
28 f += f;
29 if (fetestexcept (FE_INVALID))
30 abort ();
31 exit (0);