1 /* Verify that indirect inlining machinery can remove references to functions
2 passed as parameters that are never used. */
3 /* { dg-do compile } */
4 /* { dg-options "-O3 -fno-early-inlining -fno-ipa-sra -fno-ipa-cp -fdump-ipa-inline -fdump-tree-optimized" } */
5
6 extern int __attribute__ ((noinline, noclone, used))
stuff(int i)7 stuff (int i)
8 {
9 return 0;
10 }
11
hooray()12 static void hooray ()
13 {
14 stuff (1);
15 }
16
hiphip(void (* f)())17 static int hiphip (void (*f)())
18 {
19 return stuff (2);
20 }
21
main(void)22 int main (void)
23 {
24 return hiphip (hooray);
25 }
26
27 /* { dg-final { scan-ipa-dump "ipa-prop: Removed a reference" "inline" } } */
28 /* { dg-final { scan-tree-dump-not "hooray" "optimized" } } */
29