ipa-cp.c (print_all_lattices): Skip cp clones.
[official-gcc.git] / gcc / testsuite / gcc.dg / lto / pr88297_0.c
blob1a144491603b80ff34cd9d2cd5bc307433b9d360
1 /* { dg-require-effective-target lto } */
2 /* { dg-lto-options { { -flto -O3 -fipa-cp -fipa-cp-clone } } } */
3 /* { dg-lto-do run } */
5 /* In order to trigger IPA-CP cloning we have to:
7 1. Put the calls in main into a loop; otherwise everything is
8 cold and we would not clone.
10 2. Make different foos and bars actually semantically different;
11 otherwise IPA-ICF unified them (as it should).
15 volatile int g;
17 void __attribute__ ((noipa))
18 use (int v)
20 g = v;
23 static int __attribute__ ((noinline))
24 foo (int arg)
26 return 7 * arg;
29 static int __attribute__ ((noinline))
30 bar (int arg)
32 return arg * arg;
35 extern int __attribute__ ((noinline))
36 entry2 (void);
38 int __attribute__ ((noipa))
39 get_opaque_number (void)
41 return 1;
44 int main (void)
46 int i;
47 for (i = 0; i < get_opaque_number (); i++)
49 use (bar (3));
50 use (bar (4));
51 use (foo (5));
52 use (foo (6));
54 entry2 ();
56 return 0;