aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/c-c++-common/musttail17.c
blob: 58fab84993bf7f39e1ac82d19c4ef0308b48d835 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/* { dg-do compile { target musttail } } */

struct box { char field[64]; int i; };

struct box __attribute__((noinline,noclone,noipa))
returns_struct (int i)
{
  struct box b;
  b.i = i * i;
  return b;
}

int __attribute__((noinline,noclone))
test_1 (int i)
{
  __attribute__((musttail)) return returns_struct (i * 5).i; /* { dg-error "cannot tail-call: " } */
}