2010-12-20 Tobias Burnus <burnus@net-b.de>
[official-gcc.git] / gcc / testsuite / gfortran.dg / mapping_3.f90
blob318ec00c02778f2446752e4aba0744457eadb2a1
1 ! { dg-do run }
2 ! Tests the fix for PR33888, in which the character length of
3 ! the elemental function myfunc was not being calculated before
4 ! the temporary for the array result was allocated.
6 ! Contributed by Walter Spector <w6ws@earthlink.net>
8 program ftn95bug
9 implicit none
11 character(8) :: indata(4) = &
12 (/ '12344321', '98766789', 'abcdefgh', 'ABCDEFGH' /)
14 call process (myfunc (indata)) ! <- This caused a gfortran ICE !
16 contains
18 elemental function myfunc (s)
19 character(*), intent(in) :: s
20 character(len (s)) :: myfunc
22 myfunc = s
24 end function
26 subroutine process (strings)
27 character(*), intent(in) :: strings(:)
29 if (any (strings .ne. indata)) call abort ()
31 end subroutine
33 end program