struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / bug1477149.c.in
blob07f4eea194a92c71f12d24aa7e291fc7f803bb27
1 /* bug1477149.c
2 multiple definition of local symbol both normal and debug
3 second module is fwk/lib/statics.c
4 type: long, float
5 */
7 #include <testfwk.h>
9 #if !defined( __SDCC_pdk14) && !defined(__SDCC_pdk15) // Lack of memory
10 static {type} {type}_1 = 2;
12 static {type} s_get_{type}_1(void)
14 {type} alfa = {type}_1;
15 {type} beta = {type}_1 + alfa;
16 {type} gamma = {type}_1 + beta;
17 return alfa + beta + gamma;
20 /* bug 3038028 */
21 static char s_get_indexed(char index, char *msg)
23 /* "float" will put _s_get_indexed_PARM_2 in DSEG,
24 * "long" will put _s_get_indexed_PARM_2 in OSEG
26 {type} idx = index;
27 return msg[(char)(idx+1)];
30 {type} get_{type}_1(void);
31 char get_indexed(char index, char *msg);
32 #endif
34 void testBug(void)
36 #if !defined( __SDCC_pdk14) && !defined(__SDCC_pdk15) // Lack of memory
37 ASSERT (s_get_{type}_1() == 12);
38 ASSERT (get_{type}_1() == 6);
39 ASSERT (s_get_indexed(1, "One") == 'e');
40 ASSERT (get_indexed(1, "One") == 'n');
41 #endif