implicit none

call call_a(a1)  ! { dg-error "Character length mismatch in function result" }
call call_b(b1)  ! { dg-error "Shape mismatch" }
call call_c(c1)  ! { dg-error "POINTER mismatch in function result" }
call call_d(c1)  ! { dg-error "ALLOCATABLE mismatch in function result" }

contains

  character(1) function a1()
  end function

  subroutine call_a(a2)
    interface
      character(2) function a2()
      end function
    end interface
  end subroutine


  function b1()
    integer, dimension(1:3) :: b1
  end function

  subroutine call_b(b2)
    interface
      function b2()
	integer, dimension(0:4) :: b2
      end function
    end interface
  end subroutine


  integer function c1()
  end function

  subroutine call_c(c2)
    interface
      function c2()
	integer, pointer :: c2
      end function
    end interface
  end subroutine


  subroutine call_d(d2)
    interface
      function d2()
	integer, allocatable :: d2
      end function
    end interface
  end subroutine

end
