diff options
author | Andy Wingo <wingo@pobox.com> | 2013-02-14 17:33:40 +0100 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2013-02-14 17:33:40 +0100 |
commit | 30c3dac7a671cfdfadf8452c4ff9117fc0a5b8c0 (patch) | |
tree | a62f68248171fa34fd8bd9326ee3c75bc3214328 /test-suite/tests/peval.test | |
parent | 5ad85ba15f901163190b365ddd744db22bbbfc42 (diff) | |
download | guile-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.test | 14 |
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) |