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

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)
{
  [[gnu::musttail]] return returns_struct (i * 5).i; /* { dg-error "cannot tail-call: " } */
}