2 ! Test the fix for PR113885, where not only was there a gimplifier ICE
3 ! for a derived type 't' with no components but this version gave wrong
5 ! Contributed by David Binderman <dcb314@hotmail.com>
15 impure elemental
subroutine finalize(x
)
16 type(t
), intent(inout
) :: x
18 end subroutine finalize
21 impure elemental
function elem(x
)
23 type(t
), intent(in
) :: x
28 impure elemental
function elem2(x
, y
)
30 type(t
), intent(in
) :: x
, y
38 impure elemental
function elem(x
)
40 type(t
), intent(in
) :: x
45 type(t
), allocatable
:: y(:)
53 impure elemental
function elem(x
)
55 type(t
), intent(in
) :: x
58 impure elemental
function elem2(x
, y
)
60 type(t
), intent(in
) :: x
, y
65 type(t
), allocatable
:: y(:)
67 x
= elem2(elem(y
), elem(y
))
82 type(t
) :: x(2) = [t(1),t(2)]
84 if (any (x
%i
.ne
. [2,3])) stop 1
85 if (ctr
.ne
. 6) stop 2
87 if (any (x
%i
.ne
. [6,8])) stop 3
88 if (ctr
.ne
. 16) stop 4