summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/torture/stackalign/nested-5.c
blob: 95eba0482f671a4df9b38ed098f3b2c8dd43caf4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/* { dg-do run } */

extern void abort (void);
extern void exit (int);

#ifndef NO_TRAMPOLINES
static void recursive (int n, void (*proc) (void))
{
  __label__ l1;

  void do_goto (void)
  {
    goto l1;
  }

  if (n == 3)
      recursive (n - 1, do_goto);
  else if (n > 0)
    recursive (n - 1, proc);
  else
    (*proc) ();
  return;

l1:
  if (n == 3)
    exit (0);
  else
    abort ();
}

int main ()
{
  recursive (10, abort);
  abort ();
}
#else
int main () { return 0; }
#endif