Skip to content

Commit

Permalink
Add test of numeric-contagion on float number pair
Browse files Browse the repository at this point in the history
  • Loading branch information
ajberkley committed Feb 14, 2021
1 parent 67e6754 commit 760c33b
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions tests/float.pure.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -596,3 +596,21 @@

(with-test (:name :ctype-of-nan)
(checked-compile '(lambda () #.(sb-kernel:make-single-float -1))))

;; bug #1914094
(with-test (:name :float-type-derivation :skipped-on (not :64-bit))
(labels ((car-type-equal (x y)
(and (subtypep (car x) (car y))
(subtypep (car y) (car x)))))
(let ((long #+long-float 'long-float
#-long-float 'double-float))
(checked-compile-and-assert () '(lambda (x) (ctu:compiler-derived-type (* 3d0 x)))
((1) (values `(or ,long (complex ,long)) t) :test #'car-type-equal))
(checked-compile-and-assert () '(lambda (x) (ctu:compiler-derived-type (* 3f0 x)))
((1) (values `(or single-float ,long (complex single-float) (complex ,long)) t)
:test #'car-type-equal))
(checked-compile-and-assert () '(lambda (x) (ctu:compiler-derived-type (* 3f0 x)))
((1) (values `(or single-float ,long (complex single-float) (complex ,long)) t)
:test #'car-type-equal))
(checked-compile-and-assert () '(lambda (x y) (ctu:compiler-derived-type (atan x y)))
((1 2) (values `(or ,long single-float (complex ,long) (complex single-float)) t) :test #'car-type-equal)))))

0 comments on commit 760c33b

Please sign in to comment.