X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=support%2Fregression%2Ftests%2Fabsolute.c;h=3f0598e48a92ae555d22f80113d57acd2733055d;hb=3bd25d75bcad68055bb616dcc29dde8a2965965e;hp=cfc5b140c10a3e6a1915a0a169fe00872eb5e264;hpb=28e26703880560af06ad6fd7b1d0d123587de26e;p=fw%2Fsdcc diff --git a/support/regression/tests/absolute.c b/support/regression/tests/absolute.c index cfc5b140..3f0598e4 100644 --- a/support/regression/tests/absolute.c +++ b/support/regression/tests/absolute.c @@ -4,10 +4,22 @@ */ #include -{mem} at(0xCAB7) char u; -{mem} at(0xCAB7) char x = 'x'; -{mem} at(0xCAB9) char y = 'y'; -{mem} at(0xCAB0) int k = 0x1234; +#ifdef SDCC_pic16 +# define ADDRESS(x) (0x02 ## x) +#else +# define ADDRESS(x) (0xCA ## x) +#endif + +typedef struct +{ + int a,b; +} TestStruct; + +{mem} volatile at(ADDRESS(BC)) TestStruct TestVar = {0,0}; +{mem} at(ADDRESS(B7)) char u; +{mem} at(ADDRESS(B7)) char x = 'x'; +{mem} at(ADDRESS(B9)) char y = 'y'; +{mem} at(ADDRESS(B0)) int k = 0x1234; char z = 'z'; @@ -15,9 +27,9 @@ void testAbsolute(void) { #if defined(SDCC_mcs51) || defined(SDCC_ds390) || defined(SDCC_hc08) - static {mem} at(0xCAB6) char s = 's'; - char {mem} *pC = (char {mem} *)(0xCAB0); - int {mem} *pI = (int {mem} *)(0xCAB0); + static {mem} at(ADDRESS(B6)) char s = 's'; + char {mem} *pC = (char {mem} *)(ADDRESS(B0)); + int {mem} *pI = (int {mem} *)(ADDRESS(B0)); ASSERT(u == 'x'); ASSERT(pC[7] == 'x');