re PR libfortran/41711 ([F08] BOZ edit-descr does not support reading large kind reals)

2009-12-08  Tobias Burnus  <burnus@net-b.de>

        PR fortran/41711
        * io/read.c (set_integer): Support kind=10 for reading
        real/complex BOZ.

2009-12-08  Tobias Burnus  <burnus@net-b.de>

        PR fortran/41711
        * gfortran.dg/boz_15.f90: New test.

From-SVN: r155088
This commit is contained in:
Tobias Burnus 2009-12-08 15:12:06 +01:00 committed by Tobias Burnus
parent 5d7cefe516
commit 17314cd9eb
4 changed files with 62 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2009-12-08 Tobias Burnus <burnus@net-b.de>
PR fortran/41711
* gfortran.dg/boz_15.f90: New test.
2008-12-08 Daniel Kraft <d@domob.eu>
PR fortran/41177

View File

@ -0,0 +1,49 @@
! { dg-do run }
! { dg-require-effective-target fortran_large_real }
! { dg-require-effective-target fortran_large_int }
!
! PR fortran/41711
!
! Check reading and writing of real(10/16) BOZ,
! which needs integer(16) support.
!
implicit none
character(len=255) :: str
integer,parameter :: xp = selected_real_kind (precision (0.0d0)+1)
real(xp) :: r1,r2
complex(xp) :: z1,z2
r2 = 5.0_xp
r1 = 2.0_xp
! Real B(OZ)
write(str,'(b126)') r1
read (str,'(b126)') r2
if(r2 /= r1) call abort()
! Real (B)O(Z)
r2 = 5.0_xp
write(str,'(o126)') r1
read (str,'(o126)') r2
if(r2 /= r1) call abort()
! Real (BO)Z
r2 = 5.0_xp
write(str,'(z126)') r1
read (str,'(z126)') r2
if(r2 /= r1) call abort()
z2 = cmplx(5.0_xp,7.0_xp)
z1 = cmplx(2.0_xp,3.0_xp)
! Complex B(OZ)
write(str,'(2b126)') z1
read (str,'(2b126)') z2
if(z2 /= z1) call abort()
! Complex (B)O(Z)
z2 = cmplx(5.0_xp,7.0_xp)
write(str,'(2o126)') z1
read (str,'(2o126)') z2
if(z2 /= z1) call abort()
! Complex (BO)Z
z2 = cmplx(5.0_xp,7.0_xp)
write(str,'(2z126)') z1
read (str,'(2z126)') z2
if(z2 /= z1) call abort()
end

View File

@ -1,3 +1,9 @@
2009-12-08 Tobias Burnus <burnus@net-b.de>
PR fortran/41711
* io/read.c (set_integer): Support kind=10 for reading
real/complex BOZ.
2009-12-06 Janus Weil <janus@gcc.gnu.org>
PR fortran/41478

View File

@ -45,6 +45,8 @@ set_integer (void *dest, GFC_INTEGER_LARGEST value, int length)
switch (length)
{
#ifdef HAVE_GFC_INTEGER_16
/* length=10 comes about for kind=10 real/complex BOZ, cf. PR41711. */
case 10:
case 16:
{
GFC_INTEGER_16 tmp = value;