summaryrefslogtreecommitdiff
path: root/test-suite/tests
AgeCommit message (Collapse)AuthorFilesLines
2013-11-28Merge commit '8571dbde639e0ee9885bad49c9e180474bd23646'Andy Wingo3-15/+111
Conflicts: libguile/procprop.c
2013-11-22Convert test-suite/tests/exceptions.test to use hygienic macros.Chris K. Jester-Young1-12/+14
* test-suite/tests/exceptions.test (push): New syntax parameter. (throw-test): Convert to a syntax-rules macro, using syntax parameters to support the otherwise-unhygienic use of "push".
2013-11-21No more VM objects visible to SchemeAndy Wingo3-24/+21
* libguile/vm.h: * libguile/vm.c (scm_the_vm): Don't expose to Scheme. (scm_vm_p): Remove, as it is not needed. * module/system/vm/vm.scm: Remove the-vm and vm? exports. * doc/ref/api-coverage.texi (Code Coverage): * test-suite/tests/coverage.test: * module/system/vm/coverage.scm (with-code-coverage): Don't take a VM argument. Adapt documentation and tests. * module/ice-9/command-line.scm: Remove the-vm autoload. * module/system/vm/trace.scm (trace-calls-to-procedure): (trace-calls-in-procedure): (trace-instructions-in-procedure): (call-with-trace): Remove #:vm kwarg, and adapt to trap changes. * module/system/vm/trap-state.scm (the-trap-state): Rework to use a parameter underneath instead of a weak key on (the-vm). * module/system/vm/traps.scm (new-disabled-trap): (new-enabled-trap): Remove vm argument. (trap-at-procedure-call): (trap-in-procedure): (trap-instructions-in-procedure): (trap-at-procedure-ip-in-range): (trap-at-source-location): (trap-frame-finish): (trap-in-dynamic-extent): (trap-calls-in-dynamic-extent): (trap-instructions-in-dynamic-extent): (trap-calls-to-procedure): (trap-matching-instructions): Remove vm keyword arguments. * test-suite/tests/control.test ("unwind"): Adapt test. * test-suite/tests/eval.test (test-suite): Remove the-vm import.
2013-11-21VM accessors take VM as implicit argument, not explicit argumentAndy Wingo2-4/+3
* libguile/vm.h: * libguile/vm.c: (scm_vm_apply_hook, scm_vm_push_continuation_hook, scm_vm_pop_continuation_hook, scm_vm_abort_continuation_hook, scm_vm_restore_continuation_hook, scm_vm_next_hook, scm_vm_trace_level, scm_set_vm_trace_level_x, scm_vm_engine, scm_set_vm_engine_x, scm_c_set_vm_engine_x): The VM argument is now implicit: the VM for the current thread. * doc/ref/api-debug.texi (VM Hooks): Try to adapt. * module/ice-9/command-line.scm: * module/statprof.scm: * module/system/vm/coverage.scm: * module/system/vm/trace.scm: * module/system/vm/trap-state.scm: * module/system/vm/traps.scm: * test-suite/tests/control.test: * test-suite/tests/eval.test: Adapt users that set hooks or ensure that we have a debug engine.
2013-11-21Remove make-vm; there will be one vm per thread now.Andy Wingo3-10/+7
* libguile/vm.h: * libguile/vm.c (scm_make_vm): Remove. * module/system/vm/vm.scm: Remove make-vm export. * test-suite/tests/control.test ("the-vm"): * test-suite/tests/coverage.test (%test-vm): * test-suite/tests/eval.test ("stack overflow"): Adapt tests.
2013-11-19Rename objcodes?.{scm,c,h} to loader.{scm,c,h}Andy Wingo4-4/+4
* libguile/loader.c: * libguile/loader.h: Rename from objcodes.[ch]. * module/system/vm/loader.scm: Rename from objcode.scm. * libguile/Makefile.am: * libguile/gsubr.c: * libguile/init.c: * libguile/procs.c: * libguile/vm.c: * module/Makefile.am: * module/ice-9/eval-string.scm: * module/language/rtl/spec.scm: * module/system/base/target.scm: * module/system/repl/command.scm: * module/system/repl/common.scm: * module/system/vm/debug.scm: * module/system/vm/disassembler.scm: * module/system/vm/objcode.scm: * test-suite/tests/compiler.test: * test-suite/tests/dwarf.test: * test-suite/tests/rtl-compilation.test: * test-suite/tests/rtl.test: Adapt.
2013-11-19rtl-program-code -> program-codeAndy Wingo2-7/+7
* libguile/programs.h: * libguile/programs.c (scm_program_code): Rename from scm_rtl_program_code. Also renames rtl-program-code to program-code. * module/statprof.scm: * module/system/repl/command.scm: * module/system/repl/debug.scm: * module/system/vm/coverage.scm: * module/system/vm/disassembler.scm: * module/system/vm/program.scm: * module/system/vm/traps.scm: * test-suite/tests/dwarf.test: * test-suite/tests/rtl.test: Adapt callers.
2013-11-18Add procedures to convert alists into hash tables.David Thompson1-1/+37
* module/ice-9/hash-table.scm: New module. * test-suite/tests/hash.test ("alist conversion"): Add tests. * doc/ref/api-compound.texi (Hash Table Reference): Add docs.
2013-11-18Convert guile exceptions to R6RS conditions in R6RS exception handlers.Mark H Weaver1-2/+60
* module/rnrs/exceptions.scm (&guile): New condition type. (guile-condition-converters): New variable. (convert-guile-condition, default-guile-condition-converter, set-guile-condition-converter!, guile-common-conditions, guile-lexical-violation-converter, guile-syntax-violation-converter, guile-assertion-violation-converter, guile-system-error-converter, guile-undefined-violation-converter, guile-error-converter, guile-implementation-restriction-converter): New procedures. (with-exception-handler): Catch all exceptions, not just R6RS exceptions. Convert native Guile exceptions to R6RS conditions, preserving the original Guile exception information in the &guile condition object. (raise): If the condition includes a &guile condition, use 'throw' to throw the original native guile exception instead of raising an R6RS exception. * test-suite/tests/r6rs-exceptions.test ("guile condition conversions"): Add tests.
2013-11-08Move assemble-program to test cases.Andy Wingo1-0/+10
* module/system/vm/assembler.scm (assemble-program): Remove. * test-suite/tests/rtl.test (assemble-program): Move here.
2013-11-08Move useful parts of asm-to-bytecode.test to cross-compilation.testAndy Wingo2-217/+90
* test-suite/tests/cross-compilation.test: Rename from asm-to-bytecode, and remove the bits testing assembly->bytecode but keep the cross-compilation things. * test-suite/Makefile.am: Adapt.
2013-11-08Tree-IL warnings tests compile to CPS instead of "assembly"Andy Wingo1-100/+100
* test-suite/tests/tree-il.test ("warnings"): Change warnings test to compile to CPS instead of assembly.
2013-11-08Remove tree-il->glil test casesAndy Wingo1-578/+8
* test-suite/tests/tree-il.test: Remove GLIL test cases. They have never been helpful to me in the 2.0 series, so there is no loss.
2013-11-08Remove a couple of uses of GLIL from the test suite.Andy Wingo2-6/+3
* test-suite/tests/cse.test ("cse"): * test-suite/tests/peval.test: Remove uses of GLIL.
2013-11-08Fix procedure-arguments on RTL programs, and tweak session.testAndy Wingo1-3/+3
* module/ice-9/session.scm (procedure-arguments): Add an rtl-program? case. * module/system/vm/debug.scm (arity-arguments-alist): Use the order that session.test expects. * test-suite/tests/session.test ("procedure-arguments"): Adapt tests with keywords for the new starting-with-the-procedure numbering of locals.
2013-11-08Fix make-vector peval testAndy Wingo1-1/+1
* test-suite/tests/peval.test ("partial evaluation"): Fix to expect a primcall.
2013-11-08Fix eval.test: stack involving a primitiveAndy Wingo1-3/+1
* test-suite/tests/eval.test ("stacks"): Revert expect-fail introduced in 27337b6373954e1a975d97d0bf06b5c03d65b64d.
2013-11-08Fix coverage.test: instrumented-source-filesAndy Wingo1-1/+1
* test-suite/tests/coverage.test ("instrumented-source-files"): Adapt to new expectation that all files loaded on the system will be present in the source information.
2013-11-08Fix coverage.test: "procedure-execution-count: never"Andy Wingo1-1/+1
* test-suite/tests/coverage.test ("procedure-execution-count"): Adapt test to new behavior of procedure-execution-count of an unseen procedure: zero, not false.
2013-11-08Fix coverage.test: "line-execution-counts: one proc hit, one proc unused"Andy Wingo1-4/+3
* test-suite/tests/coverage.test ("line-execution-counts"): Fix test for even/odd? in letrec. The test profiles the execution of even?, not the letrec, so the last line is in fact not reached.
2013-11-07Fix DWARF source test now that we have more precise source info.Andy Wingo1-5/+7
* test-suite/tests/dwarf.test: Fix test after the $continue/$cont source change, which reifies proper source info for the +.
2013-11-05compiler.test fix for rtl compilationAndy Wingo1-4/+4
* test-suite/tests/compiler.test ("current-reader"): Fix the way we make programs from objcode.
2013-11-05squish to primitive reificationAndy Wingo1-4/+9
* test-suite/tests/tree-il.test: Update for primitive-ref reification fix.
2013-11-03Fix test case for uniform-array->bytevector on bitvectorsAndy Wingo1-3/+11
* test-suite/tests/bytevectors.test ("uniform-array->bytevector"): Bitvectors are accessed in 32-bit chunks.
2013-10-31Support serialization of uniform vector literalsAndy Wingo1-1/+5
* libguile/uniform.h: * libguile/uniform.c (scm_uniform_vector_element_type_code): New interface, returns a type code as an integer. * module/system/vm/assembler.scm (<uniform-vector-backing-store>) (simple-vector?, uniform-array?, statically-allocatable?) (intern-constant, link-data, link-constants): Support uniform arrays, and punt on vectors aren't contiguous from 0. Support for general arrays will come later. * test-suite/tests/rtl.test ("load-constant"): Add tests.
2013-10-18Foreign procedures are RTL programsAndy Wingo1-0/+5
* libguile/foreign.c: Convert to using RTL stubs. Because RTL code has different GC characteristics than objcode -- it's mostly assumed that RTL code will never go away -- we go ahead and pre-generate code for 100 arguments. This is actually less memory than the stack VM code, and doesn't require any relocations at load-time: bonus! We'll cross the >=100 args bridge if we ever come to it. (get_foreign_stub_code) New function. (scm_i_foreign_arity): New helper, like scm_i_primitive_arity. (cif_to_procedure): Rework to make RTL programs. * libguile/foreign.h: Declare scm_pointer_to_scm and scm_scm_to_pointer. Declare new internal helpers. * libguile/gsubr.c (create_subr): Refactor to set the flags when the object is allocated. * libguile/instructions.h: Define SCM_PACK_RTL_12_12. * libguile/programs.c (scm_i_rtl_program_minimum_arity): Dispatch to scm_i_foreign_arity if the procedure has the FOREIGN flag. * libguile/programs.h (SCM_F_PROGRAM_IS_FOREIGN) (SCM_PROGRAM_IS_FOREIGN): New interfaces. * test-suite/tests/foreign.test ("procedure->pointer"): Add a test for foreign arities.
2013-10-18Subrs are RTL programsAndy Wingo1-2/+4
* libguile/gsubr.c: Define RTL stubs instead of stack VM stubs. (SUBR_STUB_CODE, get_subr_stub_code): Adapt to return a uint32_t* pointer instead of a SCM value. (create_subr): Create RTL procedures instead of stack VM procedures. For RTL procedures, the function pointer, name, and generic address pointer go inline to the procedure, as free variables. (scm_i_primitive_arity, scm_i_primitive_call_ip): New helpers. (scm_c_make_gsubr, scm_c_define_gsubr, scm_c_make_gsubr_with_generic) (scm_c_define_gsubr_with_generic): Adapt to create_gsubr being renamed to create_subr. Remove gsubr test code. * libguile/gsubr.h (SCM_PRIMITIVE_P, SCM_PRIMITIVE_GENERIC_P): Only RTL programs can be primitives now. (SCM_SUBRF, SCM_SUBR_NAME, SCM_SUBR_GENERIC): These fields are now in the RTL free variables, not the object table. * libguile/programs.c (scm_i_rtl_program_name): (scm_i_rtl_program_documentation): (scm_i_rtl_program_properties): (scm_i_rtl_program_minimum_arity): Implement these appropriately for primitives, which lack debugging information. (scm_primitive_p, scm_primitive_call_ip): New helpers. * libguile/snarf.h: Remove static allocation for subrs. Since there is nothing to allocate besides the program itself, which needs runtime relocation, static allocation is not a win. * system/vm/program.scm: Fix up various arity-related things for primitives, which don't use ELF arity info. * test-suite/tests/eval.test ("stack involving a primitive"): Add an XFAIL until we get just one VM.
2013-10-12Identify loopsAndy Wingo1-1/+12
* module/language/cps/dfg.scm (compute-dom-edges) (compute-join-edges, compute-reducible-back-edges) (compute-irreducible-dom-levels, compute-nodes-by-level) (mark-loop-body, mark-irreducible-loops, identify-loops): Identify loops. Irreducible loops are TODO. * test-suite/tests/rtl-compilation.test ("contification"): Add an irreducible loop test.
2013-10-10Fix peval bug with inlining and optional argument initializersAndy Wingo1-1/+9
* module/language/tree-il/peval.scm (peval): Fix a bug whereby inlined function applications with default argument initializers were putting the initializers in the wrong scope. * test-suite/tests/peval.test ("partial evaluation"): Add a test.
2013-10-04add contification testAndy Wingo1-1/+10
* test-suite/tests/rtl-compilation.test ("contification"): Add contification test where non-recursive call is not in tail position relative to the letrec.
2013-10-03Fix edge case in 'ash'.Mark H Weaver1-1/+7
* libguile/numbers.c (left_shift_exact_integer): Fix edge case where N is -1 and count is SCM_I_FIXNUM_BIT-1 to return the most negative fixnum. Previously this result was returned as a bignum. * test-suite/tests/numbers.test (ash): Add tests.
2013-10-03Revert "Fix edge case in 'ash'."Mark H Weaver1-7/+1
This reverts commit 8df68898b9f6ba15171244f1f3549688f13d605f.
2013-10-03Merge remote-tracking branch 'origin/stable-2.0'Andy Wingo1-1/+7
Conflicts: libguile/deprecated.h libguile/programs.c libguile/programs.h
2013-10-03Fix edge case in 'ash'.Mark H Weaver1-1/+7
* libguile/numbers.c (scm_ash): Fix (ash -1 SCM_I_FIXNUM_BIT-1) to return a fixnum instead of a bignum. * test-suite/tests/numbers.test (ash): Add tests.
2013-10-03Add source location testAndy Wingo1-0/+88
* test-suite/tests/dwarf.test: New test, testing that source location information survives the round-trip through the compiler, back out to the (system vm debug) interfaces.
2013-09-13Merge remote-tracking branch 'origin/stable-2.0'Mark H Weaver1-3/+7
Conflicts: module/srfi/srfi-9.scm module/web/server.scm
2013-09-12Adapt srfi-9.test to error reporting improvements; update copyright dates.Mark H Weaver1-3/+7
* module/srfi/srfi-9.scm: Add 2013 copyright date. * test-suite/tests/srfi-9.test: Adapt to recent error reporting improvements to procedures defined by 'define-tagged-inlinable'.
2013-08-31Add CPS -> RTL compilerAndy Wingo1-0/+200
* module/Makefile.am: * module/language/cps/compile-rtl.scm: * module/language/cps/dfg.scm: * module/language/cps/slot-allocation.scm: New modules. * module/language/cps/spec.scm: Register the compiler. * test-suite/Makefile.am: * test-suite/tests/rtl-compilation.test: Add tests.
2013-08-24RTL: 'return-values' instruction assumes 'reset-frame' has been called.Mark H Weaver1-1/+2
* libguile/vm-engine.c (return-values): Remove NVALUES operand. Don't reset the frame. * test-suite/tests/rtl.test ("cached-toplevel-set!"): Adapt to the fact that 'return-values' has no operand now, and that 'reset-frame' must be done first.
2013-08-23Merge remote-tracking branch 'origin/stable-2.0'Mark H Weaver1-0/+4
2013-08-19`write-request-line' always prints a path component.Ian Price1-0/+4
* module/web/http.scm (write-request-line): Always write "/" when path is empty, regardless of query. * test-suite/tests/web-http.test ("write-request-line"): Add test.
2013-08-16In bytevector->uint-list et al, check that SIZE divides the bv length.Mark H Weaver1-8/+3
Fixes <http://bugs.gnu.org/15100>. Reported by Göran Weinholt <goran@weinholt.se>. * libguile/bytevectors.c (INTEGERS_TO_LIST): Enforce the R6RS requirement that SIZE divides the bytevector length. * test-suite/tests/bytevectors.test: Add test. Remove tests that assumes that this "divides" check is not enforced.
2013-08-16Merge remote-tracking branch 'origin/stable-2.0'Mark H Weaver1-1/+9
2013-08-16Improved error checking in bytevector->uint-list and bytevector->sint-list.Mark H Weaver1-1/+9
Partially fixes <http://bugs.gnu.org/15100>. Reported by Göran Weinholt <goran@weinholt.se>. * libguile/bytevectors.c (INTEGERS_TO_LIST): Make sure SIZE isn't 0. Allow SIZE to be greater than the bytevector length, for consistency with allowing extra bytes at the end when the bytevector length is non-zero. Use scm_from_size_t instead of scm_from_uint. * test-suite/tests/bytevectors.test: Add tests. Remove a test that checks for an exception when SIZE is greater than the bytevector length.
2013-08-13Adapt peval.test to recent associativity fixes of numeric ops.Mark H Weaver1-12/+9
* test-suite/tests/peval.test ("partial evaluation"): Adapt tests to the fact that arithmetic operators are now expanded into binary ops with left-to-right associativity.
2013-08-11Merge remote-tracking branch 'origin/stable-2.0'Mark H Weaver4-61/+49
2013-08-11Broken Turkish UTF-8 locale still unresolved in FreeBSD 9.1.Mark H Weaver1-4/+6
* test-suite/tests/i18n.test (under-turkish-utf8-locale-or-unresolved): Disable tests of Turkish UTF-8 locale in FreeBSD 9.1.
2013-08-11Various RTL VM and calling convention tweaksAndy Wingo1-30/+35
* libguile/instructions.c (FOR_EACH_INSTRUCTION_WORD_TYPE): Allow for five-word instructions, and for new instruction word types. * libguile/vm-engine.c (RETURN_ONE_VALUE): Instead of returning the value in the fixed part of the call frame, return it in the same place multiple-value returns go: from slot 1. (BR_ARITHMETIC): Allow arithmetic tests to be negated. (rtl_vm_engine): Change calling convention to use the same location for single and multiple-value returns. Renumber all instructions. (halt, halt/values): Fold into a single instruction (halt). (call): Take the location of the procedure instead of the location of the call frame. Also take the number of args, and reset the sp before jumping to the procedure, so as to indicate the number of arguments. (call/values): Remove, as the new calling convention has RA == MVRA. (tail-call): Require the procedure to be shuffled down already, and take "nlocals" as an arg instead of "nargs". (receive, receive-values): New instructions, for receiving returned values from calls. (return-values): Rename from return/values. Remove "values". (alloc-frame): Rename from reserve-locals. (reset-frame): New instruction. (drop-locals): Remove. (br-if-=, br-if-<, br-if-<=): Allow these instructions to be negatable. (br-if->, br-if->=): Remove. Probably a bad idea, given NaN. (box-ref): Don't bother trying to do a reverse lookup -- the toplevel-box, module-box, and resolve instructions should handle that. (resolve): Add arg to check that the variable is bound. (toplevel-box, module-box): New instructions, replacing toplevel-ref, toplevel-set, module-ref, and module-set. * libguile/vm.c (rtl_boot_continuation_code, rtl_values_code): Adapt to instruction set changes. * module/Makefile.am: Make the assembler and disassembler dependent on vm-operations.h. * module/system/vm/assembler.scm: * module/system/vm/disassembler.scm: Adapt to instruction changes and new instruction word kinds. * test-suite/tests/rtl.test: Adapt to instruction set changes.
2013-08-11Inline escape-only prompt bodies in the Tree-ILAndy Wingo1-4/+1
* module/language/scheme/decompile-tree-il.scm (do-decompile): * module/language/tree-il/analyze.scm (analyze-lexicals): * module/language/tree-il/canonicalize.scm (canonicalize): * module/language/tree-il/compile-glil.scm (flatten-lambda-case): * module/language/tree-il/cse.scm (cse): * module/language/tree-il/peval.scm (peval): * test-suite/tests/peval.test ("partial evaluation"): Partially revert 178a40928, so that escape-only prompts explicitly inline their bodies.
2013-08-11remove peval abort-in-tail-position optimizationAndy Wingo1-0/+3
* module/language/tree-il/peval.scm (peval): Remove abort optimization; the CPS compiler will do much better here, and it is complicating things in the meantime.