From 0fcf21b4a7dcc8a20a4fb3fa49271ef65b217ea4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Kochma=C5=84ski?= Date: Fri, 26 Apr 2019 11:07:50 +0200 Subject: [PATCH] tests: compiler: add regression test for constant folding. --- src/tests/normal-tests/compiler.lsp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/tests/normal-tests/compiler.lsp b/src/tests/normal-tests/compiler.lsp index af8292cec..9eca0d85c 100644 --- a/src/tests/normal-tests/compiler.lsp +++ b/src/tests/normal-tests/compiler.lsp @@ -1525,3 +1525,18 @@ #+complex-float (is (and (not (subtypep '(complex bit) '(complex double-float))) (not (subtypep '(complex double-float) '(complex bit) ))))) + +;;; Date 2019-04-26 +;;; URL: https://gitlab.com/embeddable-common-lisp/ecl/issues/497 +;;; Fixed: 60978163 +;;; Description +;;; +;;; Constant folding first dropped the multiple values, then +;;; refused to compile properly for not self-evaluating ones. This +;;; test checks if both cases are compiled correctly. +(test cmp.0072.cmp-constant-fold + (let (f1 f2) + (finishes (setq f1 (compile nil '(lambda () (byte 0 0))))) + (finishes (setq f2 (compile nil '(lambda () (truncate 2 1))))) + (is (equal '(0 . 0) (funcall f1))) + (is (equal '(2 0) (multiple-value-list (funcall f2))))))