Tidied up the build, install, and regression tests.
authormichaelh <michaelh@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Mon, 26 Jan 2004 08:05:16 +0000 (08:05 +0000)
committermichaelh <michaelh@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Mon, 26 Jan 2004 08:05:16 +0000 (08:05 +0000)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@3151 4a8a32a2-be11-0410-ad9d-d568d2c75423

ChangeLog
as/Makefile
doc/Makefile
support/regression/generate-cases.py
support/regression/ports/ucz80/spec.mk
support/regression/tests/float_trans.c
support/regression/tests/libmullong.c
support/regression/tests/literalop.c

index fbee181b1e691e9d4f5bccc913b38de22ca06bd7..9197149e86d3828c0db0d442d4911439ff8741f3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,21 @@
+2004-01-26  Michael Hope  <michaelh@juju.net.nz>
+
+       * 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 <bernhard@bernhardheld.de>
 
        * src/SDCCast.c: added an additional type flow in decorateType() of
index ccecebabb242a23619bbd09488cfed59446e9b8c..214880a36428fd7e1e9c9f57de7b61e7c703a530 100644 (file)
@@ -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)
index 80410d28a4c1cc672a427f35c50619c096a4e8a8..d014b034520443e1ca1b07f69b63d8c16cd3c340 100644 (file)
@@ -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:
index 55839e9130f38c7b762d76755ded34c5e6ff1352..917213d6d0589f02d0391ba97b6d7418103e07de 100644 (file)
@@ -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()
+    
index 788dca5a3e529e1c6a785cc4a1729568a69eaf57..42e8b791611e8652164ce2e83cd9287c8e90d2db 100644 (file)
@@ -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
index e2edb3dee119ff1b32ddfb7a966e0ea1948c00b8..6431baf664888cd93c85eb2005dc40a37449a0d6 100644 (file)
@@ -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
index 61ead68b4212cda24ecc0559781fb0b96c77aa61..efe0c816c96ca7336ffde6e96b74160d3876f7e5 100644 (file)
@@ -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
index 08800c1471f39149401ca85a8cf48604b21cde72..57a835e68adc02c2835fec0abf85cf87537437e3 100644 (file)
@@ -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;