5 ! Contributed by Tobias Burnus <burnus@gcc.gnu.org>
7 ! Spurious assert was added at revision 192495
15 subroutine opt(xa
, xc
, xaa
, xca
)
16 type(t
), allocatable
, intent(out
), optional
:: xa
17 class(t
), allocatable
, intent(out
), optional
:: xc
18 type(t
), allocatable
, intent(out
), optional
:: xaa(:)
19 class(t
), allocatable
, intent(out
), optional
:: xca(:)
20 if (present (xca
)) call foo_opt(xca
=xca
)
22 subroutine foo_opt(xa
, xc
, xaa
, xca
)
23 type(t
), allocatable
, intent(out
), optional
:: xa
24 class(t
), allocatable
, intent(out
), optional
:: xc
25 type(t
), allocatable
, intent(out
), optional
:: xaa(:)
26 class(t
), allocatable
, intent(out
), optional
:: xca(:)
27 if (present (xca
)) then
28 if (allocated (xca
)) deallocate (xca
)
29 allocate (xca(3), source
= [t(9),t(99),t(999)])
31 end subroutine foo_opt
34 class(t
), allocatable
:: xca(:)
35 allocate (xca(1), source
= t(42))
38 if (any (xca
%i
.ne
. [42])) call abort
43 if (any (xca
%i
.ne
. [9,99,999])) call abort