gcc/testsuite/gcc.dg/torture/pr43879_1.c
raw| 1 | /* { dg-do run } */ |
| 2 | /* { dg-options "-fipa-pta -fno-inline" } */ |
| 3 | /* { dg-additional-sources "pr43879_2.c" } */ |
| 4 | |
| 5 | void bar(int c) |
| 6 | { |
| 7 | static int x = 1; |
| 8 | if (c != x) __builtin_abort(); |
| 9 | x--; |
| 10 | } |
| 11 | |
| 12 | void baz(int *i) |
| 13 | { |
| 14 | (*i)--; |
| 15 | } |
| 16 | |
| 17 | struct TBL { |
| 18 | int (*p)(int *i); |
| 19 | }; |
| 20 | extern struct TBL tbl; |
| 21 | |
| 22 | int main() |
| 23 | { |
| 24 | int c = 1; |
| 25 | return tbl.p(&c); |
| 26 | } |
| 27 |