aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ninjabackend.py2
-rw-r--r--test cases/fortran/3 module procedure/meson.build4
-rw-r--r--test cases/fortran/3 module procedure/prog.f9015
3 files changed, 21 insertions, 0 deletions
diff --git a/ninjabackend.py b/ninjabackend.py
index 28a4f97..5cb7705 100644
--- a/ninjabackend.py
+++ b/ninjabackend.py
@@ -991,6 +991,8 @@ class NinjaBackend(backends.Backend):
modmatch = modre.match(line)
if modmatch is not None:
modname = modmatch.group(1)
+ if modname.lower() == 'procedure': # MODULE PROCEDURE construct
+ continue
if modname in module_files:
raise InvalidArguments('Namespace collision: module %s defined in two files %s and %s.' %
(modname, module_files[modname], s))
diff --git a/test cases/fortran/3 module procedure/meson.build b/test cases/fortran/3 module procedure/meson.build
new file mode 100644
index 0000000..f05a70c
--- /dev/null
+++ b/test cases/fortran/3 module procedure/meson.build
@@ -0,0 +1,4 @@
+project('use in same file', 'fortran')
+
+e = executable('prog', 'prog.f90')
+test('simple', e)
diff --git a/test cases/fortran/3 module procedure/prog.f90 b/test cases/fortran/3 module procedure/prog.f90
new file mode 100644
index 0000000..4899d8b
--- /dev/null
+++ b/test cases/fortran/3 module procedure/prog.f90
@@ -0,0 +1,15 @@
+MODULE Circle
+ REAL, PARAMETER :: Pi = 3.1415927
+ REAL :: radius
+ INTERFACE DEFAULT
+ MODULE PROCEDURE func
+ END INTERFACE
+ CONTAINS
+ FUNCTION func()
+ func = 0
+ END FUNCTION
+END MODULE Circle
+
+PROGRAM PROG
+ print *, "Module procedure is working."
+END PROGRAM PROG