From: bernhardheld Date: Thu, 30 Aug 2001 10:33:45 +0000 (+0000) Subject: small changes for mcs51 X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=df006cf4055614dd399c238c1f65e13def2d791b;p=fw%2Fsdcc small changes for mcs51 git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@1189 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- diff --git a/support/regression/tests/bug-221100.c b/support/regression/tests/bug-221100.c index 052b8aa2..347e1ac8 100644 --- a/support/regression/tests/bug-221100.c +++ b/support/regression/tests/bug-221100.c @@ -5,6 +5,9 @@ */ #include +#ifdef __mcs51 +xdata +#endif static unsigned int testArray[130]; diff --git a/support/regression/tests/bug-221168.c b/support/regression/tests/bug-221168.c index 623f06b4..15cc281d 100644 --- a/support/regression/tests/bug-221168.c +++ b/support/regression/tests/bug-221168.c @@ -2,7 +2,11 @@ */ #include -#define XDATA +#ifdef __mcs51 +# define XDATA xdata +#else +# define XDATA +#endif XDATA static char x[10][20]; @@ -15,5 +19,5 @@ getAddrOfCell(unsigned char y, unsigned char z) static void testMultiDimensionalAddress(void) { - ASSERT(getAddrOfCell(5, 6) == (char *)x + 106); + ASSERT(getAddrOfCell(5, 6) == (char XDATA *)x + 106); } diff --git a/support/regression/tests/bug-227710.c b/support/regression/tests/bug-227710.c index 9b57e77b..bd16d669 100644 --- a/support/regression/tests/bug-227710.c +++ b/support/regression/tests/bug-227710.c @@ -2,7 +2,7 @@ */ #include -static unsigned char _data[] = { +static unsigned char __data[] = { 1, 2, 3, 4 }; @@ -17,12 +17,12 @@ foo(void) { // BUG, there will be a PRE-increment return p[s.index++]; -} +} void testPostIncrement(void) { - p = _data; + p = __data; ASSERT(foo() == 1); ASSERT(foo() == 2); ASSERT(foo() == 3); diff --git a/support/regression/tests/staticinit.c b/support/regression/tests/staticinit.c index 75875320..c9532b55 100644 --- a/support/regression/tests/staticinit.c +++ b/support/regression/tests/staticinit.c @@ -20,6 +20,9 @@ testSmallDense(void) ASSERT(smallDense[5] == 6); } +#ifdef __mcs51 +idata +#endif static {type} smallSparse[] = { 1, 1, 1, 1, 1, 1, 1, 1, 1 }; @@ -38,6 +41,9 @@ testSmallSparse(void) ASSERT(smallSparse[8] == 1); } +#ifdef __mcs51 +idata +#endif static {type} smallSparseZero[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0 }; @@ -60,6 +66,9 @@ testSmallSparseZero(void) ASSERT(smallSparseZero[8] == 0); } +#ifdef __mcs51 +xdata +#endif static {type} largeMixed[] = { 1, 2, 3, 4, 5, 6, 7, /* 0-6 */ 1, 1, 1, 1, 1, 1, 1, 1,