2009-07-17 Richard Guenther <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gcc.dg / torture / pta-structcopy-1.c
blobbdb2acb0464ff563f1e1d8ff543e923cbe412fb2
1 /* { dg-do run } */
2 /* { dg-options "-fno-tree-sra -fdump-tree-alias" } */
3 /* { dg-skip-if "" { *-*-* } { "-O0" } { "" } } */
5 struct X
7 long l1;
8 struct Y
10 long l2;
11 int *p;
12 } y;
14 int i;
15 static int
16 foo (struct X *x)
18 struct Y y = x->y;
19 *y.p = 0;
20 i = 1;
21 return *y.p;
23 extern void abort (void);
24 int main()
26 struct X x;
27 x.y.p = &i;
28 if (foo(&x) != 1)
29 abort ();
30 return 0;
33 /* { dg-final { scan-tree-dump "points-to vars: { i }" "alias" } } */
34 /* { dg-final { cleanup-tree-dump "alias" } } */