OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-stable/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.dg/] [fastmath-1.c] - Blame information for rev 826

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 298 jeremybenn
/* { 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
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.