guile-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Guile-commits] GNU Guile branch, wip-rtl, updated. v2.1.0-149-gfe0dbf1


From: Andy Wingo
Subject: [Guile-commits] GNU Guile branch, wip-rtl, updated. v2.1.0-149-gfe0dbf1
Date: Wed, 23 Jan 2013 16:14:28 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Guile".

http://git.savannah.gnu.org/cgit/guile.git/commit/?id=fe0dbf1b0a5227fcd2e2aaa2b2095aeca9d46052

The branch, wip-rtl has been updated
       via  fe0dbf1b0a5227fcd2e2aaa2b2095aeca9d46052 (commit)
      from  75b2cc9a56d9de6a5ad39db1493813cb917bdc6f (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit fe0dbf1b0a5227fcd2e2aaa2b2095aeca9d46052
Author: Noah Lavine <address@hidden>
Date:   Wed Jan 23 17:13:15 2013 +0100

    add rtl tests for call and tail-call
    
    * test-suite/tests/rtl.test: Add RTL tests.

-----------------------------------------------------------------------

Summary of changes:
 test-suite/tests/rtl.test |   43 ++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 42 insertions(+), 1 deletions(-)

diff --git a/test-suite/tests/rtl.test b/test-suite/tests/rtl.test
index 891aed2..3de5c74 100644
--- a/test-suite/tests/rtl.test
+++ b/test-suite/tests/rtl.test
@@ -1,6 +1,6 @@
 ;;;; Low-level tests of the RTL assembler -*- mode: scheme; coding: utf-8; -*-
 ;;;;
-;;;;   Copyright (C) 2010, 2011, 2012 Free Software Foundation, Inc.
+;;;;   Copyright (C) 2010, 2011, 2012, 2013 Free Software Foundation, Inc.
 ;;;;
 ;;;; This library is free software; you can redistribute it and/or
 ;;;; modify it under the terms of the GNU Lesser General Public
@@ -122,3 +122,44 @@
                     (accum 1)
                     (accum 2)
                     (accum 3)))))
+
+(with-test-prefix "call"
+  (assert-equal 42
+                (let ((call ;; (lambda (x) (x))
+                       (assemble-program
+                        '((begin-program call)
+                          (assert-nargs-ee/locals 1 0)
+                          (call 1 0 ())
+                          (return 1) ;; MVRA from call
+                          (return 1))))) ;; RA from call
+                  (call (lambda () 42))))
+
+  (assert-equal 6
+                (let ((call-with-3 ;; (lambda (x) (x 3))
+                       (assemble-program
+                        '((begin-program call-with-3)
+                          (assert-nargs-ee/locals 1 1)
+                          (load-constant 1 3)
+                          (call 2 0 (1))
+                          (return 2) ;; MVRA from call
+                          (return 2))))) ;; RA from call
+                  (call-with-3 (lambda (x) (* x 2))))))
+
+(with-test-prefix "tail-call"
+  (assert-equal 3
+                (let ((call ;; (lambda (x) (x))
+                       (assemble-program
+                        '((begin-program call)
+                          (assert-nargs-ee/locals 1 0)
+                          (tail-call 0 0)))))
+                  (call (lambda () 3))))
+
+  (assert-equal 6
+                (let ((call-with-3 ;; (lambda (x) (x 3))
+                       (assemble-program
+                        '((begin-program call-with-3)
+                          (assert-nargs-ee/locals 1 1)
+                          (mov 1 0) ;; R1 <- R0
+                          (load-constant 0 3) ;; R0 <- 3
+                          (tail-call 1 1)))))
+                  (call-with-3 (lambda (x) (* x 2))))))


hooks/post-receive
-- 
GNU Guile



reply via email to

[Prev in Thread] Current Thread [Next in Thread]