Page MenuHomeSoftware Heritage

No OneTemporary

diff --git a/Units/parser-fortran.r/fortran-bind-c.d/args.ctags b/Units/parser-fortran.r/fortran-bind-c.d/args.ctags
new file mode 100644
index 00000000..1bfb0454
--- /dev/null
+++ b/Units/parser-fortran.r/fortran-bind-c.d/args.ctags
@@ -0,0 +1 @@
+--Fortran-kinds=+P
diff --git a/Units/parser-fortran.r/fortran-bind-c.d/expected.tags b/Units/parser-fortran.r/fortran-bind-c.d/expected.tags
new file mode 100644
index 00000000..4f9525cb
--- /dev/null
+++ b/Units/parser-fortran.r/fortran-bind-c.d/expected.tags
@@ -0,0 +1,5 @@
+a input.f90 /^ real/;" k type:atype
+atype input.f90 /^ type, bind(c) :: atype$/;" t module:test_bind_c
+global_flag input.f90 /^ integer(C_INT), bind(C, name="_MyProject_flags") :: global_flag$/;" v module:test_bind_c
+print_c input.f90 /^ subroutine print_c(/;" P module:test_bind_c
+test_bind_c input.f90 /^module test_bind_c$/;" m
diff --git a/Units/parser-fortran.r/fortran-bind-c.d/input.f90 b/Units/parser-fortran.r/fortran-bind-c.d/input.f90
new file mode 100644
index 00000000..196b8b6d
--- /dev/null
+++ b/Units/parser-fortran.r/fortran-bind-c.d/input.f90
@@ -0,0 +1,25 @@
+! See https://gcc.gnu.org/onlinedocs/gfortran/Interoperability-with-C.html
+module test_bind_c
+ use iso_c_binding
+
+ ! test derived type
+ type, bind(c) :: atype
+ real(c_double) :: a
+ end type atype
+ ! this is
+ ! struct {
+ ! double a;
+ ! } atype;
+ ! in C language
+
+ ! test interoperable global variable
+ integer(C_INT), bind(C, name="_MyProject_flags") :: global_flag
+
+ ! test Interoperable Subroutines and Functions
+ interface
+ subroutine print_c(string) bind(C, name="print_C")
+ use iso_c_binding, only: c_char
+ character(kind=c_char) :: string(*)
+ end subroutine print_c
+ end interface
+end module test_bind_c

File Metadata

Mime Type
text/x-diff
Expires
Sat, Jun 21, 5:10 PM (1 w, 6 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3447336

Event Timeline