modula2: Simplify REAL/LONGREAL/SHORTREAL node creation.
[official-gcc.git] / gcc / testsuite / gfortran.dg / inquire_size.f90
blob07ed0ba6b0fea78c6fea3b770bb1477a00b5185c
1 ! { dg-do run }
2 ! PR43409 I/O: INQUIRE for SIZE does not work.
3 integer :: i
4 character(30) :: aname = "noname"
5 logical :: is_named
7 open(25, file="testfile_inquire_size", status="replace", access="stream", form="unformatted")
8 do i=1,100
9 write(25) i, "abcdefghijklmnopqrstuvwxyz"
10 enddo
11 ! Gfortran implicitly flushes the buffer when doing a file size
12 ! inquire on an open file.
13 ! flush(25)
15 inquire(unit=25, named=is_named, name=aname, size=i)
16 if (.not.is_named) STOP 1
17 if (aname /= "testfile_inquire_size") STOP 2
18 if (i /= 3000) STOP 3
20 inquire(file="testfile_inquire_size", size=i)
21 if (.not.is_named) STOP 4
22 if (aname /= "testfile_inquire_size") STOP 5
23 if (i /= 3000) STOP 6
25 close(25, status="delete")
26 inquire(file="testfile_inquire_size", size=i)
27 if (i /= -1) STOP 7
28 end