summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/tree-ssa/inline-3.C
blob: f01f26cafa75d38d0ac1a594c0b9370df3d271e4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-einline" } */
/* { dg-add-options bind_pic_locally } */

#include <algorithm>

void foo(const char *s);

void
inline_me (char *x)
{
  foo(x);
}

static void
inline_me_too (char *x)
{
  foo(x);
}

int main(int argc, char **argv)
{
  std::for_each (argv, argv + argc, inline_me);
  std::for_each (argv, argv + argc, inline_me_too);
}

/* { dg-final { scan-tree-dump-times "Inlining void inline_me\\(" 1 "einline"} } */
/* { dg-final { scan-tree-dump-times "Inlining void inline_me_too\\(" 1 "einline"} } */
/* { dg-final { cleanup-tree-dump "einline" } } */