aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/c2x-float-12.c
blob: 40900bd918ae43dd10ec2d2f48acde5c78235e45 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/* Test C2x definition of LDBL_EPSILON.  */
/* { dg-do run } */
/* { dg-options "-std=c2x -pedantic-errors" } */

#include <float.h>

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

int
main (void)
{
  volatile long double x = 1.0L;
  for (int i = 0; i < LDBL_MANT_DIG - 1; i++)
    x /= 2;
  if (x != LDBL_EPSILON)
    abort ();
  exit (0);
}