diff options
author | Brad King <brad.king@kitware.com> | 2005-02-15 14:01:14 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2005-02-15 14:01:14 (GMT) |
commit | eb9164bf0ee20ec53d53b88087d977ccaac928e1 (patch) | |
tree | 4f1c36908fdb3692a5595a939276a0eedf5a9ed2 /Tests | |
parent | 23dfc9440a0a82ec00c48cbd2177b43f2cea76f6 (diff) | |
download | CMake-eb9164bf0ee20ec53d53b88087d977ccaac928e1.zip CMake-eb9164bf0ee20ec53d53b88087d977ccaac928e1.tar.gz CMake-eb9164bf0ee20ec53d53b88087d977ccaac928e1.tar.bz2 |
ENH: Added Fortran 90 test if the platform supports it.
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/Fortran/CMakeLists.txt | 7 | ||||
-rw-r--r-- | Tests/Fortran/test_module_implementation.f90 | 6 | ||||
-rw-r--r-- | Tests/Fortran/test_module_interface.f90 | 9 | ||||
-rw-r--r-- | Tests/Fortran/test_module_main.f90 | 4 |
4 files changed, 26 insertions, 0 deletions
diff --git a/Tests/Fortran/CMakeLists.txt b/Tests/Fortran/CMakeLists.txt index 6d08f5e..57634cf 100644 --- a/Tests/Fortran/CMakeLists.txt +++ b/Tests/Fortran/CMakeLists.txt @@ -6,3 +6,10 @@ MESSAGE("CMAKE_Fortran_COMPILER_FULLPATH = ${CMAKE_Fortran_COMPILER_FULLPATH}") MESSAGE("CMAKE_Fortran_COMPILER = ${CMAKE_Fortran_COMPILER}") MESSAGE("CMAKE_Fortran_FLAGS = ${CMAKE_Fortran_FLAGS}") ADD_EXECUTABLE(testf hello.f) + +IF(CMAKE_Fortran_COMPILER_SUPPORTS_F90 AND CMAKE_GENERATOR_NEW) + ADD_EXECUTABLE(test_module + test_module_main.f90 + test_module_implementation.f90 + test_module_interface.f90) +ENDIF(CMAKE_Fortran_COMPILER_SUPPORTS_F90 AND CMAKE_GENERATOR_NEW) diff --git a/Tests/Fortran/test_module_implementation.f90 b/Tests/Fortran/test_module_implementation.f90 new file mode 100644 index 0000000..de3cb57 --- /dev/null +++ b/Tests/Fortran/test_module_implementation.f90 @@ -0,0 +1,6 @@ +FUNCTION TEST_MODULE_FUNCTION(A,B) + REAL :: TEST_MODULE_FUNCTION + REAL, INTENT(IN) :: A + REAL, INTENT(IN) :: B + TEST_MODULE_FUNCTION = A + B +END FUNCTION TEST_MODULE_FUNCTION diff --git a/Tests/Fortran/test_module_interface.f90 b/Tests/Fortran/test_module_interface.f90 new file mode 100644 index 0000000..dd0f35c --- /dev/null +++ b/Tests/Fortran/test_module_interface.f90 @@ -0,0 +1,9 @@ +MODULE TEST_MODULE + INTERFACE + FUNCTION TEST_MODULE_FUNCTION(A,B) + REAL :: TEST_MODULE_FUNCTION + REAL, INTENT(IN) :: A + REAL, INTENT(IN) :: B + END FUNCTION TEST_MODULE_FUNCTION + END INTERFACE +END MODULE TEST_MODULE diff --git a/Tests/Fortran/test_module_main.f90 b/Tests/Fortran/test_module_main.f90 new file mode 100644 index 0000000..6ac97fa --- /dev/null +++ b/Tests/Fortran/test_module_main.f90 @@ -0,0 +1,4 @@ +PROGRAM MAINF90 + USE TEST_MODULE + PRINT *,'Sum is',TEST_MODULE_FUNCTION(1., 2.) +END PROGRAM MAINF90 |