OSDN Git Service

2009-01-10 Sebastian Pop <sebastian.pop@amd.com>
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / fastmath-1.c
1 /* { dg-do run } */
2 /* { dg-options "-O2 -ffast-math" } */
3
4 extern void abort (void);
5
6 int foo ( float* dists,  int k) 
7
8 if ( ( dists [ 0 ] > 0 ) == ( dists [ 1 ] > 0 ) ) 
9   return k;
10 return 0;
11
12 main() {
13   float dists[16] = { 0., 1., 1., 0., 0., -1., -1., 0.,
14                      1., 1., 1., -1., -1., 1., -1., -1. };
15   if ( foo(&dists[0], 1) +
16        foo(&dists[2], 2) +
17        foo(&dists[4], 4) +
18        foo(&dists[6], 8) +
19        foo(&dists[8], 16) +
20        foo(&dists[10], 32) +
21        foo(&dists[12], 64) +
22        foo(&dists[14], 128)
23         != 156)
24     abort();
25   return 0;
26 }