This is the mail archive of the
cgen@sourceware.org
mailing list for the CGEN project.
Re: "make gas-test" broken?
- From: Dave Korn <dave dot korn dot cygwin at googlemail dot com>
- To: Doug Evans <dje at sebabeach dot org>
- Cc: Dave Korn <dave dot korn dot cygwin at googlemail dot com>, cgen at sourceware dot org
- Date: Wed, 19 Aug 2009 04:55:13 +0100
- Subject: Re: "make gas-test" broken?
- References: <4A6B1A40.1020405@gmail.com> <4A8AD9F7.30605@sebabeach.org>
Doug Evans wrote:
> btw, here's how I'm testing gas-test.
>
> bash$ cd src/cgen
> bash$ guile
> guile> (load "dev.scm")
> guile> (load-gtest)
> guile> (cload #:arch "../cpu/m32r.cpu") ; replace with path to your cpu
> file of course
> guile> (cgen-build.sh)
> guile> (cgen-all-insn.exp)
>
> That should run without any errors.
Hmm. Not for me it doesn't: cgen-build.sh give me:
> Backtrace:
> In ./gas-test.scm:
> 57: 0* [list-ref ((a0 0) (a1 1)) {3}]
> 57: 1* [car ...
> 57: 2* [->string ...
> 52: {3}* [string-append "" "" ...
> In unknown file:
> ?: 4* [#<procedure #f (n)> {3}]
> In ./gas-test.scm:
> 51: 5 [map #<procedure #f (n)> (0 {3} 2 1 1 1 2 0)]
> ...
> In ./cos.scm:
> 1106: 6 (if class-desc.meth (apply (cdr class-desc.meth) (cons # args)) ...)
> 1104: 7 (let* ((class-desc.meth #)) (if class-desc.meth (apply # #) ...))
> In ./gas-test.scm:
> 132: 8 [send #(#("object" # h-accums ...) (# #f # ...)) test-data ...]
> In unknown file:
> ?: 9 [#<procedure #f (self n)> #(#("object" # accs ...) (# #f # ...)) 8]
> In ./cos.scm:
> 1107: 10 [apply #<procedure #f (self n)> (#(#("object" # accs ...) (# #f # ...)
> ) 8)]
> 1106: 11 (if class-desc.meth (apply (cdr class-desc.meth) (cons # args)) ...)
> 1104: 12 (let* ((class-desc.meth #)) (if class-desc.meth (apply # #) ...))
> In ./gas-test.scm:
> 140: 13 [send #(#("object" # accs ...) (# #f # ...)) test-data ...]
> 172: 14* [operand-test-data #(#("object" # accs ...) (# #f # ...)) 8]
> In unknown file:
> ?: 15* [#<procedure #f (op)> #(#("object" # accs ...) (# #f # ...))]
> In ./gas-test.scm:
> 172: 16* [map #<procedure #f (op)> (#(# #) #(# #))]
> 172: 17 (let ((test-data #) (len #)) (cond (# #) (else #)))
> 204: 18* [build-test-set (#(# #) #(# #)) 8]
> 202: 19* (let* (# # #) (string-map # test-set))
> 198: 20 [string-append "\x09.text
> " "\x09.global " ... ...
> 285: 21* [gen-gas-test #(#("object" # mvfachi-a "mvfachi-a" ...) (# #f # #f ...
> ))]
> In unknown file:
> ?: 22* [#<procedure #f (insn)> #(#("object" # mvfachi-a ...) (# #f # ...))]
> ?: 23* [map #<procedure #f (insn)> (#(# #) #(# #) #(# #) #(# #) ...)]
> ?: 24 [map]
> In ./utils.scm:
> 100: 25* [apply #<primitive-generic map> (#<procedure #f (insn)> (# # # # ...))
> ]
> 100: 26 [apply #<primitive-procedure string-append> ...
> In ./gas-test.scm:
> 284: 27* [string-map #<procedure #f (insn)> (#(# #) #(# #) #(# #) #(# #) ...)]
> 229: 28 [string-append "#/bin/sh
> # Generate test result data for " m32r ... ...
> In standard input:
> 4: 29* [cgen-build.sh]
>
> ./gas-test.scm:57:29: In procedure list-ref in expression (list-ref test-cases n
> ):
> ./gas-test.scm:57:29: Argument 2 out of range: 3
> ABORT: (out-of-range)
> guile>
And my own target seems to fall at the first hurdle:
> Backtrace:
> In ./gas-test.scm:
> 229: 0 [string-append "#/bin/sh
> # Generate test result data for " ...]
> In standard input:
> 4: 1* [cgen-build.sh]
>
> ./gas-test.scm:229:3: In procedure string-append in expression (string-append "#
> /bin/sh
> # Generate test result data for " (current-arch-name) ...):
> ./gas-test.scm:229:3: Wrong type (expecting string): foobararch
> ABORT: (wrong-type-arg)
> guile>
... where 'foobararch' is the name attribute from my define-arch:
> (define-arch
> (name "foobararch")
> (comment "Example")
> (default-alignment aligned)
> (insn-lsb0? #t)
> (machs foobar24)
> (isas foobarisa)
> )
It doesn't make any difference whether or not I quote 'foobararch' in that
definition.
What can I do next to find out why the m32r regeneration doesn't work for
me? I'm using Guile 1.8.2 (on Cygwin) and I updated cgen from CVS earlier
today; I have no significant local diffs, just this in Makefile.am/in:
-ARCHFILE = $(srcroot)/cpu/$(ARCH).cpu
+ARCHFILE = $(word 1,$(wildcard $(srcroot)/cpu/$(ARCH).cpu
$(srcroot)/cgen/cpu/$(ARCH).cpu))
and this in mode.scm:
(dfm 'HI "16 bit int" '() 'INT 16 2 "int" "'x'" #f #f #f)
+ (dfm 'TQI "24 bit int" '() 'INT 24 3 "int" "'x'" #f #f #f)
(dfm 'SI "32 bit int" '() 'INT 32 4 "int" "'x'" #f #f #f)
(dfm 'DI "64 bit int" '(FN-SUPPORT) 'INT 64 8 "" "'D'" #f #f #f)
@@ -517,6 +518,8 @@ Define a mode, all arguments specified.
8 1 "unsigned int" "'x'" (mode:lookup 'QI) #f #f)
(dfm 'UHI "16 bit unsigned int" '() 'UINT
16 2 "unsigned int" "'x'" (mode:lookup 'HI) #f #f)
+ (dfm 'UTQI "24 bit unsigned int" '() 'UINT
+ 24 3 "unsigned int" "'x'" (mode:lookup 'TQI) #f #f)
... neither of which I'd expect to cause this kind of problem. I guess I'll
try it on a linux vm tomorrow morning and see what happens there.
cheers,
DaveK