1! { dg-do run }
2!
3! Tests the fix for PR77358, in which the wrong gfc_charlen was
4! being used for the result of 'get'.
5!
6! Contributed by Damian Rouson  <damian@sourceryinstitute.org>
7!
8module hello_interface
9  character(len=13) :: string="Hello, world!"
10  interface
11    module function get() result(result_string)
12      character(:), allocatable :: result_string
13    end function
14  end interface
15end module
16
17submodule(hello_interface) hello_implementation
18contains
19  module function get() result(result_string)
20    character(:), allocatable :: result_string
21    result_string = string
22  end function
23end submodule
24
25  use hello_interface
26  if (get() .ne. string) STOP 1
27end
28