diff options
Diffstat (limited to 'gcc/testsuite/c-c++-common/strub-tail-O2.c')
-rw-r--r-- | gcc/testsuite/c-c++-common/strub-tail-O2.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/gcc/testsuite/c-c++-common/strub-tail-O2.c b/gcc/testsuite/c-c++-common/strub-tail-O2.c new file mode 100644 index 0000000..87cda7a --- /dev/null +++ b/gcc/testsuite/c-c++-common/strub-tail-O2.c @@ -0,0 +1,14 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fstrub=strict -fno-exceptions -fdump-ipa-strub" } */ + +/* Check that the expected strub calls are issued. + Tail calls are short-circuited at -O2+. */ + +int __attribute__ ((__strub__)) +g (int i, int j) { + return g (i, j); +} + +/* { dg-final { scan-ipa-dump-times "strub_enter" 0 "strub" } } */ +/* { dg-final { scan-ipa-dump-times "strub_update" 2 "strub" } } */ +/* { dg-final { scan-ipa-dump-times "strub_leave" 0 "strub" } } */ |