1 ! Related to PR 15326. Try calling string functions whose lengths depend
2 ! on the lengths of other strings.
4 pure
function double (string
)
5 character (len
= *), intent (in
) :: string
6 character (len
= len (string
) * 2) :: double
7 double = string
// string
11 character (len
= *) :: string
12 character (len
= len (string
)) :: f1
16 function f2 (string1
, string2
)
17 character (len
= *) :: string1
18 character (len
= len (string1
) - 20) :: string2
19 character (len
= len (string1
) + len (string2
) / 2) :: f2
27 pure
function double (string
)
28 character (len
= *), intent (in
) :: string
29 character (len
= len (string
) * 2) :: double
32 character (len
= *) :: string
33 character (len
= len (string
)) :: f1
35 function f2 (string1
, string2
)
36 character (len
= *) :: string1
37 character (len
= len (string1
) - 20) :: string2
38 character (len
= len (string1
) + len (string2
) / 2) :: f2
43 character (len
= 80) :: text
44 character (len
= 70), target
:: textt
45 character (len
= 70), pointer :: textp
50 call test (f1 (text
), 80)
51 call test (f2 (text
, text
), 110)
52 call test (f3 (text
), 115)
53 call test (f4 (text
), 192)
54 call test (f5 (text
), 160)
55 call test (f6 (text
), 39)
57 call test (f1 (textp
), 70)
58 call test (f2 (textp
, text
), 95)
59 call test (f3 (textp
), 105)
60 call test (f4 (textp
), 192)
61 call test (f5 (textp
), 140)
62 call test (f6 (textp
), 29)
67 integer, parameter :: l1
= 30
68 character (len
= *) :: string
69 character (len
= len (string
) + l1
+ 5) :: f3
74 character (len
= len (text
) - 10) :: string
75 character (len
= len (string
) + len (text
) + a
) :: f4
80 character (len
= *) :: string
81 character (len
= len (double (string
))) :: f5
86 character (len
= *) :: string
87 character (len
= len (string (a
:))) :: f6
91 subroutine indirect (text2
)
92 character (len
= *) :: text2
94 call test (f1 (text
), 80)
95 call test (f2 (text
, text
), 110)
96 call test (f3 (text
), 115)
97 call test (f4 (text
), 192)
98 call test (f5 (text
), 160)
99 call test (f6 (text
), 39)
101 call test (f1 (text2
), 70)
102 call test (f2 (text2
, text2
), 95)
103 call test (f3 (text2
), 105)
104 call test (f4 (text2
), 192)
105 call test (f5 (text2
), 140)
106 call test (f6 (text2
), 29)
107 end subroutine indirect
109 subroutine test (string
, length
)
110 character (len
= *) :: string
111 integer, intent (in
) :: length
112 if (len (string
) .ne
. length
) call abort