2 ! Test the fix for PR31879 in which the concatenation operators below
3 ! would cause ICEs because the character lengths were never resolved.
5 ! Contributed by Vivek Rao <vivekrao4@yahoo.com>
8 character(3) :: mz(2) = (/"fgh","ijk"/)
10 function ccopy(yy
) result(xy
)
11 character (len
=*), intent(in
) :: yy(:)
12 character (len
=5) :: xy(size(yy
))
18 use str_mod
, only
: ccopy
, mz
20 character(2) :: z
= "zz"
21 character(3) :: zz(2) = (/"abc","cde"/)
22 character(2) :: ans(2)
23 integer :: i
= 2, j
= 3
24 if (any(ccopy("_&_"//(/"A","B"/)//"?") .ne
. (/"_&_A?","_&_B?"/))) call abort ()
25 if (any(ccopy(z
//zz
) .ne
. (/"zzabc","zzcde"/))) call abort ()
26 if (any(ccopy(z
//zz(:)(1:2)) .ne
. (/"zzab ","zzcd "/))) call abort ()
27 if (any(ccopy(z
//mz(:)(2:3)) .ne
. (/"zzgh ","zzjk "/))) call abort ()
29 ! This was another bug, uncovered when the PR was fixed.
30 if (any(ccopy(z
//mz(:)(i
:j
)) .ne
. (/"zzgh ","zzjk "/))) call abort ()