gcc/testsuite/gcc.dg/tree-prof/crossmodule-indircall-1.c
raw| 1 | /* { dg-require-effective-target lto } */ |
| 2 | /* { dg-additional-sources "crossmodule-indircall-1a.c" } */ |
| 3 | /* { dg-options "-O3 -flto -DDOJOB=1" } */ |
| 4 | |
| 5 | int a; |
| 6 | extern void (*p[5])(int n); |
| 7 | void abort (void); |
| 8 | int |
| 9 | main() |
| 10 | { int i; |
| 11 | |
| 12 | /* This call shall be converted. */ |
| 13 | for (i = 0;i<1000;i++) |
| 14 | p[0](1); |
| 15 | /* This call shall not be converted. */ |
| 16 | for (i = 0;i<1000;i++) |
| 17 | p[i%5](2); |
| 18 | if (a != -1000) |
| 19 | abort (); |
| 20 | |
| 21 | return 0; |
| 22 | } |