struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / gcc-torture-execute-lto-tbaa-1.c
blob88fa07f95bcbd99eca3df3f60daa3e5c821acee2
1 /*
2 lto-tbaa-1.c from the execute part of the gcc torture tests.
3 */
5 #include <testfwk.h>
7 /* { dg-additional-options "-fno-early-inlining -fno-ipa-cp" } */
8 struct a {
9 float *b;
10 } *a;
11 struct b {
12 int *b;
13 } b;
14 struct c {
15 float *b;
16 } *c;
17 int d;
18 void use_a (struct a *a)
20 (void)a;
22 void set_b (int **a)
24 *a=&d;
26 void use_c (struct c *a)
28 (void)a;
30 int **retme(int **val)
32 return val;
34 int e;
35 struct b b= {&e};
36 struct b b2;
37 struct b b3;
38 int **ptr = &b2.b;
39 void
40 testTortureExecute (void)
42 a= (void *)0;
43 b.b=&e;
44 ptr =retme ( &b.b);
45 set_b (ptr);
46 b3=b;
47 ASSERT(b3.b == &d);
48 c= (void *)0;
49 return;