aboutsummaryrefslogtreecommitdiffstats
path: root/csc/macros-test.csc
diff options
context:
space:
mode:
Diffstat (limited to 'csc/macros-test.csc')
-rw-r--r--csc/macros-test.csc25
1 files changed, 22 insertions, 3 deletions
diff --git a/csc/macros-test.csc b/csc/macros-test.csc
index 23a9cfc..6211131 100644
--- a/csc/macros-test.csc
+++ b/csc/macros-test.csc
@@ -9,7 +9,10 @@
lexical-set-name
lexical-set?
make-constant
+ make-lexical-ref
make-lambda-case
+ make-letrec
+ make-library-ref
void?)
(only (csc testing)
assert-equal
@@ -175,12 +178,28 @@
builtins-environment)))
-(test builtin-case-lambda
+(test builtin-case-lambda-cases
(assert-equal ir1=?
- (make-lambda-case '(x y z) #f #f (make-constant 5)
- (make-lambda-case '(a b c) 'd #f (make-constant 6) '()))
+ (make-lambda-case '(x y z) #f #f (make-sequence (make-void) (make-constant 5))
+ (make-lambda-case '(a b c) 'd #f (make-sequence (make-void) (make-constant 6)) '()))
(expand
'(case-lambda
((x y z) (quote 5))
((a b c . d) (quote 6)))
builtins-environment)))
+
+
+(test builtin-case-lambda-defines
+ (assert-equal ir1=?
+ (make-lambda-case '(x) #f #f
+ (make-letrec #t '(a b) #f
+ (list (make-constant 6)
+ (make-lexical-ref 'a #f))
+ (make-sequence (make-void) (make-constant 7))))
+ (expand
+ '(case-lambda
+ ((x)
+ (builtin-define a (quote 6))
+ (builtin-define b a)
+ (quote 7)))
+ builtins-environment)))