2 ! Test the fix for PR43227, in which the lines below would segfault.
4 ! Dominique d'Humieres <dominiq@lps.ens.fr>
6 function char1 (s
) result(res
)
7 character, dimension(:), intent(in
) :: s
8 character(len
=size(s
)) :: res
16 procedure(string_to_char
) :: char1
! segfault
17 procedure(string_to_char
), pointer :: char2
! segfault
19 procedure(string_to_char
), pointer, nopass
:: char3
! segfault
24 function string_to_char (s
) result(res
)
25 character, dimension(:), intent(in
) :: s
26 character(len
=size(s
)) :: res
30 end function string_to_char
36 print *, string_to_char (["a","b","c"])
37 char2
=> string_to_char
38 print *, char2 (["d","e","f"])
39 t
%char3
=> string_to_char
40 print *, t
%char3 (["g","h","i"])
41 print *, char1 (["j","k","l"])
43 ! { dg-final { cleanup-tree-dump "m_string" } }
44 ! { dg-final { cleanup-modules "m_string" } }