1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-17 09:10:22 +02:00

support calls and tail-calls with more than 255 formals

* module/language/tree-il/compile-glil.scm (flatten-lambda-case):
  Support calls and tail-calls with more than 255 formals.

* test-suite/tests/tree-il.test ("many args"): Add a test.
This commit is contained in:
Andy Wingo 2013-03-07 13:59:18 +01:00
parent 8d48877d2c
commit d0ecf8eb9e
2 changed files with 31 additions and 4 deletions

View file

@ -1,7 +1,7 @@
;;;; tree-il.test --- test suite for compiling tree-il -*- scheme -*-
;;;; Andy Wingo <wingo@pobox.com> --- May 2009
;;;;
;;;; Copyright (C) 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
;;;; Copyright (C) 2009, 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
@ -701,6 +701,22 @@
;; reduce the entire thing to #t.
#:opts '(#:partial-eval? #f)))))
(define (sum . args)
(apply + args))
(with-test-prefix "many args"
(pass-if "call with > 256 args"
(equal? (compile `(1+ (sum ,@(iota 1000)))
#:env (current-module))
(1+ (apply sum (iota 1000)))))
(pass-if "tail call with > 256 args"
(equal? (compile `(sum ,@(iota 1000))
#:env (current-module))
(apply sum (iota 1000)))))
(with-test-prefix "tree-il-fold"