diff options
Diffstat (limited to 'test-suite/tests/rtl.test')
-rw-r--r-- | test-suite/tests/rtl.test | 65 |
1 files changed, 35 insertions, 30 deletions
diff --git a/test-suite/tests/rtl.test b/test-suite/tests/rtl.test index ce0a0c2c9..6f61f375f 100644 --- a/test-suite/tests/rtl.test +++ b/test-suite/tests/rtl.test @@ -92,7 +92,7 @@ (begin-standard-arity (x) 4 #f) (br fix-body) (label loop-head) - (br-if-= 2 1 out) + (br-if-= 2 1 #f out) (add 3 2 3) (add1 2 2) (br loop-head) @@ -144,12 +144,11 @@ (assemble-program '((begin-program call ((name . call))) - (begin-standard-arity (f) 2 #f) - (push-frame 2 1) + (begin-standard-arity (f) 7 #f) (mov 5 1) - (call 2) - (return 2) ;; MVRA from call - (return 2) ;; RA from call + (call 5 1) + (receive 2 5 7) + (return 2) (end-arity) (end-program))))) (call (lambda () 42)))) @@ -159,13 +158,12 @@ (assemble-program '((begin-program call-with-3 ((name . call-with-3))) - (begin-standard-arity (f) 3 #f) - (push-frame 2 2) + (begin-standard-arity (f) 7 #f) (mov 5 1) (load-constant 6 3) - (call 2) - (return 2) ;; MVRA from call - (return 2) ;; RA from call + (call 5 2) + (receive 2 5 7) + (return 2) (end-arity) (end-program))))) (call-with-3 (lambda (x) (* x 2)))))) @@ -177,7 +175,8 @@ '((begin-program call ((name . call))) (begin-standard-arity (f) 2 #f) - (tail-call 0 1) + (mov 0 1) + (tail-call 1) (end-arity) (end-program))))) (call (lambda () 3)))) @@ -187,10 +186,10 @@ (assemble-program '((begin-program call-with-3 ((name . call-with-3))) - (begin-standard-arity (f) 3 #f) - (mov 2 1) ;; R1 <- R0 - (load-constant 1 3) ;; R0 <- 3 - (tail-call 1 2) + (begin-standard-arity (f) 2 #f) + (mov 0 1) ;; R0 <- R1 + (load-constant 1 3) ;; R1 <- 3 + (tail-call 2) (end-arity) (end-program))))) (call-with-3 (lambda (x) (* x 2)))))) @@ -202,6 +201,7 @@ '((begin-program get-sqrt-trampoline ((name . get-sqrt-trampoline))) (begin-standard-arity () 2 #f) + (current-module 1) (cache-current-module! 1 sqrt-scope) (load-static-procedure 1 sqrt-trampoline) (return 1) @@ -211,8 +211,9 @@ (begin-program sqrt-trampoline ((name . sqrt-trampoline))) (begin-standard-arity (x) 3 #f) - (cached-toplevel-ref 2 sqrt-scope sqrt) - (tail-call 1 2) + (cached-toplevel-box 2 sqrt-scope sqrt #t) + (box-ref 0 2) + (tail-call 2) (end-arity) (end-program))))) ((get-sqrt-trampoline) 25.0)))) @@ -227,6 +228,7 @@ '((begin-program make-top-incrementor ((name . make-top-incrementor))) (begin-standard-arity () 2 #f) + (current-module 1) (cache-current-module! 1 top-incrementor) (load-static-procedure 1 top-incrementor) (return 1) @@ -235,11 +237,12 @@ (begin-program top-incrementor ((name . top-incrementor))) - (begin-standard-arity () 2 #f) - (cached-toplevel-ref 1 top-incrementor *top-val*) - (add1 1 1) - (cached-toplevel-set! 1 top-incrementor *top-val*) - (return/values 1) + (begin-standard-arity () 3 #f) + (cached-toplevel-box 1 top-incrementor *top-val* #t) + (box-ref 2 1) + (add1 2 2) + (box-set! 1 2) + (return-values 0) (end-arity) (end-program))))) ((make-top-incrementor)) @@ -260,8 +263,9 @@ (begin-program sqrt-trampoline ((name . sqrt-trampoline))) (begin-standard-arity (x) 3 #f) - (cached-module-ref 2 (guile) #t sqrt) - (tail-call 1 2) + (cached-module-box 2 (guile) sqrt #t #t) + (box-ref 0 2) + (tail-call 2) (end-arity) (end-program))))) ((get-sqrt-trampoline) 25.0)))) @@ -281,11 +285,12 @@ (begin-program top-incrementor ((name . top-incrementor))) - (begin-standard-arity () 2 #f) - (cached-module-ref 1 (tests rtl) #f *top-val*) - (add1 1 1) - (cached-module-set! 1 (tests rtl) #f *top-val*) - (return 1) + (begin-standard-arity () 3 #f) + (cached-module-box 1 (tests rtl) *top-val* #f #t) + (box-ref 2 1) + (add1 2 2) + (box-set! 1 2) + (return 2) (end-arity) (end-program))))) ((make-top-incrementor)) |