summaryrefslogtreecommitdiff
path: root/test-suite/tests/compiler.test
diff options
context:
space:
mode:
Diffstat (limited to 'test-suite/tests/compiler.test')
-rw-r--r--test-suite/tests/compiler.test34
1 files changed, 33 insertions, 1 deletions
diff --git a/test-suite/tests/compiler.test b/test-suite/tests/compiler.test
index 70213ca3d..778a8e1ea 100644
--- a/test-suite/tests/compiler.test
+++ b/test-suite/tests/compiler.test
@@ -1,5 +1,5 @@
;;;; compiler.test --- tests for the compiler -*- scheme -*-
-;;;; Copyright (C) 2008, 2009, 2010, 2011, 2012, 2013 Free Software Foundation, Inc.
+;;;; Copyright (C) 2008, 2009, 2010, 2011, 2012, 2013, 2014 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
@@ -164,3 +164,35 @@
(list x y))))
(display (t 'x)))))
"(x y)(x y)")))
+
+(with-test-prefix "limits"
+ (define (arg n)
+ (string->symbol (format #f "arg~a" n)))
+
+ ;; Cons and vector-set! take uint8 arguments, so this triggers the
+ ;; shuffling case. Also there is the case where more than 252
+ ;; arguments causes shuffling.
+
+ (pass-if "300 arguments"
+ (equal? (apply (compile `(lambda ,(map arg (iota 300))
+ 'foo))
+ (iota 300))
+ 'foo))
+
+ (pass-if "300 arguments with list"
+ (equal? (apply (compile `(lambda ,(map arg (iota 300))
+ (list ,@(reverse (map arg (iota 300))))))
+ (iota 300))
+ (reverse (iota 300))))
+
+ (pass-if "300 arguments with vector"
+ (equal? (apply (compile `(lambda ,(map arg (iota 300))
+ (vector ,@(reverse (map arg (iota 300))))))
+ (iota 300))
+ (list->vector (reverse (iota 300)))))
+
+ (pass-if "0 arguments with list of 300 elements"
+ (equal? ((compile `(lambda ()
+ (list ,@(map (lambda (n) `(identity ,n))
+ (iota 300))))))
+ (iota 300))))