fixing code and adding some more test cases
This commit is contained in:
parent
e13f26ff61
commit
d2fa527872
|
@ -1538,7 +1538,7 @@
|
||||||
;; Finally, make sure any multiple values are off the stack.
|
;; Finally, make sure any multiple values are off the stack.
|
||||||
(if (> (length ids) 1)
|
(if (> (length ids) 1)
|
||||||
(make-instruction-sequence
|
(make-instruction-sequence
|
||||||
`(,(make-PopEnvironment (make-Const (length ids))
|
`(,(make-PopEnvironment (make-Const (sub1 (length ids)))
|
||||||
(make-Const 0))))
|
(make-Const 0))))
|
||||||
empty-instruction-sequence)))))
|
empty-instruction-sequence)))))
|
||||||
|
|
||||||
|
|
|
@ -1170,6 +1170,56 @@
|
||||||
-1
|
-1
|
||||||
#:with-bootstrapping? #t)
|
#:with-bootstrapping? #t)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
(test '(begin (define-values () (values))
|
||||||
|
'ok)
|
||||||
|
'ok
|
||||||
|
#:with-bootstrapping? #t)
|
||||||
|
|
||||||
|
(test '(begin (define-values (x y z) (values 3 4 5))
|
||||||
|
x)
|
||||||
|
3
|
||||||
|
#:with-bootstrapping? #t)
|
||||||
|
|
||||||
|
|
||||||
|
(test '(begin (define-values (x y z) (values 3 4 5))
|
||||||
|
y)
|
||||||
|
4
|
||||||
|
#:with-bootstrapping? #t)
|
||||||
|
|
||||||
|
(test '(begin (define-values (x y z) (values 3 4 5))
|
||||||
|
z)
|
||||||
|
5
|
||||||
|
#:with-bootstrapping? #t)
|
||||||
|
|
||||||
|
|
||||||
|
(test '(begin (define-values (x) "hello")
|
||||||
|
x)
|
||||||
|
"hello"
|
||||||
|
#:with-bootstrapping? #t)
|
||||||
|
|
||||||
|
|
||||||
|
(test '(begin (define-values (x) (values "hello"))
|
||||||
|
x)
|
||||||
|
"hello"
|
||||||
|
#:with-bootstrapping? #t)
|
||||||
|
|
||||||
|
|
||||||
|
(test '(begin (define (f x)
|
||||||
|
(values (* x 2)
|
||||||
|
(/ x 2)))
|
||||||
|
(define-values (a b) (f 16))
|
||||||
|
(list a b))
|
||||||
|
(list 32 8)
|
||||||
|
#:with-bootstrapping? #t)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#;(test (read (open-input-file "tests/conform/program0.sch"))
|
#;(test (read (open-input-file "tests/conform/program0.sch"))
|
||||||
(port->string (open-input-file "tests/conform/expected0.txt")))
|
(port->string (open-input-file "tests/conform/expected0.txt")))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user