aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/dfp/c2x-float-dfp-4.c
blob: 58ee74db484d5784898977f4186c1bfcf02ab662 (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_INFINITY defined in <float.h> with DFP support.  */
/* { dg-do run } */
/* { dg-options "-std=c2x" } */

#include <float.h>

#ifndef DEC_INFINITY
# error "DEC_INFINITY not defined"
#endif

volatile _Decimal32 d = DEC_INFINITY;

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

int
main (void)
{
  (void) _Generic (DEC_INFINITY, _Decimal32 : 0);
  if (!(DEC_INFINITY > DEC32_MAX))
    abort ();
  if (!(d > DEC32_MAX))
    abort ();
  exit (0);
}