]> gcc.gnu.org Git - gcc.git/commitdiff
re PR libfortran/41711 ([F08] BOZ edit-descr does not support reading large kind...
authorTobias Burnus <burnus@net-b.de>
Tue, 8 Dec 2009 14:12:06 +0000 (15:12 +0100)
committerTobias Burnus <burnus@gcc.gnu.org>
Tue, 8 Dec 2009 14:12:06 +0000 (15:12 +0100)
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

gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/boz_15.f90 [new file with mode: 0644]
libgfortran/ChangeLog
libgfortran/io/read.c

index cafd4671db8ae0a7fc473be98c015cf2b9444a20..c054565a6cfb92894e67ebe87433db301ee98634 100644 (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
diff --git a/gcc/testsuite/gfortran.dg/boz_15.f90 b/gcc/testsuite/gfortran.dg/boz_15.f90
new file mode 100644 (file)
index 0000000..40ad514
--- /dev/null
@@ -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
index 3c63896e2ee7406a15f57dcdff0175464a63b2d0..936163965c78a3f2e43923bffbfee3ef3e455a9c 100644 (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
index a5cb97a00e571a186441581958afa32711a1adb2..03046b943b99ef207a60e790d14710f18f84b27e 100644 (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;
This page took 0.082803 seconds and 5 git commands to generate.