struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / smallc.c
blob8ade7a949a2df8c10af63e6e93aed1081ae350f0
1 /*
2 smallc.c
4 Test support for __smallc for Small-C-compatible calling convention
5 */
6 #include <testfwk.h>
7 #include <stdlib.h>
9 unsigned char f1(unsigned char c) __smallc
11 return c + 1;
14 unsigned int f2(unsigned int c) __smallc
16 return c + 1;
19 unsigned char s1(unsigned char c, unsigned char d) __smallc
21 return c - d;
24 unsigned int s2(unsigned int c, unsigned int d) __smallc
26 return c - d;
29 void
30 testSmallC(void)
32 ASSERT (f1 (23) == 24);
33 ASSERT (f2 (23) == 24);
35 ASSERT (s1 (42, 23) == 19);
36 ASSERT (s2 (42, 23) == 19);