re PR c++/71973 (c++ handles built-in functions inconsistently)
[gcc.git] / gcc / testsuite / g++.dg / tree-ssa / inline-1.C
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fdump-tree-einline --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
10 foreach (T b, T e, void (*ptr)(E))
11 {
12 for (; b != e; b++)
13 ptr(*b);
14 }
15
16 void
17 inline_me (char *x)
18 {
19 std::puts(x);
20 }
21
22 static void
23 inline_me_too (char *x)
24 {
25 std::puts(x);
26 }
27
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"} } */