struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / bug-3256.c
blob2a0d7302b8367fbb38b3fbba18179aa5d3bb4987
1 /*
2 bug-3256.c
3 A bug in the stm8 peephole optimizer for functions calls through function pointers where the caller has no non-pointer calls, and the callee has register arguments.
4 */
6 #include <testfwk.h>
8 #ifndef __SDCC_stm8
9 #define __raisonance
10 #endif
12 int (*volatile twocharargptr)(char, char) __raisonance __reentrant;
14 int f(void)
16 return (*twocharargptr)(23, 42);
19 int twochararg(char a, char b) __raisonance __reentrant
21 return a + b;
24 void
25 testBug(void)
27 twocharargptr = &twochararg;
28 ASSERT (f() == 23 + 42);