From: bernhardheld Date: Thu, 23 Aug 2001 12:53:07 +0000 (+0000) Subject: add mcs51-port X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=71cd88ccd05c9f07c4fe7298fc1085d57e71d7f9;p=fw%2Fsdcc add mcs51-port git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@1163 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- diff --git a/support/regression/Makefile b/support/regression/Makefile index daa42ef7..b3209365 100644 --- a/support/regression/Makefile +++ b/support/regression/Makefile @@ -20,8 +20,9 @@ # o Provides the emulators # * The gbdk-lib package from gbdk. # o cvs -d cvs.gbdk.sourceforge.net:/cvsroot/gbdk co gbdk-lib -# o Provildes mul, div, and include files for the z80 tests. +# o Proviles mul, div, and include files for the z80 tests. # * python 1.5 or above +# * uCsim for the mcs51 port # # The paths below assume that sdcc, sdcc-extra, and gbdk-lib all reside in # the same directory. @@ -60,7 +61,7 @@ GENERATE_CASES = generate-cases.py # The port name must be the same as the one used in the SDCC '-mxxx' argument. # Each port must have a spec.mk which describes how to build the object # files and how to run the emulator. -ALL_PORTS = $(filter-out CVS,$(notdir $(wildcard $(PORTS_DIR)/*))) +ALL_PORTS = $(filter-out CVS mcs51,$(notdir $(wildcard $(PORTS_DIR)/*))) all: test-ports diff --git a/support/regression/fwk/lib/testfwk.c b/support/regression/fwk/lib/testfwk.c index 55e2085b..8ba42960 100644 --- a/support/regression/fwk/lib/testfwk.c +++ b/support/regression/fwk/lib/testfwk.c @@ -57,6 +57,18 @@ static void _printn(int n) _putchar('0' + rem); } +#ifdef SDCC_mcs51 +union +{ + struct + { + int offset; + char data_space; + } part; + char *p; +} generic_p_u; +#endif + void __printf(const char *szFormat, ...) REENTRANT { va_list ap; @@ -66,7 +78,16 @@ void __printf(const char *szFormat, ...) REENTRANT if (*szFormat == '%') { switch (*++szFormat) { case 's': { +#ifdef SDCC_mcs51 +#warning Workaround bug #436344 + char GENERIC *sz; + + generic_p_u.part.data_space = va_arg (ap, char); + generic_p_u.part.offset = va_arg (ap, int); + sz = generic_p_u.p; +#else char GENERIC *sz = va_arg(ap, char GENERIC *); +#endif while (*sz) { _putchar(*sz++); }