1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fdump-tree-einline-optimized --param max-early-inliner-iterations=3" } */
3 /* { dg-add-options bind_pic_locally } */
4 
5 namespace std {
6   extern "C" int puts(const char *s);
7 }
8 
9 template <class T, class E> void
foreach(T b,T e,void (* ptr)(E))10 foreach (T b, T e, void (*ptr)(E))
11 {
12   for (; b != e; b++)
13     ptr(*b);
14 }
15 
16 void
inline_me(char * x)17 inline_me (char *x)
18 {
19   std::puts(x);
20 }
21 
22 static void
inline_me_too(char * x)23 inline_me_too (char *x)
24 {
25   std::puts(x);
26 }
27 
main(int argc,char ** argv)28 int main(int argc, char **argv)
29 {
30   foreach (argv, argv + argc, inline_me);
31   foreach (argv, argv + argc, inline_me_too);
32 }
33 
34 /* { dg-final { scan-tree-dump-times "Inlining void inline_me\\(" 1 "einline"} } */
35 /* { dg-final { scan-tree-dump-times "Inlining void inline_me_too\\(" 1 "einline"} } */
36