2 ! Tests function return of deferred length scalars.
4 ! Contributed by Paul Thomas <pault@gcc.gnu.org>
8 function mfoo (carg
) result(res
)
9 character (:), allocatable
:: res
14 character (:), allocatable
:: mbar
21 character (:), allocatable
:: lhs
22 lhs
= foo ("foo calling ")
23 if (lhs
.ne
. "foo") call abort
24 if (len (lhs
) .ne
. 3) call abort
26 lhs
= bar ("bar calling - baaaa!")
27 if (lhs
.ne
. "bar calling") call abort
28 if (len (lhs
) .ne
. 12) call abort
30 lhs
= mfoo ("mfoo calling ")
31 if (lhs
.ne
. "foo") call abort
32 if (len (lhs
) .ne
. 3) call abort
34 lhs
= mbar ("mbar calling - baaaa!")
35 if (lhs
.ne
. "bar calling") call abort
36 if (len (lhs
) .ne
. 12) call abort
38 function foo (carg
) result(res
)
39 character (:), allocatable
:: res
44 character (:), allocatable
:: bar