2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / gcc.dg / fastmath-1.c
blob1194a6f7d4230ab72843f1ab52381584668a4fbd
1 /* { dg-do run } */
2 /* { dg-options "-O2 -ffast-math" } */
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 return 0;