* support/regression/generate-cases.py,
authorfrief <frief@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Thu, 9 Nov 2006 15:07:43 +0000 (15:07 +0000)
committerfrief <frief@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Thu, 9 Nov 2006 15:07:43 +0000 (15:07 +0000)
* support/regression/fwk/include/testfwk.h,
* support/regression/fwk/lib/testfwk.c: used code pointers, (about 50kByte less code generated for mcs51)

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

ChangeLog
support/regression/fwk/include/testfwk.h
support/regression/fwk/lib/testfwk.c
support/regression/generate-cases.py

index da090bb03edc3864cb7639e80e4901148830bacd..3c8b0e74f94d7672a1b9131b3d7ebfd6d36ccaec 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2006-11-09 Frieder Ferlemann <Frieder.Ferlemann AT web.de>
+
+       * support/regression/generate-cases.py,
+       * support/regression/fwk/include/testfwk.h,
+       * support/regression/fwk/lib/testfwk.c: used code pointers,
+         (about 50kByte less code generated for mcs51) 
+
 2006-11-06 Borut Razem <borut.razem AT siol.net>
 
        * debugger/mcs51/acinclude.m4, debugger/mcs51/aclocal.m4,
index 29987ba9940c1683ef10816d706d31f476becce8..467e20559cf445bc114f0e3b81b6867f6b5562bd 100644 (file)
@@ -11,20 +11,6 @@ void __printf(const char *szFormat, ...);
 #define LOG(_a)     /* hollow log */
 #endif
 
-void __fail(const char *szMsg, const char *szCond, const char *szFile, int line);
-void __prints(const char *s);
-void __printn(int n);
-const char *__getSuiteName(void);
-void __runSuite(void);
-
-#define ASSERT(_a)  (__numTests++, (_a) ? (void)0 : __fail("Assertion failed", #_a, __FILE__, __LINE__))
-#define FAIL()      FAILM("Failure")
-#define FAILM(_a)   __fail(_a, #_a, __FILE__, __LINE__)
-
-#define NULL  0
-
-#define UNUSED(_a)  if (_a) { }
-
 #if defined(PORT_HOST) || defined(SDCC_z80) || defined(SDCC_gbz80)
 # define idata
 # define pdata
@@ -43,4 +29,18 @@ void __runSuite(void);
 # define xdata data
 #endif
 
+void __fail(code const char *szMsg, code const char *szCond, code const char *szFile, int line);
+void __prints(const char *s);
+void __printn(int n);
+code const char *__getSuiteName(void);
+void __runSuite(void);
+
+#define ASSERT(_a)  (__numTests++, (_a) ? (void)0 : __fail("Assertion failed", #_a, __FILE__, __LINE__))
+#define FAIL()      FAILM("Failure")
+#define FAILM(_a)   __fail(_a, #_a, __FILE__, __LINE__)
+
+#define NULL  0
+
+#define UNUSED(_a)  if (_a) { }
+
 #endif
index 8c162c8877ea971f08e2a787b5bb08b3ded72cb7..eed8c6f2744627c3aaac22a4021f19d63a945ea6 100644 (file)
@@ -12,6 +12,9 @@
 #ifdef SDCC_mcs51
 /* until changed, isr's must have a prototype in the module containing main */
 void T2_isr (void) interrupt 5;
+#define MEMSPACE_BUF idata
+#else
+#define MEMSPACE_BUF
 #endif
 
 /** Define this if the port's div or mod functions are broken.
@@ -69,8 +72,8 @@ __printn(int n)
     _putchar('0');
   }
   else {
-    static char buf[6];
-    char *p = &buf[sizeof(buf) - 1];
+    static char MEMSPACE_BUF buf[6];
+    char MEMSPACE_BUF *p = &buf[sizeof(buf) - 1];
     char neg = 0;
 
     buf[sizeof(buf) - 1] = '\0';
@@ -128,7 +131,7 @@ __printf(const char *szFormat, ...)
 }
 
 void
-__fail(const char *szMsg, const char *szCond, const char *szFile, int line)
+__fail(code const char *szMsg, code const char *szCond, code const char *szFile, int line)
 {
   __printf("--- FAIL: \"%s\" on %s at %s:%u\n", szMsg, szCond, szFile, line);
   __numFailures++;
@@ -154,7 +157,7 @@ main(void)
 }
 #else
 void
-__fail(const char *szMsg, const char *szCond, const char *szFile, int line)
+__fail(code const char *szMsg, code const char *szCond, code const char *szFile, int line)
 {
   __prints("--- FAIL: \"");
   __prints(szMsg);
index 9ad7a5bb54048968e91e370b4bb3a57406ea2e12..70da87d9163596332220e9a9b0fc34126be00116 100644 (file)
@@ -20,7 +20,7 @@ testfuntablefooter = """}
 
 # Code to generate the suite function
 testfunsuite = """
-const char *
+code const char *
 __getSuiteName(void)
 {
   return "{testcase}";