diff options
| author | Andrea Corallo | 2020-12-27 21:33:07 +0100 |
|---|---|---|
| committer | Andrea Corallo | 2020-12-27 21:50:34 +0100 |
| commit | 42fb6de0b366622cd59006f69fbc13c5cf3a0714 (patch) | |
| tree | 1aa87b079cccfd96b828b0ef089ddc513d08ed68 /test/src | |
| parent | 7d07a718416d6c24df0719483279c4278dce4acb (diff) | |
| download | emacs-42fb6de0b366622cd59006f69fbc13c5cf3a0714.tar.gz emacs-42fb6de0b366622cd59006f69fbc13c5cf3a0714.zip | |
Add 1+ 1- integer range propagation support
* lisp/emacs-lisp/comp-cstr.el (comp-cstr-one): New special var.
* lisp/emacs-lisp/comp.el (comp-fwprop-call): Propagate integer
ranges on +1 -1.
* test/src/comp-tests.el (comp-tests-type-spec-tests): Add two tests.
Diffstat (limited to 'test/src')
| -rw-r--r-- | test/src/comp-tests.el | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/test/src/comp-tests.el b/test/src/comp-tests.el index 154229ec872..d0e482bb501 100644 --- a/test/src/comp-tests.el +++ b/test/src/comp-tests.el | |||
| @@ -1125,7 +1125,19 @@ Return a list of results." | |||
| 1125 | (< 1 j 5) | 1125 | (< 1 j 5) |
| 1126 | (< 1 k 5)) | 1126 | (< 1 k 5)) |
| 1127 | (+ x y z i j k))) | 1127 | (+ x y z i j k))) |
| 1128 | (or null float (integer 12 24))))) | 1128 | (or null float (integer 12 24))) |
| 1129 | |||
| 1130 | ;; 45 | ||
| 1131 | ((defun comp-tests-ret-type-spec-f (x) | ||
| 1132 | (when (<= 1 x 5) | ||
| 1133 | (1+ x))) | ||
| 1134 | (or null float (integer 2 6))) | ||
| 1135 | |||
| 1136 | ;;46 | ||
| 1137 | ((defun comp-tests-ret-type-spec-f (x) | ||
| 1138 | (when (<= 1 x 5) | ||
| 1139 | (1- x))) | ||
| 1140 | (or null float (integer 0 4))))) | ||
| 1129 | 1141 | ||
| 1130 | (defun comp-tests-define-type-spec-test (number x) | 1142 | (defun comp-tests-define-type-spec-test (number x) |
| 1131 | `(comp-deftest ,(intern (format "ret-type-spec-%d" number)) () | 1143 | `(comp-deftest ,(intern (format "ret-type-spec-%d" number)) () |