summaryrefslogtreecommitdiff
path: root/test-suite/tests/peval.test
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2013-02-14 17:33:40 +0100
committerAndy Wingo <wingo@pobox.com>2013-02-14 17:33:40 +0100
commit30c3dac7a671cfdfadf8452c4ff9117fc0a5b8c0 (patch)
treea62f68248171fa34fd8bd9326ee3c75bc3214328 /test-suite/tests/peval.test
parent5ad85ba15f901163190b365ddd744db22bbbfc42 (diff)
downloadguile-30c3dac7a671cfdfadf8452c4ff9117fc0a5b8c0.tar.gz
peval can inline let-bound lambdas
* module/language/tree-il/peval.scm (peval): Better inlining of complicated operators. * test-suite/tests/peval.test ("partial evaluation"): Add a couple tests.
Diffstat (limited to 'test-suite/tests/peval.test')
-rw-r--r--test-suite/tests/peval.test14
1 files changed, 13 insertions, 1 deletions
diff --git a/test-suite/tests/peval.test b/test-suite/tests/peval.test
index 7fae423bd..aa36182cd 100644
--- a/test-suite/tests/peval.test
+++ b/test-suite/tests/peval.test
@@ -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
@@ -830,6 +830,18 @@
(((x) #f #f #f () (_))
(apply (toplevel top) (lexical x _)))))))
+ (pass-if-peval resolve-primitives
+ ;; The inliner sees through a `let'.
+ ((let ((a 10)) (lambda (b) (* b 2))) 30)
+ (const 60))
+
+ (pass-if-peval
+ ((lambda ()
+ (define (const x) (lambda (_) x))
+ (let ((v #f))
+ ((const #t) v))))
+ (const #t))
+
(pass-if-peval
;; Constant folding: cons of #nil does not make list
(cons 1 #nil)