aboutsummaryrefslogtreecommitdiffstats
path: root/lib/csc/macros-test.csc
diff options
context:
space:
mode:
Diffstat (limited to 'lib/csc/macros-test.csc')
-rw-r--r--lib/csc/macros-test.csc24
1 files changed, 24 insertions, 0 deletions
diff --git a/lib/csc/macros-test.csc b/lib/csc/macros-test.csc
index 531e3e2..9b4c128 100644
--- a/lib/csc/macros-test.csc
+++ b/lib/csc/macros-test.csc
@@ -32,9 +32,11 @@
make-call-builtin
make-constant
make-define-syntax
+ make-if
make-lambda
make-letrec
make-lexical-ref
+ make-lexical-set
make-library-ref
make-sequence
sequence?)
@@ -291,4 +293,26 @@
(expand-body 'main
'((call-builtin bbb 5))
builtins-environment)
+ transform-ir1))
+
+
+ (test builtin-lexical-set
+ (assert-equal
+ (make-lambda (list (test-ref 'x)) #f
+ (make-sequence
+ (make-constant #f)
+ (make-lexical-set (test-ref 'x) (make-constant 5))))
+ (expand-body 'main
+ '((lambda (x)
+ (set! x 5)))
+ builtins-environment)
+ transform-ir1))
+
+
+ (test builtin-if
+ (assert-equal
+ (make-if (make-constant #t) (make-constant 5) (make-constant 10))
+ (expand-body 'main
+ '((builtin-if #t 5 10))
+ builtins-environment)
transform-ir1))))