* [PATCH] fix sim-test likewise to gas-test
@ 2009-08-30 5:26 Dave Korn
0 siblings, 0 replies; only message in thread
From: Dave Korn @ 2009-08-30 5:26 UTC (permalink / raw)
To: cgen
[-- Attachment #1: Type: text/plain, Size: 399 bytes --]
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
[-- Attachment #2: sim-test-stringfix.diff --]
[-- Type: text/x-c, Size: 1921 bytes --]
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2009-08-30 5:26 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-30 5:26 [PATCH] fix sim-test likewise to gas-test Dave Korn
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).