Debian Codegraph @

gcc/testsuite/gfortran.dg/submodule_34.f90

raw
1 ! { dg-do compile }
2 !
3 ! PR fortran/122046
4 ! The check for illegal recursion used to trigger on assertion when resolving
5 ! the array spec of the dummy argument in the submodule
6 !
7 ! Contributed by Tomáš Trnka <[email protected]>
8
9 module ChemicalSystemModule
10
11 implicit none
12 private
13
14 type, public :: ChemicalSystemType
15 contains
16 procedure, public :: NumAtoms
17 end type
18
19 contains
20
21 elemental integer function NumAtoms(self)
22 class(ChemicalSystemType), intent(in) :: self
23
24 NumAtoms = 123
25
26 end function
27
28 end module
29
30 module ChemicalSystemUtilsModule
31
32 use ChemicalSystemModule
33
34 implicit none
35 private
36
37 public :: ChemicalSystemRMSD
38
39 interface
40
41 module subroutine ChemicalSystemRMSD(modelSys, rmsdGrad)
42 type(ChemicalSystemType), intent(in) :: modelSys
43 real , intent(out) :: rmsdGrad(3,modelSys%NumAtoms())
44 end subroutine
45
46 end interface
47
48 end module
49
50 submodule(ChemicalSystemUtilsModule) ChemicalSystemUtilsSubModule
51 use ChemicalSystemModule
52
53 implicit none
54
55 contains
56
57 module subroutine ChemicalSystemRMSD(modelSys, rmsdGrad)
58 type(ChemicalSystemType), intent(in) :: modelSys
59 real , intent(out) :: rmsdGrad(3,modelSys%NumAtoms())
60 end subroutine
61
62 end submodule
63