Merge from mainline (167278:168000).
[official-gcc/graphite-test-results.git] / gcc / testsuite / gfortran.dg / inquire_size.f90
blob568c3d6a0f3b35497f4c21e0c575c810b529d736
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", status="replace", access="stream", form="unformatted")
8 do i=1,100
9 write(25) i, "abcdefghijklmnopqrstuvwxyz"
10 enddo
11 flush(25)
13 inquire(unit=25, named=is_named, name=aname, size=i)
14 if (.not.is_named) call abort
15 if (aname /= "testfile") call abort
16 if (i /= 3000) call abort
18 inquire(file="testfile", size=i)
19 if (.not.is_named) call abort
20 if (aname /= "testfile") call abort
21 if (i /= 3000) call abort
23 close(25, status="delete")
24 inquire(file="testfile", size=i)
25 if (i /= -1) call abort
26 end