aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/plugin/must-tail-call-1.c
blob: 3a6d4cceaba756f5f8acb832c5e7e066dccd0957 (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
/* { dg-do compile { target tail_call } } */
/* { dg-options "-fdelayed-branch" { target sparc*-*-* } } */

extern void abort (void);

int __attribute__((noinline,noclone))
callee (int i)
{
  return i * i;
}

int __attribute__((noinline,noclone))
caller (int i)
{
  return callee (i + 1);
}

int
main (int argc, const char **argv)
{
  int result = caller (5);
  if (result != 36)
    abort ();
  return 0;
}