struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / div.c
blobe29c74266b34bafdff85601a83f6bb1e84a6d8b3
1 /* Test return of div functions
3 */
4 #include <testfwk.h>
6 #include <stdlib.h>
8 void testDiv(void)
10 #if !defined(__SDCC_ds390) && !defined(__SDCC_ds390) && !defined(__SDCC_hc08) && !defined(__SDCC_s08) // struct return not yet supported
11 ASSERT (div(4223, 23).quot == 4223 / 23);
12 ASSERT (div(4223, 23).rem == 4223 % 23);
13 #if !defined(__SDCC_pdk13) && !defined(__SDCC_pdk14) && !defined(__SDCC_pdk15) && !(defined(__SDCC_mcs51) && defined(__SDCC_MODEL_SMALL))// Lack of memory
14 ASSERT (ldiv(4223, 23).quot == 4223l / 23);
15 ASSERT (ldiv(4223, 23).rem == 4223l % 23);
16 #if !defined(__SDCC_mos6502) && !defined(__SDCC_mos65c02) // no support for struct return with size > 8
17 ASSERT (lldiv(4223, 23).quot == 4223ll / 23);
18 ASSERT (lldiv(4223, 23).rem == 4223ll % 23);
19 #endif
20 #endif
21 #endif