Raymond Toy pushed to branch issue-158-darwin-pathnames-utf8 at cmucl / cmucl
Commits:
-
4fe2a3f4
by Raymond Toy at 2023-02-27T08:09:42-08:00
-
80ac0130
by Tarn W. Burton at 2023-02-27T08:09:42-08:00
-
c2311453
by Raymond Toy at 2023-02-27T08:09:42-08:00
-
53803637
by Raymond Toy at 2023-02-27T08:11:20-08:00
10 changed files:
- .gitlab-ci.yml
- bin/build.sh
- + src/bootfiles/21d/boot-2021-07-1.lisp
- src/code/exports.lisp
- src/code/format.lisp
- src/code/unidata.lisp
- src/compiler/fndb.lisp
- src/compiler/generic/vm-type.lisp
- tests/issues.lisp
- tests/printer.lisp
Changes:
1 | 1 | variables:
|
2 | 2 | download_url: "https://common-lisp.net/project/cmucl/downloads/snapshots/2021/07"
|
3 | 3 | version: "2021-07-x86"
|
4 | - bootstrap: ""
|
|
4 | + bootstrap: "-B boot-2021-07-1"
|
|
5 | 5 | |
6 | 6 | stages:
|
7 | 7 | - install
|
... | ... | @@ -39,7 +39,7 @@ ENABLE2="yes" |
39 | 39 | ENABLE3="yes"
|
40 | 40 | ENABLE4="yes"
|
41 | 41 | |
42 | -version=21c
|
|
42 | +version=21d
|
|
43 | 43 | SRCDIR=src
|
44 | 44 | BINDIR=bin
|
45 | 45 | TOOLDIR=$BINDIR
|
1 | +;; Bootstrap file
|
|
2 | +;;
|
|
3 | +;; Use "bin/build.sh -B boot-2021-07-1" to build this.
|
|
4 | +;;
|
|
5 | +;; We want to export the symbols from the KERNEL package which also
|
|
6 | +;; exists in the C package, so we unintern the conflicting symbols from
|
|
7 | +;; the C package.
|
|
8 | + |
|
9 | +(in-package "KERNEL")
|
|
10 | +(ext:without-package-locks
|
|
11 | + (handler-bind
|
|
12 | + ((error (lambda (c)
|
|
13 | + (declare (ignore c))
|
|
14 | + (invoke-restart 'lisp::unintern-conflicting-symbols))))
|
|
15 | + (export '(DOUBLE-FLOAT-INT-EXPONENT
|
|
16 | + SINGLE-FLOAT-INT-EXPONENT))))
|
|
17 | + |
... | ... | @@ -2329,10 +2329,11 @@ |
2329 | 2329 | "DOUBLE-FLOAT-EXPONENT"
|
2330 | 2330 | "DOUBLE-FLOAT-BITS"
|
2331 | 2331 | "DOUBLE-FLOAT-HIGH-BITS"
|
2332 | + "DOUBLE-FLOAT-INT-EXPONENT"
|
|
2332 | 2333 | "DOUBLE-FLOAT-LOW-BITS" "DOUBLE-FLOAT-P" "FLOAT-WAIT"
|
2333 | 2334 | "DYNAMIC-SPACE-FREE-POINTER" "ERROR-NUMBER-OR-LOSE" "FILENAME"
|
2334 | 2335 | "FLOAT-DIGITS" "FLOAT-EXPONENT" "FLOAT-FORMAT-DIGITS"
|
2335 | - "FLOAT-FORMAT-MAX" "FLOAT-RADIX" "FORM" "FUNCALLABLE-INSTANCE-P"
|
|
2336 | + "FLOAT-FORMAT-MAX" "FLOAT-INT-EXPONENT" "FLOAT-RADIX" "FORM" "FUNCALLABLE-INSTANCE-P"
|
|
2336 | 2337 | "FUNCTION-CODE-HEADER" "FUNCTION-TYPE" "FUNCTION-TYPE-ALLOWP"
|
2337 | 2338 | "FUNCTION-TYPE-KEYP" "FUNCTION-TYPE-KEYWORDS"
|
2338 | 2339 | "FUNCTION-TYPE-NARGS" "FUNCTION-TYPE-OPTIONAL" "FUNCTION-TYPE-P"
|
... | ... | @@ -2426,6 +2427,7 @@ |
2426 | 2427 | "SIMPLE-ARRAY-SIGNED-BYTE-16-P" "SIMPLE-ARRAY-SIGNED-BYTE-30-P"
|
2427 | 2428 | "SIMPLE-ARRAY-SIGNED-BYTE-32-P" "SIMPLE-ARRAY-SIGNED-BYTE-8-P"
|
2428 | 2429 | "SIMPLE-UNBOXED-ARRAY" "SINGLE-FLOAT-BITS" "SINGLE-FLOAT-EXPONENT"
|
2430 | + "SINGLE-FLOAT-INT-EXPONENT"
|
|
2429 | 2431 | "SINGLE-FLOAT-P" "SINGLE-VALUE-TYPE" "SPECIFIER-TYPE" "STACK-REF"
|
2430 | 2432 | "STD-COMPUTE-CLASS-PRECEDENCE-LIST"
|
2431 | 2433 | "STREAMLIKE" "SIMPLE-STREAM-BUFFER" "STRINGABLE" "STRINGLIKE"
|
... | ... | @@ -399,7 +399,8 @@ |
399 | 399 | (form new-directives)
|
400 | 400 | (expand-directive (car remaining-directives)
|
401 | 401 | (cdr remaining-directives))
|
402 | - (push form results)
|
|
402 | + (when form
|
|
403 | + (push form results))
|
|
403 | 404 | (setf remaining-directives new-directives)))
|
404 | 405 | (reverse results)))
|
405 | 406 |
... | ... | @@ -514,7 +514,7 @@ |
514 | 514 | (values split hvec mvec lvec))))
|
515 | 515 | (declare (ignorable #'read16 #'read32 #'read-ntrie))
|
516 | 516 | (with-open-file (,stm *unidata-path* :direction :input
|
517 | - :element-type '(unsigned-byte 8))
|
|
517 | + :element-type '(unsigned-byte 8))
|
|
518 | 518 | (unless (unidata-locate ,stm ,locn)
|
519 | 519 | (error (intl:gettext "No data in file.")))
|
520 | 520 | ,@body)))))
|
... | ... | @@ -319,7 +319,7 @@ |
319 | 319 | (defknown (float-digits float-precision) (float) float-digits
|
320 | 320 | (movable foldable flushable explicit-check))
|
321 | 321 | (defknown integer-decode-float (float)
|
322 | - (values integer float-exponent (member -1 1))
|
|
322 | + (values integer float-int-exponent (member -1 1))
|
|
323 | 323 | (movable foldable flushable explicit-check))
|
324 | 324 | |
325 | 325 | (defknown complex (real &optional real) number
|
... | ... | @@ -50,6 +50,8 @@ |
50 | 50 | (deftype float-exponent ()
|
51 | 51 | #-long-float 'double-float-exponent
|
52 | 52 | #+long-float 'long-float-exponent)
|
53 | +(deftype float-int-exponent ()
|
|
54 | + 'double-float-int-exponent)
|
|
53 | 55 | (deftype float-digits ()
|
54 | 56 | #-long-float `(integer 0 ,vm:double-float-digits)
|
55 | 57 | #+long-float `(integer 0 ,vm:long-float-digits))
|
... | ... | @@ -18,8 +18,10 @@ |
18 | 18 | (declare (ignore arg))
|
19 | 19 | form)
|
20 | 20 | |
21 | -(defparameter *test-path*
|
|
22 | - (merge-pathnames (make-pathname :name :unspecific :type :unspecific
|
|
21 | +(defparameter *tmp-dir*
|
|
22 | + (merge-pathnames (make-pathname :directory '(:relative "tmp")
|
|
23 | + :name :unspecific
|
|
24 | + :type :unspecific
|
|
23 | 25 | :version :unspecific)
|
24 | 26 | *load-truename*)
|
25 | 27 | "Directory for temporary test files.")
|
... | ... | @@ -777,10 +779,11 @@ |
777 | 779 | |
778 | 780 | (define-test issue.140.two-way-stream
|
779 | 781 | (:tag :issues)
|
782 | + (ensure-directories-exist *tmp-dir*)
|
|
780 | 783 | (with-open-file (in (merge-pathnames "issues.lisp" cmucl-test-runner::*load-path*)
|
781 | 784 | :direction :input
|
782 | 785 | :external-format :utf-8)
|
783 | - (with-open-file (out "/tmp/output.tst"
|
|
786 | + (with-open-file (out (merge-pathnames "output.tst" *tmp-dir*)
|
|
784 | 787 | :direction :output
|
785 | 788 | :external-format :utf-8
|
786 | 789 | :if-exists :supersede)
|
... | ... | @@ -803,15 +806,15 @@ |
803 | 806 | ;; Create 3 output streams. The exact external formats aren't
|
804 | 807 | ;; really important here as long as they're different for each file
|
805 | 808 | ;; so we can tell if we got the right answer.
|
806 | - (with-open-file (s1 "/tmp/broad-1"
|
|
809 | + (with-open-file (s1 (merge-pathnames "broad-1" *tmp-dir*)
|
|
807 | 810 | :direction :output
|
808 | 811 | :if-exists :supersede
|
809 | 812 | :external-format :latin1)
|
810 | - (with-open-file (s2 "/tmp/broad-2"
|
|
813 | + (with-open-file (s2 (merge-pathnames "broad-2" *tmp-dir*)
|
|
811 | 814 | :direction :output
|
812 | 815 | :if-exists :supersede
|
813 | 816 | :external-format :utf-8)
|
814 | - (with-open-file (s3 "/tmp/broad-3"
|
|
817 | + (with-open-file (s3 (merge-pathnames "broad-3" *tmp-dir*)
|
|
815 | 818 | :direction :output
|
816 | 819 | :if-exists :supersede
|
817 | 820 | :external-format :utf-16)
|
... | ... | @@ -827,6 +830,7 @@ |
827 | 830 | (assert-true (stream::find-external-format :euckr))
|
828 | 831 | (assert-true (stream::find-external-format :cp949))))
|
829 | 832 | |
833 | + |
|
830 | 834 | (define-test issue.158
|
831 | 835 | (:tag :issues)
|
832 | 836 | (let* ((name (string #\Hangul_Syllable_Gyek))
|
... | ... | @@ -872,3 +876,15 @@ |
872 | 876 | #-darwin
|
873 | 877 | (assert-equal (pathname-name f) expected-name))))
|
874 | 878 |
|
879 | + |
|
880 | + |
|
881 | + |
|
882 | +(define-test issue.166
|
|
883 | + (:tag :issues)
|
|
884 | + ;; While this tests for the correct return value, the problem was
|
|
885 | + ;; that the compiler was miscompiling the function below and causing
|
|
886 | + ;; an error when the function run.
|
|
887 | + (let ((f (compile nil #'(lambda ()
|
|
888 | + (nth-value 1 (integer-decode-float least-positive-double-float))))))
|
|
889 | + (assert-equal -1126 (funcall f))))
|
|
890 | + |
... | ... | @@ -113,3 +113,16 @@ |
113 | 113 | |
114 | 114 | (define-test sub-output-integer.1
|
115 | 115 | (assert-prints "-536870912" (princ most-negative-fixnum)))
|
116 | + |
|
117 | +;;; Simple LOOP requires only compound forms. Hence NIL is not
|
|
118 | +;;; permitted. Some FORMAT directives (like newline) return NIL
|
|
119 | +;;; as the form when they have nothing to add to the body.
|
|
120 | +;;; Normally this is fine since BLOCK accepts NIL as a form. On
|
|
121 | +;;; the other hand, when the newline directive is inside of an
|
|
122 | +;;; iteration directive this will produce something like
|
|
123 | +;;; (LOOP (fu) nil (bar)) which is not acceptable. To verify
|
|
124 | +;;; that this is not happening we make sure we are not getting
|
|
125 | +;;; (BLOCK NIL NIL) since this is easier to test for.
|
|
126 | +(define-test format-no-nil-form.1
|
|
127 | + (assert-equal '(block nil) (third (second (macroexpand-1 '(formatter "~
|
|
128 | +")))))) |