gcc/testsuite/gfortran.dg/g77/f77-edit-i-in.f
raw| 1 | C Test Fortran 77 I edit descriptor for input |
| 2 | C (ANSI X3.9-1978 Section 13.5.9.1) |
| 3 | C |
| 4 | C Origin: David Billinghurst <[email protected]> |
| 5 | C |
| 6 | C { dg-do run } |
| 7 | C { dg-options "-std=legacy" } |
| 8 | C |
| 9 | |
| 10 | integer i,j |
| 11 | character*10 buf |
| 12 | |
| 13 | write(buf,'(A)') '1 -1' |
| 14 | |
| 15 | read(buf,'(I1)') i |
| 16 | if ( i.ne.1 ) STOP 1 |
| 17 | |
| 18 | read(buf,'(1X,I1)') i |
| 19 | if ( i.ne.0 ) STOP 2 |
| 20 | |
| 21 | read(buf,'(1X,I1,1X,I2)') i,j |
| 22 | if ( i.ne.0 .and. j.ne.-1 ) STOP 3 |
| 23 | |
| 24 | end |