mirror of
https://github.com/Kitware/CMake.git
synced 2026-03-14 05:20:50 -05:00
Tests/FortranModules: add case for modules after "end interface X"
When there is an `end interface X` in a file, subsequent modules should not be considered part of interface X. Issue: #24203
This commit is contained in:
@@ -42,6 +42,16 @@ add_executable(test_module
|
|||||||
test_module_implementation.f90
|
test_module_implementation.f90
|
||||||
test_module_interface.f90)
|
test_module_interface.f90)
|
||||||
|
|
||||||
|
add_executable(test_multi_module
|
||||||
|
# Place this first so that we do not get "lucky" and find the module provided
|
||||||
|
# by compiling `test_multi_module.f90` first.
|
||||||
|
test_multi_module_main.f90
|
||||||
|
test_multi_module.f90)
|
||||||
|
set_property(TARGET test_multi_module PROPERTY
|
||||||
|
JOB_POOL_COMPILE multi_module_serial)
|
||||||
|
set_property(GLOBAL APPEND PROPERTY
|
||||||
|
JOB_POOLS multi_module_serial=1)
|
||||||
|
|
||||||
add_executable(test_use_in_comment_fixedform
|
add_executable(test_use_in_comment_fixedform
|
||||||
test_use_in_comment_fixedform.f)
|
test_use_in_comment_fixedform.f)
|
||||||
set_property(SOURCE test_use_in_comment_fixedform.f PROPERTY Fortran_FORMAT FIXED)
|
set_property(SOURCE test_use_in_comment_fixedform.f PROPERTY Fortran_FORMAT FIXED)
|
||||||
|
|||||||
8
Tests/FortranModules/test_multi_module.f90
Normal file
8
Tests/FortranModules/test_multi_module.f90
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
module first
|
||||||
|
interface inner
|
||||||
|
end interface inner
|
||||||
|
end module first
|
||||||
|
|
||||||
|
module second
|
||||||
|
REAL :: C = 1
|
||||||
|
end module second
|
||||||
4
Tests/FortranModules/test_multi_module_main.f90
Normal file
4
Tests/FortranModules/test_multi_module_main.f90
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
PROGRAM MAINF90
|
||||||
|
use second
|
||||||
|
PRINT *,'Constant is',C
|
||||||
|
END PROGRAM MAINF90
|
||||||
Reference in New Issue
Block a user