Pick three bugfixes from next branch to trunk for inclusion in 4.5.0 RC2, as discusse...
[sdcc.git] / sdcc / support / regression / tests / gcc-torture-execute-pr41317.c
blob5da50d5af541433e3aa4e101c0032c02870045de
1 /*
2 pr41317.c from the execute part of the gcc torture tests.
3 */
5 #include <testfwk.h>
7 #ifdef __SDCC
8 #pragma std_c99
9 #endif
11 struct A
13 int i;
15 struct B
17 struct A a;
18 int j;
21 static void
22 foo (struct B *p)
24 ((struct A *)p)->i = 1;
27 void
28 testTortureExecute (void)
30 struct A a;
31 a.i = 0;
32 foo ((struct B *)&a);
33 if (a.i != 1)
34 ASSERT (0);
35 return;