diff options
author | upstream source tree <ports@midipix.org> | 2015-03-15 20:14:05 -0400 |
---|---|---|
committer | upstream source tree <ports@midipix.org> | 2015-03-15 20:14:05 -0400 |
commit | 554fd8c5195424bdbcabf5de30fdc183aba391bd (patch) | |
tree | 976dc5ab7fddf506dadce60ae936f43f58787092 /gcc/testsuite/gfortran.dg/streamio_6.f90 | |
download | cbb-gcc-4.6.4-upstream.tar.bz2 cbb-gcc-4.6.4-upstream.tar.xz |
obtained gcc-4.6.4.tar.bz2 from upstream website;upstream
verified gcc-4.6.4.tar.bz2.sig;
imported gcc-4.6.4 source tree from verified upstream tarball.
downloading a git-generated archive based on the 'upstream' tag
should provide you with a source tree that is binary identical
to the one extracted from the above tarball.
if you have obtained the source via the command 'git clone',
however, do note that line-endings of files in your working
directory might differ from line-endings of the respective
files in the upstream repository.
Diffstat (limited to 'gcc/testsuite/gfortran.dg/streamio_6.f90')
-rw-r--r-- | gcc/testsuite/gfortran.dg/streamio_6.f90 | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/streamio_6.f90 b/gcc/testsuite/gfortran.dg/streamio_6.f90 new file mode 100644 index 000000000..3857667b0 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/streamio_6.f90 @@ -0,0 +1,32 @@ +! { dg-do run } +! PR25828 Stream IO test 6, random writes and reads. +! Contributed by Jerry DeLisle <jvdelisle@verizon.net>. +program streamio_6 + implicit none + integer, dimension(100) :: a + character(1) :: c + integer :: i,j,k,ier + real :: x + data a / 13, 9, 34, 41, 25, 98, 6, 12, 11, 44, 79, 3,& + & 64, 61, 77, 57, 59, 2, 92, 38, 71, 64, 31, 60, 28, 90, 26,& + & 97, 47, 26, 48, 96, 95, 82, 100, 90, 45, 71, 71, 67, 72,& + & 76, 94, 49, 85, 45, 100, 22, 96, 48, 13, 23, 40, 14, 76, 99,& + & 96, 90, 65, 2, 8, 60, 96, 19, 45, 1, 100, 48, 91, 20, 92,& + & 72, 81, 59, 24, 37, 43, 21, 54, 68, 31, 19, 79, 63, 41,& + & 42, 12, 10, 62, 43, 9, 30, 9, 54, 35, 4, 5, 55, 3, 94 / + + open(unit=15,file="teststream",access="stream",form="unformatted") + do i=1,100 + k = a(i) + write(unit=15, pos=k) achar(k) + enddo + do j=1,100 + read(unit=15, pos=a(j), iostat=ier) c + if (ier.ne.0) then + call abort + else + if (achar(a(j)) /= c) call abort + endif + enddo + close(unit=15, status="delete") +end program streamio_6
\ No newline at end of file |