c: Fix up pointer types to may_alias structures [PR114493]
[official-gcc.git] / gcc / testsuite / gfortran.dg / mapping_3.f90
blobb2713372ab9d0b1967563c78ee3367448dae3826
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)) STOP 1
31 end subroutine
33 end program