Skip to content

Commit

Permalink
Merge pull request #525 from k-okada/fix-ppc64el
Browse files Browse the repository at this point in the history
defforeign on ppc64el is not work for float/double, skpping test for now
  • Loading branch information
k-okada authored Feb 27, 2025
2 parents bf4cc17 + 8599ab1 commit f27fba2
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .travis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ if [[ "$QEMU" != "" ]]; then
export GIT_SSL_NO_VERIFY=1
git clone http://salsa.debian.org/science-team/euslisp /tmp/euslisp-dfsg
for file in $(cat /tmp/euslisp-dfsg/debian/patches/series); do
# skip patches already applied by https://github.com/euslisp/EusLisp/pull/482, https://github.com/euslisp/EusLisp/pull/511
[[ $file =~ use-rtld-global-loadelf.patch|fix-arm-ldflags.patch|fix-library-not-linked-against-libc.patch|fix-manpage-has-bad-whatis-entry-on-man-pages.patch|fix-jpegmemcd-compile-error.patch|install-bin-lib-man-to-destdir.patch|install-eusjpeg-lib.patch|fix-lintian-typo.patch|fix-makefile-linux-MACHINE.patch|fix-makefile-generic1-version.patch ]] && continue;
# skip patches already applied by https://github.com/euslisp/EusLisp/pull/482, https://github.com/euslisp/EusLisp/pull/511, https://github.com/euslisp/EusLisp/pull/525
[[ $file =~ use-rtld-global-loadelf.patch|fix-arm-ldflags.patch|fix-library-not-linked-against-libc.patch|fix-manpage-has-bad-whatis-entry-on-man-pages.patch|fix-jpegmemcd-compile-error.patch|install-bin-lib-man-to-destdir.patch|install-eusjpeg-lib.patch|fix-lintian-typo.patch|fix-makefile-linux-MACHINE.patch|fix-makefile-generic1-version.patch|fix-ppc64el-test.patch ]] && continue;
# skip patch already applied by https://github.com/euslisp/EusLisp/pull/441, https://github.com/euslisp/EusLisp/pull/509, https://github.com/euslisp/EusLisp/pull/512, https://github.com/euslisp/EusLisp/pull/514, https://github.com/euslisp/EusLisp/pull/517
if [[ $file =~ fix-for-reprotest.patch ]]; then
filterdiff -p1 -x 'lisp/image/jpeg/makefile' -x 'lisp/comp/comp.l' < /tmp/euslisp-dfsg/debian/patches/$file > /tmp/euslisp-dfsg/debian/patches/$file-fix
Expand Down
2 changes: 1 addition & 1 deletion lisp/c/eus.c
Original file line number Diff line number Diff line change
Expand Up @@ -903,7 +903,7 @@ static void initfeatures()
#if Linux
p=cons(ctx,intern(ctx,"LINUX",5,keywordpkg),p);
#endif
#if Linux_ppc
#if defined(Linux_ppc) || defined(__PPC__)
p=cons(ctx,intern(ctx,"PPC",3,keywordpkg),p);
#endif
#if USE_MULTI_LIB
Expand Down
16 changes: 13 additions & 3 deletions test/test-foreign.l
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ test-testd = 1.23456
1040.0 1050.0 1060.0 1070.0
2080.0 2090.0
206 207)))
(when (not (memq :ppc *features*))
(when (not (and (memq :word-size=32 *features*) (memq :arm *features*)))
(assert (eps= 1.23456 ret))
)
Expand Down Expand Up @@ -133,6 +134,7 @@ test-testd = 1.23456
(assert-read-line-string= f "206 207")
)
)
)

(deftest test-int-test
(format t "~%~%int-test~%")
Expand Down Expand Up @@ -214,6 +216,7 @@ test-testd = 1.23456
(float3-test 0 0.1 0.2 0.3 0.4)

;;
(when (not (memq :ppc *features*))
(check-func 'float-test)
(setq f (piped-fork (format nil "eusg ~A/test/test-foreign.module_l '(progn (float-test 0 0.1 0.2 0.3 0.4)(exit 0))'" *eusdir*)))
(assert-read-line-eps= f 0.1)
Expand All @@ -229,6 +232,7 @@ test-testd = 1.23456
(assert-read-line-eps= f 0.3)
(assert-read-line-eps= f 0.4))
)
)

#-(or :s390x :riscv64 :loongarch64)
(deftest test-double-test
Expand All @@ -252,15 +256,15 @@ test-testd = 1.23456
(double3-test 1 0.1 0.2 0.3 0.4)

;;
(when (not (eq (read (unix::piped-fork "gcc -dumpmachine") nil 'arm-linux-gnueabi) 'arm-linux-gnueabi))
(when (not (or (memq :ppc *features*) (eq (read (unix::piped-fork "gcc -dumpmachine") nil 'arm-linux-gnueabi) 'arm-linux-gnueabi)))
(check-func 'double-test)
(setq f (piped-fork (format nil "eusg ~A/test/test-foreign.module_l '(progn (double-test 1 0.1 0.2 0.3 0.4)(exit 0))'" *eusdir*)))
(assert-read-line-eps= f 0.1)
(assert-read-line-eps= f 0.2)
(assert-read-line-eps= f 0.3)
(assert-read-line-eps= f 0.4)
)
(when (not (and (memq :word-size=32 *features*) (memq :arm *features*)))
(when (not (or (memq :ppc *features*) (and (memq :word-size=32 *features*) (memq :arm *features*))))
(check-func 'double3-test)
(setq f (piped-fork (format nil "eusg ~A/test/test-foreign.module_l '(progn (double3-test 1 0.1 0.2 0.3 0.4)(exit 0))'" *eusdir*)))
(assert-read-line-eps= f 0.1)
Expand Down Expand Up @@ -292,6 +296,7 @@ test-testd = 1.23456
(eusfloat3-test 0 0.1 0.2 0.3 0.4)

;;
(when (not (memq :ppc *features*))
(when (memq :word-size=32 *features*)
(check-func 'eusfloat-test)
(setq f (piped-fork (format nil "eusg ~A/test/test-foreign.module_l '(progn (eusfloat-test 0 0.1 0.2 0.3 0.4)(exit 0))'" *eusdir*)))
Expand Down Expand Up @@ -323,6 +328,7 @@ test-testd = 1.23456
(assert-read-line-eps= f 0.4))

)
)

(deftest test-integer-vector
(setq iv (integer-vector 0 100 10000 1000000 100000000 10000000000))
Expand Down Expand Up @@ -473,10 +479,12 @@ test-testd = 1.23456
(format t "~%ret-float(exec in eus)~%")
(format t " ret-float ~8,8e~%" (ret-float 0.55555 133.0))
;;
(when (not (memq :ppc *features*))
(check-func 'ret-float)
(assert-read-funcall= '(ret-float 0.55555 133.0) (+ 0.55555 133.0))
(assert (eps= (ret-float 0.55555 133.0) (+ 0.55555 133.0)))
)
)

#-(or :s390x :riscv64 :loongarch64)
(deftest test-return-double
Expand All @@ -486,7 +494,7 @@ test-testd = 1.23456
(format t "~%ret-double(exec in eus)~%")
(format t " ret-double ~8,8e~%" (ret-double 0.55555 133.0))
;;
(when (not (and (memq :word-size=32 *features*) (memq :arm *features*)))
(when (not (or (memq :ppc *features*) (and (memq :word-size=32 *features*) (memq :arm *features*))))
(check-func 'ret-double)
(assert-read-funcall= '(ret-double 0.55555 133.0) (+ 0.55555 133.0))
(assert (eps= (ret-double 0.55555 133.0) (+ 0.55555 133.0)))
Expand All @@ -501,10 +509,12 @@ test-testd = 1.23456
(format t "~%ret-eusfloat(exec in eus)~%")
(format t " ret-eusfloat ~8,8e~%" (ret-eusfloat 0.55555 133.0))
;;
(when (not (memq :ppc *features*))
(check-func 'ret-eusfloat)
(assert-read-funcall= '(ret-eusfloat 0.55555 133.0) (+ 0.55555 133.0))
(assert (eps= (ret-eusfloat 0.55555 133.0) (+ 0.55555 133.0)))
)
)

(deftest test-return-int
(format t "~%return int test~%")
Expand Down

1 comment on commit f27fba2

@k-okada
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for contributing EusLisp documentation

Please check latest documents before merging

PDF version of English manual: manual.pdf
PDF version of Japanese jmanual: jmanual.pdf
HTML version of English manual: manual.html
HTML version of Japanese manual: jmanual.html
Sphinx (ReST) version of English manual: manual.rst

Please sign in to comment.