1 | ;-*- Mode: Lisp -*- |
---|
2 | ;;;; Author: Paul Dietz |
---|
3 | ;;;; Created: Fri Mar 4 06:21:51 2005 |
---|
4 | ;;;; Contains: CMUCL type prop failures (moved from misc.lsp) |
---|
5 | |
---|
6 | (in-package :cl-test) |
---|
7 | |
---|
8 | ;;; All these are 'strange template failures' |
---|
9 | ;;; The comment before each is the NAME of the template in the backtrace |
---|
10 | ;;; These tests seem to all have (space 2) (speed 3) |
---|
11 | |
---|
12 | ; X86::FAST-LOGAND-C/FIXNUM=>FIXNUM |
---|
13 | (deftest cmucl-type-prop.1 |
---|
14 | (funcall |
---|
15 | (compile |
---|
16 | nil |
---|
17 | '(lambda (p1) |
---|
18 | (declare (optimize (speed 2) (safety 2) (debug 2) (space 3)) |
---|
19 | (type (member 2 -4 -211907662 -27215198) p1)) |
---|
20 | (logand (the (integer * 161212781) p1) 10600829))) |
---|
21 | -27215198) |
---|
22 | 2129952) |
---|
23 | |
---|
24 | ; X86::FAST-LOGAND/SIGNED-UNSIGNED=>UNSIGNED |
---|
25 | (deftest cmucl-type-prop.2 |
---|
26 | (funcall |
---|
27 | (compile |
---|
28 | nil |
---|
29 | '(lambda (p1 p2) |
---|
30 | (declare (optimize (speed 2) (safety 1) (debug 3) (space 3)) |
---|
31 | (type (integer 1619851121 1619868587) p1) (type (integer * 303689) p2)) |
---|
32 | (logandc2 (the (integer -5359291650 1619851136) p1) (the unsigned-byte p2)))) |
---|
33 | 1619851124 300065) |
---|
34 | 1619551060) |
---|
35 | |
---|
36 | ; X86::FAST-LOGIOR-C/FIXNUM=>FIXNUM |
---|
37 | (deftest cmucl-type-prop.3 |
---|
38 | (funcall |
---|
39 | (compile |
---|
40 | nil |
---|
41 | '(lambda (p1) |
---|
42 | (declare (optimize (speed 2) (safety 3) (debug 0) (space 3)) |
---|
43 | (type (integer 59087 63964) p1)) |
---|
44 | (logior p1 -65887623))) |
---|
45 | 59967) |
---|
46 | -65869185) |
---|
47 | |
---|
48 | ; X86::FAST-LOGIOR/FIXNUM=>FIXNUM |
---|
49 | (deftest cmucl-type-prop.4 |
---|
50 | (funcall |
---|
51 | (compile |
---|
52 | nil |
---|
53 | '(lambda (p1 p2) |
---|
54 | (declare (optimize (speed 2) (safety 2) (debug 0) (space 3)) |
---|
55 | (type (integer 3585942 72924743) p1) (type (integer -70689 *) p2)) |
---|
56 | (logorc2 (the (integer * 8514860) p1) (the (integer 1 411) p2)))) |
---|
57 | 3586455 4) |
---|
58 | -1) |
---|
59 | |
---|
60 | ; X86::FAST-LOGAND-C/SIGNED=>SIGNED |
---|
61 | (deftest cmucl-type-prop.5 |
---|
62 | (funcall |
---|
63 | (compile |
---|
64 | nil |
---|
65 | '(lambda (p2) |
---|
66 | (declare (optimize (speed 2) (safety 1) (debug 2) (space 3)) |
---|
67 | (type (integer -257 *) p2)) |
---|
68 | (lognand 1020158769 (the (integer -5275217 2381998) p2)))) |
---|
69 | 2) |
---|
70 | -1) |
---|
71 | |
---|
72 | ; X86::FAST-LOGAND-C/SIGNED-UNSIGNED=>UNSIGNED |
---|
73 | (deftest cmucl-type-prop.6 |
---|
74 | (funcall |
---|
75 | (compile |
---|
76 | nil |
---|
77 | '(lambda (p1) |
---|
78 | (declare (optimize (speed 2) (safety 1) (debug 0) (space 3)) |
---|
79 | (type (integer -96413017 -96297711) p1)) |
---|
80 | (lognand p1 3472289945))) |
---|
81 | -96413016) |
---|
82 | -3393245321) |
---|
83 | |
---|
84 | ; X86::FAST-LOGAND/UNSIGNED-SIGNED=>UNSIGNED |
---|
85 | (deftest cmucl-type-prop.7 |
---|
86 | (funcall |
---|
87 | (compile |
---|
88 | nil |
---|
89 | '(lambda (p1 p2) |
---|
90 | (declare (optimize (speed 2) (safety 3) (debug 2) (space 3)) |
---|
91 | (type (integer 438294 891242) p1) |
---|
92 | (type (member 16317 -15 -541332155 33554427) p2)) |
---|
93 | (logand (the (integer -33116139 1759877902) p1) p2))) |
---|
94 | 438295 16317) |
---|
95 | 12309) |
---|
96 | |
---|
97 | ; X86::FAST-LOGIOR-C/SIGNED=>SIGNED |
---|
98 | (deftest cmucl-type-prop.8 |
---|
99 | (funcall |
---|
100 | (compile |
---|
101 | nil |
---|
102 | '(lambda (p1) |
---|
103 | (declare (optimize (speed 2) (safety 1) (debug 1) (space 3)) |
---|
104 | (type (integer -728025757 -727856169) p1)) |
---|
105 | (logorc1 (the (integer -734005577 -727855553) p1) -3311))) |
---|
106 | -727856176) |
---|
107 | -2241) |
---|
108 | |
---|
109 | ; X86::FAST-LOGXOR/FIXNUM=>FIXNUM |
---|
110 | (deftest cmucl-type-prop.9 |
---|
111 | (funcall |
---|
112 | (compile |
---|
113 | nil |
---|
114 | '(lambda (p1 p2) |
---|
115 | (declare (optimize (speed 2) (safety 3) (debug 3) (space 3)) |
---|
116 | (type (integer * 1489068) p1) (type (integer -7455 *) p2)) |
---|
117 | (logeqv (the (member 9543 -15 32766 -264472) p1) |
---|
118 | (the (integer -524303 11182721) p2)))) |
---|
119 | 9543 -8) |
---|
120 | 9536) |
---|
121 | |
---|
122 | ; X86::FAST-LOGXOR/SIGNED=>SIGNED |
---|
123 | (deftest cmucl-type-prop.10 |
---|
124 | (funcall |
---|
125 | (compile |
---|
126 | nil |
---|
127 | '(lambda (p1 p2) |
---|
128 | (declare (optimize (speed 2) (safety 1) (debug 3) (space 3)) |
---|
129 | (type (integer -616605365 -616598658) p1) (type (eql 499113) p2)) |
---|
130 | (logeqv (the real p1) p2))) |
---|
131 | -616604953 499113) |
---|
132 | 617035953) |
---|
133 | |
---|
134 | ; X86::FAST-LOGXOR-C/FIXNUM=>FIXNUM |
---|
135 | (deftest cmucl-type-prop.11 |
---|
136 | (funcall |
---|
137 | (compile |
---|
138 | nil |
---|
139 | '(lambda (p1) |
---|
140 | (declare (optimize (speed 2) (safety 1) (debug 0) (space 3)) |
---|
141 | (type (integer -112225610 *) p1)) |
---|
142 | (logeqv (the (integer -2822315666 3) p1) 1679389))) |
---|
143 | 1) |
---|
144 | -1679389) |
---|
145 | |
---|
146 | ; X86::FAST-LOGXOR-C/SIGNED=>SIGNED |
---|
147 | (deftest cmucl-type-prop.12 |
---|
148 | (funcall |
---|
149 | (compile |
---|
150 | nil |
---|
151 | '(lambda (p2) |
---|
152 | (declare (optimize (speed 2) (safety 3) (debug 0) (space 3)) |
---|
153 | (type (integer -67 268435455) p2)) |
---|
154 | (logeqv 1038360149 (the (integer -3605943309) p2)))) |
---|
155 | -1) |
---|
156 | 1038360149) |
---|
157 | |
---|
158 | ; X86::-/SINGLE-FLOAT |
---|
159 | (deftest cmucl-type-prop.13 |
---|
160 | (notnot |
---|
161 | (typep |
---|
162 | (funcall |
---|
163 | (compile |
---|
164 | nil |
---|
165 | '(lambda (p1) |
---|
166 | (declare (optimize (speed 2) (safety 2) (debug 1) (space 3)) |
---|
167 | (type (eql 64848.973) p1)) |
---|
168 | (- (the (eql 64848.973f0) p1) -2808/1031))) |
---|
169 | 64848.973f0) |
---|
170 | 'single-float)) |
---|
171 | t) |
---|
172 | |
---|
173 | ; X86::-/DOUBLE-FLOAT |
---|
174 | (deftest cmucl-type-prop.14 |
---|
175 | (notnot |
---|
176 | (typep |
---|
177 | (funcall |
---|
178 | (compile |
---|
179 | nil |
---|
180 | '(lambda (p2) |
---|
181 | (declare (optimize (speed 2) (safety 1) (debug 1) (space 3)) |
---|
182 | (type (integer 9297 *) p2)) |
---|
183 | (- 54090.82691488265d0 (the (integer * 1263530808) p2)))) |
---|
184 | 9590) |
---|
185 | 'double-float)) |
---|
186 | t) |
---|
187 | |
---|
188 | ; X86::-/SINGLE-FLOAT |
---|
189 | (deftest cmucl-type-prop.15 |
---|
190 | (notnot |
---|
191 | (typep |
---|
192 | (funcall |
---|
193 | (compile |
---|
194 | nil |
---|
195 | '(lambda (p1) |
---|
196 | (declare (optimize (speed 2) (safety 3) (debug 3) (space 3)) |
---|
197 | (type (eql 328536/53893) p1)) |
---|
198 | (- p1 59218.633f0))) |
---|
199 | 328536/53893) |
---|
200 | 'single-float)) |
---|
201 | t) |
---|
202 | |
---|
203 | ; X86::FAST--/FIXNUM=>FIXNUM |
---|
204 | (deftest cmucl-type-prop.16 |
---|
205 | (funcall |
---|
206 | (compile nil '(lambda (p2) |
---|
207 | (declare (optimize (speed 2) (safety 2) (debug 3) (space 3)) |
---|
208 | (type (integer -605782 -28141) p2)) |
---|
209 | (- -61118 p2))) |
---|
210 | -28225) |
---|
211 | -32893) |
---|
212 | |
---|
213 | ; X86::FAST---C/FIXNUM=>FIXNUM |
---|
214 | (deftest cmucl-type-prop.17 |
---|
215 | (funcall |
---|
216 | (compile nil '(lambda (p1) |
---|
217 | (declare (optimize (speed 2) (safety 1) (debug 1) (space 3)) |
---|
218 | (type (integer 5535202) p1)) |
---|
219 | (- (the (integer * 27858177) p1) 405))) |
---|
220 | 5535436) |
---|
221 | 5535031) |
---|
222 | |
---|
223 | ; X86::FAST--/SIGNED=>SIGNED |
---|
224 | (deftest cmucl-type-prop.18 |
---|
225 | (funcall |
---|
226 | (compile nil '(lambda (p2) |
---|
227 | (declare (optimize (speed 2) (safety 2) (debug 2) (space 3)) |
---|
228 | (type (integer -1175231414 -3471291) p2)) |
---|
229 | (- -440 p2))) |
---|
230 | -3536832) |
---|
231 | 3536392) |
---|
232 | |
---|
233 | ; X86::FAST-+-C/FIXNUM=>FIXNUM |
---|
234 | (deftest cmucl-type-prop.19 |
---|
235 | (funcall |
---|
236 | (compile nil '(lambda (p2) |
---|
237 | (declare (optimize (speed 2) (safety 3) (debug 2) (space 3)) |
---|
238 | (type (integer -1015240116 5) p2)) |
---|
239 | (+ 491841 (the unsigned-byte p2)))) |
---|
240 | 0) |
---|
241 | 491841) |
---|
242 | |
---|
243 | ; X86::+/DOUBLE-FLOAT |
---|
244 | (deftest cmucl-type-prop.20 |
---|
245 | (notnot (typep (funcall (compile nil '(lambda (p1) |
---|
246 | (declare (optimize (speed 2) (safety 3) (debug 3) (space 3)) |
---|
247 | (type (rational -1255531/68466 4) p1)) |
---|
248 | (+ p1 41888.98682005542d0))) |
---|
249 | -1255531/68466) |
---|
250 | 'double-float)) |
---|
251 | t) |
---|
252 | |
---|
253 | ; X86::+/SINGLE-FLOAT |
---|
254 | (deftest cmucl-type-prop.21 |
---|
255 | (notnot (typep (funcall (compile nil '(lambda (p1) |
---|
256 | (declare (optimize (speed 2) (safety 2) (debug 1) (space 3)) |
---|
257 | (type (integer -284887911 *) p1)) |
---|
258 | (+ (the (integer -50006902 19512639861) p1) 68648.28f0))) |
---|
259 | -16452463) |
---|
260 | 'single-float)) |
---|
261 | t) |
---|
262 | |
---|
263 | ; X86::=0/DOUBLE-FLOAT |
---|
264 | (deftest cmucl-type-prop.22 |
---|
265 | (funcall (compile nil '(lambda (p1) |
---|
266 | (declare (optimize (speed 2) (safety 3) (debug 1) (space 3)) |
---|
267 | (type (complex double-float) p1)) |
---|
268 | (= p1 -1590311/896933))) |
---|
269 | #c(1.0d0 1.0d0)) |
---|
270 | nil) |
---|
271 | |
---|
272 | ; X86::=/SINGLE-FLOAT |
---|
273 | (deftest cmucl-type-prop.23 |
---|
274 | (funcall (compile nil '(lambda (p2) |
---|
275 | (declare (optimize (speed 2) (safety 2) (debug 1) (space 3)) |
---|
276 | (type (complex single-float) p2)) |
---|
277 | (= -976855 (the (eql #c(-57420.04 806984.0)) p2)))) |
---|
278 | #c(-57420.04f0 806984.0f0)) |
---|
279 | nil) |
---|
280 | |
---|
281 | ; X86::FAST-EQL/FIXNUM |
---|
282 | (deftest cmucl-type-prop.24 |
---|
283 | (notnot |
---|
284 | (funcall (compile nil '(lambda (p1 p2) |
---|
285 | (declare (optimize (speed 2) (safety 1) (debug 3) (space 3)) |
---|
286 | (type (integer -3705845 488458) p1) (type (integer * 869076010) p2)) |
---|
287 | (/= p1 (the (integer -69832764 470) p2)))) |
---|
288 | 488456 465)) |
---|
289 | t) |
---|
290 | |
---|
291 | ; X86::FAST-EQL-C/FIXNUM |
---|
292 | (deftest cmucl-type-prop.25 |
---|
293 | (notnot |
---|
294 | (funcall (compile nil '(lambda (p1) |
---|
295 | (declare (optimize (speed 2) (safety 3) (debug 2) (space 3)) |
---|
296 | (type (integer -69741922) p1)) |
---|
297 | (/= (the (integer * 216) p1) 182))) |
---|
298 | 103)) |
---|
299 | t) |
---|
300 | |
---|
301 | ; X86::FAST-IF->-C/FIXNUM |
---|
302 | (deftest cmucl-type-prop.26 |
---|
303 | (funcall (compile nil '(lambda (p2) |
---|
304 | (declare (optimize (speed 2) (safety 2) (debug 3) (space 3)) |
---|
305 | (type (integer -451 204073899) p2)) |
---|
306 | (< 134799 (the (integer -56 8589934581) p2)))) |
---|
307 | -2) |
---|
308 | nil) |
---|
309 | |
---|
310 | ; X86::FAST-IF-<-C/FIXNUM |
---|
311 | (deftest cmucl-type-prop.27 |
---|
312 | (funcall (compile nil '(lambda (p2) |
---|
313 | (declare (optimize (speed 2) (safety 2) (debug 2) (space 3)) |
---|
314 | (type (integer -93662 *) p2)) |
---|
315 | (<= -1 (the (integer -2975848 16770677) p2)))) |
---|
316 | -6548) |
---|
317 | nil) |
---|
318 | |
---|
319 | ; X86::FAST-+-C/FIXNUM=>FIXNUM |
---|
320 | ; (simple example) |
---|
321 | (deftest cmucl-type-prop.28 |
---|
322 | (funcall (compile nil '(lambda (p1) |
---|
323 | (declare (optimize (speed 2) (safety 1) (debug 0) (space 3)) |
---|
324 | (type (integer -65545 80818) p1)) |
---|
325 | (1+ p1))) |
---|
326 | -1) |
---|
327 | 0) |
---|
328 | |
---|
329 | ; X86::FAST-NEGATE/FIXNUM |
---|
330 | (deftest cmucl-type-prop.29 |
---|
331 | (funcall (compile nil '(lambda (p1) |
---|
332 | (declare (optimize (speed 2) (safety 1) (debug 0) (space 3)) |
---|
333 | (type (integer -4194320 11531) p1)) |
---|
334 | (- (the (integer -6253866924 34530147) p1)))) |
---|
335 | -20) |
---|
336 | 20) |
---|
337 | |
---|
338 | ;;; Bug in COPY-SEQ |
---|
339 | |
---|
340 | (deftest cmucl-type-prop.30 |
---|
341 | (let ((a (funcall |
---|
342 | (compile nil `(lambda () |
---|
343 | (declare (optimize (speed 2) (safety 2) (debug 0) (space 2))) |
---|
344 | (copy-seq |
---|
345 | ,(make-array '(0) :adjustable t))))))) |
---|
346 | (and (not (adjustable-array-p a)) |
---|
347 | (= (length a) 0) |
---|
348 | t)) |
---|
349 | t) |
---|
350 | |
---|
351 | ; Bug for PACKAGEP |
---|
352 | |
---|
353 | (deftest cmucl-type-prop.31 |
---|
354 | (funcall (compile nil '(lambda (x) |
---|
355 | (declare (optimize (speed 2) (space 3))) |
---|
356 | (packagep x))) |
---|
357 | t) |
---|
358 | nil) |
---|
359 | |
---|
360 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
---|
361 | |
---|
362 | ;;; There were many failures in string comparison functions |
---|
363 | ;;; Some are that C::WIN strange template problem, but others |
---|
364 | ;;; are not. |
---|
365 | |
---|
366 | ;;; 0 is not of type (INTEGER 0 (0)) |
---|
367 | (deftest cmucl-type-prop.32 |
---|
368 | (funcall |
---|
369 | (compile |
---|
370 | nil |
---|
371 | '(lambda (p4) |
---|
372 | (declare (optimize (speed 1) (safety 1) (debug 1) (space 0)) |
---|
373 | (type (integer -2040 9) p4)) |
---|
374 | (string< "bbaa" "" :start1 p4))) |
---|
375 | 2) |
---|
376 | nil) |
---|
377 | |
---|
378 | ;;; 2 is not of type (INTEGER 0 (2)) |
---|
379 | (deftest cmucl-type-prop.33 |
---|
380 | (funcall |
---|
381 | (compile |
---|
382 | nil |
---|
383 | '(lambda (p4) |
---|
384 | (declare (optimize (speed 0) (safety 0) (debug 2) (space 0)) |
---|
385 | (type (integer -52340 *) p4)) |
---|
386 | (string< "baabbb" "bb" :start2 p4))) |
---|
387 | 1) |
---|
388 | nil) |
---|
389 | |
---|
390 | ;;; Incorrect return value |
---|
391 | (deftest cmucl-type-prop.34 |
---|
392 | (funcall |
---|
393 | (compile |
---|
394 | nil |
---|
395 | '(lambda (p1 p4) |
---|
396 | (declare (optimize (speed 2) (safety 0) (debug 3) (space 0)) |
---|
397 | (type (simple-string) p1) (type real p4)) |
---|
398 | (string< (the array p1) |
---|
399 | "bbbba" |
---|
400 | :start1 (the (integer -16382 *) p4) |
---|
401 | :end1 7))) |
---|
402 | "J4sPI71C3Xn" 5) |
---|
403 | 5) |
---|