3 ! Test the fix for PR87239 in which the call to the elemental function
4 ! 'gettwo' was being added before the scalarization loop in the assignment.
5 ! Since the result temporary was being declared in the loop body, this
6 ! drove the gimplifier crazy. It is sufficient to compile this testcase
7 ! since it used to ICE.
9 ! Contributed by Juergen Reuter <juergen.reuter@desy.de>
15 elemental
function gettwo( s
) result( res
)
16 character(*), intent(in
) :: s
17 character(len(s
)) :: res
27 character(10) :: inp( 5 )
30 ! character(10), allocatable :: out(:) ! this works
31 character(:), allocatable
:: out(:) ! this was stuffed
33 inp
= [ 'aaa', 'bbb', 'ccc', 'ddd', 'eee' ]
37 do i
= 1, size (out
, 1)
38 if (trim (out(i
)) .ne
. inp(i
)(1:2)) stop 1