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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.c-torture/] [execute/] [ieee/] [mzero6.c] - Rev 801

Go to most recent revision | Compare with Previous | Blame | View Log

/* Tail call optimizations would convert func() into the moral equivalent of:
 
       double acc = 0.0;
       for (int i = 0; i <= n; i++)
	 acc += d;
       return acc;
 
   which mishandles the case where 'd' is -0.  They also initialised 'acc'
   to a zero int rather than a zero double.  */
 
double func (double d, int n)
{
  if (n == 0)
    return d;
  else
    return d + func (d, n - 1);
}
 
int main ()
{
  if (__builtin_copysign (1.0, func (0.0 / -5.0, 10)) != -1.0)
    abort ();
  exit (0);
}
 

Go to most recent revision | Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

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