2017-02-20 Paul Thomas <pault@gcc.gnu.org>
[official-gcc.git] / gcc / testsuite / gfortran.dg / array_function_4.f90
blobf98b545518cde142447095972b87735a5f40d4da
1 ! { dg-do compile }
3 ! PR fortran/37411
4 ! This used to cause an ICE because of a missing array spec after interface
5 ! mapping.
7 ! Contributed by Kristjan Jonasson <jonasson@hi.is>
9 MODULE B1
10 CONTAINS
11 subroutine sub()
12 integer :: x(1)
13 character(3) :: st
14 st = fun(x)
15 end subroutine sub
17 function fun(x) result(st)
18 integer, intent(in) :: x(1)
19 character(lenf(x)) :: st
20 st = 'abc'
21 end function fun
23 pure integer function lenf(x)
24 integer, intent(in) :: x(1)
25 lenf = x(1)
26 end function lenf
27 END MODULE B1