aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/dfp/c2x-float-dfp-5.c
blob: 8d097255e0ea2307bdac32e69bc291f013fe0417 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/* Test DEC_NAN defined in <float.h> with DFP support.  */
/* { dg-do run } */
/* { dg-options "-std=c2x" } */

#include <float.h>

#ifndef DEC_NAN
# error "DEC_NAN not defined"
#endif

volatile _Decimal32 d = DEC_NAN;

extern void abort (void);
extern void exit (int);

int
main (void)
{
  (void) _Generic (DEC_NAN, _Decimal32 : 0);
  if (!__builtin_isnan (DEC_NAN))
    abort ();
  if (!__builtin_isnan (d))
    abort ();
  exit (0);
}