[AArch64] SVE tests
[official-gcc.git] / gcc / testsuite / gfortran.dg / pr16597.f90
blobfc191efef7c7e46a9040824f6f78e042fcb472ad
1 ! { dg-do run }
2 ! { dg-options "-std=legacy" }
4 ! pr 16597
5 ! libgfortran
6 ! reading a direct access record after it was written did
7 ! not always return the correct data.
9 program gfbug4
10 implicit none
12 integer strlen
13 parameter (strlen = 4)
15 integer iunit
16 character string *4
18 iunit = 99
19 open (UNIT=iunit,FORM='unformatted',ACCESS='direct',RECL=strlen)
20 write (iunit, rec=1) 'ABCD'
21 read (iunit, rec=1) string
22 close (iunit, status = 'delete')
23 if (string.ne.'ABCD') call abort
25 open (UNIT=iunit,FORM='unformatted',ACCESS='direct',STATUS='scratch',RECL=strlen)
26 write (iunit, rec=1) 'ABCD'
27 read (iunit, rec=1) string
28 close (iunit)
29 if (string.ne.'ABCD') call abort
30 end