struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / bug-3231.c
blobc5eca7f8f829b5c0c2b6111b6ace75c67e3632cd
1 /*
2 bug-3230.c
3 A bug in code generation for __z88dk_callee __critical functions with parameters.
4 */
6 #include <testfwk.h>
8 #if defined(__SDCC_mcs51) || defined(__SDCC_z80) || defined(__SDCC_z80n) || defined(__SDCC_z180) || defined(__SDCC_r2k) || defined(__SDCC_r2ka) || defined(__SDCC_r3ka) || defined(__SDCC_hc08) || defined(__SDCC_s08) || defined(__SDCC_tlcs90) || defined(__SDCC_stm8) || defined(__SDCC_f8)
9 volatile int j;
11 void f0(int i) __z88dk_callee __critical
13 j = i;
16 int f1(int i) __z88dk_callee __critical
18 return (i + j);
20 #endif
22 void testBug(void)
24 #if defined(__SDCC_mcs51) || defined(__SDCC_z80) || defined(__SDCC_z80n) || defined(__SDCC_z180) || defined(__SDCC_r2k) || defined(__SDCC_r2ka) || defined(__SDCC_r3ka) || defined(__SDCC_hc08) || defined(__SDCC_s08) || defined(__SDCC_tlcs90) || defined(__SDCC_stm8) || defined(__SDCC_f8)
25 f0(23);
26 ASSERT (j == 23);
27 ASSERT (f1(23) == 46);
28 #endif