summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/i386/excess-precision-2.c
blob: b5035e5a1fe325810de36518e43be7e681c18147 (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
/* Excess precision tests.  Test excess precision of constants.  */
/* { dg-do run } */
/* { dg-options "-O2 -mfpmath=387 -fexcess-precision=standard" } */

#include <float.h>

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

volatile long double ldadd1 = 1.0l + 0x1.0p-30l;
volatile long double ld11f = 1.1f;
volatile long double ld11d = 1.1;
volatile long double ld11 = 1.1;

void
test_const (void)
{
  if (1.0f + 0x1.0p-30f != ldadd1)
    abort ();
  if (ld11f != ld11)
    abort ();
  if (ld11d != ld11)
    abort ();
  if (1.1f != ld11)
    abort ();
}

int
main (void)
{
  test_const ();
  exit (0);
}