diff options
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/boz_15.f90 | 49 | ||||
-rw-r--r-- | libgfortran/ChangeLog | 6 | ||||
-rw-r--r-- | libgfortran/io/read.c | 2 |
4 files changed, 62 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index cafd467..c054565 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -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 diff --git a/gcc/testsuite/gfortran.dg/boz_15.f90 b/gcc/testsuite/gfortran.dg/boz_15.f90 new file mode 100644 index 0000000..40ad514 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/boz_15.f90 @@ -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 diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog index 3c63896..9361639 100644 --- a/libgfortran/ChangeLog +++ b/libgfortran/ChangeLog @@ -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 diff --git a/libgfortran/io/read.c b/libgfortran/io/read.c index a5cb97a..03046b9 100644 --- a/libgfortran/io/read.c +++ b/libgfortran/io/read.c @@ -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; |