OSDN Git Service

2008-03-13 Jerry DeLisle <jvdelisle@gcc.gnu.org>
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gfortran.dg / arrayio_3.f90
1 ! { dg-do run }
2 ! PR 21875 : Test formatted input/output to/from character arrays.
3 ! This test deliberately exceeds the record length in a write and verifies
4 ! the error message.  Contributed by Jerry DeLisle <jvdelisle@verizon.net>.
5       program arrayio_3
6       implicit none
7       integer        :: i(6),j,ierr
8       character(12)  :: r(4,2) = '0123456789AB'
9  
10 ! Write using a format string that defines a record greater than 
11 ! the length of an element in the character array.
12
13       i = (/(j,j=1,6)/)
14       write(r,'(3(2x,i4/)/3(4x,i9/))', iostat=ierr) i
15       if (ierr.ne.-2) call abort()
16       end program arrayio_3