diff options
Diffstat (limited to 'gcc/testsuite/c-c++-common/musttail17.c')
-rw-r--r-- | gcc/testsuite/c-c++-common/musttail17.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/gcc/testsuite/c-c++-common/musttail17.c b/gcc/testsuite/c-c++-common/musttail17.c new file mode 100644 index 0000000..490f3c3 --- /dev/null +++ b/gcc/testsuite/c-c++-common/musttail17.c @@ -0,0 +1,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) +{ + __attribute__((musttail)) return returns_struct (i * 5).i; /* { dg-error "cannot tail-call: " } */ +} |