]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/testsuite/gcc.dg/torture/pr39074-2.c
2009-04-03 Richard Guenther <rguenther@suse.de>
[thirdparty/gcc.git] / gcc / testsuite / gcc.dg / torture / pr39074-2.c
CommitLineData
c5168a9e 1/* { dg-do run } */
2/* { dg-require-effective-target stdint_types } */
3/* { dg-options "-fdump-tree-alias" } */
4/* { dg-skip-if "" { *-*-* } { "-O0" } { "" } } */
5
6#include <stdint.h>
7
8int i;
9uintptr_t __attribute__((noinline,const)) bar(int ***p) { return (uintptr_t)p; }
10void __attribute__((noinline))
11foo(void)
12{
13 int *y;
14 int **a = &y, **x;
15 int ***p;
16 uintptr_t b;
17 b = bar(&a);
18 p = (int ***)b;
19 x = *p;
20 *x = &i; /* *ANYTHING = &i has to make sure that y points to i. */
21 *y = 0;
22}
23extern void abort (void);
24int main()
25{
26 i = 1;
27 foo ();
28 if (i != 0)
29 abort ();
30 return 0;
31}
32
dd277d48 33/* { dg-final { scan-tree-dump "y.._., points-to vars: { i }" "alias" } } */
c5168a9e 34/* { dg-final { cleanup-tree-dump "alias" } } */