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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.2.2/] [gcc/] [testsuite/] [gcc.c-torture/] [execute/] [981001-1.c] - Blame information for rev 237

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

Line No. Rev Author Line
1 149 jeremybenn
#define NG   0x100L
2
 
3
unsigned long flg = 0;
4
 
5
long sub (int n)
6
{
7
  int a, b ;
8
 
9
  if (n >= 2)
10
    {
11
      if (n % 2 == 0)
12
        {
13
          a = sub (n / 2);
14
 
15
          return (a + 2 * sub (n / 2 - 1)) * a;
16
        }
17
      else
18
        {
19
          a = sub (n / 2 + 1);
20
          b = sub (n / 2);
21
 
22
          return a * a + b * b;
23
        }
24
    }
25
  else
26
    return (long) n;
27
}
28
 
29
int main (void)
30
{
31
  if (sub (30) != 832040L)
32
    flg |= NG;
33
 
34
  if (flg)
35
    abort ();
36
 
37
  exit (0);
38
}

powered by: WebSVN 2.1.0

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