From ac23fca796d6dc6fc7aab0ac5bdf8987aa490761 Mon Sep 17 00:00:00 2001 From: Rose Hogenson Date: Sun, 24 Jul 2022 20:29:19 -0700 Subject: Write a test for codegen. I'm not sure yet how to test regalloc. --- csc/codegen.csc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'csc/codegen.csc') diff --git a/csc/codegen.csc b/csc/codegen.csc index c51420e..aab8e23 100644 --- a/csc/codegen.csc +++ b/csc/codegen.csc @@ -27,6 +27,7 @@ closure-arguments closure-body closure-name + constant-expression constant? fix-body fix-functions @@ -186,7 +187,7 @@ else if (globals? arg) do (set! in->out (insert in->out 0 i)) else if (constant? arg) - collect (list 'mov (list 'local i) (list 'const arg)) + collect (list 'mov (list 'local i) (list 'const (constant-expression arg))) else if (label? arg) collect (list 'mov (list 'local i) (list 'label (translate-label arg))) else if (library-ref? arg) -- cgit v1.3.1