1! { dg-do run }
2!
3! Tests the fix for PR71838 in which the PROCEDURE dummy argument caused
4! an ICE in the submodule. This an executable version of the reduced test
5! in comment #11.
6!
7! Contributed by Anton Shterenlikht  <mexas@bristol.ac.uk>
8! Test reduced by Dominique d'Humieres <dominiq@lps.ens.fr>
9!
10subroutine hello (message)
11  character (7), intent(inout) :: message
12  message = "hello  "
13end
14
15module cgca_m3clvg
16  interface
17    subroutine cgca_clvgs_abstract(message)
18      character (7), intent(inout) :: message
19    end subroutine cgca_clvgs_abstract
20  end interface
21
22  interface
23    module subroutine cgca_clvgp(sub)
24      procedure( cgca_clvgs_abstract ) :: sub
25    end subroutine cgca_clvgp
26  end interface
27
28  character (7) :: greeting
29end module cgca_m3clvg
30
31submodule ( cgca_m3clvg ) m3clvg_sm3
32  implicit none
33contains
34  module procedure cgca_clvgp
35    call sub (greeting)
36  end procedure cgca_clvgp
37end submodule m3clvg_sm3
38
39  use cgca_m3clvg
40  external hello
41  greeting = "goodbye"
42  call cgca_clvgp (hello)
43  if (trim (greeting) .ne. "hello") call abort
44end
45