From f1d39027b7f7f496aa891d93f1979e4771c515fe Mon Sep 17 00:00:00 2001 From: borutr Date: Thu, 11 Sep 2008 19:20:36 +0000 Subject: [PATCH] * tests\bug-221100.c, tests\shifts.c, tests\absolute.c: applied patch #2105615: Some PIC16 testcase fixlets thanks Mauro Giachero git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@5234 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- ChangeLog | 6 ++++++ support/regression/tests/absolute.c | 24 +++++++++++++++--------- support/regression/tests/bug-221100.c | 6 +++--- support/regression/tests/shifts.c | 7 +++---- 4 files changed, 27 insertions(+), 16 deletions(-) diff --git a/ChangeLog b/ChangeLog index b16634f9..d12ee2b2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-09-11 Borut Razem + + * tests\bug-221100.c, tests\shifts.c, tests\absolute.c: + applied patch #2105615: Some PIC16 testcase fixlets + thanks Mauro Giachero + 2008-09-08 Maarten Brock * src/z80/gen.c (genCmpGt, genCmpLt): fixed bug 2094505 diff --git a/support/regression/tests/absolute.c b/support/regression/tests/absolute.c index e8c3b229..3f0598e4 100644 --- a/support/regression/tests/absolute.c +++ b/support/regression/tests/absolute.c @@ -4,16 +4,22 @@ */ #include +#ifdef SDCC_pic16 +# define ADDRESS(x) (0x02 ## x) +#else +# define ADDRESS(x) (0xCA ## x) +#endif + typedef struct { - int a,b; + int a,b; } TestStruct; -{mem} volatile at(0xCABC) TestStruct TestVar = {0,0}; -{mem} at(0xCAB7) char u; -{mem} at(0xCAB7) char x = 'x'; -{mem} at(0xCAB9) char y = 'y'; -{mem} at(0xCAB0) int k = 0x1234; +{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'; @@ -21,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'); diff --git a/support/regression/tests/bug-221100.c b/support/regression/tests/bug-221100.c index 2095f80b..131cd3f5 100644 --- a/support/regression/tests/bug-221100.c +++ b/support/regression/tests/bug-221100.c @@ -1,7 +1,7 @@ /* bug-221100.c - If test_index is char, loses high bit when indexes table - workaround is to use [(unsigned int) test_index] + If test_index is char, loses high bit when indexes table + workaround is to use [(unsigned int) test_index] */ #include @@ -21,7 +21,7 @@ testArray[ARRAY_SIZE] = { 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, - 100, 101, 02, 103, 104, 105, 106, 107, 108, 109, + 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, }; diff --git a/support/regression/tests/shifts.c b/support/regression/tests/shifts.c index 0eb607f9..a975cdff 100644 --- a/support/regression/tests/shifts.c +++ b/support/regression/tests/shifts.c @@ -1,9 +1,8 @@ /** Tests covering the shift operators. - disabled for pic16 sign: signed, unsigned type: char, int, long - storage: static, + storage: static, attr: volatile vals: 3 @@ -20,7 +19,7 @@ test1ShiftClasses(void) i = 30; ASSERT(i>>3 == 3); ASSERT(i<<2 == 120); - + result = i; result >>= 2; ASSERT(result == 7); @@ -46,7 +45,7 @@ test2ShiftRight(void) ASSERT(i>>8 == -1); result = i; result >>= 3; - ASSERT(result == -15); + ASSERT(result == -15); } void -- 2.30.2