struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / bug-2373.c
blob8cb444caf420366ca3170d071576f6a836f7d89e
1 /** Bug 2373
2 */
3 #include <testfwk.h>
5 char func(char a)
7 return a-1;
10 static char a;
12 static struct
14 char c;
15 } s;
17 static char (* __xdata func_ptr) (char);
19 void
20 testFptr(void)
22 #if !defined( __SDCC_pdk14) && !defined( __SDCC_pdk15) // pdk needs function pointer to be reentrant even for a single argument
23 char b = 10;
24 a = 10;
25 s.c = 10;
27 func_ptr=func;
29 // works as expected
30 ASSERT(func_ptr(a) == 9);
31 ASSERT(func_ptr(b) == 9);
33 // error passing s.c to func
34 ASSERT(func_ptr(s.c) == 9);
35 #endif