small changes for mcs51
authorbernhardheld <bernhardheld@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Thu, 30 Aug 2001 10:33:45 +0000 (10:33 +0000)
committerbernhardheld <bernhardheld@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Thu, 30 Aug 2001 10:33:45 +0000 (10:33 +0000)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@1189 4a8a32a2-be11-0410-ad9d-d568d2c75423

support/regression/tests/bug-221100.c
support/regression/tests/bug-221168.c
support/regression/tests/bug-227710.c
support/regression/tests/staticinit.c

index 052b8aa2c8ce5adf1af3885b83109f9d9074318f..347e1ac8d38e5feeac4a3dc1c56f110772f6596c 100644 (file)
@@ -5,6 +5,9 @@
  */
 #include <testfwk.h>
 
+#ifdef __mcs51
+xdata
+#endif
 static unsigned int
 testArray[130];
 
index 623f06b4df42fcd445cf57c15618a6354eeb4d43..15cc281d03d6f644a190f79095ec143b920409db 100644 (file)
@@ -2,7 +2,11 @@
  */
 #include <testfwk.h>
 
-#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);
 }
index 9b57e77ba4c0793753fbdfeed1bd985a4af4a619..bd16d6697d69a414fbc8352dd87039e47f63b400 100644 (file)
@@ -2,7 +2,7 @@
  */
 #include <testfwk.h>
 
-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);
index 758753203d73ea536733fb9f9b5f4b3a77d0a4fc..c9532b5515c2bdcb9ad15df5eea94cd760a6f557 100644 (file)
@@ -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,