LWG 3035. std::allocator's constructors should be constexpr
[official-gcc.git] / gcc / testsuite / gcc.dg / ipa / remref-2b.c
blob698e74964e5b80be538d994246af7aa6d24d8a44
1 /* Verify that indirect inlining can also remove references of the functions it
2 discovers calls for, even when nodes being inlined are virtual IPA-CP
3 clones. */
4 /* { dg-do compile } */
5 /* { dg-options "-O3 -fno-early-inlining -fdump-ipa-cp-details -fdump-ipa-inline -fdump-tree-optimized -fno-ipa-icf" } */
8 int global;
10 void __attribute__ ((noinline, noclone, used))
11 stuff (int i)
13 global = i;
16 int __attribute__ ((noinline,noclone)) get_input(void)
18 return 1;
21 static void
22 hooray_1 ()
24 stuff (1);
27 static inline void
28 hip2_1 (void (*g)())
30 int i;
31 g ();
32 /* Some stuff to make the function bigger so that hip1_1 gets inlined
33 fiorst. */
34 for (i = 0; i < get_input (); i++)
36 stuff (2);
37 stuff (2+2);
41 static inline void
42 hip1_1 (void (*g)())
44 hip2_1 (g);
47 static void
48 hooray_2 ()
50 stuff (1);
53 static inline void
54 hip2_2 (void (*g)())
56 g ();
59 static inline void
60 hip1_2 (void (*g)())
62 int i;
64 hip2_2 (g);
66 /* Some stuff to make the function bigger so that hip2_2 gets inlined
67 fiorst. */
68 for (i = 0; i < get_input (); i++)
70 stuff (2);
71 stuff (2+2);
75 int
76 main (int argc, int *argv[])
78 int i;
80 for (i = 0; i < get_input (); i++)
82 hip1_1 (hooray_1);
83 hip1_2 (hooray_2);
85 return 0;
88 /* { dg-final { scan-ipa-dump-times "removing its cloning-created reference" 2 "cp" } } */
89 /* { dg-final { scan-ipa-dump "ipa-prop: Removed a reference" "inline" } } */
90 /* { dg-final { scan-ipa-dump-times "ipa-prop: Removing cloning-created reference" 2 "inline" } } */
91 /* { dg-final { scan-tree-dump-not "hooray" "optimized" } } */