1/* Verify that simple indirect calls are inlined even without early
2   inlining..  */
3/* { dg-do compile } */
4/* { dg-options "-O3 -c -fdump-ipa-inline -fno-early-inlining -fno-ipa-cp"  } */
5
6extern void non_existent(int);
7
8int __attribute__ ((noinline,noclone)) get_input(void)
9{
10  return 1;
11}
12
13static void hooray ()
14{
15  non_existent (1);
16}
17
18static void hip2 (void (*g)())
19{
20  non_existent (2);
21  g ();
22}
23
24static void hip1 (void (*f)(void (*)()), void (*g)())
25{
26  non_existent (2);
27  f (g);
28}
29
30int main (int argc, int *argv[])
31{
32  int i;
33
34  for (i = 0; i < get_input (); i++)
35    hip1 (hip2, hooray);
36  return 0;
37}
38
39/* { dg-final { scan-ipa-dump "hooray\[^\\n\]*inline copy in main" "inline"  } } */
40/* { dg-final { scan-ipa-dump "hip2\[^\\n\]*inline copy in main" "inline"  } } */
41/* { dg-final { cleanup-ipa-dump "inline" } } */
42