From: borutr Date: Sat, 27 May 2006 18:41:47 +0000 (+0000) Subject: * support/regression/tests/staticinit.c, X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=aa9e673e35a8589bc8f96a2a96c46603e1c3954e;p=fw%2Fsdcc * support/regression/tests/staticinit.c, support/regression/tests/float.c: regression tests fully enabled for pic16 port by putting the initialized data arrays into the code section * support/regression/ports/pic16/spec.mk: don't link default libraries. This was changed by mistake in the previous version. git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@4193 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- diff --git a/ChangeLog b/ChangeLog index 0ec01fb9..4b238a25 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,12 @@ * support/regression/fwk/lib/testfwk.c: increase stack size from deafult 64 bytes to 128 bytes + * support/regression/tests/staticinit.c, + support/regression/tests/float.c: regression tests fully enabled + for pic16 port by putting the initialized data arrays into the code + section + * support/regression/ports/pic16/spec.mk: don't link default libraries. + This was changed by mistake in the previous version. 2006-05-28 Vangelis Rokas diff --git a/support/regression/ports/pic16/spec.mk b/support/regression/ports/pic16/spec.mk index 1e77dd02..b1fdcb0e 100644 --- a/support/regression/ports/pic16/spec.mk +++ b/support/regression/ports/pic16/spec.mk @@ -8,8 +8,8 @@ else endif 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 +LINKFLAGS = --nostdlib +LINKFLAGS += libsdcc.lib libc18f.lib libm18f.lib LIBDIR = $(top_builddir)device/lib/build/pic16 OBJEXT = .o diff --git a/support/regression/tests/float.c b/support/regression/tests/float.c index 0cc2fbac..448782ee 100644 --- a/support/regression/tests/float.c +++ b/support/regression/tests/float.c @@ -1,7 +1,6 @@ /* Float tests. operation: ADD, SUB, MUL, DIV, REVDIV - Test excluded from pic16 regression test */ #if 1 @@ -25,12 +24,11 @@ #ifdef SDCC_mcs51 #define STORAGE xdata #define XDATA xdata -#else -#define STORAGE +#elif SDCC_pic16 +#define STORAGE code #define XDATA #endif -#ifndef SDCC_pic16 XDATA volatile float left, right, result; struct { @@ -80,12 +78,10 @@ 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; @@ -123,7 +119,6 @@ testFloatMath(void) #endif } DEBUG(printf ("%d tests, %d errors\n", tests, errors)); -#endif /* SDCC_pic16 */ } #ifndef REENTRANT diff --git a/support/regression/tests/staticinit.c b/support/regression/tests/staticinit.c index e20063d8..4f03698e 100644 --- a/support/regression/tests/staticinit.c +++ b/support/regression/tests/staticinit.c @@ -4,8 +4,6 @@ type: char, int, long */ -//error: no target memory available for section ".idata" - #include static {type} smallDense[] = { @@ -23,7 +21,7 @@ testSmallDense(void) ASSERT(smallDense[5] == 6); } -#ifdef __mcs51 +#ifdef SDCC_mcs51 idata at 0xa0 /* leave space for the stack */ #endif static {type} smallSparse[] = { @@ -44,7 +42,7 @@ testSmallSparse(void) ASSERT(smallSparse[8] == 1); } -#ifdef __mcs51 +#ifdef SDCC_mcs51 idata at 0xd0 #endif static {type} smallSparseZero[] = { @@ -72,9 +70,10 @@ testSmallSparseZero(void) ASSERT(smallSparseZeroTail[0] == 1); } -#ifndef SDCC_pic16 -#ifdef __mcs51 +#ifdef SDCC_mcs51 xdata +#elif SDCC_pic16 +code #endif static {type} largeMixed[] = { 1, 2, 3, 4, 5, 6, 7, /* 0-6 */ @@ -113,12 +112,10 @@ 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); @@ -129,5 +126,4 @@ testLargeMixed(void) ASSERT(largeMixed[143+1] == 4); ASSERT(largeMixed[143+8+1] == 4); ASSERT(largeMixed[143+16+1] == 4); -#endif }