* support/regression/ports/pic16/specs.mk: removed stack size linker
authorborutr <borutr@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Mon, 22 May 2006 20:04:51 +0000 (20:04 +0000)
committerborutr <borutr@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Mon, 22 May 2006 20:04:51 +0000 (20:04 +0000)
  directive
* support/regression/tests/array.c,
  support/regression/tests/bitopcse.c,
  support/regression/tests/bug-908454.c,
  support/regression/tests/malloc.c: modified for pic16 regression test
* support/regression/tests/bitfields.c:
  pic16 - excluded bitfileds of size > 8
* support/regression/tests/bp.c: pic16 - reduced data size
* support/regression/tests/bug-221100.c: pic16 - reduced data size
* support/regression/tests/bug-460010.c:
  pic16 - used the absolute address the fits in memory
* support/regression/tests/bug-716242.c:
  bug [ 1443651 ] pic 16: redefining symbol that cannot be redefined.
* support/regression/tests/float.c:
  pic16 - excluded - data size too big
* support/regression/tests/onebyte.c:
  pic16 - bug [ 1444425 ] onebyte.c regression tes fails on pic16
* support/regression/tests/shifts.c:
  pic16 - function names probably have to differ in first X characters
  (gpasm limitation?)
* support/regression/tests/staticinit.c:
  pic16 - excluded some tests due error: no target memory available for
  section ".idata"

git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@4185 4a8a32a2-be11-0410-ad9d-d568d2c75423

15 files changed:
ChangeLog
support/regression/ports/pic16/spec.mk
support/regression/tests/array.c
support/regression/tests/bitfields.c
support/regression/tests/bitopcse.c
support/regression/tests/bp.c
support/regression/tests/bug-221100.c
support/regression/tests/bug-460010.c
support/regression/tests/bug-716242.c
support/regression/tests/bug-908454.c
support/regression/tests/float.c
support/regression/tests/malloc.c
support/regression/tests/onebyte.c
support/regression/tests/shifts.c
support/regression/tests/staticinit.c

index a58aafcb116883202080b6ac15db125117b1b4d4..9cd477a968bf45ef09d747025c9b5a51e0e706a6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,30 @@
+2006-05-22 Borut Razem <borut.razem AT siol.net>
+
+       * support/regression/ports/pic16/specs.mk: removed stack size linker
+         directive
+       * support/regression/tests/array.c,
+         support/regression/tests/bitopcse.c,
+         support/regression/tests/bug-908454.c,
+         support/regression/tests/malloc.c: modified for pic16 regression test
+       * support/regression/tests/bitfields.c:
+         pic16 - excluded bitfileds of size > 8
+       * support/regression/tests/bp.c: pic16 - reduced data size
+       * support/regression/tests/bug-221100.c: pic16 - reduced data size
+       * support/regression/tests/bug-460010.c:
+         pic16 - used the absolute address the fits in memory
+       * support/regression/tests/bug-716242.c:
+         bug [ 1443651 ] pic 16: redefining symbol that cannot be redefined.
+       * support/regression/tests/float.c:
+         pic16 - excluded - data size too big
+       * support/regression/tests/onebyte.c:
+         pic16 - bug [ 1444425 ] onebyte.c regression tes fails on pic16
+       * support/regression/tests/shifts.c:
+         pic16 - function names probably have to differ in first X characters
+         (gpasm limitation?)
+       * support/regression/tests/staticinit.c:
+         pic16 - excluded some tests due error: no target memory available for
+         section ".idata"
+
 2006-05-22 Borut Razem <borut.razem AT siol.net>
 
        * support/Util/dbuf.c: fixed bug #1489008 fix dbuf_c_str(),
index 288edfefee382b13a7272924dba7f328f95cc94e..1e77dd024dbee47cfbd56913403d7ac9cc21d86f 100644 (file)
@@ -7,9 +7,9 @@ else
   GPSIM := gpsim
 endif
 
-SDCCFLAGS += -mpic16 -pp18f452 -I$(top_srcdir)/device/include/pic16 --nostdinc --less-pedantic -Wl,-t255 -Wl,-q -DREENTRANT=reentrant -I$(top_srcdir)
-LINKFLAGS = --nostdlib
-LINKFLAGS += libsdcc.lib libc18f.lib libm18f.lib
+SDCCFLAGS += -mpic16 -pp18f452 -I$(top_srcdir)/device/include/pic16 --nostdinc --less-pedantic -Wl,-q -DREENTRANT=reentrant -I$(top_srcdir)
+#LINKFLAGS = --nostdlib
+#LINKFLAGS += libsdcc.lib libc18f.lib libm18f.lib
 LIBDIR = $(top_builddir)device/lib/build/pic16
 
 OBJEXT = .o
@@ -27,14 +27,16 @@ EXTRAS = $(PORT_CASES_DIR)/testfwk$(OBJEXT) $(PORT_CASES_DIR)/support$(OBJEXT)
 $(PORT_CASES_DIR)/%$(OBJEXT): $(PORTS_DIR)/$(PORT)/%.c
        $(SDCC) $(SDCCFLAGS) -c $< -o $@
 
+.PRECIOUS: gen/pic16/testfwk.o gen/pic16/support.o
+
 $(PORT_CASES_DIR)/%$(OBJEXT): fwk/lib/%.c
        $(SDCC) $(SDCCFLAGS) -c $< -o $@
 
 # run simulator with 25 seconds timeout
 %.out: %$(EXEEXT) $(CASES_DIR)/timeout
        mkdir -p $(dir $@)
-       -$(CASES_DIR)/timeout 25 $(GPSIM) -i -s $< -c $(PORTS_DIR)/pic16/gpsim.cmd > $@ || \
-          echo -e --- FAIL: \"timeout, simulation killed\" in $(<:$(EXEEXT)=.c)"\n"--- Summary: 1/1/1: timeout >> $@
+       -$(CASES_DIR)/timeout 25 "$(GPSIM)" -i -s $< -c $(PORTS_DIR)/pic16/gpsim.cmd > $@ || \
+         echo -e --- FAIL: \"timeout, simulation killed\" in $(<:$(EXEEXT)=.c)"\n"--- Summary: 1/1/1: timeout >> $@
        python $(srcdir)/get_ticks.py < $@ >> $@
        -grep -n FAIL $@ /dev/null || true
 
index b2e1853977d0bd9874a9bc29c7cca627c525a529..cf8f64503b50cc6b71ce086e78b540c1d74b5e64 100644 (file)
@@ -4,11 +4,6 @@
 */
 #include <testfwk.h>
 
-#if defined(PORT_HOST) || defined(SDCC_z80) || defined(SDCC_gbz80)
-# define xdata
-# define code
-#endif
-
 #define TC(x) (0x10+(x))
 #define TI(x) (0x1020+(x) + 0x100*(x))
 #define TL(x) (0x10203040+(x))
index 7007741142d02d80e72e5cbbf18dd29f8df8c824..4268d74b43ac1819454c4a894933ea86a39295f7 100644 (file)
@@ -1,5 +1,7 @@
 /** Bitfield tests.
 
+  SDCC pic16 port currently does not support bitfields of size > 8,
+  so they are ifdefed out.
 */
 #include <testfwk.h>
 
@@ -8,6 +10,7 @@ struct {
   char c3_5 : 5;
 } c_bf;
 
+#if !defined(SDCC_pic16)
 struct {
   int i0_7 : 7;
   int i7_9 : 9;
@@ -32,6 +35,7 @@ struct {
   unsigned int b8 : 1;
   unsigned int b9 : 1;
 } sb_bf;
+#endif  /* !SDCC_pic16 */
 
 struct {
   unsigned int b0 : 1;
@@ -56,6 +60,7 @@ struct {
   unsigned int b1 : 1;
 } size2a_bf;
 
+#if !defined(SDCC_pic16)
 struct {
   unsigned int b0 : 1;
   unsigned int b1 : 1;
@@ -90,7 +95,7 @@ struct {
   signed int s7_1  : 1;
   signed int s8_9  : 9;
 } s_bf;
-
+#endif  /* !SDCC_pic16 */
 
 void
 testBitfieldSizeof(void)
@@ -102,12 +107,13 @@ testBitfieldSizeof(void)
   ASSERT( sizeof(size1a_bf) >= 1);
   ASSERT( sizeof(size1b_bf) >= 1);
   ASSERT( sizeof(size1c_bf) >= 1);
+#if !defined(SDCC_pic16)
   ASSERT( sizeof(size2b_bf) >= 2);
   ASSERT( sizeof(size2c_bf) >= 2);
   ASSERT( sizeof(size2d_bf) >= 2);
   ASSERT( sizeof(size3a_bf) >= 2);
   ASSERT( sizeof(size1a_bf) <= sizeof(size1b_bf));
-
+#endif  /* !SDCC_pic16 */
   /* Some SDCC specific assertions. SDCC uses 8 bit storage units.
      Bitfields that are less than 8 bits, but would (due to earlier
      bitfield declarations) span a storage unit boundary are
@@ -120,10 +126,12 @@ testBitfieldSizeof(void)
   ASSERT( sizeof(size1b_bf) == 1);
   ASSERT( sizeof(size1c_bf) == 1);
   ASSERT( sizeof(size2a_bf) == 2);
+#if !defined(SDCC_pic16)
   ASSERT( sizeof(size2b_bf) == 2);
   ASSERT( sizeof(size2c_bf) == 2);
   ASSERT( sizeof(size2d_bf) == 2);
   ASSERT( sizeof(size3a_bf) == 3);
+#endif  /* !SDCC_pic16 */
 #endif
 }
 
@@ -131,6 +139,7 @@ testBitfieldSizeof(void)
 void
 testBitfieldsSingleBitLiteral(void)
 {
+#if !defined(SDCC_pic16)
   size2b_bf.b0 = 0;
   size2b_bf.b1 = 0;
   size2b_bf.b2 = 0;
@@ -178,11 +187,13 @@ testBitfieldsSingleBitLiteral(void)
   ASSERT(size2b_bf.b7==0);
   ASSERT(size2b_bf.b8==0);
   ASSERT(size2b_bf.b9==1);
+#endif  /* !SDCC_pic16 */
 }
 
 void
 testBitfieldsSingleBit(void)
 {
+#if !defined(SDCC_pic16)
   volatile unsigned char c;
 
   c = 0;
@@ -235,11 +246,13 @@ testBitfieldsSingleBit(void)
   ASSERT(size2b_bf.b7==0);
   ASSERT(size2b_bf.b8==0);
   ASSERT(size2b_bf.b9==1);
+#endif  /* !SDCC_pic16 */
 }
 
 void
 testBitfieldsMultibitLiteral(void)
 {
+#if !defined(SDCC_pic16)
   size2c_bf.b0 = 0xff; /* should truncate to 0x0f */
   size2c_bf.b1 = 0;
   ASSERT(size2c_bf.b0==0x0f);
@@ -279,11 +292,13 @@ testBitfieldsMultibitLiteral(void)
   size2d_bf.b1 = 5;
   ASSERT(size2d_bf.b0==0x0a46);
   ASSERT(size2d_bf.b1==5);
+#endif  /* !SDCC_pic16 */
 }
 
 void
 testBitfieldsMultibit(void)
 {
+#if !defined(SDCC_pic16)
   volatile int allones = 0xffff;
   volatile int zero = 0;
   volatile int x;
@@ -321,6 +336,7 @@ testBitfieldsMultibit(void)
   size2d_bf.b1 = x;
   ASSERT(size2d_bf.b0==0x0a46);
   ASSERT(size2d_bf.b1==5);
+#endif  /* !SDCC_pic16 */
 }
 
 void
@@ -345,6 +361,7 @@ testBitfields(void)
 void
 testSignedBitfields(void)
 {
+#if !defined(SDCC_pic16)
   s_bf.s0_7 =   0xf0;
   s_bf.s7_1 =      1;
   s_bf.s8_9 = 0xfff8;
@@ -363,4 +380,5 @@ testSignedBitfields(void)
   ASSERT(s_bf.s8_9 == 0xff);
   ASSERT(s_bf.s0_7 > 0);
   ASSERT(s_bf.s8_9 > 0);
+#endif  /* !SDCC_pic16 */
 }
index b8118bd3fe776070c7c1be503c362eb37aa47424..552eadcd603440ef6fa4adfc9f865bb0a95ba39c 100644 (file)
@@ -16,7 +16,7 @@
 #  define _data idata
 #endif
 
-#if defined(PORT_HOST) || defined(SDCC_z80) || defined(SDCC_gbz80) || defined(SDCC_hc08)
+#if defined(PORT_HOST) || defined(SDCC_z80) || defined(SDCC_gbz80) || defined(SDCC_hc08) || defined(SDCC_pic16)
 #  define NO_BIT_TYPE
 #endif
 
index 1671035b94c4264500d8aab2331b2a0d065f2240..029ee315cfd819d08aabef4bc3a931fea7455b67 100644 (file)
@@ -20,20 +20,20 @@ spoil(int a)
   return a;
 }
 
-#ifndef SDCC_mcs51
+#if defined(SDCC_mcs51) || defined(SDCC_pic16)
 
-#define ABOVE_MEM_SIZE      400
+// test devices with much less memory
+#define ABOVE_MEM_SIZE       30
 #define ABOVE_MEM_TEST_SIZE  17
-#define BELOW_MEM_SIZE      200
-#define BELOW_MEM_TEST_SIZE  74
+#define BELOW_MEM_SIZE       20
+#define BELOW_MEM_TEST_SIZE   7
 
 #else
 
-// test mcs51 with much less memory
-#define ABOVE_MEM_SIZE       30
+#define ABOVE_MEM_SIZE      400
 #define ABOVE_MEM_TEST_SIZE  17
-#define BELOW_MEM_SIZE       20
-#define BELOW_MEM_TEST_SIZE   7
+#define BELOW_MEM_SIZE      200
+#define BELOW_MEM_TEST_SIZE  74
 
 #endif
 
index 347e1ac8d38e5feeac4a3dc1c56f110772f6596c..7b6c6f884c74bc9b4a1019e5206d916c214f78d2 100644 (file)
@@ -5,11 +5,14 @@
  */
 #include <testfwk.h>
 
-#ifdef __mcs51
-xdata
+#ifdef SDCC_pic16
+#define ARRAY_SIZE  60
+#else
+#define ARRAY_SIZE  130
 #endif
+
 static unsigned int
-testArray[130];
+testArray[ARRAY_SIZE];
 
 static unsigned int test_int ; 
 static unsigned char test_index ; 
index 2b9bed54398ee74776fc4522e014dbd2f0c69791..e5bf0ba6170df19fd53591337a27e14665e2e8f0 100644 (file)
@@ -2,6 +2,14 @@
  */
 #include <testfwk.h>
 
+#ifdef SDCC
+#ifdef SDCC_pic16
+#define ADDRESS 0x0070
+#else
+#define ADDRESS 0xa000
+#endif  /* SDCC_pic16 */
+#endif  /* SDCC */
+
 void 
 func( unsigned char a )
 {
@@ -13,7 +21,7 @@ testBadPromotion(void)
 {
 
 #ifdef SDCC
-  unsigned char c=*((unsigned xdata char*)(0xa000));
+  unsigned char c=*((unsigned xdata char*)(ADDRESS));
 #else
   unsigned char loc_c;
   unsigned char c=*(unsigned char*)&loc_c;
index 604bc22b5add6689abbafdbb5b3beaf5614a85f1..d0c72a7b9ba1f1b0a537a0188f7d6c450f58fc9c 100644 (file)
@@ -29,7 +29,14 @@ void f1()
 
 /****************************/
 
+#ifndef SDCC_pic16
+// Ifdefed out for PIC16 port since it generates the error:
+// Duplicate label or redefinin g symbol that cannot be redefined. (_g)
+// Submitted to the bug tracker:
+// [ 1443651 ] pic 16: redefining symbol that cannot be redefined. (_g)
+
 void g (int (*h) (int));
+#endif
 
 void f2()
 {
@@ -40,7 +47,14 @@ void f2()
 
 /****************************/
 
+#ifndef SDCC_pic16
+// Ifdefed out for PIC16 port since it generates the error:
+// Duplicate label or redefinin g symbol that cannot be redefined. (_g)
+// Submitted to the bug tracker:
+// [ 1443651 ] pic 16: redefining symbol that cannot be redefined. (_g)
+
 void g (int (*h) (int));
+#endif
 
 void f3()
 {
index 9a67d263152142935cded359588976ae924a2319..fa766aedcdea951c84c292da2313f335f91650fe 100644 (file)
@@ -2,7 +2,7 @@
 
 #include <testfwk.h>
 
-#if defined(PORT_HOST) || defined(SDCC_z80) || defined(SDCC_gbz80) || defined(SDCC_hc08)
+#if defined(PORT_HOST) || defined(SDCC_z80) || defined(SDCC_gbz80) || defined(SDCC_hc08) || defined(SDCC_pic16)
 #  define NO_BIT_TYPE
 #endif
 
index 864b83c484c221ca12a8f6d690ad918c7ead133d..0cc2fbace61d7ac216b894f37847bb4aa7b3577d 100644 (file)
@@ -1,6 +1,7 @@
 /* Float tests.
 
    operation: ADD, SUB, MUL, DIV, REVDIV
+   Test excluded from pic16 regression test
 */
 
 #if 1
@@ -21,7 +22,7 @@
   #define REVDIV 1
 #endif
 
-#ifdef __mcs51
+#ifdef SDCC_mcs51
 #define STORAGE xdata
 #define XDATA xdata
 #else
@@ -29,6 +30,7 @@
 #define XDATA
 #endif
 
+#ifndef SDCC_pic16
 XDATA volatile float left, right, result;
 
 struct {
@@ -78,10 +80,12 @@ char compare (float is, float should) {
     return 1;
   }
 }
+#endif  /* SDCC_pic16 */
 
 void
 testFloatMath(void)
 {
+#ifndef SDCC_pic16
   int i;
   int t = sizeof(cases)/sizeof(cases[0]);
   float result;
@@ -119,6 +123,7 @@ testFloatMath(void)
     #endif
   }
   DEBUG(printf ("%d tests, %d errors\n", tests, errors));
+#endif  /* SDCC_pic16 */
 }
 
 #ifndef REENTRANT
index 6659b949df114dd2e6e9143e868abc1210821289..319de73b7a03dbc0dba02093c321aca9aacb0e6d 100644 (file)
@@ -2,29 +2,34 @@
  */
 #include <testfwk.h>
 #include <stdlib.h>
-
-/* PENDING */
-#if defined(__gbz80) || defined(__z80) || defined(__GNUC__)
-#define XDATA
-#else
-#define XDATA xdata
+#if defined(SDCC_pic16)
+#include <malloc.h>
 #endif
 
-XDATA char heap[100];
+xdata char heap[100];
 
 void
 testMalloc(void)
 {
-  void XDATA *p1, *p2, *p3;
+  void xdata *p1, *p2, *p3;
   char *p;
   unsigned char i;
 
-#if !defined(__gbz80) && !defined(__z80) && !defined(__GNUC__)
-  init_dynamic_memory((MEMHEADER XDATA *)heap, sizeof(heap));
+#if !defined(__GNUC__) && !defined(SDCC_gbz80) && !defined(SDCC_z80)
+#if defined(SDCC_pic16)
+  _initHeap(heap, sizeof heap);
+#else
+  init_dynamic_memory((MEMHEADER xdata *)heap, sizeof(heap));
+#endif
 
   p1 = malloc(200);
   ASSERT(p1 == NULL);
   LOG(("p1 == NULL when out of memory\n"));
+#ifdef PORT_HOST
+  LOG(("p1: %p\n", p1));
+#else
+  LOG(("p1: %u\n", (unsigned) p1));
+#endif
 #endif
 
   p1 = malloc(5);
index b3ce9781042df764374138b3b067f25ff6e3d96e..7ac65fa606e6a967d68fae07d962785d5d64dae2 100644 (file)
@@ -8,6 +8,7 @@
 void
 testMul(void)
 {
+#ifndef SDCC_pic16  /* bug [ 1444425 ] onebyte.c regression tes fails on pic16 */
   {attrL}            char  cL;
   {attrL}  unsigned  char ucL;
   {attrR}            char  cR;
@@ -35,6 +36,7 @@ testMul(void)
   ucL = 128;  cR =   1; ur8 = ucL * cR;  ur8b  = cR * ucL; ASSERT(ur8 ==  128); ASSERT(ur8b  ==  128);
   ucL = 128; ucR =   5; r16 = ucL * ucR; r16b = ucR * ucL; ASSERT(r16 ==  640); ASSERT(r16b ==  640);
   ucL = 128; ucR =   1; ur8 = ucL * ucR; ur8b = ucR * ucL; ASSERT(ur8 ==  128); ASSERT(ur8b ==  128);
+#endif
 }
 
 void
index 200caffba63141e040a32c2b86209e2e70abe1d0..0eb607f91a808f4cf007377efca0e50fc71baf35 100644 (file)
@@ -1,4 +1,5 @@
 /** Tests covering the shift operators.
+    disabled for pic16
 
     sign: signed, unsigned
     type: char, int, long
@@ -12,7 +13,7 @@
 #include <testfwk.h>
 
 void
-testShiftClasses(void)
+test1ShiftClasses(void)
 {
     {attr} {storage} {sign} {type} i, result;
 
@@ -30,7 +31,7 @@ testShiftClasses(void)
 }
 
 void
-testShiftRight(void)
+test2ShiftRight(void)
 {
     {attr} {storage} {type} i, result;
 
@@ -48,8 +49,8 @@ testShiftRight(void)
     ASSERT(result == -15); 
 }
 
-static void
-testShiftByteMultiples(void)
+void
+test3ShiftByteMultiples(void)
 {
     {attr} {storage} {type} i;
 
@@ -64,8 +65,8 @@ testShiftByteMultiples(void)
     ASSERT((({type}) i<<24) == (({type}) {vals} << 24));
 }
 
-static void
-testShiftOne(void)
+void
+test4ShiftOne(void)
 {
     {attr} {storage} {sign} {type} i;
     {sign} {type} result;
index 6a2480f4bbed0180505ce5db11ef0e9c428c2805..e20063d8a7c532614f10da1c64e4309d621b08d3 100644 (file)
@@ -3,6 +3,9 @@
 
     type: char, int, long
 */
+
+//error: no target memory available for section ".idata"
+
 #include <testfwk.h>
 
 static {type} smallDense[] = {
@@ -69,6 +72,7 @@ testSmallSparseZero(void)
     ASSERT(smallSparseZeroTail[0] == 1);
 }
 
+#ifndef SDCC_pic16
 #ifdef __mcs51
 xdata
 #endif
@@ -109,10 +113,12 @@ static {type} largeMixed[] = {
     3, 4, 5, 6, 3, 4, 5, 6,
     3, 4, 5, 6, 3, 4, 5, 6
 };
+#endif
 
 static void
 testLargeMixed(void)
 {
+#ifndef SDCC_pic16
     ASSERT(largeMixed[0] == 1);
     ASSERT(largeMixed[1] == 2);
     ASSERT(largeMixed[7] == 1);
@@ -123,4 +129,5 @@ testLargeMixed(void)
     ASSERT(largeMixed[143+1] == 4);
     ASSERT(largeMixed[143+8+1] == 4);
     ASSERT(largeMixed[143+16+1] == 4);
+#endif
 }