struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / bug-3081.c
blobe2ad0ba4a6c8ab65646dce64605c1ec554adfa88
1 /* bug-3081.c
2 z80 backend inserted extra whitespace in call via __z88dk_fastcall function pointer
3 for --reserve-regs-iy, confusing peephole optimizer
4 */
7 #include <testfwk.h>
9 #pragma disable_warning 283
11 #include <stdint.h>
13 #if defined(__SDCC_mcs51) || defined(__SDCC_pdk14) || defined(__SDCC_pdk15)
14 #ifdef __z88dk_fastcall
15 #undef __z88dk_fastcall
16 #endif
17 #define __z88dk_fastcall __reentrant
18 #elif !(defined(__SDCC_z80) || defined(__SDCC_z180))
19 #define __z88dk_fastcall
20 #endif
22 short example(short x) __z88dk_fastcall
24 return x+1;
27 short (*ifunc)(short arg) __z88dk_fastcall;
29 int m()
31 int i, sum;
32 ifunc = example;
33 sum = 0;
34 for (i = 0; i < 42; ++i)
35 sum += (ifunc)(i);
36 return sum;
39 void
40 testBug(void)