aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/c-c++-common/strub-at-calls2.c
blob: 97a3988a6b9224abfe54d904b00fe3806d03d854 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/* { dg-do compile } */
/* { dg-options "-fstrub=at-calls -fdump-ipa-strubm -fdump-ipa-strub" } */

/* g does NOT become STRUB_AT_CALLS because it's not viable.  Without inline,
   force_output is set for static non-inline functions when not optimizing, and
   that keeps only_called_directly_p from returning true, which makes
   STRUB_AT_CALLS non-viable.  It becomes STRUB_CALLABLE instead.  */
static void
g() {
}

/* f does NOT become STRUB_AT_CALLS because it is visible; it becomes
   STRUB_CALLABLE.  */
void
f() {
  g();
}

/* { dg-final { scan-ipa-dump-times "strub \[(\]" 2 "strubm" } } */
/* { dg-final { scan-ipa-dump-times "strub \[(\]callable\[)\]" 2 "strubm" } } */

/* { dg-final { scan-ipa-dump-times "strub \[(\]" 2 "strub" } } */
/* { dg-final { scan-ipa-dump-times "strub \[(\]callable\[)\]" 2 "strub" } } */