* tests\bug-221100.c, tests\shifts.c, tests\absolute.c:
authorborutr <borutr@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Thu, 11 Sep 2008 19:20:36 +0000 (19:20 +0000)
committerborutr <borutr@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Thu, 11 Sep 2008 19:20:36 +0000 (19:20 +0000)
  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
support/regression/tests/absolute.c
support/regression/tests/bug-221100.c
support/regression/tests/shifts.c

index b16634f9c9ba29d7d14c28ed1ab4924e74fb4fa6..d12ee2b209b099f94066c6ca3f0b40a2cf6f70c1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2008-09-11 Borut Razem <borut.razem AT siol.net>
+
+       * 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 <sourceforge.brock AT dse.nl>
 
        * src/z80/gen.c (genCmpGt, genCmpLt): fixed bug 2094505
index e8c3b22970c63e423ddbd77a81bded8dab4ce19b..3f0598e48a92ae555d22f80113d57acd2733055d 100644 (file)
@@ -4,16 +4,22 @@
 */
 #include <testfwk.h>
 
+#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');
index 2095f80b3a4068c9d50aa506446fbec6750f5867..131cd3f58efe6e54e9e483d40a32cc1c0f76a63f 100644 (file)
@@ -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 <testfwk.h>
 
@@ -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,
 };
index 0eb607f91a808f4cf007377efca0e50fc71baf35..a975cdff060979b7d93aa57a4c7cc3ce872379aa 100644 (file)
@@ -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