libcpp, c, middle-end: Optimize initializers using #embed in C
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-prof / crossmodule-indir-call-topn-1.c
blobf6ec71a9298d425d8715240e7d9a729813b942cb
1 /* { dg-require-effective-target lto } */
2 /* { dg-require-profiling "-fprofile-generate" } */
3 /* { dg-additional-sources "crossmodule-indir-call-topn-1a.c" } */
4 /* { dg-options "-O2 -flto -DDOJOB=1 -fdump-ipa-profile_estimate" } */
6 #ifdef FOR_AUTOFDO_TESTING
7 #define MAXITER 350000000
8 #else
9 #define MAXITER 3500000
10 #endif
12 #include <stdio.h>
14 typedef int (*fptr) (int);
15 int
16 one (int a);
18 int
19 two (int a);
21 fptr table[] = {&one, &two};
23 int
24 main()
26 int i, x;
27 fptr p = &one;
29 x = one (3);
31 for (i = 0; i < MAXITER; i++)
33 x = (*p) (3);
34 p = table[x];
36 printf ("done:%d\n", x);
39 /* { dg-final-use-not-autofdo { scan-pgo-wpa-ipa-dump "2 \\(200.00%\\) speculations produced." "profile_estimate" } } */