2 ! Tests that inquire(iolength=) treats derived types as if they do not
3 ! have User Defined procedures. Fortran Draft F2016 Standard, 9.10.3
6 CHARACTER (LEN
=20) :: name
9 INTERFACE WRITE(FORMATTED
)
12 INTERFACE WRITE(UNFORMATTED
)
15 INTERFACE read(FORMATTED
)
18 INTERFACE read(UNFORMATTED
)
22 SUBROUTINE pwf (dtv
,unit
,iotype
,vlist
,iostat
,iomsg
)
23 CLASS(person
), INTENT(IN
) :: dtv
24 INTEGER, INTENT(IN
) :: unit
25 CHARACTER (LEN
=*), INTENT(IN
) :: iotype
26 INTEGER, INTENT(IN
) :: vlist(:)
27 INTEGER, INTENT(OUT
) :: iostat
28 CHARACTER (LEN
=*), INTENT(INOUT
) :: iomsg
29 WRITE(unit
, FMT
= *, IOSTAT
=iostat
) dtv
%name
, dtv
%age
32 SUBROUTINE prf (dtv
,unit
,iotype
,vlist
,iostat
,iomsg
)
33 CLASS(person
), INTENT(INOUT
) :: dtv
34 INTEGER, INTENT(IN
) :: unit
35 CHARACTER (LEN
=*), INTENT(IN
) :: iotype
36 INTEGER, INTENT(IN
) :: vlist(:)
37 INTEGER, INTENT(OUT
) :: iostat
38 CHARACTER (LEN
=*), INTENT(INOUT
) :: iomsg
39 READ (UNIT
= UNIT
, FMT
= *) dtv
%name
, dtv
%age
42 SUBROUTINE pwuf (dtv
,unit
,iostat
,iomsg
)
43 CLASS(person
), INTENT(IN
) :: dtv
44 INTEGER, INTENT(IN
) :: unit
45 INTEGER, INTENT(OUT
) :: iostat
46 CHARACTER (LEN
=*), INTENT(INOUT
) :: iomsg
48 WRITE (UNIT
=UNIT
, FMT
= *) DTV
%name
, DTV
%age
51 SUBROUTINE pruf (dtv
,unit
,iostat
,iomsg
)
52 CLASS(person
), INTENT(INOUT
) :: dtv
53 INTEGER, INTENT(IN
) :: unit
54 INTEGER, INTENT(OUT
) :: iostat
55 CHARACTER (LEN
=*), INTENT(INOUT
) :: iomsg
57 READ (UNIT
= UNIT
, FMT
= *) dtv
%name
, dtv
%age
65 TYPE (person
) :: chairman
66 integer(4) :: rl
, tl
, kl
68 chairman
%name
="Charlie"
71 inquire(iolength
=rl
) rl
, kl
, chairman
, rl
, chairman
, tl
72 if (rl
.ne
.64) call abort