diff options
author | Brad King <brad.king@kitware.com> | 2018-04-19 15:26:06 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2018-04-20 14:57:32 (GMT) |
commit | b1f95e5b1477794c0ee3a56a4ea016a34c3e3d5c (patch) | |
tree | 715af1b794f404479f96a5932d2d1ea9b0187490 /Tests | |
parent | 402735314ec7fe48ec21e5f4c5b19b6f17682c54 (diff) | |
download | CMake-b1f95e5b1477794c0ee3a56a4ea016a34c3e3d5c.zip CMake-b1f95e5b1477794c0ee3a56a4ea016a34c3e3d5c.tar.gz CMake-b1f95e5b1477794c0ee3a56a4ea016a34c3e3d5c.tar.bz2 |
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.
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/FortranModules/Submodules/CMakeLists.txt | 3 | ||||
-rw-r--r-- | Tests/FortranModules/Submodules/greatgrandchild.f90 | 8 | ||||
-rw-r--r-- | Tests/FortranModules/Submodules/main.f90 | 2 | ||||
-rw-r--r-- | Tests/FortranModules/Submodules/parent.f90 | 5 | ||||
-rw-r--r-- | Tests/FortranModules/Submodules/sibling.f90 | 5 |
5 files changed, 23 insertions, 0 deletions
diff --git a/Tests/FortranModules/Submodules/CMakeLists.txt b/Tests/FortranModules/Submodules/CMakeLists.txt index da204d0..ab8e0f9 100644 --- a/Tests/FortranModules/Submodules/CMakeLists.txt +++ b/Tests/FortranModules/Submodules/CMakeLists.txt @@ -8,6 +8,8 @@ # child sibling # | # grandchild +# | +# GreatGrandChild # # where the parent node is a module and all other nodes are submodules. @@ -16,5 +18,6 @@ add_executable(submod parent.f90 child.f90 grandchild.f90 + greatgrandchild.f90 sibling.f90 ) diff --git a/Tests/FortranModules/Submodules/greatgrandchild.f90 b/Tests/FortranModules/Submodules/greatgrandchild.f90 new file mode 100644 index 0000000..85404ea --- /dev/null +++ b/Tests/FortranModules/Submodules/greatgrandchild.f90 @@ -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 diff --git a/Tests/FortranModules/Submodules/main.f90 b/Tests/FortranModules/Submodules/main.f90 index 3c750ce..3cd2989 100644 --- a/Tests/FortranModules/Submodules/main.f90 +++ b/Tests/FortranModules/Submodules/main.f90 @@ -1,5 +1,7 @@ program main use parent, only : child_function,grandchild_subroutine + use parent, only : sibling_function,GreatGrandChild_subroutine implicit none if (child_function()) call grandchild_subroutine + if (sibling_function()) call GreatGrandChild_subroutine end program diff --git a/Tests/FortranModules/Submodules/parent.f90 b/Tests/FortranModules/Submodules/parent.f90 index 7693a72..3180b70 100644 --- a/Tests/FortranModules/Submodules/parent.f90 +++ b/Tests/FortranModules/Submodules/parent.f90 @@ -7,10 +7,15 @@ module parent module function child_function() result(child_stuff) logical :: child_stuff end function + module function sibling_function() result(sibling_stuff) + logical :: sibling_stuff + end function ! Test Fortran 2008 "module subroutine" syntax module subroutine grandchild_subroutine() end subroutine + module subroutine GreatGrandChild_subroutine() + end subroutine end interface diff --git a/Tests/FortranModules/Submodules/sibling.f90 b/Tests/FortranModules/Submodules/sibling.f90 index bba5f92..8c0943d 100644 --- a/Tests/FortranModules/Submodules/sibling.f90 +++ b/Tests/FortranModules/Submodules/sibling.f90 @@ -1,4 +1,9 @@ ! Empty submodule for checking disambiguation of ! nodes at the same vertical level in the tree submodule ( parent ) sibling +contains + module function sibling_function() result(sibling_stuff) + logical :: sibling_stuff + sibling_stuff=.true. + end function end submodule sibling |