ieee_9.f90: XFAIL on arm*-*-gnueabi[hf].
[official-gcc.git] / gcc / testsuite / gfortran.dg / module_read_2.f90
blob0723590d0568b325e51a4836cafedf346fb8a1d4
1 ! { dg-do run }
3 ! PR fortran/43199
5 ! This program gave an ICE due to reading the REF_COMPONENT with CLASS.
7 module m_string
8 type t_string
9 character, dimension(:), allocatable :: string
10 end type t_string
11 contains
12 pure function string_to_char ( s ) result(res)
13 class(t_string), intent(in) :: s
14 character(len=size(s%string)) :: res
15 integer :: i
16 do i = 1,len(res)
17 res(i:i) = s%string(i)
18 end do
19 end function string_to_char
20 end module m_string
22 use m_string
23 type(t_string) :: str
24 allocate(str%string(5))
25 str%string = ['H','e','l','l','o']
26 if (len (string_to_char (str)) /= 5) STOP 1
27 if (string_to_char (str) /= "Hello") STOP 2
28 end