aboutsummaryrefslogtreecommitdiffstats
path: root/test/src
diff options
context:
space:
mode:
authorAndrea Corallo2019-06-10 11:02:47 +0200
committerAndrea Corallo2020-01-01 11:33:40 +0100
commit7ce2c17a0fbde3203f311c6b91d8bb2ba77adeda (patch)
treed0f9d0be59f517a4c1ed813c1ad47e516d0f8289 /test/src
parent65eb55ff4194c67ede020ceabd7b92e7d2128908 (diff)
downloademacs-7ce2c17a0fbde3203f311c6b91d8bb2ba77adeda.tar.gz
emacs-7ce2c17a0fbde3203f311c6b91d8bb2ba77adeda.zip
add Bnegate support
Diffstat (limited to 'test/src')
-rw-r--r--test/src/comp-tests.el42
1 files changed, 28 insertions, 14 deletions
diff --git a/test/src/comp-tests.el b/test/src/comp-tests.el
index 06c7697be74..dc2c396392b 100644
--- a/test/src/comp-tests.el
+++ b/test/src/comp-tests.el
@@ -148,28 +148,42 @@
148 148
149(ert-deftest comp-tests-fixnum () 149(ert-deftest comp-tests-fixnum ()
150 "Testing some fixnum inline operation." 150 "Testing some fixnum inline operation."
151 (defun comp-tests-fixnum-1--f (x) 151 (defun comp-tests-fixnum-1-minus-f (x)
152 ;; Bsub1
152 (1- x)) 153 (1- x))
153 (defun comp-tests-fixnum-1+-f (x) 154 (defun comp-tests-fixnum-1-plus-f (x)
155 ;; Badd1
154 (1+ x)) 156 (1+ x))
155 157 (defun comp-tests-fixnum-minus-f (x)
156 (byte-compile #'comp-tests-fixnum-1--f) 158 ;; Bnegate
157 (byte-compile #'comp-tests-fixnum-1+-f) 159 (- x))
158 ;; (native-compile #'comp-tests-fixnum-1--f) 160
159 (native-compile #'comp-tests-fixnum-1+-f) 161 (byte-compile #'comp-tests-fixnum-1-minus-f)
160 162 (byte-compile #'comp-tests-fixnum-1-plus-f)
161 (should (= (comp-tests-fixnum-1--f 10) 9)) 163 (byte-compile #'comp-tests-fixnum-minus-f)
162 (should (= (comp-tests-fixnum-1--f most-negative-fixnum) 164 (native-compile #'comp-tests-fixnum-1-minus-f)
165 (native-compile #'comp-tests-fixnum-1-plus-f)
166 (native-compile #'comp-tests-fixnum-minus-f)
167
168 (should (= (comp-tests-fixnum-1-minus-f 10) 9))
169 (should (= (comp-tests-fixnum-1-minus-f most-negative-fixnum)
163 (1- most-negative-fixnum))) 170 (1- most-negative-fixnum)))
164 (should (equal (condition-case err 171 (should (equal (condition-case err
165 (comp-tests-fixnum-1--f 'a) 172 (comp-tests-fixnum-1-minus-f 'a)
166 (error err)) 173 (error err))
167 '(wrong-type-argument number-or-marker-p a))) 174 '(wrong-type-argument number-or-marker-p a)))
168 (should (= (comp-tests-fixnum-1+-f 10) 11)) 175 (should (= (comp-tests-fixnum-1-plus-f 10) 11))
169 (should (= (comp-tests-fixnum-1+-f most-positive-fixnum) 176 (should (= (comp-tests-fixnum-1-plus-f most-positive-fixnum)
170 (1+ most-positive-fixnum))) 177 (1+ most-positive-fixnum)))
171 (should (equal (condition-case err 178 (should (equal (condition-case err
172 (comp-tests-fixnum-1+-f 'a) 179 (comp-tests-fixnum-1-plus-f 'a)
180 (error err))
181 '(wrong-type-argument number-or-marker-p a)))
182 (should (= (comp-tests-fixnum-minus-f 10) -10))
183 (should (= (comp-tests-fixnum-minus-f most-negative-fixnum)
184 (- most-negative-fixnum)))
185 (should (equal (condition-case err
186 (comp-tests-fixnum-minus-f 'a)
173 (error err)) 187 (error err))
174 '(wrong-type-argument number-or-marker-p a)))) 188 '(wrong-type-argument number-or-marker-p a))))
175 189