mirror of
https://github.com/Kitware/CMake.git
synced 2026-02-18 05:01:50 -06:00
Fortran: Extend submodule test with great-grandchild
Name the module using CamelCase to test lower-case file name conversion. Also add coverage of existing "sibling" module.
This commit is contained in:
@@ -8,6 +8,8 @@
|
|||||||
# child sibling
|
# child sibling
|
||||||
# |
|
# |
|
||||||
# grandchild
|
# grandchild
|
||||||
|
# |
|
||||||
|
# GreatGrandChild
|
||||||
#
|
#
|
||||||
# where the parent node is a module and all other nodes are submodules.
|
# where the parent node is a module and all other nodes are submodules.
|
||||||
|
|
||||||
@@ -16,5 +18,6 @@ add_executable(submod
|
|||||||
parent.f90
|
parent.f90
|
||||||
child.f90
|
child.f90
|
||||||
grandchild.f90
|
grandchild.f90
|
||||||
|
greatgrandchild.f90
|
||||||
sibling.f90
|
sibling.f90
|
||||||
)
|
)
|
||||||
|
|||||||
8
Tests/FortranModules/Submodules/greatgrandchild.f90
Normal file
8
Tests/FortranModules/Submodules/greatgrandchild.f90
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
! Test the notation for an Nth-generation descendant
|
||||||
|
! for N>1, which necessitates the colon.
|
||||||
|
submodule ( parent : grandchild ) GreatGrandChild
|
||||||
|
contains
|
||||||
|
module subroutine GreatGrandChild_subroutine()
|
||||||
|
print *,"Test passed."
|
||||||
|
end subroutine
|
||||||
|
end submodule GreatGrandChild
|
||||||
@@ -1,5 +1,7 @@
|
|||||||
program main
|
program main
|
||||||
use parent, only : child_function,grandchild_subroutine
|
use parent, only : child_function,grandchild_subroutine
|
||||||
|
use parent, only : sibling_function,GreatGrandChild_subroutine
|
||||||
implicit none
|
implicit none
|
||||||
if (child_function()) call grandchild_subroutine
|
if (child_function()) call grandchild_subroutine
|
||||||
|
if (sibling_function()) call GreatGrandChild_subroutine
|
||||||
end program
|
end program
|
||||||
|
|||||||
@@ -7,10 +7,15 @@ module parent
|
|||||||
module function child_function() result(child_stuff)
|
module function child_function() result(child_stuff)
|
||||||
logical :: child_stuff
|
logical :: child_stuff
|
||||||
end function
|
end function
|
||||||
|
module function sibling_function() result(sibling_stuff)
|
||||||
|
logical :: sibling_stuff
|
||||||
|
end function
|
||||||
|
|
||||||
! Test Fortran 2008 "module subroutine" syntax
|
! Test Fortran 2008 "module subroutine" syntax
|
||||||
module subroutine grandchild_subroutine()
|
module subroutine grandchild_subroutine()
|
||||||
end subroutine
|
end subroutine
|
||||||
|
module subroutine GreatGrandChild_subroutine()
|
||||||
|
end subroutine
|
||||||
|
|
||||||
end interface
|
end interface
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,9 @@
|
|||||||
! Empty submodule for checking disambiguation of
|
! Empty submodule for checking disambiguation of
|
||||||
! nodes at the same vertical level in the tree
|
! nodes at the same vertical level in the tree
|
||||||
submodule ( parent ) sibling
|
submodule ( parent ) sibling
|
||||||
|
contains
|
||||||
|
module function sibling_function() result(sibling_stuff)
|
||||||
|
logical :: sibling_stuff
|
||||||
|
sibling_stuff=.true.
|
||||||
|
end function
|
||||||
end submodule sibling
|
end submodule sibling
|
||||||
|
|||||||
Reference in New Issue
Block a user