aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gfortran.dg/inquire_16.f90
blob: b52e23db6b43adb7ea559063fe2b370df145452f (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
25
26
27
28
29
! { dg-do run }
!
! PR fortran/60286
!
! Contributed by  Alexander Vogt
!
program test_inquire
  use, intrinsic :: ISO_Fortran_env
  implicit none
  character(len=20) :: s_read, s_write, s_readwrite

  inquire(unit=input_unit, read=s_read, write=s_write, &
          readwrite=s_readwrite)
  if (s_read /= "YES" .or. s_write /= "NO" .or. s_readwrite /="NO") then
    call abort()
  endif

  inquire(unit=output_unit, read=s_read, write=s_write, &
          readwrite=s_readwrite)
  if (s_read /= "NO" .or. s_write /= "YES" .or. s_readwrite /="NO") then
    call abort()
  endif

  inquire(unit=error_unit, read=s_read, write=s_write, &
          readwrite=s_readwrite)
  if (s_read /= "NO" .or. s_write /= "YES" .or. s_readwrite /="NO") then
    call abort()
  endif
end program test_inquire