]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/gcc.dg/c2x-float-12.c
c: Adjust LDBL_EPSILON for C2x for IBM long double
[thirdparty/gcc.git] / gcc / testsuite / gcc.dg / c2x-float-12.c
1 /* Test C2x definition of LDBL_EPSILON. */
2 /* { dg-do run } */
3 /* { dg-options "-std=c2x -pedantic-errors" } */
4
5 #include <float.h>
6
7 extern void abort (void);
8 extern void exit (int);
9
10 int
11 main (void)
12 {
13 volatile long double x = 1.0L;
14 for (int i = 0; i < LDBL_MANT_DIG - 1; i++)
15 x /= 2;
16 if (x != LDBL_EPSILON)
17 abort ();
18 exit (0);
19 }