2017-12-08 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gfortran.dg / inquire_internal.f90
blob26570e6e43eed6396b6b879f88aee6a5dc1a9ac7
1 ! { dg-do run }
2 ! Test case from PR61933.
3 use iso_fortran_env
4 logical :: unit_exists
5 integer :: tunit, istat
6 istat = 0
7 tunit=-1 ! Represents an internal unit.
8 unit_exists = .true.
9 inquire(unit=tunit, exist=unit_exists, iostat=istat)
10 !print *, "Error Code is : ", IOSTAT_INQUIRE_INTERNAL_UNIT
11 !print *, "IOSTAT Code is: ", istat
12 !print *, tunit, unit_exists
13 if (istat.ne.iostat_inquire_internal_unit) call abort()
14 if (unit_exists) call abort()
15 END