From: Ludovic Courtès Date: Wed, 26 May 2010 21:14:01 +0000 (+0200) Subject: Clean up `test-suite/vm'. X-Git-Url: http://git.hcoop.net/bpt/guile.git/commitdiff_plain/cad5d935358d5ccabe6106eff997a24a90f9b274 Clean up `test-suite/vm'. * test-suite/vm/Makefile.am: Add copyright/license header. * test-suite/vm/the-bug.txt: Remove. --- diff --git a/test-suite/vm/Makefile.am b/test-suite/vm/Makefile.am index 2bc78142c..0e6e974e2 100644 --- a/test-suite/vm/Makefile.am +++ b/test-suite/vm/Makefile.am @@ -1,3 +1,24 @@ +## Process this file with automake to produce Makefile.in. +## +## Copyright 2005, 2006, 2008, 2009, 2010 Software Foundation, Inc. +## +## This file is part of GUILE. +## +## GUILE is free software; you can redistribute it and/or modify it +## under the terms of the GNU Lesser General Public License as +## published by the Free Software Foundation; either version 3, or +## (at your option) any later version. +## +## GUILE is distributed in the hope that it will be useful, but +## WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +## GNU Lesser General Public License for more details. +## +## You should have received a copy of the GNU Lesser General Public +## License along with GUILE; see the file COPYING.LESSER. If not, +## write to the Free Software Foundation, Inc., 51 Franklin Street, +## Fifth Floor, Boston, MA 02110-1301 USA + TESTS_ENVIRONMENT = \ $(top_builddir)/meta/guile \ -l $(srcdir)/run-vm-tests.scm -e run-vm-tests diff --git a/test-suite/vm/the-bug.txt b/test-suite/vm/the-bug.txt deleted file mode 100644 index 95683f445..000000000 --- a/test-suite/vm/the-bug.txt +++ /dev/null @@ -1,95 +0,0 @@ --*- Outline -*- - -Once (system vm assemble) is compiled, things start to fail in -unpredictable ways. - -* `compile-file' of non-closure-using programs works - -$ guile-disasm t-records.go > t-records.ref.asm -... -$ diff -uBb t-macros.*.asm -$ diff -uBb t-records.*.asm -$ diff -uBb t-global-bindings.*.asm - -* `compile-file' of closure-using programs fails - -ERROR: During compiling t-closure.scm: -ERROR: VM: Wrong type to apply: #( ((parent . #( ((parent . #f) (nexts . 1) (closure? . #f)))) (nexts . 0) (closure? . #f))) [IP offset: 28] - -guile> (vm-debugger (the-vm)) -debug> bt -#1 # #( ((nargs . 0) (nrest . 0) (nlocs . 0) (nexts . 1))) (#( 2) #( ((x external 0))) #( set 0 0) #( #( ((nargs . 0) (nrest . 0) (nlocs . 1) (nexts . 0))) (#( ref #f +) #( 1) #( ref 1 0) #( call 2) #( (2 . 15)) #( ((x++ local 0))) #( set 0) #( ref 0) #( set 1 0) #( ref 0) #( return 0) #())) #( return 0) #())) # ())> -#2 (# #( ...) (#( ...) #( ...) ...)) -#3 (#) -#4 (# #( ...) (#( ...) #( ...) ...)) -#5 (#) -#6 (# ref ...) -#7 (_l 1 #( ...)) -guile> (vm-debugger (the-vm)) -debug> stack -(#t closure? #( ((parent . #( ((parent . #f) (nexts . 1) (closure? . #f)))) (nexts . 0) (closure? . #f))) # # # #) - -* Compiling anything "by hand" fails - -** Example 1: the read/compile/run loop - -guile> (set! %load-path (cons "/home/ludo/src/guile-vm/module" %load-path)) -guile> (use-modules (system vm assemble)(system vm core)(system repl repl)) -guile> (start-repl 'scheme) -Guile Scheme interpreter 0.5 on Guile 1.7.2 -Copyright (C) 2001 Free Software Foundation, Inc. - -Enter `,help' for help. -scheme@guile-user> (use-modules (ice-9 match) - (system base syntax) - (system vm assemble)) - -(define (%preprocess x e) - (match x - (($ vars body) - (let* ((venv ( :parent e :nexts (slot vars 'nexts) :closure? #f)) - (body (map (lambda (x) (preprocess x venv)) body))) - ( :venv venv :glil x :body body))) - (($ op depth index) - (do ((d depth (1- d)) - (e e (slot e 'parent))) - ((= d 0)) - (set! (slot e 'closure?) #t)) - x) - (else x))) - -scheme@guile-user> preprocess -# -scheme@guile-user> (getpid) -470 -scheme@guile-user> (set! preprocess %preprocess) -scheme@guile-user> preprocess -ERROR: VM: Unbound variable: #> -scheme@guile-user> getpid -ERROR: VM: Unbound variable: #> -scheme@guile-user> - - -** Example 2: the test suite (which also reads/compiles/runs) - -All the closure-using tests fail. - -ludo@lully:~/src/guile-vm/testsuite $ make check -../src/guile-vm -L ../module \ - -l run-vm-tests.scm -e run-vm-tests \ - t-global-bindings.scm t-closure.scm t-closure2.scm t-closure3.scm t-do-loop.scm t-macros.scm t-proc-with-setter.scm t-values.scm t-records.scm t-match.scm - -running `t-global-bindings.scm'... reading... compiling... running... ok -running `t-closure.scm'... reading... compiling... [vm-error/(vm-run VM: Wrong type to apply: ~S [IP offset: ~a] (#( ((parent . #( ((parent . #f) (nexts . 1) (closure? . #f)))) (nexts . 0) (closure? . #f))) 28))] FAILED -running `t-closure2.scm'... reading... compiling... [vm-error/(vm-run VM: Wrong type to apply: ~S [IP offset: ~a] (#( ((parent . #( ((parent . #( ((parent . #f) (nexts . 0) (closure? . #f)))) (nexts . 1) (closure? . #f)))) (nexts . 0) (closure? . #f))) 28))] FAILED -running `t-closure3.scm'... reading... compiling... [vm-error/(vm-run VM: Wrong ype to apply: ~S [IP offset: ~a] (#( ((parent . #( ((parent . #( ((parent . #f) (nexts . 0) (closure? . #f)))) (nexts . 1) (closure? . #f)))) (nexts . 0) (closure? . #f))) 28))] FAILED -running `t-do-loop.scm'... reading... compiling... [vm-error/(vm-run VM: Wrong type to apply: ~S [IP offset: ~a] (#( ((parent . #( ((parent . #f) (nexts . 1) (closure? . #f)))) (nexts . 0) (closure? . #f))) 28))] FAILED -running `t-macros.scm'... reading... compiling... running... ok -running `t-proc-with-setter.scm'... reading... compiling... running... ok -running `t-values.scm'... reading... compiling... running... ok -running `t-records.scm'... reading... compiling... running... ok -running `t-match.scm'... reading... compiling... running... ok - -4 tests failed out of 10 -make: *** [check] Error 4 -