aboutsummaryrefslogtreecommitdiffstats
path: root/meson/test cases/fortran/6 dynamic
diff options
context:
space:
mode:
authorAngelos Mouzakitis <a.mouzakitis@virtualopensystems.com>2023-10-10 14:33:42 +0000
committerAngelos Mouzakitis <a.mouzakitis@virtualopensystems.com>2023-10-10 14:33:42 +0000
commitaf1a266670d040d2f4083ff309d732d648afba2a (patch)
tree2fc46203448ddcc6f81546d379abfaeb323575e9 /meson/test cases/fortran/6 dynamic
parente02cda008591317b1625707ff8e115a4841aa889 (diff)
Add submodule dependency filesHEADmaster
Change-Id: Iaf8d18082d3991dec7c0ebbea540f092188eb4ec
Diffstat (limited to 'meson/test cases/fortran/6 dynamic')
-rw-r--r--meson/test cases/fortran/6 dynamic/dynamic.f9017
-rw-r--r--meson/test cases/fortran/6 dynamic/main.f906
-rw-r--r--meson/test cases/fortran/6 dynamic/meson.build13
3 files changed, 36 insertions, 0 deletions
diff --git a/meson/test cases/fortran/6 dynamic/dynamic.f90 b/meson/test cases/fortran/6 dynamic/dynamic.f90
new file mode 100644
index 000000000..6a1f3590f
--- /dev/null
+++ b/meson/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/meson/test cases/fortran/6 dynamic/main.f90 b/meson/test cases/fortran/6 dynamic/main.f90
new file mode 100644
index 000000000..ba2e2d2fc
--- /dev/null
+++ b/meson/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/meson/test cases/fortran/6 dynamic/meson.build b/meson/test cases/fortran/6 dynamic/meson.build
new file mode 100644
index 000000000..413223b0a
--- /dev/null
+++ b/meson/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)