+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
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)
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:
# 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()
+
#
# 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
void
testTrans(void)
{
-#ifndef SDCC_z80
+#if !defined(SDCC_z80) && !PORT_HOST
# ifdef SQRTF
ASSERT(fabsf (sqrtf (5.0) - 2.23606801) < 0.00001);
# endif
# 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)
/* 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;
/* 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
unsigned LONG t1, t2;
+int
+mulWrapper(int a, int b)
+{
+ return a * b;
+}
+
void
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);
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;