Fix warning with -Wsign-compare -Wsystem-headers
[official-gcc.git] / gcc / testsuite / gfortran.fortran-torture / execute / direct_io.f90
blob7a9e4130ff0640031bbf5550cc8017e578607a10
1 ! demonstrates basic direct access using variables for REC
2 ! pr14872
3 OPEN(UNIT=10,ACCESS='DIRECT',RECL=128)
4 DO I = 1,10
5 WRITE(10,REC=I,ERR=10)I
6 ENDDO
7 CLOSE(10)
8 OPEN(UNIT=10,ACCESS='DIRECT',RECL=128)
9 DO I = 1,10
10 READ(10,REC=I,ERR=10)J
11 IF (J.NE.I) THEN
12 ! PRINT*,' READ ',J,' EXPECTED ',I
13 STOP 1
14 ENDIF
15 ENDDO
16 CLOSE(10,STATUS='DELETE')
17 STOP
18 10 CONTINUE
19 ! PRINT*,' ERR= RETURN FROM READ OR WRITE'
20 STOP 2
21 END