struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / bug-2912.c
blob7468241dd25591b20318c672b3f2cbc75e56c96a
1 /*
2 bug-2912.c a bug in handling non-spilt register parameters in __z88dk_fastcall functions.
3 */
5 #include <testfwk.h>
7 #ifdef __SDCC
8 #pragma disable_warning 85
9 #endif
11 #if !defined(__SDCC_pdk14) && !defined(__SDCC_pdk15) // lack of memory
12 float y, z;
14 float m32_sinf (float x) __z88dk_fastcall
16 y = x;
19 float m32_cosf (float x) __z88dk_fastcall
21 z = y;
24 float m32_tanf (float x) __z88dk_fastcall
26 return m32_sinf(x)/m32_cosf(x);
28 #endif
30 void testBug(void)
32 #if !defined(__SDCC_pdk14) && !defined(__SDCC_pdk15) // lack of memory
33 volatile float x = 23.0f;
35 m32_tanf(x);
37 ASSERT(y == x);
38 ASSERT(z == x);
39 #endif