1 ! Related to PR 15326. Try calling string functions whose lengths involve
2 ! some sort of array calculation.
4 pure elemental
function double (x
)
5 integer, intent (in
) :: x
14 pure elemental
function double (x
)
15 integer, intent (in
) :: x
20 integer, dimension (100:104), target
:: a
21 integer, dimension (:), pointer :: ap
24 a
= (/ (i
+ 5, i
= 0, 4) /)
28 call test (f1 (a
), 35)
29 call test (f1 (ap
), 35)
30 call test (f1 ((/ 5, 10, 50 /)), 65)
31 call test (f1 (a (101:103)), 21)
33 call test (f2 (a
), 115)
34 call test (f2 (ap
), 115)
35 call test (f2 ((/ 5, 10, 50 /)), 119)
36 call test (f2 (a (101:103)), 116)
38 call test (f3 (a
), 60)
39 call test (f3 (ap
), 60)
40 call test (f3 ((/ 5, 10, 50 /)), 120)
41 call test (f3 (a (101:103)), 30)
43 call test (f4 (a
, 13, 1), 21)
44 call test (f4 (ap
, 13, 2), 14)
45 call test (f4 ((/ 5, 10, 50 /), 12, 1), 60)
46 call test (f4 (a (101:103), 12, 1), 15)
49 integer, dimension (10:) :: array
50 character (len
= sum (array
)) :: f1
55 integer, dimension (10:) :: array
56 character (len
= array (11) + a (104) + 100) :: f2
61 integer, dimension (:) :: array
62 character (len
= sum (double (array (2:)))) :: f3
66 function f4 (array
, upper
, stride
)
67 integer, dimension (10:) :: array
68 integer :: upper
, stride
69 character (len
= sum (array (lower
:upper
:stride
))) :: f4
73 subroutine test (string
, length
)
74 character (len
= *) :: string
75 integer, intent (in
) :: length
76 if (len (string
) .ne
. length
) call abort