1 /* Test large structs of odd size
2 Some ports use block move instructions 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 slightly different for objects of odd size, which is
5 not covered well in other tests.
11 #if __SDCC_BITINT_MAXWIDTH >= {width} // TODO: When we can regression-test in --std-c23 mode, use the standard macro from limits.h instead!
15 unsigned _BitInt({width
}) bi
;
20 const struct largeoddstruct struct0
= {0xaa, 23, 0x55};
21 struct largeoddstruct struct1
= {0xa5, 42, 0x5a};
23 #if !defined (__SDCC_hc08) && !defined (__SDCC_s08) && !defined (__SDCC_ds390) && !defined (__SDCC_mos6502) && !defined (__SDCC_mos65c02) // struct return not yet supported
24 struct largeoddstruct
f0(void)
29 struct largeoddstruct
f1(void)
35 struct largeoddstruct
f2(struct largeoddstruct
*p
)
40 void f3(struct largeoddstruct
*p
)
45 void compare0(struct largeoddstruct s0
)
47 ASSERT(s0
.c0
== 0xaa);
49 ASSERT(s0
.c1
== 0x55);
52 void compare1(struct largeoddstruct s1
)
54 ASSERT(s1
.c0
== 0xa5);
56 ASSERT(s1
.c1
== 0x5a);
60 void testLargeOddStruct (void)
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
;
75 #ifndef __SDCC_ds390 // struct return support incomplete for ds390