summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/i386/excess-precision-5.c
blob: 1cc7e589cfa3a65c5eee03bea3984ea214b41ca4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/* Excess precision tests.  Verify excess precision doesn't affect
   actual types.  */
/* { dg-do compile } */
/* { dg-options "-mfpmath=387 -fexcess-precision=standard" } */

float f;
double d;

void
test_types (void)
{
  float *fp;
  double *dp;
#define CHECK_FLOAT(E) fp = &(typeof(E)){0}
#define CHECK_DOUBLE(E) dp = &(typeof(E)){0}
  CHECK_FLOAT (f + f);
  CHECK_DOUBLE (d + d);
  CHECK_FLOAT (f * f / f);
  CHECK_DOUBLE (d * d / d);
  CHECK_FLOAT (f ? f - f : f);
  CHECK_DOUBLE (d ? d - d : d);
}