1 ! RUN: %python %S/test_errors.py %s %flang_fc1
2 ! Tests for I/O of derived types without defined I/O procedures
3 ! but with exposed allocatable/pointer components that would fail
8 real, allocatable
:: allocatableComponent(:)
15 generic
:: write(unformatted
) => wuf1
22 subroutine wuf1(dtv
, unit
, iostat
, iomsg
)
23 class(ok
), intent(in
) :: dtv
24 integer, intent(in
) :: unit
25 integer, intent(out
) :: iostat
26 character(*), intent(in out
) :: iomsg
33 interface write(unformatted
)
37 subroutine wuf2(dtv
, unit
, iostat
, iomsg
)
38 class(maybeBad
), intent(in
) :: dtv
39 integer, intent(in
) :: unit
40 integer, intent(out
) :: iostat
41 character(*), intent(in out
) :: iomsg
50 integer, intent(in
) :: u
54 write(u
) x
! always ok
55 !ERROR: Derived type 'maybebad' in I/O cannot have an allocatable or pointer direct component 'allocatablecomponent' unless using defined I/O
57 !ERROR: Derived type 'poison' in I/O cannot have an allocatable or pointer direct component 'allocatablecomponent' unless using defined I/O
66 integer, intent(in
) :: u
70 write(u
) x
! always ok
72 !ERROR: Derived type 'poison' in I/O cannot have an allocatable or pointer direct component 'allocatablecomponent' unless using defined I/O