summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/torture/ipa-pta-2.c
blob: 768c99e823ea73d71b82c68029c3a08b11136b09 (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
/* { dg-do run } */
/* { dg-options "-fipa-pta" } */

int **x;

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

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