3 ! Test the fix for PR99819 - explicit shape class arrays in different
4 ! procedures caused an ICE.
6 ! Contributed by Gerhard Steinmetz <gscfq@t-online.de>
12 class(t
), allocatable
:: dum1(:), dum2(:), dum3(:,:)
14 allocate (t
:: dum1(3), dum2(10), dum3(2,5))
15 dum2
%i
= [1,2,3,4,5,6,7,8,9,10]
16 dum3
%i
= reshape ([1,2,3,4,5,6,7,8,9,10],[2,5])
18 ! Somewhat elaborated versions of the PR procedures.
19 if (f (dum1
, dum2
, dum3
) .ne
. 10) stop 1
20 if (g (dum1
) .ne
. 3) stop 2
22 ! Test the original versions of the procedures.
23 if (f_original (dum1
, dum2
) .ne
. 3) stop 3
24 if (g_original (dum2
) .ne
. 10) stop 4
27 integer function f(x
, y
, z
)
29 class(t
) :: y(size( x
))
31 if (size (y
) .ne
. 3) stop 5
32 if (size (z
) .ne
. 0) stop 6
36 if (any (y
%i
.ne
. [1,2,3])) stop 7
43 if (any (z(1,1:4)%i
.ne
. [1,3,5,7])) stop 8
54 integer function f_original(x
, y
)
56 class(*) :: y(size (x
))
60 integer function g_original(z
)