summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-08-10 13:17:23 (GMT)
committerKitware Robot <kwrobot@kitware.com>2022-08-10 13:17:33 (GMT)
commit20e544eb24fb13e8cfde9f8ab4efa0afbb6d7fda (patch)
tree34c468bf69dc872de415ada157e30993f4113ab9 /Tests
parent3907c081469242a56efc330c2701a7dd05f956ec (diff)
parent219a9b1e14084d16284c909ea055b3329750c909 (diff)
downloadCMake-20e544eb24fb13e8cfde9f8ab4efa0afbb6d7fda.zip
CMake-20e544eb24fb13e8cfde9f8ab4efa0afbb6d7fda.tar.gz
CMake-20e544eb24fb13e8cfde9f8ab4efa0afbb6d7fda.tar.bz2
Merge topic 'fortran-module-dep'
219a9b1e14 Fortran: Fix suprious dependencies with submodules a7211d6a2f Fortran: Teach lexer to handle CRLF newlines Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !7529
Diffstat (limited to 'Tests')
-rw-r--r--Tests/FortranModules/Submodules/CMakeLists.txt1
-rw-r--r--Tests/FortranModules/Submodules/main.f907
-rw-r--r--Tests/FortranModules/Submodules/obfuscated_parent.f9033
-rw-r--r--Tests/FortranModules/test_module_main.f902
4 files changed, 40 insertions, 3 deletions
diff --git a/Tests/FortranModules/Submodules/CMakeLists.txt b/Tests/FortranModules/Submodules/CMakeLists.txt
index ab8e0f9..783af7e 100644
--- a/Tests/FortranModules/Submodules/CMakeLists.txt
+++ b/Tests/FortranModules/Submodules/CMakeLists.txt
@@ -16,6 +16,7 @@
add_executable(submod
main.f90
parent.f90
+ obfuscated_parent.f90
child.f90
grandchild.f90
greatgrandchild.f90
diff --git a/Tests/FortranModules/Submodules/main.f90 b/Tests/FortranModules/Submodules/main.f90
index 3cd2989..67ffba8 100644
--- a/Tests/FortranModules/Submodules/main.f90
+++ b/Tests/FortranModules/Submodules/main.f90
@@ -1,7 +1,10 @@
program main
use parent, only : child_function,grandchild_subroutine
use parent, only : sibling_function,GreatGrandChild_subroutine
+ ! Using a module without postfix
+ use obfuscated_parent
implicit none
- if (child_function()) call grandchild_subroutine
- if (sibling_function()) call GreatGrandChild_subroutine
+ if (child_function()) call grandchild_subroutine
+ if (sibling_function()) call GreatGrandChild_subroutine
+ if (child_function_obf()) call grandchild_subroutine_obf
end program
diff --git a/Tests/FortranModules/Submodules/obfuscated_parent.f90 b/Tests/FortranModules/Submodules/obfuscated_parent.f90
new file mode 100644
index 0000000..f3e68be
--- /dev/null
+++ b/Tests/FortranModules/Submodules/obfuscated_parent.f90
@@ -0,0 +1,33 @@
+! This module has two procedures from the "parent" module
+! but it has different combinations 'module <word>' phrases
+! in breaked lines for test of modules dependencies detection
+
+! Module declaration on breaked line with reminder
+module &
+ obfuscated_parent; implicit none
+
+ interface
+
+ ! Boolean module function
+ module logical &
+ function child_function_obf() result(child_stuff)
+ end function
+
+ ! Module subroutine
+ module subroutine &
+ grandchild_subroutine_obf()
+ end subroutine
+
+ end interface
+
+ contains
+
+ module logical function child_function_obf() result(child_stuff)
+ child_stuff=.true.
+ end function
+
+ module subroutine grandchild_subroutine_obf()
+ print *,"Test passed."
+ end subroutine
+
+end module obfuscated_parent
diff --git a/Tests/FortranModules/test_module_main.f90 b/Tests/FortranModules/test_module_main.f90
index 6ac97fa..958d0a2 100644
--- a/Tests/FortranModules/test_module_main.f90
+++ b/Tests/FortranModules/test_module_main.f90
@@ -1,4 +1,4 @@
PROGRAM MAINF90
- USE TEST_MODULE
+ USE TEST_MODULE, only : TEST_MODULE_FUNCTION
PRINT *,'Sum is',TEST_MODULE_FUNCTION(1., 2.)
END PROGRAM MAINF90