gcc/testsuite/gcc.dg/torture/pr94947-1.c
raw| 1 | /* { dg-do run } */ |
| 2 | /* { dg-additional-sources "pr94947-2.c" } */ |
| 3 | /* { dg-additional-options "-fipa-pta -flto-partition=1to1" } */ |
| 4 | /* { dg-prune-output "warning: using serial compilation" } */ |
| 5 | |
| 6 | extern void abort (); |
| 7 | extern void baz (); |
| 8 | extern void (*baz_call)(); |
| 9 | static int *p; |
| 10 | |
| 11 | static void foo () |
| 12 | { |
| 13 | if (*p != 1) |
| 14 | abort (); |
| 15 | } |
| 16 | |
| 17 | int main() |
| 18 | { |
| 19 | int x = 1; |
| 20 | p = &x; |
| 21 | baz_call = foo; |
| 22 | baz (); |
| 23 | return 0; |
| 24 | } |