Debian Codegraph @

gcc/testsuite/gfortran.dg/submodule_27.f08

raw
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 <[email protected]>
8 ! Test reduced by Dominique d'Humieres <[email protected]>
9 !
10 subroutine hello (message)
11 character (7), intent(inout) :: message
12 message = "hello "
13 end
14
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
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
29 end module cgca_m3clvg
30
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
38
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