summaryrefslogtreecommitdiffstats
path: root/test cases/fortran/6 dynamic
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--test cases/fortran/6 dynamic/dynamic.f9017
-rw-r--r--test cases/fortran/6 dynamic/main.f906
-rw-r--r--test cases/fortran/6 dynamic/meson.build13
3 files changed, 36 insertions, 0 deletions
diff --git a/test cases/fortran/6 dynamic/dynamic.f90 b/test cases/fortran/6 dynamic/dynamic.f90
new file mode 100644
index 0000000..6a1f359
--- /dev/null
+++ b/test cases/fortran/6 dynamic/dynamic.f90
@@ -0,0 +1,17 @@
+module dynamic
+implicit none
+
+private
+public :: hello
+
+interface hello
+ module procedure say
+end interface hello
+
+contains
+
+subroutine say
+ print *, "Hello from shared library."
+end subroutine say
+
+end module dynamic
diff --git a/test cases/fortran/6 dynamic/main.f90 b/test cases/fortran/6 dynamic/main.f90
new file mode 100644
index 0000000..ba2e2d2
--- /dev/null
+++ b/test cases/fortran/6 dynamic/main.f90
@@ -0,0 +1,6 @@
+program main
+use dynamic, only: hello
+implicit none
+
+call hello()
+end program
diff --git a/test cases/fortran/6 dynamic/meson.build b/test cases/fortran/6 dynamic/meson.build
new file mode 100644
index 0000000..413223b
--- /dev/null
+++ b/test cases/fortran/6 dynamic/meson.build
@@ -0,0 +1,13 @@
+project('dynamic_fortran', 'fortran')
+
+fcid = meson.get_compiler('fortran').get_id()
+if fcid == 'intel-cl' or (host_machine.system() == 'windows' and fcid == 'pgi')
+ error('MESON_SKIP_TEST: non-Gfortran Windows Fortran compilers do not do shared libraries in a Fortran standard way')
+ # !DEC$ ATTRIBUTES DLLEXPORT must be used!
+ # https://software.intel.com/en-us/node/535306
+ # https://www.pgroup.com/resources/docs/19.4/x86/pgi-user-guide/index.htm#lib-dynlnk-bld-dll-fort
+endif
+
+dynamic = shared_library('dynamic', 'dynamic.f90')
+exe = executable('test_exe', 'main.f90', link_with : dynamic)
+test('dynamic-fortran', exe)