2 ! { dg-options "-pedantic" }
3 ! This test verifies the most basic sequential unformatted I/O
5 ! Adapted from seq_io.f.
6 ! write 3 records of various sizes
14 ! set debug to true for help in debugging failures.
21 m(1) = Z
'11223344' ! { dg-warning "BOZ literal at .1. outside a DATA statement" }
22 m(2) = Z
'55667788' ! { dg-warning "BOZ literal at .1. outside a DATA statement" }
23 n
= Z
'77AABBCC' ! { dg-warning "BOZ literal at .1. outside a DATA statement" }
28 open(9,form
="unformatted",access
="sequential",convert
="swap") ! { dg-warning "Extension: CONVERT" }
29 write(9) m
! an array of 2
30 write(9) n
! an integer
31 write(9) r
! an array of reals
33 ! zero all the results so we can compare after they are read back
49 if (m(1).ne
.Z
'11223344') then
51 print '(A,Z8)','m(1) incorrect. m(1) = ',m(1)
57 if (m(2).ne
.Z
'55667788') then
59 print '(A,Z8)','m(2) incorrect. m(2) = ',m(2)
65 if (n
.ne
.Z
'77AABBCC') then
67 print '(A,Z8)','n incorrect. n = ',n
74 if (int(r(i
)).ne
.i
) then
76 print*,'element ',i
,' was ',r(i
),' should be ',i
82 if (str
.ne
. 'asdf') then
84 print *,'str incorrect, str = ', str
89 ! use hexdump to look at the file "fort.9"
93 close(9,status
='DELETE')