10 character(len
=:), allocatable
:: s1
11 character(len
=:), pointer :: s2
12 character(len
=5), target
:: fifeC
= 'FIVEC'
14 if (len(s1
) /= 5) STOP 1
15 if (s1
/= "ZZZZZ") STOP 2
17 if (len(s2
) /= 5) STOP 3
18 if (s2
/= "FIVEC") STOP 4
19 s1
= addPrefix(subfunc())
20 if (len(s1
) /= 7) STOP 5
21 if (s1
/= "..FIVEC") STOP 6
24 character(len
=:), allocatable
:: str
27 if (len(str
) /= 5) STOP 7
28 if (str
/= "ZZZZZ") STOP 8
30 function subfunc() result(res
)
31 character(len
=:), pointer :: res
33 if (len(res
) /= 5) STOP 9
34 if (res
/= "FIVEC") STOP 10
36 function addPrefix(str
) result(res
)
37 character(len
=:), pointer :: str
38 character(len
=:), allocatable
:: res
40 end function addPrefix
44 character(len
=:),allocatable
:: s
47 if (len(repeat(' ',j
)) /= 2) STOP 11
48 if (repeat('y',j
) /= "yy") STOP 12
49 if (len(s
) /= 2) STOP 13
50 if (s
/= "xx") STOP 14