aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/c-c++-common/strub-tail-O2.c
blob: 043813b1de467c02197bca001f208256287267c6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/* { dg-do compile } */
/* { dg-options "-O2 -fstrub=strict -fno-exceptions -fdump-ipa-strub" } */
/* { dg-require-effective-target 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" } } */