aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/c23-float-10.c
blob: d3d03597f604627f3db35bdb7f8bb0a6db62ab03 (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
26
27
28
29
30
31
32
33
/* Test *_IS_IEC_60559 macros.  */
/* { dg-do compile } */
/* { dg-options "-std=c23 -pedantic-errors" } */

#include <float.h>

#ifndef FLT_IS_IEC_60559
#error "FLT_IS_IEC_60559 undefined"
#endif

#ifndef DBL_IS_IEC_60559
#error "DBL_IS_IEC_60559 undefined"
#endif

#ifndef LDBL_IS_IEC_60559
#error "LDBL_IS_IEC_60559 undefined"
#endif

#if defined __pdp11__ || defined __vax__
_Static_assert (FLT_IS_IEC_60559 == 0);
_Static_assert (DBL_IS_IEC_60559 == 0);
_Static_assert (LDBL_IS_IEC_60559 == 0);
#else
_Static_assert (FLT_IS_IEC_60559 == 1);
_Static_assert (DBL_IS_IEC_60559 == 1);
#if LDBL_MANT_DIG == 106 || LDBL_MIN_EXP == -16382
/* IBM long double and m68k extended format do not meet the definition
   of an IEC 60559 interchange or extended format.  */
_Static_assert (LDBL_IS_IEC_60559 == 0);
#else
_Static_assert (LDBL_IS_IEC_60559 == 1);
#endif
#endif