summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/ipa/ipa-pta-2.c
blob: a6c7e4b4786c349218496399702e9c24ab95bcda (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/* { dg-do compile } */
/* { dg-options "-O -fipa-pta -fdump-ipa-pta-details" } */

int (*fn)(int *);

static int __attribute__((noinline,noclone))
foo (int *p)
{
  return *p;
}

extern void bar (void);

int main()
{
  fn = foo;
  bar ();
  return 0;
}

/* Make sure that when a local function escapes its argument points-to sets
   are properly adjusted.  */

/* { dg-final { scan-ipa-dump "foo.arg0 = { ESCAPED NONLOCAL }" "pta" } } */
/* { dg-final { cleanup-ipa-dump "pta" } } */