aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.dg/torture/pta-callused-1.c
blob: 5ca71c2a02e77ce7cf3460159b6b73913cbb3967 (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 run } */
/* { dg-options "-fdump-tree-alias" } */
/* { dg-skip-if "" { *-*-* } { "-O0" "-fno-fat-lto-objects" } { "" } } */

volatile int i;
int ** __attribute__((noinline,pure)) foo(int **p) { i; return p; }
int bar(void)
{
  int i = 0, j = 1;
  int *p, **q;
  p = &i;
  q = foo(&p);
  *q = &j;
  return *p;
}
extern void abort (void);
int main()
{
  if (bar() != 1)
    abort ();
  return 0;
}

/* { dg-final { scan-tree-dump "p.._. = { i j }" "alias" } } */
/* { dg-final { cleanup-tree-dump "alias" } } */