public inbox for cgen@sourceware.org
 help / color / mirror / Atom feed
From: Dave Korn <dave.korn.cygwin@googlemail.com>
To: cgen@sourceware.org
Subject: [PATCH] fix sim-test likewise to gas-test
Date: Sun, 30 Aug 2009 05:26:00 -0000	[thread overview]
Message-ID: <4A9A10B9.2070802@gmail.com> (raw)

[-- 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
 

                 reply	other threads:[~2009-08-30  5:26 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A9A10B9.2070802@gmail.com \
    --to=dave.korn.cygwin@googlemail.com \
    --cc=cgen@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).