summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/pr23115.c
blob: 61408e47a8094a3714b356a7e0f87a7c08f11ab5 (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
/* { dg-do run } */
/* { dg-options "-O2 -ftree-vectorize" } */

extern void abort (void);

#define MIN2(a,b) (((a)<(b)) ? (a) : (b))
#define MAX2(a,b) (((a)>(b)) ? (a) : (b))

double p[2] = { 4., 5. };

int main()
{
  long j;
  double R, n, x;
#if __SIZEOF_DOUBLE__ >= 8
  n = 1.e300;
  x = -1.e300;
#else
  n = 1.e30;
  x = -1.e30;
#endif
  for( j=0; j < 2; j++ )
    {
      x = MAX2(x,p[j]);
      n = MIN2(n,p[j]);
    }
  R = x-n;

  if( R < 0.1 )
      abort ();

  return 0;
}