OSDN Git Service

Fix fastmath-specific crash PR 7133.
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / fastmath-1.c
1 /* { dg-do run } */
2 /* { dg-options "-O2 -ffast-math" } */
3
4 int foo ( float* dists,  int k) 
5
6 if ( ( dists [ 0 ] > 0 ) == ( dists [ 1 ] > 0 ) ) 
7   return k;
8 return 0;
9
10 main() {
11   float dists[16] = { 0., 1., 1., 0., 0., -1., -1., 0.,
12                      1., 1., 1., -1., -1., 1., -1., -1. };
13   if ( foo(&dists[0], 1) +
14        foo(&dists[2], 2) +
15        foo(&dists[4], 4) +
16        foo(&dists[6], 8) +
17        foo(&dists[8], 16) +
18        foo(&dists[10], 32) +
19        foo(&dists[12], 64) +
20        foo(&dists[14], 128)
21         != 156)
22     abort();
23 }