[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
feature/native-comp c3daee7 3/6: * Add few more type specifier tests
From: |
Andrea Corallo |
Subject: |
feature/native-comp c3daee7 3/6: * Add few more type specifier tests |
Date: |
Thu, 12 Nov 2020 18:11:56 -0500 (EST) |
branch: feature/native-comp
commit c3daee78004b8bfc3459b0f763540bdf01cc96f8
Author: Andrea Corallo <akrl@sdf.org>
Commit: Andrea Corallo <akrl@sdf.org>
* Add few more type specifier tests
* test/src/comp-tests.el (comp-tests-type-spec-tests): Add three
tests and uncomment one.
---
test/src/comp-tests.el | 61 +++++++++++++++++++++++++++++++++-----------------
1 file changed, 41 insertions(+), 20 deletions(-)
diff --git a/test/src/comp-tests.el b/test/src/comp-tests.el
index 23c4df8..61838c6 100644
--- a/test/src/comp-tests.el
+++ b/test/src/comp-tests.el
@@ -771,19 +771,19 @@ Return a list of results."
(native-compile (cadr func-form))))
(defconst comp-tests-type-spec-tests
- `(((defun comp-tests-ret-type-spec-0-f (x)
+ `(((defun comp-tests-ret-type-spec-f (x)
x)
- (t))
+ t)
- ((defun comp-tests-ret-type-spec-1-f ()
+ ((defun comp-tests-ret-type-spec-f ()
1)
(integer 1 1))
- ((defun comp-tests-ret-type-spec-2-f (x)
+ ((defun comp-tests-ret-type-spec-f (x)
(if x 1 3))
(or (integer 1 1) (integer 3 3)))
- ((defun comp-tests-ret-type-spec-3-f (x)
+ ((defun comp-tests-ret-type-spec-f (x)
(let (y)
(if x
(setf y 1)
@@ -791,7 +791,7 @@ Return a list of results."
y))
(integer 1 2))
- ((defun comp-tests-ret-type-spec-4-f (x)
+ ((defun comp-tests-ret-type-spec-f (x)
(let (y)
(if x
(setf y 1)
@@ -799,48 +799,48 @@ Return a list of results."
y))
(or (integer 1 1) (integer 3 3)))
- ((defun comp-tests-ret-type-spec-5-f (x)
+ ((defun comp-tests-ret-type-spec-f (x)
(if x
(list x)
3))
(or cons (integer 3 3)))
- ((defun comp-tests-ret-type-spec-6-f (x)
+ ((defun comp-tests-ret-type-spec-f (x)
(if x
'foo
3))
(or (member foo) (integer 3 3)))
- ((defun comp-tests-ret-type-spec-7-1-f (x)
+ ((defun comp-tests-ret-type-spec-f (x)
(if (eq x 3)
x
'foo))
(or (member foo) (integer 3 3)))
- ((defun comp-tests-ret-type-spec-7-2-f (x)
+ ((defun comp-tests-ret-type-spec-f (x)
(if (eq 3 x)
x
'foo))
(or (member foo) (integer 3 3)))
- ((defun comp-tests-ret-type-spec-8-1-f (x)
+ ((defun comp-tests-ret-type-spec-f (x)
(if (= x 3)
x
'foo))
(or (member foo) (integer 3 3)))
- ((defun comp-tests-ret-type-spec-8-2-f (x)
+ ((defun comp-tests-ret-type-spec-f (x)
(if (= 3 x)
x
'foo))
(or (member foo) (integer 3 3)))
- ;; FIXME returning ATM (or t (member foo))
- ;; ((defun comp-tests-ret-type-spec-8-3-f (x)
- ;; (if (= x 3)
- ;; 'foo
- ;; x))
- ;; (or number (member foo)))
+ ;; FIXME would be nice to have (or number (member foo))
+ ((defun comp-tests-ret-type-spec-8-3-f (x)
+ (if (= x 3)
+ 'foo
+ x))
+ t)
((defun comp-tests-ret-type-spec-8-4-f (x y)
(if (= x y)
@@ -852,9 +852,30 @@ Return a list of results."
(comp-hint-fixnum y))
(integer ,most-negative-fixnum ,most-positive-fixnum))
- ((defun comp-tests-ret-type-spec-9-1-f (x)
+ ((defun comp-tests-ret-type-spec-f (x)
(comp-hint-cons x))
- (cons))))
+ cons)
+
+ ((defun comp-tests-ret-type-spec-f (x)
+ (let (y)
+ (when x
+ (setf y 4))
+ y))
+ (or null (integer 4 4)))
+
+ ((defun comp-tests-ret-type-spec-f ()
+ (let (x
+ (y 3))
+ (setf x y)
+ y))
+ (integer 3 3))
+
+ ((defun comp-tests-ret-type-spec-f (x)
+ (let ((y 3))
+ (when x
+ (setf y x))
+ y))
+ t)))
(comp-deftest ret-type-spec ()
"Some derived return type specifier tests."
- feature/native-comp updated (2435c10 -> 9bb2fc1), Andrea Corallo, 2020/11/12
- feature/native-comp 6f10e0f 2/6: * Rework `comp-ret-type-spec' in terms of `comp-phi', Andrea Corallo, 2020/11/12
- feature/native-comp c3daee7 3/6: * Add few more type specifier tests,
Andrea Corallo <=
- feature/native-comp c4749ce 1/6: * Move phi function code into dedicated function and improve it, Andrea Corallo, 2020/11/12
- feature/native-comp 9bb2fc1 6/6: Add copy insn testcase, Andrea Corallo, 2020/11/12
- feature/native-comp c412d39 5/6: * lisp/emacs-lisp/comp.el (comp-mvar-value-vld-p): Fix logic., Andrea Corallo, 2020/11/12
- feature/native-comp a37cc95 4/6: * Memoize `comp-common-supertype', Andrea Corallo, 2020/11/12