struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / bug-2253.c
blob04deeb0f8f77d5fba8793d7b27a7821f537ca9b4
1 /*
2 bug-2253.c was a bug in operand handling of operands that are outside the stack-pointer-offset range in code generation for wide division in the stm8 port.
3 */
5 #include <testfwk.h>
7 /* Reduce array size for ports that can't handle large local variables */
8 #if !defined(__SDCC_mcs51) && !defined(__SDCC_ds390) && !defined(__SDCC_pic14) && !defined(__SDCC_pic16) && !defined(__SDCC_pdk14) && !defined(__SDCC_pdk15) && !defined(__SDCC_STACK_AUTO)
9 #define ARRAYSIZE 255
10 #else
11 #define ARRAYSIZE 2
12 #endif
14 char ad(char *p)
19 unsigned int ss(unsigned int c, unsigned int d)
21 char s1[ARRAYSIZE];
22 ad(s1);
23 return c / d;
26 void testBug(void)
28 ASSERT(ss(4, 2) == 2);