1 /* Test return of struct / union - mcs51 code generation for calls via function pointers to functions to functions returnign struct / union is different from both no-struct function pointer calls and non-pointer calls to struct-returning functions. So we want a separate test here. Also, when this test found a bug in stm8 codegen, so it is useful beyond mcs51.
3 type: char, int, long, long long
9 #ifndef __SDCC_pdk14 // Lack of memory
10 #if !defined(__SDCC_ds390) && !defined(__SDCC_ds390) && !defined(__SDCC_hc08) && !defined(__SDCC_s08) && !defined(__SDCC_mos6502) && !defined(__SDCC_mos65c02) // struct return not yet supported
38 int g1(struct s (*f
)(void))
41 r
= (*f
)(); // Assignment of returned struct
45 int g2(struct s (*f
)(void))
47 return (*f
)().a
+ (*f
)().b
; // Access to member of returned struct
50 int h1(union u (*g
)(void))
53 r
= (*g
)(); // Assignment of returned struct
57 int h2(union u (*g
)(void))
59 return (*g
)().a
+ 1; // Access to member of returned struct
66 #if !defined(__SDCC_ds390) && !defined(__SDCC_ds390) && !defined(__SDCC_hc08) && !defined(__SDCC_s08) && !defined(__SDCC_mos6502) && !defined(__SDCC_mos65c02) // struct return not yet supported
67 #ifndef __SDCC_pdk14 // Lack of memory