AArch64: correct constraint on Upl early clobber alternatives
[official-gcc.git] / gcc / testsuite / gfortran.dg / pr16597.f90
blob47e3549aa80764e4ce04db18de350ffa42ec6ab9
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') STOP 1
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') STOP 2
30 end