summaryrefslogtreecommitdiffstats
path: root/Tests/FortranModules/ModulesViaTargetObjectsLink
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/FortranModules/ModulesViaTargetObjectsLink')
-rw-r--r--Tests/FortranModules/ModulesViaTargetObjectsLink/CMakeLists.txt5
-rw-r--r--Tests/FortranModules/ModulesViaTargetObjectsLink/dummy.f903
-rw-r--r--Tests/FortranModules/ModulesViaTargetObjectsLink/obj.f9011
-rw-r--r--Tests/FortranModules/ModulesViaTargetObjectsLink/use.f9013
4 files changed, 32 insertions, 0 deletions
diff --git a/Tests/FortranModules/ModulesViaTargetObjectsLink/CMakeLists.txt b/Tests/FortranModules/ModulesViaTargetObjectsLink/CMakeLists.txt
new file mode 100644
index 0000000..202e59e
--- /dev/null
+++ b/Tests/FortranModules/ModulesViaTargetObjectsLink/CMakeLists.txt
@@ -0,0 +1,5 @@
+add_library(mvtol_obj STATIC obj.f90)
+add_library(mvtol_lib dummy.f90)
+target_link_libraries(mvtol_lib PRIVATE "$<TARGET_OBJECTS:mvtol_obj>")
+add_library(mvtol_use use.f90)
+target_link_libraries(mvtol_use PRIVATE mvtol_lib)
diff --git a/Tests/FortranModules/ModulesViaTargetObjectsLink/dummy.f90 b/Tests/FortranModules/ModulesViaTargetObjectsLink/dummy.f90
new file mode 100644
index 0000000..96a8138
--- /dev/null
+++ b/Tests/FortranModules/ModulesViaTargetObjectsLink/dummy.f90
@@ -0,0 +1,3 @@
+pure real function dummy()
+dummy = 4*atan(1.)
+end function
diff --git a/Tests/FortranModules/ModulesViaTargetObjectsLink/obj.f90 b/Tests/FortranModules/ModulesViaTargetObjectsLink/obj.f90
new file mode 100644
index 0000000..6b5ddd5
--- /dev/null
+++ b/Tests/FortranModules/ModulesViaTargetObjectsLink/obj.f90
@@ -0,0 +1,11 @@
+module m1
+
+implicit none
+
+contains
+
+pure real function pi()
+pi = 4*atan(1.)
+end function
+
+end module m1
diff --git a/Tests/FortranModules/ModulesViaTargetObjectsLink/use.f90 b/Tests/FortranModules/ModulesViaTargetObjectsLink/use.f90
new file mode 100644
index 0000000..f971909
--- /dev/null
+++ b/Tests/FortranModules/ModulesViaTargetObjectsLink/use.f90
@@ -0,0 +1,13 @@
+module lib
+
+use m1, only : pi
+
+implicit none
+
+contains
+
+pure real function func()
+func = pi()
+end function
+
+end module