OSDN Git Service

* config/i386/i386.md (UNSPEC_VSIBADDR): New.
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / nested-func-8.c
1 /* { 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 }