2 ! Tests the fix for PR38538, where the character length for the
3 ! argument of 'func' was not calculated.
5 ! Contributed by Vivek Rao <vivekrao4@yahoo.com>
10 subroutine xmain (i
, j
)
12 call foo (func ("_"//bar (i
)//"x"//bar (j
)//"x"), "_abcxabx") ! original was elemental
13 call foo (nfunc("_"//bar (j
)//"x"//bar (i
)//"x"), "_abxabcx")
16 function bar (i
) result(yy
)
18 character (len
= i
) :: yy(2)
19 do j
= 1, size (yy
, 1)
21 yy(j
)(k
:k
) = char (96+k
)
26 elemental
function func (yy
) result(xy
)
27 character (len
= *), intent(in
) :: yy
28 character (len
= len (yy
)) :: xy
32 function nfunc (yy
) result(xy
)
33 character (len
= *), intent(in
) :: yy(:)
34 character (len
= len (yy
)) :: xy(size (yy
))
38 subroutine foo(cc
, teststr
)
39 character (len
=*), intent(in
) :: cc(:)
40 character (len
=*), intent(in
) :: teststr
41 if (any (cc
.ne
. teststr
)) call abort