This is the mail archive of the
cgen@sourceware.org
mailing list for the CGEN project.
[PATCH] fix sim-test likewise to gas-test
- From: Dave Korn <dave dot korn dot cygwin at googlemail dot com>
- To: cgen at sourceware dot org
- Date: Sun, 30 Aug 2009 06:40:09 +0100
- Subject: [PATCH] fix sim-test likewise to gas-test
Hi CGEN,
I think this patch is about right. It stringifies the test data at a handy
point where it's all being mapped over a list anyway, and now I get a working
sim-build.sh and a tmpdir/ full of *.cgs scripts.
* sim-test.scm (build-sim-testcase): Convert test-data and
syntax-list items to strings.
(cgen-build.sh): Stringify current-arch-name throughout.
cheers,
DaveK
Index: sim-test.scm
===================================================================
--- sim-test.scm (revision 145)
+++ sim-test.scm (working copy)
@@ -128,14 +128,14 @@
(lambda () (display sl)))))))
syntax-list)
", test data: "
- (map (lambda (td) (list " " td))
+ (map (lambda (td) (list " " (->string td)))
test-data)
"\n")
(let loop ((result nil) (sl syntax-list) (td test-data))
;(display (list result sl td "\n"))
(cond ((null? sl)
(string-append "\t"
- (apply string-append (reverse result))
+ (apply string-append (map (lambda (x) (->string x)) (reverse result)))
"\n"))
((string? (car sl))
(loop (cons (car sl) result) (cdr sl) td))
@@ -175,7 +175,7 @@
(string-append
"\
#/bin/sh
-# Generate test result data for " (current-arch-name) " simulator testing.
+# Generate test result data for " (->string (current-arch-name)) " simulator testing.
# This script is machine generated.
# It is intended to be run in the testsuite source directory.
#
@@ -191,7 +191,7 @@ cd tmpdir
(string-append
"cat <<EOF > " (gen-file-name (obj:name insn)) ".cgs\n"
; FIXME: Need to record assembler line comment char in .cpu.
- "# " (current-arch-name) " testcase for " (backslash "$" (insn-syntax insn)) " -*- Asm -*-\n"
+ "# " (->string (current-arch-name)) " testcase for " (backslash "$" (insn-syntax insn)) " -*- Asm -*-\n"
"# mach: "
(let ((machs (insn-machs insn)))
(if (null? machs)
@@ -215,9 +215,9 @@ cd tmpdir
(logit 1 "Generating sim-allinsn.exp ...\n")
(string-append
"\
-# " (string-upcase (current-arch-name)) " simulator testsuite.
+# " (string-upcase (->string (current-arch-name))) " simulator testsuite.
-if [istarget " (current-arch-name) "*-*-*] {
+if [istarget " (->string (current-arch-name)) "*-*-*] {
# load support procs (none yet)
# load_lib cgen.exp