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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [nested-func-8.c] - Blame information for rev 695

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

Line No. Rev Author Line
1 689 jeremybenn
/* { dg-do run } */
2
/* { dg-options "-O -fno-inline" } */
3
 
4
extern void abort (void);
5
 
6
/* Return 0 and clobber the static chain.  */
7
 
8
int
9
zero (int n)
10
{
11
  int
12
  nested (int m)
13
  {
14
    return m - n;
15
  }
16
 
17
  return nested (n);
18
}
19
 
20
/* Return the triple of ARG in a convoluted manner.  */
21
 
22
int
23
triple (int arg)
24
{
25
  int
26
  read_arg (void)
27
  {
28
    return arg;
29
  }
30
 
31
  int
32
  parent (int nested_arg)
33
  {
34
    int
35
    child1 (void)
36
    {
37
      return parent (zero (5));
38
    }
39
 
40
    int
41
    child2 (void)
42
    {
43
      return nested_arg + read_arg ();
44
    }
45
 
46
    return (nested_arg == 0 ? 0 : child1 ()) + child2 ();
47
  }
48
 
49
  return parent (arg);
50
}
51
 
52
int main(void)
53
{
54
  if (triple (13) != 3 * 13)
55
    abort ();
56
  return 0;
57
}

powered by: WebSVN 2.1.0

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