2 ! Test the fix for pr69011, preventing an ICE and making sure
3 ! that the correct dynamic type is used.
5 ! Contributed by Thomas Koenig <tkoenig@gcc.gnu.org>
6 ! Andre Vehreschild <vehre@gcc.gnu.org>
25 use m1
, only
: basetype
27 integer, parameter :: I_P
= 4
30 public
:: factory
, exttype
32 type, extends(basetype
) :: exttype
38 integer(I_P
) :: steps
=-1
40 procedure
, pass(self
), public
:: construct
44 function construct(self
, previous
)
45 class(basetype
), intent(INOUT
) :: previous(1:)
46 class(factory
), intent(IN
) :: self
47 class(basetype
), pointer :: construct
48 allocate(construct
, source
=previous(self
%steps
))
54 class(factory
), allocatable
:: c1
55 class(exttype
), allocatable
:: prev(:)
56 class(basetype
), pointer :: d
63 d
=> c1
%construct(prev
)
65 if (.not
. associated(d
) ) call abort()
68 if (d
%i2
/= 5) call abort()
72 if (d
%i
/= 2) call abort()