summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/g77/f77-edit-i-in.f
blob: 18e1cb0d006ffc211817573bb318923bfe7acd4f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
C Test Fortran 77 I edit descriptor for input
C      (ANSI X3.9-1978 Section 13.5.9.1)
C
C Origin: David Billinghurst <David.Billinghurst@riotinto.com>
C
C { dg-do run }
C { dg-options "-std=legacy" }
C

      integer i,j
      character*10 buf

      write(buf,'(A)') '1  -1'

      read(buf,'(I1)') i
      if ( i.ne.1 ) STOP 1

      read(buf,'(1X,I1)') i
      if ( i.ne.0 ) STOP 2

      read(buf,'(1X,I1,1X,I2)') i,j
      if ( i.ne.0 .and. j.ne.-1 ) STOP 3

      end