1 /* Test large structs of odd size
2 Some ports use blockmoveinstructions for handling large objects, in particular
3 for assignment, read and write via pointers, passing as parameters and returning.
4 Sometimes the code path is sloghtly different for objects of odd size.
10 #if __SDCC_BITINT_MAXWIDTH >= {width} // TODO: When we can regression-test in --std-c23 mode, use the standard macro from limits.h instead!
14 unsigned _BitInt({width
}) bi
;
19 const struct largeoddstruct struct0
= {0xaa, 23, 0x55};
20 struct largeoddstruct struct1
= {0xa5, 42, 0x5a};
22 #if !defined (__SDCC_hc08) && !defined (__SDCC_s08) && !defined (__SDCC_ds390) && !defined (__SDCC_mos6502) && !defined (__SDCC_mos65c02) // struct return not yet supported
23 struct largeoddstruct
f0(void)
28 struct largeoddstruct
f1(void)
34 struct largeoddstruct
f2(struct largeoddstruct
*p
)
39 void f3(struct largeoddstruct
*p
)
44 void compare0(struct largeoddstruct s0
)
46 ASSERT(s0
.c0
== 0xaa);
48 ASSERT(s0
.c1
== 0x55);
51 void compare1(struct largeoddstruct s1
)
53 ASSERT(s1
.c0
== 0xa5);
55 ASSERT(s1
.c1
== 0x5a);
59 void testLargeOddStruct (void)
61 #if !(defined(__SDCC_mcs51) && defined(__SDCC_STACK_AUTO)) // Bug #3804
62 #if __SDCC_BITINT_MAXWIDTH >= {width} // TODO: When we can regression-test in --std-c23 mode, use the standard macro from limits.h instead!
63 #if !defined (__SDCC_hc08) && !defined (__SDCC_s08) && !defined (__SDCC_ds390) && !defined (__SDCC_mos6502) && !defined (__SDCC_mos65c02) // struct return not yet supported
64 struct largeoddstruct s
;