Mercurial > hg > CbC > CbC_gcc
diff gcc/testsuite/gcc.dg/c2x-float-1.c @ 145:1830386684a0
gcc-9.2.0
author | anatofuz |
---|---|
date | Thu, 13 Feb 2020 11:34:05 +0900 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gcc/testsuite/gcc.dg/c2x-float-1.c Thu Feb 13 11:34:05 2020 +0900 @@ -0,0 +1,37 @@ +/* Test *_NORM_MAX macros. */ +/* { dg-do run } */ +/* { dg-options "-std=c2x -pedantic-errors" } */ + +#include <float.h> + +#ifndef FLT_NORM_MAX +#error "FLT_NORM_MAX undefined" +#endif + +#ifndef DBL_NORM_MAX +#error "DBL_NORM_MAX undefined" +#endif + +#ifndef LDBL_NORM_MAX +#error "LDBL_NORM_MAX undefined" +#endif + +extern void abort (void); +extern void exit (int); + +int +main (void) +{ + if (FLT_NORM_MAX != FLT_MAX) + abort (); + if (DBL_NORM_MAX != DBL_MAX) + abort (); +#if LDBL_MANT_DIG == 106 + if (LDBL_NORM_MAX != 0x0.ffffffffffffffffffffffffffcp1023L) + abort (); +#else + if (LDBL_NORM_MAX != LDBL_MAX) + abort (); +#endif + exit (0); +}