From f3946e669d77d841b638d798c3e09429cd3338c6 Mon Sep 17 00:00:00 2001 From: michaelh Date: Mon, 26 Jan 2004 08:05:16 +0000 Subject: [PATCH] Tidied up the build, install, and regression tests. git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@3151 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- ChangeLog | 18 ++++++++++++++++++ as/Makefile | 2 +- doc/Makefile | 2 +- support/regression/generate-cases.py | 19 ++++++++++++------- support/regression/ports/ucz80/spec.mk | 7 +++++-- support/regression/tests/float_trans.c | 2 +- support/regression/tests/libmullong.c | 22 +++++++++++++++++++--- support/regression/tests/literalop.c | 12 +++++++++--- 8 files changed, 66 insertions(+), 18 deletions(-) diff --git a/ChangeLog b/ChangeLog index fbee181b..9197149e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,21 @@ +2004-01-26 Michael Hope + + * support/regression/tests/literalop.c (mulWrapper): Added a + wrapper to remove integer overflow warnings. + + * support/regression/tests/float_trans.c: Made work on host. + + * support/regression/ports/ucz80/spec.mk (UCZ80): Made detect the + location of sz80. + + * support/regression/generate-cases.py (main): Changed from inline + to a main method. + + * doc/Makefile (install): Changed to depth first to get rid of + missing directory install warning. + + * as/Makefile (install-doc): Made work on Mac. + 2004-01-25 Bernhard Held * src/SDCCast.c: added an additional type flow in decorateType() of diff --git a/as/Makefile b/as/Makefile index ccecebab..214880a3 100644 --- a/as/Makefile +++ b/as/Makefile @@ -19,7 +19,7 @@ install: all install-doc install-doc: $(INSTALL) -d $(docdir)/aslink - cp -f `find doc -maxdepth 1 -not -type d` $(docdir)/aslink + cp -f `find doc -maxdepth 1 -type f` $(docdir)/aslink uninstall: cd $(bindir); rm -f as-z80$(EXEEXT) as-gbz80$(EXEEXT) as-hc08$(EXEEXT) diff --git a/doc/Makefile b/doc/Makefile index 80410d28..d014b034 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -17,7 +17,7 @@ install: if [ -f $(MANUAL).pdf ]; then cp -rf $(MANUAL).pdf $(docdir); fi if [ -f $(TSS).pdf ]; then cp -rf $(TSS).pdf $(docdir); fi if [ -f $(CDB).pdf ]; then cp -rf $(CDB).pdf $(docdir); fi - find $(docdir) -name CVS -type d -exec rm -r {} \; + find -d $(docdir) -name CVS -type d -exec rm -r {} \; rm -f $(docdir)/*/WARNINGS $(docdir)/*/*.pl $(docdir)/*/images.* uninstall: diff --git a/support/regression/generate-cases.py b/support/regression/generate-cases.py index 55839e91..917213d6 100644 --- a/support/regression/generate-cases.py +++ b/support/regression/generate-cases.py @@ -176,12 +176,17 @@ class InstanceGenerator: # Remove the temporary file os.remove(self.tmpname) -# Check and parse the command line arguments -if len(sys.argv) < 3: - # PENDING: How to throw an error? - print "usage: generate-cases.py template.c outdir" +def main(): + # Check and parse the command line arguments + if len(sys.argv) < 3: + print "usage: generate-cases.py template.c outdir" + sys.exit(-1) + + # Input name is the first arg. -# Input name is the first arg. + s = InstanceGenerator(sys.argv[1]) + s.generate() -s = InstanceGenerator(sys.argv[1]) -s.generate() +if __name__ == '__main__': + main() + diff --git a/support/regression/ports/ucz80/spec.mk b/support/regression/ports/ucz80/spec.mk index 788dca5a..42e8b791 100644 --- a/support/regression/ports/ucz80/spec.mk +++ b/support/regression/ports/ucz80/spec.mk @@ -2,8 +2,11 @@ # # path to uCsim -UCZ80 = $(SDCC_DIR)/bin/sz80 -#UCZ80 = $(SDCC_DIR)/bin/s51 +# path to uCsim +SZ80A = $(SDCC_DIR)/sim/ucsim/sz80.src/sz80 +SZ80B = $(SDCC_DIR)/bin/sz80 + +UCZ80 = $(shell if [ -f $(SZ80A) ]; then echo $(SZ80A); else echo $(SZ80B); fi) SDCCFLAGS +=-mz80 --less-pedantic --profile -DREENTRANT= #SDCCFLAGS +=--less-pedantic -DREENTRANT=reentrant diff --git a/support/regression/tests/float_trans.c b/support/regression/tests/float_trans.c index e2edb3de..6431baf6 100644 --- a/support/regression/tests/float_trans.c +++ b/support/regression/tests/float_trans.c @@ -11,7 +11,7 @@ void testTrans(void) { -#ifndef SDCC_z80 +#if !defined(SDCC_z80) && !PORT_HOST # ifdef SQRTF ASSERT(fabsf (sqrtf (5.0) - 2.23606801) < 0.00001); # endif diff --git a/support/regression/tests/libmullong.c b/support/regression/tests/libmullong.c index 61ead68b..efe0c816 100644 --- a/support/regression/tests/libmullong.c +++ b/support/regression/tests/libmullong.c @@ -15,7 +15,7 @@ # include "../../../../../device/lib/_mullong.c" # define mullong(a,b) mullong_wrapper(a,b) # else -# define mullong(a,b) (a*b) +# define mullong(a,b) mullong_wrapper(a,b) # endif #else # if defined(type_c) @@ -28,7 +28,9 @@ /* gcc 2.95.2 on usf-cf-x86-linux-1 (debian 2.2) has a bug with * packing structs */ -#if defined(PORT_HOST) && defined(type_c) && !defined(WORDS_BIGENDIAN) +#if defined(PORT_HOST) + +#if defined(type_c) && !defined(WORDS_BIGENDIAN) struct { char c1; @@ -43,9 +45,23 @@ mullong_wrapper (long a, long b) /* length of struct ok: use SDCC library */ return _mullong (a, b); else - /* buggy gcc: use generic multiplication */ + { + /* buggy gcc: use generic multiplication */ + return a * b; + } +} +#endif + +#if defined(WORDS_BIGENDIAN) + +long +mullong_wrapper (long a, long b) +{ return a * b; } + +#endif + #endif void diff --git a/support/regression/tests/literalop.c b/support/regression/tests/literalop.c index 08800c14..57a835e6 100644 --- a/support/regression/tests/literalop.c +++ b/support/regression/tests/literalop.c @@ -40,6 +40,12 @@ volatile utype vu; unsigned LONG t1, t2; +int +mulWrapper(int a, int b) +{ + return a * b; +} + void testOpOp(void) { @@ -77,7 +83,7 @@ testOpOp(void) ASSERT((stype) 1 * (utype) 0xfffffff7 == (utype) 0xfffffff7); ASSERT((unsigned char ) 0xfffffff8 * (unsigned char ) 0xfffffff7 == 0xef48); - ASSERT((unsigned short) 0xfffffff8 * (unsigned short) 0xfffffff7 == (sizeof(int) == 2 ? 0x0048 : 0xffef0048)); + ASSERT(mulWrapper((unsigned short) 0xfffffff8, (unsigned short) 0xfffffff7) == (sizeof(int) == 2 ? 0x0048 : (unsigned int)0xffef0048)); ASSERT((unsigned LONG ) 0xfffffff8 * (unsigned LONG ) 0xfffffff7 == 0x0048); ASSERT((stype ) 0xfffffff8 * (stype ) 0xfffffff7 == 72); @@ -108,8 +114,8 @@ testOpOp(void) if (sizeof (int) == 2) ASSERT(0x7fff * (unsigned char) 2 < 1); else - ASSERT(0x7fffffff * (unsigned char) 2 < 1); - ASSERT(0x7fffffff * (unsigned short) 2 < 1); + ASSERT(mulWrapper(0x7fffffff, (unsigned char) 2) < 1); + ASSERT(mulWrapper(0x7fffffff, (unsigned short) 2) < 1); /* mul icode: operandOperation() */ s = -3; -- 2.30.2