5 ! This program gave an ICE due to reading the REF_COMPONENT with CLASS.
9 character, dimension(:), allocatable :: string
12 pure function string_to_char ( s ) result(res)
13 class(t_string), intent(in) :: s
14 character(len=size(s%string)) :: res
17 res(i:i) = s%string(i)
19 end function string_to_char
24 allocate(str%string(5))
25 str%string = ['H','e','l','l','o']
26 if (len (string_to_char (str)) /= 5) call abort ()
27 if (string_to_char (str) /= "Hello") call abort ()
30 ! { dg-final { cleanup-modules "m_string" } }