Loading bin/run-ansi-tests.sh +1 −1 Viewed Changes for bin/run-ansi-tests.sh: 1 added line, 1 removed line. Original line number Diff line number Diff line Loading @@ -41,7 +41,7 @@ else fi cd ../ansi-test git checkout cmucl-expected-failures git checkout issue-288-new-failures make LISP="$LISP batch -noinit -nositeinit" # There should be no unexpected successes or failures; check these separately Loading src/compiler/float-tran.lisp +2 −2 Viewed Changes for src/compiler/float-tran.lisp: 2 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -236,7 +236,7 @@ (frob %random-single-float single-float) (frob %random-double-float double-float)) #-(or new-random random-mt19937 rand-xoroshiro) #-(or new-random random-mt19937 random-xoroshiro) (deftransform random ((num &optional state) ((integer 1 #.random-fixnum-max) &optional *)) _N"use inline fixnum operations" Loading @@ -259,7 +259,7 @@ '(values (truncate (%random-double-float (coerce num 'double-float) (or state *random-state*))))) #+(or random-mt19937) #+(or random-mt19937 random-xoroshiro) (deftransform random ((num &optional state) ((integer 1 #.(expt 2 32)) &optional *)) _N"use inline (unsigned-byte 32) operations" Loading src/i18n/locale/cmucl.pot +4 −0 Viewed Changes for src/i18n/locale/cmucl.pot: 4 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -19001,6 +19001,10 @@ msgstr "" msgid "use inline (unsigned-byte 32) operations" msgstr "" #: src/compiler/float-tran.lisp msgid "Shouldn't happen" msgstr "" #: src/compiler/float-tran.lisp msgid "Can't open-code float to rational comparison." msgstr "" tests/rng.lisp +24 −0 Viewed Changes for tests/rng.lisp: 24 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -82,3 +82,27 @@ (assert-equal result (multiple-value-list (64-bit-rng-state *test-state*))))) ;; Test that the deftransform for random integers is working. (defun rng-int-trans (state) (declare (type random-state state) (optimize (speed 3))) (random 100000 state)) (defun rng-int (n state) (declare (type random-state state)) (random n state)) (define-test deftransform-random-int (:tag :issues) ;; Using the same state, generate a random integer with RNG-INT. ;; This is the expected value. The generate an integer with ;; RNG-INT-TRANS. The compiler should have used a deftransform in ;; this function. The values returned should be the same. (let ((state (kernel::make-random-object :state (kernel::init-random-state 31415926535)))) (dotimes (k 2) (print state) (assert-equal (rng-int 100000 (make-random-state state)) (rng-int-trans (make-random-state state))) ;; Generate a random number to change our state. (random 100000 state)))) Loading
bin/run-ansi-tests.sh +1 −1 Viewed Changes for bin/run-ansi-tests.sh: 1 added line, 1 removed line. Original line number Diff line number Diff line Loading @@ -41,7 +41,7 @@ else fi cd ../ansi-test git checkout cmucl-expected-failures git checkout issue-288-new-failures make LISP="$LISP batch -noinit -nositeinit" # There should be no unexpected successes or failures; check these separately Loading
src/compiler/float-tran.lisp +2 −2 Viewed Changes for src/compiler/float-tran.lisp: 2 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -236,7 +236,7 @@ (frob %random-single-float single-float) (frob %random-double-float double-float)) #-(or new-random random-mt19937 rand-xoroshiro) #-(or new-random random-mt19937 random-xoroshiro) (deftransform random ((num &optional state) ((integer 1 #.random-fixnum-max) &optional *)) _N"use inline fixnum operations" Loading @@ -259,7 +259,7 @@ '(values (truncate (%random-double-float (coerce num 'double-float) (or state *random-state*))))) #+(or random-mt19937) #+(or random-mt19937 random-xoroshiro) (deftransform random ((num &optional state) ((integer 1 #.(expt 2 32)) &optional *)) _N"use inline (unsigned-byte 32) operations" Loading
src/i18n/locale/cmucl.pot +4 −0 Viewed Changes for src/i18n/locale/cmucl.pot: 4 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -19001,6 +19001,10 @@ msgstr "" msgid "use inline (unsigned-byte 32) operations" msgstr "" #: src/compiler/float-tran.lisp msgid "Shouldn't happen" msgstr "" #: src/compiler/float-tran.lisp msgid "Can't open-code float to rational comparison." msgstr ""
tests/rng.lisp +24 −0 Viewed Changes for tests/rng.lisp: 24 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -82,3 +82,27 @@ (assert-equal result (multiple-value-list (64-bit-rng-state *test-state*))))) ;; Test that the deftransform for random integers is working. (defun rng-int-trans (state) (declare (type random-state state) (optimize (speed 3))) (random 100000 state)) (defun rng-int (n state) (declare (type random-state state)) (random n state)) (define-test deftransform-random-int (:tag :issues) ;; Using the same state, generate a random integer with RNG-INT. ;; This is the expected value. The generate an integer with ;; RNG-INT-TRANS. The compiler should have used a deftransform in ;; this function. The values returned should be the same. (let ((state (kernel::make-random-object :state (kernel::init-random-state 31415926535)))) (dotimes (k 2) (print state) (assert-equal (rng-int 100000 (make-random-state state)) (rng-int-trans (make-random-state state))) ;; Generate a random number to change our state. (random 100000 state))))