PR inline-asm/84742
[official-gcc.git] / gcc / testsuite / gcc.c-torture / execute / pr15262.c
blob2110f33a04a3c224d8c3de9d5e5581378125dd61
1 /* We used to mis-compile this testcase as we did not know that
2 &a+offsetof(b,a) was the same as &a.b */
3 struct A
5 int t;
6 int i;
7 };
9 void
10 bar (float *p)
12 *p = 5.2;
15 int
16 foo(struct A *locp, int i, int str)
18 float f, g, *p;
19 int T355;
20 int *T356;
21 /* Currently, the alias analyzer has limited support for handling
22 aliases of structure fields when no other variables are aliased.
23 Introduce additional aliases to confuse it. */
24 p = i ? &g : &f;
25 bar (p);
26 if (*p > 0.0)
27 str = 1;
29 T355 = locp->i;
30 T356 = &locp->i;
31 *T356 = str;
32 T355 = locp->i;
34 return T355;
37 main ()
39 struct A loc;
40 int str;
42 loc.i = 2;
43 str = foo (&loc, 10, 3);
44 if (str!=1)
45 abort ();
46 return 0;