2008-05-30 Vladimir Makarov <vmakarov@redhat.com>
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / alias-18.c
blob9ef3f2aadb76be83b8409692dee2896b0cf338d4
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fdump-tree-fre-details -fdump-tree-optimized --param max-aliased-vops=0" } */
4 struct A {
5 int i;
6 int j;
7 float x;
8 };
9 struct B {
10 struct A a;
11 int k;
14 int g;
16 int test0 (struct A *p, struct A *q)
18 p->i = 0;
19 q->j = -1;
20 return p->i;
23 int test1 (struct A *p, struct B *q)
25 p->i = 1;
26 q->k = -1;
27 return p->i;
30 int test2 (struct A *p, struct B *q)
32 p->i = 2;
33 q->a.i = -1;
34 return p->i;
37 int test3 (struct A *p, struct B *q)
39 p->i = 3;
40 q->a.j = -1;
41 return p->i;
44 int test4 (struct A *p)
46 g = 4;
47 p->i = -1;
48 return g;
51 int test5 (struct A *p)
53 p->i = 5;
54 g = -1;
55 return p->i;
58 int test6 (struct A *p, int *q)
60 p->i = 6;
61 *q = -1;
62 return p->i;
65 int test7 (struct A *p, int *q)
67 p->j = 7;
68 *q = -1;
69 return p->j;
72 int test8 (struct A *p, int *q)
74 *q = 8;
75 p->x = -1;
76 return *q;
79 /* { dg-final { scan-tree-dump "with 0" "fre" } } */
80 /* { dg-final { scan-tree-dump "with 1" "fre" { xfail *-*-* } } } */
81 /* { dg-final { scan-tree-dump "with 3" "fre" } } */
82 /* { dg-final { scan-tree-dump "with 4" "fre" } } */
83 /* { dg-final { scan-tree-dump "with 5" "fre" } } */
84 /* { dg-final { scan-tree-dump "with 8" "fre" } } */
85 /* { dg-final { scan-tree-dump-not "return 2;" "optimized" } } */
86 /* { dg-final { scan-tree-dump-not "return 6;" "optimized" } } */
87 /* { dg-final { scan-tree-dump-not "return 7;" "optimized" } } */
88 /* { dg-final { scan-tree-dump-not "return -1;" "optimized" } } */
89 /* { dg-final { cleanup-tree-dump "fre" } } */
90 /* { dg-final { cleanup-tree-dump "optimized" } } */