diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index dd4652a7917..b398d198033 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,10 @@ +2005-10-24 Jerry DeLisle + + PR libgfortran/24224 + * gfortran.dg/arrayio_4.f90: Update test conditions. + * gfortran.dg/arrayio_6.f90: New test. + * gfortran.dg/arrayio_7.f90: New test. + 2005-10-24 Zdenek Dvorak * gcc.dg/tree-ssa/loop-9.c: Prevent matching "leave". diff --git a/gcc/testsuite/gfortran.dg/arrayio_1.f90 b/gcc/testsuite/gfortran.dg/arrayio_1.f90 index 1941b45c232..2d4cf31f982 100644 --- a/gcc/testsuite/gfortran.dg/arrayio_1.f90 +++ b/gcc/testsuite/gfortran.dg/arrayio_1.f90 @@ -1,5 +1,6 @@ ! { dg-do run } ! PR 21875 : Test formatted input/output to/from character arrays. +! Contributed by Jerry DeLisle . program arrayio_1 implicit none integer :: i(6),j,k diff --git a/gcc/testsuite/gfortran.dg/arrayio_2.f90 b/gcc/testsuite/gfortran.dg/arrayio_2.f90 index 934f65ccc06..96fd18fea18 100644 --- a/gcc/testsuite/gfortran.dg/arrayio_2.f90 +++ b/gcc/testsuite/gfortran.dg/arrayio_2.f90 @@ -1,7 +1,7 @@ ! { dg-do run } ! PR 21875 : Test formatted input/output to/from character arrays. ! This test ckecks proper positioning and padding with trailing blanks -! after write operations +! after write operations. Contributed by Paul Thomas. program arrayio_2 implicit none integer :: i=2 diff --git a/gcc/testsuite/gfortran.dg/arrayio_3.f90 b/gcc/testsuite/gfortran.dg/arrayio_3.f90 index a3164ac506e..eb872eb15ca 100644 --- a/gcc/testsuite/gfortran.dg/arrayio_3.f90 +++ b/gcc/testsuite/gfortran.dg/arrayio_3.f90 @@ -1,7 +1,7 @@ ! { dg-do run } ! PR 21875 : Test formatted input/output to/from character arrays. -! This test deliberately exceeds the record length in a write and -! verifies the error message. +! This test deliberately exceeds the record length in a write and verifies +! the error message. Contributed by Jerry DeLisle . program arrayio_3 implicit none integer :: i(6),j,ierr diff --git a/gcc/testsuite/gfortran.dg/arrayio_4.f90 b/gcc/testsuite/gfortran.dg/arrayio_4.f90 index 3b4e5357289..6236d2d6766 100644 --- a/gcc/testsuite/gfortran.dg/arrayio_4.f90 +++ b/gcc/testsuite/gfortran.dg/arrayio_4.f90 @@ -1,21 +1,20 @@ ! { dg-do run } -! PR 21875 : Test formatted input/output to/from character arrays. -! This test checks the error checking for non-contiguous character -! arrays which are not allowed by standard. Error 13 is -! ERROR_ARRAY_STRIDE in libgfortran.h +! PR 24244 : Test formatted input/output to/from character arrays. +! This test checks array I/O with strides other than 1. +! Contributed by Jerry DeLisle . program arrayio_4 implicit none integer :: ierr character(12) :: r(2,3,4) = '0123456789AB' write(r(::2,:,::1),'(i5)', iostat=ierr) 1,2,3,4,5 - if (ierr.ne.13) call abort() + if (ierr.ne.0) call abort() write(r(:,:,::2),'(i5)', iostat=ierr) 1,2,3,4,5 - if (ierr.ne.13) call abort() + if (ierr.ne.0) call abort() write(r(::1,::2,::1),'(i5)', iostat=ierr) 1,2,3,4,5 - if (ierr.ne.13) call abort() + if (ierr.ne.0) call abort() write(r(::1,::1,::1),'(i5)', iostat=ierr) 1,2,3,4,5 if (ierr.ne.0) call abort() diff --git a/gcc/testsuite/gfortran.dg/arrayio_5.f90 b/gcc/testsuite/gfortran.dg/arrayio_5.f90 index edaa915bb76..cb062037a4a 100644 --- a/gcc/testsuite/gfortran.dg/arrayio_5.f90 +++ b/gcc/testsuite/gfortran.dg/arrayio_5.f90 @@ -1,6 +1,7 @@ ! { dg-do run } ! PR 21875 : Test formatted input/output to/from character arrays. ! This test checks the error checking for end of file condition. +! Contributed by Jerry DeLisle . program arrayio_5 implicit none integer :: i,ierr diff --git a/gcc/testsuite/gfortran.dg/arrayio_6.f90 b/gcc/testsuite/gfortran.dg/arrayio_6.f90 new file mode 100644 index 00000000000..d9343ab3611 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/arrayio_6.f90 @@ -0,0 +1,31 @@ +! { dg-do run } +! PR24224 Test formatted input/output to/from character arrays with strides +! other than 1. Contributed by Jerry DeLisle . + program arrayio_6 + implicit none + integer :: i(3),j,k(3) + character(12) :: r(4,4,4) = '0123456789AB' + character(12) :: s(64) + equivalence(r,s) + + i = (/(j,j=1,3)/) + write(r(1:4:2,2:4:1,3:4:2),'(3(2x,i4/)/3(3x,i6/))') i + + if (s(36).ne.'0123456789AB') call abort() + if (s(37).ne.' 1 ') call abort() + if (s(38).ne.'0123456789AB') call abort() + if (s(39).ne.' 2 ') call abort() + if (s(40).ne.'0123456789AB') call abort() + if (s(41).ne.' 3 ') call abort() + if (s(42).ne.'0123456789AB') call abort() + if (s(43).ne.' ') call abort() + if (s(44).ne.'0123456789AB') call abort() + if (s(45).ne.' ') call abort() + if (s(46).ne.'0123456789AB') call abort() + + k = i + i = 0 + read(r(1:4:2,2:4:1,3:4:2),'(3(2x,i4/)/3(3x,i6/))') i + if (any(i.ne.k)) call abort() + + end program arrayio_6 diff --git a/gcc/testsuite/gfortran.dg/arrayio_7.f90 b/gcc/testsuite/gfortran.dg/arrayio_7.f90 new file mode 100644 index 00000000000..69581763a64 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/arrayio_7.f90 @@ -0,0 +1,13 @@ +! { dg-do run } +! PR24224 Test formatted input/output to/from character arrays with strides +! other than 1. Test that reading stops at the end of the current record. +! Contributed by Jerry DeLisle . +program arrayio_7 + character*4, dimension(8) :: abuf = (/"0123","4567","89AB","CDEF", & + "0123","4567","89AB","CDEF"/) + character*4, dimension(2,4) :: buf + character*8 :: a + equivalence (buf,abuf) + read(buf(2, 1:3:2), '(a8)') a + if (a.ne."4567") call abort() +end program arrayio_7