4 ! Contributed by Tobias Burnus
7 implicit none (type, external)
12 type, extends(t
) :: t2
16 class(t
), allocatable
:: aa
18 call check_intentout_false(allocated(aa
), aa
, &
20 if (allocated(aa
)) stop 1
23 if (.not
.allocated(aa
)) stop 2
24 if (.not
.same_type_as(aa
, x2
)) stop 3
25 call check_intentout_true(allocated(aa
), (same_type_as(aa
, x2
)), aa
, &
26 allocated(aa
), (same_type_as(aa
, x2
)))
27 if (allocated(aa
)) stop 4
30 subroutine check_intentout_false(alloc1
, yy
, alloc2
)
31 logical, value
:: alloc1
, alloc2
32 class(t
), allocatable
, intent(out
) :: yy
33 if (allocated(yy
)) stop 11
36 end subroutine check_intentout_false
37 subroutine check_intentout_true(alloc1
, same1
, zz
, alloc2
, same2
)
38 logical, value
:: alloc1
, alloc2
, same1
, same2
39 class(t
), allocatable
, intent(out
) :: zz
40 if (allocated(zz
)) stop 21
41 if (.not
.alloc1
) stop 22
42 if (.not
.alloc2
) stop 23
43 if (.not
.same1
) stop 24
44 if (.not
.same2
) stop 25
45 end subroutine check_intentout_true