1 /* 2 bug3004918.c 3 */ 4 5 #include <testfwk.h> 6 #include <stdint.h> 7 8 #ifdef __SDCC_STACK_AUTO 9 #define XDATA 10 #else 11 #define XDATA __xdata 12 #endif 13 foo(uint16_t a,XDATA uint8_t b)14uint16_t foo (uint16_t a, XDATA uint8_t b) 15 { 16 return a + b; 17 } 18 19 volatile uint8_t p = 0x56; 20 volatile uint8_t q = 0x78; 21 testBug(void)22void testBug(void) 23 { 24 ASSERT (foo(p + 0x1234, q) == 0x1302); 25 } 26