Merge to HEAD at tree-cleanup-merge-20041024 .
[official-gcc.git] / gcc / testsuite / gcc.dg / fastmath-1.c
blob4efe43004678c6d9d89544579f961e8d145c3e15
1 /* { dg-do run } */
2 /* { dg-options "-O2 -ffast-math" } */
4 extern void abort (void);
6 int foo ( float* dists, int k)
7 {
8 if ( ( dists [ 0 ] > 0 ) == ( dists [ 1 ] > 0 ) )
9 return k;
10 return 0;
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;