gcc/testsuite/gcc.dg/ipa/ipa-pta-2.c
raw| 1 | /* { dg-do compile } */ |
| 2 | /* { dg-options "-O -fipa-pta -fdump-ipa-pta2-details" } */ |
| 3 | |
| 4 | int (*fn)(int *); |
| 5 | |
| 6 | static int __attribute__((noinline,noclone)) |
| 7 | foo (int *p) |
| 8 | { |
| 9 | return *p; |
| 10 | } |
| 11 | |
| 12 | extern void bar (void); |
| 13 | |
| 14 | int main() |
| 15 | { |
| 16 | fn = foo; |
| 17 | bar (); |
| 18 | return 0; |
| 19 | } |
| 20 | |
| 21 | /* Make sure that when a local function escapes its argument points-to sets |
| 22 | are properly adjusted. */ |
| 23 | |
| 24 | /* { dg-final { scan-ipa-dump "foo.arg0 = { ESCAPED NONLOCAL }" "pta2" } } */ |