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") STOP 1
24 if (len (lhs
) .ne
. 3) STOP 2
26 lhs
= bar ("bar calling - baaaa!")
27 if (lhs
.ne
. "bar calling") STOP 3
28 if (len (lhs
) .ne
. 12) STOP 4
30 lhs
= mfoo ("mfoo calling ")
31 if (lhs
.ne
. "foo") STOP 5
32 if (len (lhs
) .ne
. 3) STOP 6
34 lhs
= mbar ("mbar calling - baaaa!")
35 if (lhs
.ne
. "bar calling") STOP 7
36 if (len (lhs
) .ne
. 12) STOP 8
38 function foo (carg
) result(res
)
39 character (:), allocatable
:: res
44 character (:), allocatable
:: bar