2 sdcccall.c. Test support for differnrt ABI versions.
3 typearg: unsigned char, unsigned int
4 typeret: unsigned char, unsigned int
10 #if (defined(__SDCC_stm8) || defined(__SDCC_sm83) || defined(__SDCC_z80) || defined(__SDCC_z80n) || defined(__SDCC_z180))
11 #define SDCCCALL __sdcccall({version})
16 {typeret
} f({typearg
} i
) SDCCCALL
21 {typeret
} g({typearg
} i
, unsigned int j
) SDCCCALL
26 #ifndef __SDCC_pic16 // TODO: enable when pic16 supports long long
27 {typeret
} h({typearg
} i
, unsigned int j
, unsigned long long k
) SDCCCALL
33 {typeret
} f_wrap_default({typearg
} i
)
38 {typeret
} f_wrap_explicit({typearg
} i
) SDCCCALL
44 testCallingConvention(void)
46 ASSERT(f(23) == ({typeret
})24);
47 ASSERT(g(23, 1001u) == ({typeret
})1024ul);
48 #ifndef __SDCC_pic16 // TODO: enable when pic16 supports long long
49 ASSERT(h(23, 1001u, 10000000000ul) == ({typeret
})10000001024ull);
51 ASSERT(f_wrap_default(23) == ({typeret
})24);
52 ASSERT(f_wrap_explicit(23) == ({typeret
})24);