4 ! Also tests fixes for PR52102
6 ! Check whether DT assignment with polymorphic components works.
15 class(t
), allocatable
:: a
21 if (allocated (one
%a
)) STOP 1
26 if (one
%a
%x
/= 7890) STOP 2
30 if (allocated (one
%a
)) STOP 3
35 integer, allocatable
:: x(:)
39 class(t
), allocatable
:: a
45 if (allocated (one
%a
)) STOP 4
49 if (.not
.allocated (one
%a
)) STOP 5
50 if (allocated (one
%a
%x
)) STOP 6
55 if (any (one
%a
%x
/= 7890)) STOP 7
59 if (allocated (one
%a
)) STOP 8
69 class(t
), allocatable
:: a(:)
74 ! Test allocate with array source - PR52102
75 allocate (two
%a(2), source
= [t(4), t(6)])
77 if (allocated (one
%a
)) STOP 9
80 if (.not
.allocated (one
%a
)) STOP 10
82 if ((one
%a(1)%x
/= 4)) STOP 11
83 if ((one
%a(2)%x
/= 6)) STOP 12
88 if (allocated (one
%a
)) STOP 13
90 ! Test allocate with no source followed by assignments.
95 if (allocated (one
%a
)) STOP 14
98 if (.not
.allocated (one
%a
)) STOP 15
100 if ((one
%a(1)%x
/= 5)) STOP 16
101 if ((one
%a(2)%x
/= 7)) STOP 17
105 if (allocated (one
%a
)) STOP 18
110 integer, allocatable
:: x(:)
114 class(t
), allocatable
:: a(:)
119 if (allocated (one
%a
)) STOP 19
120 if (allocated (two
%a
)) STOP 20
124 if (allocated (two
%a(1)%x
)) STOP 21
125 if (allocated (two
%a(2)%x
)) STOP 22
126 allocate (two
%a(1)%x(3), source
=[1,2,3])
127 allocate (two
%a(2)%x(5), source
=[5,6,7,8,9])
129 if (.not
. allocated (one
%a
)) STOP 23
130 if (.not
. allocated (one
%a(1)%x
)) STOP 24
131 if (.not
. allocated (one
%a(2)%x
)) STOP 25
133 if (size(one
%a
) /= 2) STOP 26
134 if (size(one
%a(1)%x
) /= 3) STOP 27
135 if (size(one
%a(2)%x
) /= 5) STOP 28
136 if (any (one
%a(1)%x
/= [1,2,3])) STOP 29
137 if (any (one
%a(2)%x
/= [5,6,7,8,9])) STOP 30
139 deallocate (two
%a(1)%x
)
141 if (.not
. allocated (one
%a
)) STOP 31
142 if (allocated (one
%a(1)%x
)) STOP 32
143 if (.not
. allocated (one
%a(2)%x
)) STOP 33
145 if (size(one
%a
) /= 2) STOP 34
146 if (size(one
%a(2)%x
) /= 5) STOP 35
147 if (any (one
%a(2)%x
/= [5,6,7,8,9])) STOP 36
151 if (allocated (one
%a
)) STOP 37
152 if (allocated (two
%a
)) STOP 38