diff options
author | burnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-11-16 21:23:19 +0000 |
---|---|---|
committer | burnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-11-16 21:23:19 +0000 |
commit | 87969c8c8b36df7b629b962028b668d7ede7321c (patch) | |
tree | e26ad385cfada5f1f2c55f92057a0259de8b98d2 /gcc/testsuite | |
parent | 6ef8d12f7e0db62100394a870efefae4c20f74f7 (diff) | |
download | gcc-87969c8c8b36df7b629b962028b668d7ede7321c.tar.gz |
/
2010-11-13 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
Tobias Burnus <burnus@net-b.de>
PR fortran/32049
* Makefile.def: Add libquadmath; build it with language=fortran.
* configure.ac: Add libquadmath.
* Makefile.tpl: Handle multiple libs in check-[+language+].
* Makefile.in: Regenerate.
* configure: Regenerate.
libquadmath/
2010-11-13 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
Tobias Burnus <burnus@net-b.de>
PR fortran/32049
Initial implementation and checkin.
gcc/fortran/
2010-11-13 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
Tobias Burnus <burnus@net-b.de>
PR fortran/32049
* gfortranspec.c (find_spec_file): New function.
(lang_specific_driver): Try to find .spec file and use it.
* trans-io.c (iocall): Define
* IOCALL_X_REAL128/COMPLEX128(,write).
(gfc_build_io_library_fndecls): Build decl for __float128 I/O.
(transfer_expr): Call __float128 I/O functions.
* trans-types.c (gfc_init_kinds): Allow kind-16 belonging
to __float128.
gcc/testsuite/
2010-11-13 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
Tobias Burnus <burnus@net-b.de>
PR fortran/32049
* gfortran.dg/quad_1.f90: New.
* lib/gcc-defs.exp (gcc-set-multilib-library-path): Use also
compiler arguments.
* lib/gfortran.exp (gfortran_link_flags): Add libquadmath to
library search path; call gcc-set-multilib-library-path with
arguments such that libgfortran.spec is found.
(gfortran_init): Add path for libgfortran.spec to
GFORTRAN_UNDER_TEST.
libgomp/
2010-11-13 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
Tobias Burnus <burnus@net-b.de>
PR fortran/32049
* configure.ac:
* configure: Regenerate.
libgfortran/
2010-11-13 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
Tobias Burnus <burnus@net-b.de>
PR fortran/32049
* Makefile.am: Add missing pow_r16_i4.c, add transfer128.c,
link libquadmath, if used.
* acinclude.m4 (LIBGFOR_CHECK_FLOAT128): Add.
* configure.ac: Use it, touch spec file.
* gfortran.map: Add pow_r16_i4 and
transfer_(real,complex)128(,write) functions.
* intrinsics/cshift0.c (cshift0): Handle __float128 type.
* intrinsics/erfc_scaled_inc.c: Ditto.
* intrinsics/pack_generic.c (pack): Ditto
* intrinsics/spread_generic.c (spread): Ditto.
* intrinsics/unpack_generic.c (unpack1): Ditto.
* io/read.c (convert_real): Ditto.
* io/transfer.c: Update comments.
* io/transfer128.c: New file.
* io/write_float.def (write_float): Handle __float128 type.
* libgfortran.h: #include quadmath_weak.h, define __builtin_infq
and nanq.
* m4/mtype.m4: Handle __float128 type.
* runtime/in_pack_generic.c (internal_pack): Ditto.
* runtime/in_unpack_generic.c (internal_unpack): Ditto.
* kinds-override.h: New file.
* libgfortran.spec.in: Ditto.
* generated/pow_r16_i4.c: Generated.
* Makefile.in: Regenerate.
* configure: Regenerate.
* config.h: Regenerate.
* bessel_r10.c: Regenerate.
* bessel_r16.c: Regenerate.
* bessel_r4.c: Regenerate.
* bessel_r8.c: Regenerate.
* exponent_r16.c: Regenerate.
* fraction_r16.c: Regenerate.
* nearest_r16.c: Regenerate.
* norm2_r10.c: Regenerate.
* norm2_r16.c: Regenerate.
* norm2_r4.c: Regenerate.
* norm2_r8.c: Regenerate.
* rrspacing_r16.c: Regenerate.
* set_exponent_r16.c: Regenerate.
* spacing_r16.c: Regenerate.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@166825 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite')
-rw-r--r-- | gcc/testsuite/ChangeLog | 12 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/quad_1.f90 | 35 | ||||
-rw-r--r-- | gcc/testsuite/lib/gcc-defs.exp | 3 | ||||
-rw-r--r-- | gcc/testsuite/lib/gfortran.exp | 20 |
4 files changed, 67 insertions, 3 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 87aebe6931f..f6f96717707 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,15 @@ +2010-11-16 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org> + Tobias Burnus <burnus@net-b.de> + + PR fortran/32049 + * gfortran.dg/quad_1.f90: New. + * lib/gcc-defs.exp (gcc-set-multilib-library-path): Use also + compiler arguments. + * lib/gfortran.exp (gfortran_link_flags): Add libquadmath to + library search path; call gcc-set-multilib-library-path with + arguments such that libgfortran.spec is found. + (gfortran_init): Add path for libgfortran.spec to GFORTRAN_UNDER_TEST. + 2010-11-16 Jakub Jelinek <jakub@redhat.com> PR c++/46401 diff --git a/gcc/testsuite/gfortran.dg/quad_1.f90 b/gcc/testsuite/gfortran.dg/quad_1.f90 new file mode 100644 index 00000000000..7d4322e5a74 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/quad_1.f90 @@ -0,0 +1,35 @@ +! { dg-do link } +! +! This test checks whether the largest possible +! floating-point number works. That's usually +! REAL(16) -- either because the hardware supports it or +! because of libquadmath. However, it can also be +! REAL(10) or REAL(8) +! +program test_qp + use iso_fortran_env, only: real_kinds + implicit none + integer, parameter :: QP = real_kinds(ubound(real_kinds,dim=1)) + real(QP), parameter :: Z1 = 1,HALF_PI = asin(Z1),PI = HALF_PI+HALF_PI + real(QP) :: x = 0.124_QP + complex(QP) :: z = 0.124_QP + print *, 'kind = ', qp + print *, x + print *, PI + print *, 16*atan(0.2_QP)-4*atan(Z1/239) + print *, sin(PI) + print *, cos(HALF_PI) + print *, asinh(PI) + print *, erfc(Z1) + print *, epsilon(x) + print *, precision(x) + print *, digits(x) + + print *, z + print *, PI*cmplx(0.0_qp, 1.0_qp) + print *, 16*atan(0.2_QP)-4*atan(Z1/239) + print *, sin(z) + print *, cos(z) + print *, sinh(z) ! asinh not implemented, cf. PR 46416 + print *, precision(z) +end program test_qp diff --git a/gcc/testsuite/lib/gcc-defs.exp b/gcc/testsuite/lib/gcc-defs.exp index 776456d6092..af898e5aa78 100644 --- a/gcc/testsuite/lib/gcc-defs.exp +++ b/gcc/testsuite/lib/gcc-defs.exp @@ -250,9 +250,10 @@ proc gcc-set-multilib-library-path { compiler } { } set libpath ":${rootme}" + set options [lrange $compiler 1 end] set compiler [lindex $compiler 0] if { [is_remote host] == 0 && [which $compiler] != 0 } { - foreach i "[exec $compiler --print-multi-lib]" { + foreach i "[exec $compiler $options --print-multi-lib]" { set mldir "" regexp -- "\[a-z0-9=_/\.-\]*;" $i mldir set mldir [string trimright $mldir "\;@"] diff --git a/gcc/testsuite/lib/gfortran.exp b/gcc/testsuite/lib/gfortran.exp index 56aef298776..be4e7feb81b 100644 --- a/gcc/testsuite/lib/gfortran.exp +++ b/gcc/testsuite/lib/gfortran.exp @@ -103,11 +103,22 @@ proc gfortran_link_flags { paths } { if [file exists "${gccpath}/libgfortran/libgforbegin.a"] { append flags "-L${gccpath}/libgfortran " } + if [file exists "${gccpath}/libquadmath/.libs/libquadmath.a"] { + # Some targets use libquadmath.a%s in their specs, so they need a -B option + # for uninstalled testing. + append flags "-B${gccpath}/libquadmath/.libs " + append flags "-L${gccpath}/libquadmath/.libs " + append ld_library_path ":${gccpath}/libquadmath/.libs" + } + if [file exists "${gccpath}/libquadmath/.libs/libquadmath.${shlib_ext}"] { + append flags "-L${gccpath}/libquadmath/.libs " + append ld_library_path ":${gccpath}/libquadmath/.libs" + } if [file exists "${gccpath}/libiberty/libiberty.a"] { append flags "-L${gccpath}/libiberty " } append ld_library_path \ - [gcc-set-multilib-library-path $GFORTRAN_UNDER_TEST] + [gcc-set-multilib-library-path { $GFORTRAN_UNDER_TEST } ] } set_ld_library_path_env_vars @@ -150,7 +161,12 @@ proc gfortran_init { args } { if { [is_remote host] || ! [info exists TESTING_IN_BUILD_TREE] } { set GFORTRAN_UNDER_TEST [transform gfortran] } else { - set GFORTRAN_UNDER_TEST [findfile $base_dir/../../gfortran "$base_dir/../../gfortran -B$base_dir/../../" [findfile $base_dir/gfortran "$base_dir/gfortran -B$base_dir/" [transform gfortran]]] + if [info exists TOOL_OPTIONS] { + set specpath [get_multilibs ${TOOL_OPTIONS}] + } else { + set specpath [get_multilibs] + } + set GFORTRAN_UNDER_TEST [findfile $base_dir/../../gfortran "$base_dir/../../gfortran -B$base_dir/../../ -L$specpath/libgfortran" [findfile $base_dir/gfortran "$base_dir/gfortran -B$base_dir/" [transform gfortran]]] } } } |