add ucsim z80 test case
authorkbongers <kbongers@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Sun, 3 Feb 2002 20:07:56 +0000 (20:07 +0000)
committerkbongers <kbongers@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Sun, 3 Feb 2002 20:07:56 +0000 (20:07 +0000)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@1896 4a8a32a2-be11-0410-ad9d-d568d2c75423

support/regression/ports/ucz80/spec.mk [new file with mode: 0644]
support/regression/ports/ucz80/support.asm [new file with mode: 0644]
support/regression/ports/ucz80/uCsim.cmd [new file with mode: 0755]

diff --git a/support/regression/ports/ucz80/spec.mk b/support/regression/ports/ucz80/spec.mk
new file mode 100644 (file)
index 0000000..7a9c572
--- /dev/null
@@ -0,0 +1,42 @@
+# Port specification for the xxxx port running with uCsim
+#
+
+# path to uCsim
+UCZ80 = $(SDCC_DIR)/bin/sz80
+#UCZ80 = $(SDCC_DIR)/bin/s51
+
+SDCCFLAGS +=-mz80 --lesspedantic --profile -DREENTRANT=
+#SDCCFLAGS +=--lesspedantic -DREENTRANT=reentrant --stack-after-data
+
+#OBJEXT = .o
+EXEEXT = .ihx
+
+EXTRAS = fwk/lib/testfwk$(OBJEXT) $(PORTS_DIR)/$(PORT)/support$(OBJEXT)
+
+# Rule to link into .ihx
+#%$(EXEEXT): %$(OBJEXT) $(EXTRAS)
+
+%$(EXEEXT): %.c $(EXTRAS)
+       $(SDCC) $(SDCCFLAGS) $< $(EXTRAS)
+#      mv fwk/lib/testfwk.ihx $@
+#      mv fwk/lib/testfwk.map $(@:.ihx=.map)
+
+%$(OBJEXT): %.asm
+       $(SDCC_DIR)/bin/as-z80 -plosgff $@ $<
+
+%$(OBJEXT): %.c
+       $(SDCC) $(SDCCFLAGS) -c $<
+
+# run simulator with 10 seconds timeout
+%.out: %$(EXEEXT) fwk/lib/timeout
+       mkdir -p `dirname $@`
+       -fwk/lib/timeout 10 $(UCZ80) -t32 $< < $(PORTS_DIR)/$(PORT)/uCsim.cmd > $@ \
+         || echo -e --- FAIL: \"timeout, simulation killed\" in $(<:.ihx=.c)"\n"--- Summary: 1/1/1: timeout >> $@
+       -grep -n FAIL $@ /dev/null || true
+
+fwk/lib/timeout: fwk/lib/timeout.c
+
+_clean:
+       rm -f fwk/lib/timeout fwk/lib/timeout.exe $(PORTS_DIR)/$(PORT)/*.rel $(PORTS_DIR)/$(PORT)/*.rst \
+             $(PORTS_DIR)/$(PORT)/*.lst $(PORTS_DIR)/$(PORT)/*.sym $(PORTS_DIR)/$(PORT)/*.asm temp.lnk
+
diff --git a/support/regression/ports/ucz80/support.asm b/support/regression/ports/ucz80/support.asm
new file mode 100644 (file)
index 0000000..01e0ef8
--- /dev/null
@@ -0,0 +1,9 @@
+        .area   _CODE
+        .globl  _putchar
+        .globl  _exit
+
+__putchar::
+        jp      _putchar
+
+__exitEmu::
+        jp      _exit
diff --git a/support/regression/ports/ucz80/uCsim.cmd b/support/regression/ports/ucz80/uCsim.cmd
new file mode 100755 (executable)
index 0000000..58afc78
--- /dev/null
@@ -0,0 +1,2 @@
+run
+quit