summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/array_function_4.f90
blob: c7e7d6e57c48925a475d123fa846000bf60b5cc2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
! { dg-do compile }

! PR fortran/37411
! This used to cause an ICE because of a missing array spec after interface
! mapping.

! Contributed by Kristjan Jonasson <jonasson@hi.is>

MODULE B1
CONTAINS
  subroutine sub()
    integer :: x(1)
    character(3) :: st
    st = fun(x)
  end subroutine sub

  function fun(x) result(st)
    integer, intent(in) :: x(1)
    character(lenf(x)) :: st
    st = 'abc'
  end function fun

  pure integer function lenf(x)
    integer, intent(in) :: x(1)
    lenf = x(1)
  end function lenf
END MODULE B1

! { dg-final { cleanup-modules "B1" } }