URL
https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk
Subversion Repositories openrisc_me
[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gfortran.dg/] [arrayio_1.f90] - Rev 302
Compare with Previous | Blame | View Log
! { dg-do run }! PR 21875 : Test formatted input/output to/from character arrays.! Contributed by Jerry DeLisle <jvdelisle@verizon.net>.program arrayio_1implicit noneinteger :: i(6),j,kcharacter(12) :: r(12,2) = '0123456789AB'! Write to and read from a whole character arrayi = (/(j,j=1,6)/)write(r,'(3(2x,i4/)/3(3x,i6/))') ii = 0read(r,'(3(2x,i4/)/3(3x,i6/))') iif (any(i.ne.(/(j,j=1,6)/))) call abort()do j=1,12do k=1,2if ((j.gt.8.and.k.eq.1).or.(k.eq.2)) thenif (r(j,k).ne.'0123456789AB') call abort()end ifend doend do! Write to a portion of a character arrayr = '0123456789AB'write(r(3:9,1),'(6(i12/))') iif (r(2,1).ne.'0123456789AB') call abort()do j=3,8if (iachar(trim(adjustl(r(j,1))))-46.ne.j) call abort()end doif (r(9,1).ne.' ') call abort()end program arrayio_1
