3 syntax tests about function pointers at compile time
5 This also tests an implementation extension that allows the casting of void * to function pointers,
6 which is not available for the stm8 large memory model.
10 #pragma disable_warning 244
12 #if !defined(__SDCC_pdk14) && !defined(__SDCC_pdk15) // pdk needs functions called via pointer to be reentrant even for a single argument
31 #if !((defined __SDCC_stm8) && defined (__SDCC_MODEL_LARGE))
32 #if defined(__SDCC_ds390)
33 p
= (void __code
*) mul2
;
37 g ((int (*) (int)) p
);
41 /****************************/
43 void g (int (*h
) (int));
53 /****************************/
55 void g (int (*h
) (int));
60 int (*fp
) (int) = (int (*) (int)) p
;
65 /****************************/
70 ((void (__code
*) (void)) p
) ();
73 /****************************/
78 int (*fp
) (int) = mul2
;
83 /****************************/
88 ((void (__code
*) (void)) 0) ();
91 /****************************/
97 #if !defined(__SDCC_pdk14) && !defined(__SDCC_pdk15)
98 #if !((defined __SDCC_stm8) && defined (__SDCC_MODEL_LARGE)) // STM8 large model has sizeof(void *) != size of function pointers.