summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/ipa/ipa-pta-5.c
blob: 3359c534aaba54e5c87db61db71c1e7fcc297bd1 (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
26
/* { dg-do run } */
/* { dg-options "-O2 -fipa-pta -fdump-ipa-pta-details" } */

int **x;

static int __attribute__((noinline,noclone))
foo (int **q)
{
  int a = 1;
  **q = 0;
  *x = &a;
  return **q;
}

extern void abort (void);
int main()
{
  int b;
  int *p = &b;
  x = &p;
  if (foo (&p) != 1)
    abort ();
  return 0;
}

/* { dg-final { cleanup-ipa-dump "pta" } } */