aboutsummaryrefslogtreecommitdiffstats
path: root/csc/codegen-test.csc
diff options
context:
space:
mode:
Diffstat (limited to 'csc/codegen-test.csc')
-rw-r--r--csc/codegen-test.csc17
1 files changed, 14 insertions, 3 deletions
diff --git a/csc/codegen-test.csc b/csc/codegen-test.csc
index 9c47661..b85ebc3 100644
--- a/csc/codegen-test.csc
+++ b/csc/codegen-test.csc
@@ -8,10 +8,14 @@
make-fix
make-primitive
make-variable)
+ (only (csc loop)
+ loop
+ return)
(only (csc match)
match)
(only (csc testing)
- assert-equal)
+ assert-equal
+ test)
(csc codegen))
@@ -21,7 +25,12 @@
(match expr
(('label _) #t)
(_ #f)))
- (lambda (expr) 'label))))
+ (lambda (expr) 'label))
+ (cons (lambda (expr)
+ (match expr
+ (('local _) #t)
+ (_ #f)))
+ (lambda (expr) 'local))))
(define (test-var)
@@ -30,7 +39,9 @@
(test codegen-apply
(assert-equal
- 'something
+ '((peek (local #f) (local #f) (const 5))
+ (mov (local #f) (const 10))
+ (jmp (local #f)))
(ir2->ir3
(make-fix '()
(make-primitive 'peek (list *globals* (make-constant 5)) (list (test-var))