c: Fix up pointer types to may_alias structures [PR114493]
[official-gcc.git] / gcc / testsuite / gfortran.dg / submodule_27.f08
blob259eeb7ccffa75462e88ce165889dcba84f94cfb
1 ! { dg-do run }
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.
7 ! Contributed by Anton Shterenlikht  <mexas@bristol.ac.uk>
8 ! Test reduced by Dominique d'Humieres <dominiq@lps.ens.fr>
10 subroutine hello (message)
11   character (7), intent(inout) :: message
12   message = "hello  "
13 end
15 module 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
22   interface
23     module subroutine cgca_clvgp(sub)
24       procedure( cgca_clvgs_abstract ) :: sub
25     end subroutine cgca_clvgp
26   end interface
28   character (7) :: greeting
29 end module cgca_m3clvg
31 submodule ( cgca_m3clvg ) m3clvg_sm3
32   implicit none
33 contains
34   module procedure cgca_clvgp
35     call sub (greeting)
36   end procedure cgca_clvgp
37 end submodule m3clvg_sm3
39   use cgca_m3clvg
40   external hello
41   greeting = "goodbye"
42   call cgca_clvgp (hello)
43   if (trim (greeting) .ne. "hello") STOP 1
44 end