recognize loongarch path in tests

This commit is contained in:
ZiLong Wang 2026-01-19 09:07:18 +08:00 committed by Stas Boukarev
parent 3c74d5696a
commit ea7ce94679
15 changed files with 37 additions and 31 deletions

View file

@ -797,7 +797,7 @@
;; No handy backend (or compiler) defined constant for this one,
;; so construct it here and now.
(sb-c:make-sc+offset control-stack-sc-number
#-(or riscv loongarch64) lra-save-offset
#-(or riscv loongarch64) lra-save-offset
#+(or riscv loongarch64) sb-vm::ra-save-offset))))
(defun old-fp-offset-for-location (debug-fun location)

View file

@ -417,7 +417,7 @@
(with-test (:name :signed-byte-8-p-unsigned
;; these lack the necessary RANGE<= vop
:fails-on (:or :mips :ppc :ppc64 :sparc :riscv))
:fails-on (:or :mips :ppc :ppc64 :sparc :riscv :loongarch64))
(checked-compile
`(lambda (a)
(declare (type (simple-array sb-vm:word (*)) a)
@ -586,7 +586,7 @@
(values (integer -255 0) (integer -9 0) &optional)))
(with-test (:name :logbitp-on-integers
:fails-on :arm)
:fails-on (or :arm :loongarch64))
(assert (not (ctu:ir1-named-calls `(lambda (x)
(logbitp 20 x))))))
(with-test (:name :bt-negative-bit)
@ -766,7 +766,8 @@
n))
(unsigned-byte 54)))
(with-test (:name :ldb-computed-posn)
(with-test (:name :ldb-computed-posn
:fails-on (or :loongarch64))
(assert-type
(lambda (x y)
(ldb (byte y (- 32 y)) x))
@ -820,7 +821,7 @@
((300 0) 303)))
(with-test (:name :truncate-unknown-integer
:fails-on :arm)
:fails-on (or :arm :loongarch64))
(assert (not (ctu:ir1-named-calls `(lambda (x)
(declare (integer x))
(values (the (signed-byte 25) (floor x 2)))))))
@ -841,7 +842,7 @@
(values (the (signed-byte 25) (ceiling x 2))))))))
(with-test (:name :word-floor-ceiling
:fails-on :arm)
:fails-on (or :arm :loongarch64))
(assert (not (ctu:ir1-named-calls `(lambda (x y)
(declare (sb-vm:signed-word x y))
(floor x y)))))

View file

@ -605,7 +605,7 @@
(('(or (eql -16) unsigned-byte)) #(0) :test #'equalp)))
(with-test (:name :check-bound-signed-bound-notes
:fails-on (not (or :x86-64 :x86 :arm64)))
:fails-on (not (or :x86-64 :x86 :arm64 :loongarch64)))
(checked-compile-and-assert
(:allow-notes nil)
`(lambda (x y)

View file

@ -628,7 +628,7 @@
(format t "Double-width compare-and-swap NOT TESTED~%")))
(test-util:with-test (:name :cas-sap-ref-smoke-test
:fails-on :riscv ; unsigned-32-bit gets the wrong answer
:fails-on (or :riscv :loongarch64) ; unsigned-32-bit gets the wrong answer
:skipped-on (not :sb-thread))
(let ((data (make-array 1 :element-type 'sb-vm:word)))
(sb-sys:with-pinned-objects (data)
@ -656,8 +656,8 @@
(test nil 32 #xbabab00e)
;; on riscv I did not implement these sizes, and
;; ppc64 might get "illegal instruction" depending on the particular CPU
#-(or riscv ppc64) (test nil 16 #xfafa)
#-(or riscv ppc64) (test nil 8 #xbb)
#-(or riscv ppc64 loongarch64) (test nil 16 #xfafa)
#-(or riscv ppc64 loongarch64) (test nil 8 #xbb)
)
;; SAP-REF-SAP
(setf (aref data 0) 0)

View file

@ -2810,7 +2810,7 @@
(with-test (:name :ftype-return-type-conflict
;; Not having UNWIND-TO-FRAME-AND-CALL-VOP changes
;; the condition type here?
:fails-on (not :unwind-to-frame-and-call-vop))
:fails-on (not (or :unwind-to-frame-and-call-vop :loongarch64)))
(proclaim '(ftype (function () fixnum) ftype-return-type-conflict))
(checked-compile-and-assert (:optimize :safe :allow-warnings t)
`(sb-int:named-lambda ftype-return-type-conflict () nil)

View file

@ -5523,7 +5523,7 @@
(let ((f (checked-compile '(lambda (x) (oddp x)))))
(ctu:assert-no-consing (funcall f most-positive-fixnum))))
(with-test (:name (oddp bignum :no-consing)
:serial t :skipped-on :interpreter :fails-on (or :arm :ppc))
:serial t :skipped-on :interpreter :fails-on (or :arm :ppc :loongarch64))
(let ((f (checked-compile '(lambda (x) (oddp x))))
(x (* most-positive-fixnum most-positive-fixnum 3)))
(ctu:assert-no-consing (funcall f x))))
@ -5532,7 +5532,7 @@
(let ((f (checked-compile '(lambda (x) (logtest x most-positive-fixnum)))))
(ctu:assert-no-consing (funcall f 1))))
(with-test (:name (logtest bignum :no-consing)
:serial t :skipped-on :interpreter :fails-on (or :arm :ppc))
:serial t :skipped-on :interpreter :fails-on (or :arm :ppc :loongarch64))
(let ((f (checked-compile '(lambda (x) (logtest x 1))))
(x (* most-positive-fixnum most-positive-fixnum 3)))
(ctu:assert-no-consing (funcall f x))))

View file

@ -1909,7 +1909,7 @@
(integer -6176139011 -222)))
(with-test (:name :ignore-delays
:fails-on :arm)
:fails-on (or :arm :loongarch64))
(assert-type
(lambda (x)
(declare (optimize debug))

View file

@ -955,7 +955,7 @@
(with-test (:name (:debugger :list-locations)
;; there's an extra location on arm for some reason.
:fails-on :arm)
:fails-on (or :arm :loongarch64))
(test-debugger
"ll #'!
debugger-test-done!"
@ -1333,8 +1333,8 @@
;; properly tagged interior pointers. For those which do use LRAs,
;; there are at least that many, because we allow pointing to LRAs,
;; but they aren't enumerable so we don't know the actual count.
(assert (#+(or x86 x86-64 arm64 riscv) =
#-(or x86 x86-64 arm64 riscv) >
(assert (#+(or x86 x86-64 arm64 riscv loongarch64) =
#-(or x86 x86-64 arm64 riscv loongarch64) >
(loop for ptr from (+ base (* 2 sb-vm:n-word-bytes))
below limit count (properly-tagged-p ptr))
n))

View file

@ -191,7 +191,7 @@
(+ x0 x1 x6 x7) (+ x2 x3 x4 x5)))))))
(with-test (:name (:nan :comparison)
:fails-on (or :sparc))
:fails-on (or :sparc :loongarch64))
(sb-int:with-float-traps-masked (:invalid)
(macrolet ((test (form)
(let ((nform (subst '(/ 0.0 0.0) 'nan form)))
@ -238,7 +238,7 @@
(test (not (> nan 1.0))))))
(with-test (:name (:nan :comparison :non-float)
:fails-on (or :sparc))
:fails-on (or :sparc :loongarch64))
(sb-int:with-float-traps-masked (:invalid)
(let ((nan (/ 0.0 0.0))
(reals (list 0 1 -1 1/2 -1/2 (expt 2 300) (- (expt 2 300))))

View file

@ -30,6 +30,7 @@
(defvar *required-alignment*
(or #+arm 8
#+mips 8
#+loongarch64 8
#+(and ppc darwin) 16
#+(and ppc (not darwin)) 8
#+(or arm64 x86 x86-64 riscv ppc64) 16

View file

@ -131,7 +131,8 @@
(defparameter *sleep-delay-max* .025)
(with-test (:name (hash-table :synchronized))
(with-test (:name (hash-table :synchronized)
:broken-on (or :loongarch64))
(dolist (shrinkp '(nil t))
(with-test-setup (keys (hash (make-hash-table :synchronized t)))
(let* ((*errors* nil)
@ -207,16 +208,18 @@
(assert (not *errors*))))))))
(compile 'test-concurrent-gethash)
(with-test (:name (hash-table :parallel-readers-eq-table))
(with-test (:name (hash-table :parallel-readers-eq-table)
:broken-on (or :loongarch64))
(test-concurrent-gethash 'eq))
(with-test (:name (hash-table :parallel-readers-eql-table)
:broken-on (or :riscv)) ;; memory reordering issues
:broken-on (or :riscv :loongarch64)) ;; memory reordering issues
(test-concurrent-gethash 'eql))
(with-test (:name (hash-table :parallel-readers-equal-table)
:broken-on (or :riscv))
:broken-on (or :riscv :loongarch64))
(test-concurrent-gethash 'equal))
(with-test (:name (hash-table :single-accessor :parallel-gc))
(with-test (:name (hash-table :single-accessor :parallel-gc)
:broken-on (or :loongarch64))
(dolist (shrinkp '(nil t))
(with-test-setup (keys (hash (make-hash-table)))
(let ((*errors* nil))
@ -247,7 +250,8 @@
;;; Stress GROW-HASH-TABLE's optimization wherein no rehashing may be
;;; done if the index vector is not growing.
(with-test (:name (hash-table :not-growing-index-vector :parallel-gc))
(with-test (:name (hash-table :not-growing-index-vector :parallel-gc)
:broken-on (or :loongarch64))
(let ((*errors* nil))
(let ((threads
(list (make-kill-thread

View file

@ -225,7 +225,7 @@
(with-locked-hash-table (h) (setf (gethash 'foo h) 1))))
(with-test (:name :hash-table-iterator-no-notes
:fails-on (:or :arm :ppc :ppc64))
:fails-on (:or :arm :ppc :ppc64 :loongarch64))
(let ((f
(checked-compile
'(lambda (h)

View file

@ -64,12 +64,12 @@
(let ((obj (sb-vm::reconstitute-object (%make-lisp-obj baseptr))))
(when (code-component-p obj)
(cond
#+(or c-stack-is-control-stack arm64 riscv)
#+(or c-stack-is-control-stack arm64 riscv loongarch64)
((= (logand word sb-vm:lowtag-mask) sb-vm:fun-pointer-lowtag)
(dotimes (i (code-n-entries obj))
(when (= (get-lisp-obj-address (%code-entry-point obj i)) word)
(return (setq obj (%code-entry-point obj i))))))
#-(or c-stack-is-control-stack arm64 riscv) ; i.e. does this backend have LRAs
#-(or c-stack-is-control-stack arm64 riscv loongarch64) ; i.e. does this backend have LRAs
((= (logand (sb-sys:sap-ref-word (int-sap (logandc2 word sb-vm:lowtag-mask)) 0)
sb-vm:widetag-mask) sb-vm:return-pc-widetag)
(setq obj (%make-lisp-obj word)))))

View file

@ -12,7 +12,7 @@
;;;; more information.
;; No stepper support on some platforms.
#+(or interpreter riscv) (invoke-restart 'run-tests::skip-file)
#+(or interpreter riscv loongarch64) (invoke-restart 'run-tests::skip-file)
;; These tests should either with code in dynamic space
;; or immobile space, but they only accidentally worked

View file

@ -636,7 +636,7 @@
(sb-ext:gc)
(incf *n-gcs-done*))
#+(or x86 x86-64 riscv) ;the only platforms with a *binding-stack-pointer* variable
#+(or x86 x86-64 riscv loongarch64) ;the only platforms with a *binding-stack-pointer* variable
(defun exercise-binding ()
(loop
(let ((*x* (make-something-big)))
@ -656,7 +656,7 @@
(wait-for-gc)
(decf sb-vm::*binding-stack-pointer* binding-pointer-delta))))
#+(or x86 x86-64 riscv) ;the only platforms with a *binding-stack-pointer* variable
#+(or x86 x86-64 riscv loongarch64) ;the only platforms with a *binding-stack-pointer* variable
(with-test (:name (:binding-stack-gc-safety)
:broken-on :win32)
(let (threads)