3 ! Test move_alloc for polymorphic scalars
13 type, extends(base_type
) :: extended_type
15 end type extended_type
17 subroutine myallocate (a
)
18 class(base_type
), allocatable
, intent(inout
) :: a
19 class(base_type
), allocatable
:: tmp
21 allocate (extended_type
:: tmp
)
26 type is(extended_type
)
27 if (tmp
%i
/= 2 .or
. tmp
%j
/= 77) STOP 2
34 if (a
%i
/= -44) STOP 3
40 call move_alloc (from
=tmp
, to=a
)
43 type is(extended_type
)
52 if (allocated (tmp
)) STOP 8
53 end subroutine myallocate
59 class(base_type
), allocatable
:: a
74 type is(extended_type
)
75 if (a
%i
/= 123) STOP 11
76 if (a
%j
/= 9498) STOP 12