struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / z88dk.c
blobb3e06e770555de46a3b813e30e6bf353f000e3c8
1 /** z88dk.c
2 */
3 #include <testfwk.h>
4 #include <stdlib.h>
6 #ifndef __SDCC_pdk14
8 unsigned char f1(unsigned char c) __z88dk_fastcall
10 return c + 1;
13 unsigned int f2(unsigned int c) __z88dk_fastcall
15 return c + 1;
18 #if !defined(__SDCC_hc08) && !defined(__SDCC_s08) && !defined(__SDCC_mos6502) && !defined(__SDCC_mos65c02)
19 unsigned long int f4(unsigned long int c) __z88dk_fastcall
20 #else
21 unsigned long int f4(unsigned long int c) __z88dk_fastcall __reentrant
22 #endif
24 return c + 1;
27 unsigned char (*p1)(unsigned char) __z88dk_fastcall;
28 unsigned int (*p2)(unsigned int) __z88dk_fastcall;
29 #if !defined(__SDCC_hc08) && !defined(__SDCC_s08) && !defined(__SDCC_mos6502) && !defined(__SDCC_mos65c02)
30 unsigned long int (*p4)(unsigned long int) __z88dk_fastcall;
31 #else
32 unsigned long int (*p4)(unsigned long int) __z88dk_fastcall __reentrant;
33 #endif
35 void s1(int x, int y) __smallc;
37 void s2(int x, int y) __z88dk_callee;
39 void s3(int x, int y) __smallc __z88dk_callee;
40 #endif
42 void
43 testZ88dk(void)
45 #if !defined(__SDCC_pdk14) && !defined(__SDCC_pdk15)
46 ASSERT (f1 (23) == 24);
47 ASSERT (f2 (23) == 24);
48 ASSERT (f4 (23) == 24);
50 p1 = &f1;
51 p2 = &f2;
52 p4 = &f4;
54 ASSERT ((*p1) (23) == 24);
55 ASSERT ((*p2) (23) == 24);
56 ASSERT ((*p4) (23) == 24);
57 #endif