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-pr60017.c
blob3829c9f45eacec9704e573bd2c39d55964d4415f
1 /*
2 pr60003.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 /* PR target/60017 */
13 struct S0
15 short m0;
16 short m1;
19 struct S1
21 unsigned m0:1;
22 char m1[2][2];
23 struct S0 m2[2];
26 struct S1 x = { 1, {{2, 3}, {4, 5}}, {{6, 7}, {8, 9}} };
28 #ifndef __SDCC_mcs51 // mcs51 does not yet support returning struct
29 #if !defined(__SDCC_hc08) && !defined(__SDCC_s08) && !defined(__SDCC_mos6502) && !defined(__SDCC_mos65c02) // Bug #3356
30 #if !defined(__SDCC_ds390) // Bug #3362
31 struct S1 func (void)
33 return x;
35 #endif
36 #endif
37 #endif
39 void
40 testTortureExecute (void)
42 #if 0 // Enable when sdcc support struct initzalization as below
43 struct S1 ret = func ();
45 if (ret.m2[1].m1 != 9)
46 ASSERT (0);
47 #endif