boot: Add gc test.

* scaffold/boot/gc.test: New file.
* build-aux/check-boot.sh (TESTS): Add it.
* include/mes/symbols.h (cell_symbol_program): New symbol.
* src/symbol.c (init_symbols_): Initialize it.
* src/mes.c (main): Add it to environment.
This commit is contained in:
Jan (janneke) Nieuwenhuizen 2020-08-16 17:36:55 +02:00
parent 17805e9d3a
commit 9e684b9886
No known key found for this signature in database
GPG key ID: F3C1A0D9C1D65273
5 changed files with 36 additions and 2 deletions

View file

@ -110,6 +110,7 @@ scaffold/boot/50-primitive-load.scm
scaffold/boot/53-closure-display.scm
scaffold/boot/60-let-syntax.scm
scaffold/boot/call-cc.scm
scaffold/boot/gc.scm
scaffold/boot/memory.scm
scaffold/boot/numbers.scm
"

View file

@ -138,10 +138,11 @@ SCM cell_type_values;
SCM cell_type_variable;
SCM cell_type_vector;
SCM cell_type_broken_heart;
SCM cell_symbol_program;
SCM cell_symbol_test;
// CONSTANT SYMBOL_MAX 119
#define SYMBOL_MAX 119
// CONSTANT SYMBOL_MAX 120
#define SYMBOL_MAX 120
// CONSTANT CELL_UNSPECIFIED 7
#define CELL_UNSPECIFIED 7

30
scaffold/boot/gc.scm Normal file
View file

@ -0,0 +1,30 @@
;;; GNU Mes --- Maxwell Equations of Software
;;; Copyright © 2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
;;;
;;; This file is part of GNU Mes.
;;;
;;; GNU Mes is free software; you can redistribute it and/or modify it
;;; under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 3 of the License, or (at
;;; your option) any later version.
;;;
;;; GNU Mes 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 General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with GNU Mes. If not, see <http://www.gnu.org/licenses/>.
(core:display "program:")
(core:write %program)
(core:display "\n")
(gc)
(core:display "1 program:")
(core:write %program)
(core:display "\n")
(gc)
(core:display "2 program:")
(core:write %program)
(core:display "\n")
(gc)

View file

@ -196,6 +196,7 @@ main (int argc, char **argv, char **envp)
module_printer (M0);
SCM program = read_boot ();
R0 = acons (cell_symbol_program, program, R0);
push_cc (R2, cell_unspecified, R0, cell_unspecified);
if (g_debug > 2)

View file

@ -178,6 +178,7 @@ init_symbols_ () /*:((internal)) */
cell_type_variable = init_symbol (g_symbol, TSYMBOL, "<cell:variable>");
cell_type_vector = init_symbol (g_symbol, TSYMBOL, "<cell:vector>");
cell_type_broken_heart = init_symbol (g_symbol, TSYMBOL, "<cell:broken-heart>");
cell_symbol_program = init_symbol (g_symbol, TSYMBOL, "%program");
cell_symbol_test = init_symbol (g_symbol, TSYMBOL, "%%test");
}