gcc/testsuite/gcc.dg/plugin/must-tail-call-1.c
raw| 1 | /* { dg-do compile { target tail_call } } */ |
| 2 | /* { dg-options "-fdelayed-branch" { target sparc*-*-* } } */ |
| 3 | |
| 4 | extern void abort (void); |
| 5 | |
| 6 | int __attribute__((noinline,noclone)) |
| 7 | callee (int i) |
| 8 | { |
| 9 | return i * i; |
| 10 | } |
| 11 | |
| 12 | int __attribute__((noinline,noclone)) |
| 13 | caller (int i) |
| 14 | { |
| 15 | return callee (i + 1); |
| 16 | } |
| 17 | |
| 18 | int |
| 19 | main (int argc, const char **argv) |
| 20 | { |
| 21 | int result = caller (5); |
| 22 | if (result != 36) |
| 23 | abort (); |
| 24 | return 0; |
| 25 | } |