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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-stable/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.c-torture/] [execute/] [981001-1.c] - Rev 826

Compare with Previous | Blame | View Log

#define NG   0x100L
 
unsigned long flg = 0;
 
long sub (int n)
{
  int a, b ;
 
  if (n >= 2)
    {
      if (n % 2 == 0)
	{
	  a = sub (n / 2);
 
	  return (a + 2 * sub (n / 2 - 1)) * a;
	}
      else
	{
	  a = sub (n / 2 + 1);
	  b = sub (n / 2);
 
	  return a * a + b * b;
	}
    }
  else 
    return (long) n;
}
 
int main (void)
{
  if (sub (30) != 832040L)
    flg |= NG;
 
  if (flg)
    abort ();
 
  exit (0);
}
 

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.