From 2b7ab61e52f4898264712a08bbcc585d0ab8aa79 Mon Sep 17 00:00:00 2001 From: xieyihui Date: Fri, 21 Oct 2022 00:08:06 +0800 Subject: [PATCH] Fix 3-test-for-interoperability-with-c-fortran-call-c.patch for add new test cases and fix test cases about bindc and Fix 5-test-for-interoperability-with-c-c-call-fortran.patch for test cases about function --- ...teroperability-with-c-fortran-call-c.patch | 17541 +++++++++++----- ...teroperability-with-c-c-call-fortran.patch | 2459 +-- flang.spec | 7 +- 3 files changed, 13209 insertions(+), 6798 deletions(-) rename 3-add-tests-interoperability-C.patch => 3-test-for-interoperability-with-c-fortran-call-c.patch (34%) diff --git a/3-add-tests-interoperability-C.patch b/3-test-for-interoperability-with-c-fortran-call-c.patch similarity index 34% rename from 3-add-tests-interoperability-C.patch rename to 3-test-for-interoperability-with-c-fortran-call-c.patch index 53f08f3..bcd7b06 100644 --- a/3-add-tests-interoperability-C.patch +++ b/3-test-for-interoperability-with-c-fortran-call-c.patch @@ -1,314 +1,314 @@ -From 167be0ef01ab4e4be233f8971da144f865b3699e Mon Sep 17 00:00:00 2001 -From: a -Date: Wed, 31 Aug 2022 19:31:22 -0700 -Subject: [flang] add test cases for interoperability with C about fortran call C +From 7202b41e38a390739a5b149289260af71af45b6d Mon Sep 17 00:00:00 2001 +From: xieyihui +Date: Thu, 20 Oct 2022 14:20:34 +0800 +Subject: [PATCH] add new test cases and fix test cases about bindc -diff --git a/test/interoperability_with_c/001_fortran_call_c_scalar/c_func001.c b/test/interoperability_with_c/001_fortran_call_c_scalar/c_func001.c +diff --git a/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/c_func001.c b/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/c_func001.c new file mode 100644 index 0000000..5acb3c0 --- /dev/null -+++ b/test/interoperability_with_c/001_fortran_call_c_scalar/c_func001.c ++++ b/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/c_func001.c @@ -0,0 +1,4 @@ +#include +void c_func_(int *a) { + printf("%d\n", *a); +} -diff --git a/test/interoperability_with_c/001_fortran_call_c_scalar/c_func002.c b/test/interoperability_with_c/001_fortran_call_c_scalar/c_func002.c +diff --git a/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/c_func002.c b/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/c_func002.c new file mode 100644 index 0000000..a695d21 --- /dev/null -+++ b/test/interoperability_with_c/001_fortran_call_c_scalar/c_func002.c ++++ b/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/c_func002.c @@ -0,0 +1,5 @@ +#include +#include +void c_func_(short *a) { + printf("%hd\n", *a); +} -diff --git a/test/interoperability_with_c/001_fortran_call_c_scalar/c_func003.c b/test/interoperability_with_c/001_fortran_call_c_scalar/c_func003.c +diff --git a/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/c_func003.c b/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/c_func003.c new file mode 100644 index 0000000..c3e2b1b --- /dev/null -+++ b/test/interoperability_with_c/001_fortran_call_c_scalar/c_func003.c ++++ b/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/c_func003.c @@ -0,0 +1,5 @@ +#include +#include +void c_func_(long *a) { + printf("%ld\n", *a); +} -diff --git a/test/interoperability_with_c/001_fortran_call_c_scalar/c_func004.c b/test/interoperability_with_c/001_fortran_call_c_scalar/c_func004.c +diff --git a/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/c_func004.c b/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/c_func004.c new file mode 100644 index 0000000..c83f515 --- /dev/null -+++ b/test/interoperability_with_c/001_fortran_call_c_scalar/c_func004.c ++++ b/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/c_func004.c @@ -0,0 +1,5 @@ +#include +#include +void c_func_(long long *a) { + printf("%lld\n", *a); +} -diff --git a/test/interoperability_with_c/001_fortran_call_c_scalar/c_func005.c b/test/interoperability_with_c/001_fortran_call_c_scalar/c_func005.c +diff --git a/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/c_func005.c b/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/c_func005.c new file mode 100644 index 0000000..df53145 --- /dev/null -+++ b/test/interoperability_with_c/001_fortran_call_c_scalar/c_func005.c ++++ b/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/c_func005.c @@ -0,0 +1,4 @@ +#include +void c_func_(signed char *a) { + printf("%c\n", *a); +} -diff --git a/test/interoperability_with_c/001_fortran_call_c_scalar/c_func006.c b/test/interoperability_with_c/001_fortran_call_c_scalar/c_func006.c +diff --git a/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/c_func006.c b/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/c_func006.c new file mode 100644 index 0000000..bf8fe98 --- /dev/null -+++ b/test/interoperability_with_c/001_fortran_call_c_scalar/c_func006.c ++++ b/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/c_func006.c @@ -0,0 +1,5 @@ +#include +#include +void c_func_(size_t *a) { + printf("%ld\n", *a); +} -diff --git a/test/interoperability_with_c/001_fortran_call_c_scalar/c_func007.c b/test/interoperability_with_c/001_fortran_call_c_scalar/c_func007.c +diff --git a/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/c_func007.c b/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/c_func007.c new file mode 100644 index 0000000..1ccc2d3 --- /dev/null -+++ b/test/interoperability_with_c/001_fortran_call_c_scalar/c_func007.c ++++ b/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/c_func007.c @@ -0,0 +1,5 @@ +#include +#include +void c_func_(int8_t *a) { + printf("%hhd\n", *a); +} -diff --git a/test/interoperability_with_c/001_fortran_call_c_scalar/c_func008.c b/test/interoperability_with_c/001_fortran_call_c_scalar/c_func008.c +diff --git a/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/c_func008.c b/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/c_func008.c new file mode 100644 index 0000000..5b4a477 --- /dev/null -+++ b/test/interoperability_with_c/001_fortran_call_c_scalar/c_func008.c ++++ b/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/c_func008.c @@ -0,0 +1,5 @@ +#include +#include +void c_func_(int16_t *a) { + printf("%hd\n", *a); +} -diff --git a/test/interoperability_with_c/001_fortran_call_c_scalar/c_func009.c b/test/interoperability_with_c/001_fortran_call_c_scalar/c_func009.c +diff --git a/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/c_func009.c b/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/c_func009.c new file mode 100644 index 0000000..ef5dbab --- /dev/null -+++ b/test/interoperability_with_c/001_fortran_call_c_scalar/c_func009.c ++++ b/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/c_func009.c @@ -0,0 +1,5 @@ +#include +#include +void c_func_(int32_t *a) { + printf("%d\n", *a); +} -diff --git a/test/interoperability_with_c/001_fortran_call_c_scalar/c_func010.c b/test/interoperability_with_c/001_fortran_call_c_scalar/c_func010.c +diff --git a/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/c_func010.c b/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/c_func010.c new file mode 100644 index 0000000..ff0c5b2 --- /dev/null -+++ b/test/interoperability_with_c/001_fortran_call_c_scalar/c_func010.c ++++ b/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/c_func010.c @@ -0,0 +1,5 @@ +#include +#include +void c_func_(int64_t *a) { + printf("%ld\n", *a); +} -diff --git a/test/interoperability_with_c/001_fortran_call_c_scalar/c_func011.c b/test/interoperability_with_c/001_fortran_call_c_scalar/c_func011.c +diff --git a/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/c_func011.c b/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/c_func011.c new file mode 100644 index 0000000..648e234 --- /dev/null -+++ b/test/interoperability_with_c/001_fortran_call_c_scalar/c_func011.c ++++ b/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/c_func011.c @@ -0,0 +1,5 @@ +#include +#include +void c_func_(int_least8_t *a) { + printf("%hhd\n", *a); +} -diff --git a/test/interoperability_with_c/001_fortran_call_c_scalar/c_func012.c b/test/interoperability_with_c/001_fortran_call_c_scalar/c_func012.c +diff --git a/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/c_func012.c b/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/c_func012.c new file mode 100644 index 0000000..175d427 --- /dev/null -+++ b/test/interoperability_with_c/001_fortran_call_c_scalar/c_func012.c ++++ b/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/c_func012.c @@ -0,0 +1,5 @@ +#include +#include +void c_func_(int_least16_t *a) { + printf("%hd\n", *a); +} -diff --git a/test/interoperability_with_c/001_fortran_call_c_scalar/c_func013.c b/test/interoperability_with_c/001_fortran_call_c_scalar/c_func013.c +diff --git a/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/c_func013.c b/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/c_func013.c new file mode 100644 index 0000000..3e63c13 --- /dev/null -+++ b/test/interoperability_with_c/001_fortran_call_c_scalar/c_func013.c ++++ b/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/c_func013.c @@ -0,0 +1,5 @@ +#include +#include +void c_func_(int_least32_t *a) { + printf("%d\n", *a); +} -diff --git a/test/interoperability_with_c/001_fortran_call_c_scalar/c_func014.c b/test/interoperability_with_c/001_fortran_call_c_scalar/c_func014.c +diff --git a/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/c_func014.c b/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/c_func014.c new file mode 100644 index 0000000..ac6a62b --- /dev/null -+++ b/test/interoperability_with_c/001_fortran_call_c_scalar/c_func014.c ++++ b/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/c_func014.c @@ -0,0 +1,5 @@ +#include +#include +void c_func_(int_least64_t *a) { + printf("%ld\n", *a); +} -diff --git a/test/interoperability_with_c/001_fortran_call_c_scalar/c_func015.c b/test/interoperability_with_c/001_fortran_call_c_scalar/c_func015.c +diff --git a/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/c_func015.c b/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/c_func015.c new file mode 100644 index 0000000..85b98cc --- /dev/null -+++ b/test/interoperability_with_c/001_fortran_call_c_scalar/c_func015.c ++++ b/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/c_func015.c @@ -0,0 +1,5 @@ +#include +#include +void c_func_(int_fast8_t *a) { + printf("%hhd\n", *a); +} -diff --git a/test/interoperability_with_c/001_fortran_call_c_scalar/c_func016.c b/test/interoperability_with_c/001_fortran_call_c_scalar/c_func016.c +diff --git a/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/c_func016.c b/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/c_func016.c new file mode 100644 index 0000000..ce358c3 --- /dev/null -+++ b/test/interoperability_with_c/001_fortran_call_c_scalar/c_func016.c ++++ b/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/c_func016.c @@ -0,0 +1,5 @@ +#include +#include +void c_func_(int_fast16_t *a) { + printf("%ld\n", *a); +} -diff --git a/test/interoperability_with_c/001_fortran_call_c_scalar/c_func017.c b/test/interoperability_with_c/001_fortran_call_c_scalar/c_func017.c +diff --git a/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/c_func017.c b/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/c_func017.c new file mode 100644 index 0000000..9576185 --- /dev/null -+++ b/test/interoperability_with_c/001_fortran_call_c_scalar/c_func017.c ++++ b/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/c_func017.c @@ -0,0 +1,5 @@ +#include +#include +void c_func_(int_fast32_t *a) { + printf("%ld\n", *a); +} -diff --git a/test/interoperability_with_c/001_fortran_call_c_scalar/c_func018.c b/test/interoperability_with_c/001_fortran_call_c_scalar/c_func018.c +diff --git a/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/c_func018.c b/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/c_func018.c new file mode 100644 index 0000000..84469ba --- /dev/null -+++ b/test/interoperability_with_c/001_fortran_call_c_scalar/c_func018.c ++++ b/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/c_func018.c @@ -0,0 +1,5 @@ +#include +#include +void c_func_(int_fast64_t *a) { + printf("%ld\n", *a); +} -diff --git a/test/interoperability_with_c/001_fortran_call_c_scalar/c_func019.c b/test/interoperability_with_c/001_fortran_call_c_scalar/c_func019.c +diff --git a/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/c_func019.c b/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/c_func019.c new file mode 100644 index 0000000..acd8949 --- /dev/null -+++ b/test/interoperability_with_c/001_fortran_call_c_scalar/c_func019.c ++++ b/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/c_func019.c @@ -0,0 +1,5 @@ +#include +#include +void c_func_(intmax_t *a) { + printf("%ld\n", *a); +} -diff --git a/test/interoperability_with_c/001_fortran_call_c_scalar/c_func020.c b/test/interoperability_with_c/001_fortran_call_c_scalar/c_func020.c +diff --git a/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/c_func020.c b/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/c_func020.c new file mode 100644 index 0000000..43c01a7 --- /dev/null -+++ b/test/interoperability_with_c/001_fortran_call_c_scalar/c_func020.c ++++ b/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/c_func020.c @@ -0,0 +1,5 @@ +#include +#include +void c_func_(intptr_t *a) { + printf("%ld\n", *a); +} -diff --git a/test/interoperability_with_c/001_fortran_call_c_scalar/c_func021.c b/test/interoperability_with_c/001_fortran_call_c_scalar/c_func021.c +diff --git a/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/c_func021.c b/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/c_func021.c new file mode 100644 index 0000000..af99025 --- /dev/null -+++ b/test/interoperability_with_c/001_fortran_call_c_scalar/c_func021.c ++++ b/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/c_func021.c @@ -0,0 +1,4 @@ +#include +void c_func_(float *a) { + printf("%f\n", *a); +} -diff --git a/test/interoperability_with_c/001_fortran_call_c_scalar/c_func022.c b/test/interoperability_with_c/001_fortran_call_c_scalar/c_func022.c +diff --git a/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/c_func022.c b/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/c_func022.c new file mode 100644 index 0000000..7ae046f --- /dev/null -+++ b/test/interoperability_with_c/001_fortran_call_c_scalar/c_func022.c ++++ b/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/c_func022.c @@ -0,0 +1,4 @@ +#include +void c_func_(double *a) { + printf("%0.20f\n", *a); +} -diff --git a/test/interoperability_with_c/001_fortran_call_c_scalar/c_func023.c b/test/interoperability_with_c/001_fortran_call_c_scalar/c_func023.c +diff --git a/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/c_func023.c b/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/c_func023.c new file mode 100644 index 0000000..be8b2b1 --- /dev/null -+++ b/test/interoperability_with_c/001_fortran_call_c_scalar/c_func023.c ++++ b/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/c_func023.c @@ -0,0 +1,4 @@ +#include +void c_func_(long double *a) { + printf("%0.20Lf\n", *a); +} -diff --git a/test/interoperability_with_c/001_fortran_call_c_scalar/c_func024.c b/test/interoperability_with_c/001_fortran_call_c_scalar/c_func024.c +diff --git a/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/c_func024.c b/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/c_func024.c new file mode 100644 index 0000000..1e65f36 --- /dev/null -+++ b/test/interoperability_with_c/001_fortran_call_c_scalar/c_func024.c ++++ b/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/c_func024.c @@ -0,0 +1,5 @@ +#include +#include +void c_func_(float _Complex *t) { + printf("%f + %fi\n", creal(*t), cimag(*t)); +} -diff --git a/test/interoperability_with_c/001_fortran_call_c_scalar/c_func025.c b/test/interoperability_with_c/001_fortran_call_c_scalar/c_func025.c +diff --git a/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/c_func025.c b/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/c_func025.c new file mode 100644 index 0000000..b3f9944 --- /dev/null -+++ b/test/interoperability_with_c/001_fortran_call_c_scalar/c_func025.c ++++ b/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/c_func025.c @@ -0,0 +1,5 @@ +#include +#include +void c_func_(double _Complex *t) { + printf("%0.20lf + %0.20lfi\n", creal(*t), cimag(*t)); +} -diff --git a/test/interoperability_with_c/001_fortran_call_c_scalar/c_func026.c b/test/interoperability_with_c/001_fortran_call_c_scalar/c_func026.c +diff --git a/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/c_func026.c b/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/c_func026.c new file mode 100644 index 0000000..c049c6f --- /dev/null -+++ b/test/interoperability_with_c/001_fortran_call_c_scalar/c_func026.c ++++ b/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/c_func026.c @@ -0,0 +1,5 @@ +#include +#include +void c_func_(long double _Complex *t) { + printf("%0.20f + %0.20fi\n", creal(*t), cimag(*t)); +} -diff --git a/test/interoperability_with_c/001_fortran_call_c_scalar/c_func027.c b/test/interoperability_with_c/001_fortran_call_c_scalar/c_func027.c +diff --git a/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/c_func027.c b/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/c_func027.c new file mode 100644 index 0000000..a3a8596 --- /dev/null -+++ b/test/interoperability_with_c/001_fortran_call_c_scalar/c_func027.c ++++ b/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/c_func027.c @@ -0,0 +1,4 @@ +#include +void c_func_(_Bool *a) { + printf("%d\n", *a); +} -diff --git a/test/interoperability_with_c/001_fortran_call_c_scalar/c_func028.c b/test/interoperability_with_c/001_fortran_call_c_scalar/c_func028.c +diff --git a/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/c_func028.c b/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/c_func028.c new file mode 100644 index 0000000..0abbf89 --- /dev/null -+++ b/test/interoperability_with_c/001_fortran_call_c_scalar/c_func028.c ++++ b/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/c_func028.c @@ -0,0 +1,4 @@ +#include +void c_func_(char *a) { + printf("%c\n", *a); +} -diff --git a/test/interoperability_with_c/001_fortran_call_c_scalar/fortran_main001.f90 b/test/interoperability_with_c/001_fortran_call_c_scalar/fortran_main001.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/fortran_main001.f90 b/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/fortran_main001.f90 new file mode 100644 index 0000000..67065b5 --- /dev/null -+++ b/test/interoperability_with_c/001_fortran_call_c_scalar/fortran_main001.f90 ++++ b/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/fortran_main001.f90 @@ -0,0 +1,11 @@ +! Test fortran call c for the scalar type and the scalar type is int +! @@ -321,11 +321,11 @@ index 0000000..67065b5 + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/001_fortran_call_c_scalar/fortran_main002.f90 b/test/interoperability_with_c/001_fortran_call_c_scalar/fortran_main002.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/fortran_main002.f90 b/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/fortran_main002.f90 new file mode 100644 index 0000000..be8e4a6 --- /dev/null -+++ b/test/interoperability_with_c/001_fortran_call_c_scalar/fortran_main002.f90 ++++ b/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/fortran_main002.f90 @@ -0,0 +1,11 @@ +! Test fortran call c for the scalar type and the scalar type is short +! @@ -338,11 +338,11 @@ index 0000000..be8e4a6 + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/001_fortran_call_c_scalar/fortran_main003.f90 b/test/interoperability_with_c/001_fortran_call_c_scalar/fortran_main003.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/fortran_main003.f90 b/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/fortran_main003.f90 new file mode 100644 index 0000000..32fe301 --- /dev/null -+++ b/test/interoperability_with_c/001_fortran_call_c_scalar/fortran_main003.f90 ++++ b/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/fortran_main003.f90 @@ -0,0 +1,11 @@ +! Test fortran call c for the scalar type and the scalar type is long +! @@ -355,11 +355,11 @@ index 0000000..32fe301 + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/001_fortran_call_c_scalar/fortran_main004.f90 b/test/interoperability_with_c/001_fortran_call_c_scalar/fortran_main004.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/fortran_main004.f90 b/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/fortran_main004.f90 new file mode 100644 index 0000000..fec8bc8 --- /dev/null -+++ b/test/interoperability_with_c/001_fortran_call_c_scalar/fortran_main004.f90 ++++ b/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/fortran_main004.f90 @@ -0,0 +1,12 @@ +! Test fortran call c for the scalar type and the scalar type is +! long long @@ -373,11 +373,11 @@ index 0000000..fec8bc8 + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/001_fortran_call_c_scalar/fortran_main005.f90 b/test/interoperability_with_c/001_fortran_call_c_scalar/fortran_main005.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/fortran_main005.f90 b/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/fortran_main005.f90 new file mode 100644 index 0000000..1c70d24 --- /dev/null -+++ b/test/interoperability_with_c/001_fortran_call_c_scalar/fortran_main005.f90 ++++ b/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/fortran_main005.f90 @@ -0,0 +1,12 @@ +! Test fortran call c for the scalar type and the scalar type is +! signed char @@ -391,11 +391,11 @@ index 0000000..1c70d24 + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/001_fortran_call_c_scalar/fortran_main006.f90 b/test/interoperability_with_c/001_fortran_call_c_scalar/fortran_main006.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/fortran_main006.f90 b/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/fortran_main006.f90 new file mode 100644 index 0000000..1c51bf7 --- /dev/null -+++ b/test/interoperability_with_c/001_fortran_call_c_scalar/fortran_main006.f90 ++++ b/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/fortran_main006.f90 @@ -0,0 +1,11 @@ +! Test fortran call c for the scalar type and the scalar type is size_t +! @@ -408,11 +408,11 @@ index 0000000..1c51bf7 + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/001_fortran_call_c_scalar/fortran_main007.f90 b/test/interoperability_with_c/001_fortran_call_c_scalar/fortran_main007.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/fortran_main007.f90 b/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/fortran_main007.f90 new file mode 100644 index 0000000..1905558 --- /dev/null -+++ b/test/interoperability_with_c/001_fortran_call_c_scalar/fortran_main007.f90 ++++ b/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/fortran_main007.f90 @@ -0,0 +1,11 @@ +! Test fortran call c for the scalar type and the scalar type is int8_t +! @@ -425,11 +425,11 @@ index 0000000..1905558 + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/001_fortran_call_c_scalar/fortran_main008.f90 b/test/interoperability_with_c/001_fortran_call_c_scalar/fortran_main008.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/fortran_main008.f90 b/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/fortran_main008.f90 new file mode 100644 index 0000000..ad502f7 --- /dev/null -+++ b/test/interoperability_with_c/001_fortran_call_c_scalar/fortran_main008.f90 ++++ b/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/fortran_main008.f90 @@ -0,0 +1,12 @@ +! Test fortran call c for the scalar type and the scalar type is +! int16_t @@ -443,11 +443,11 @@ index 0000000..ad502f7 + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/001_fortran_call_c_scalar/fortran_main009.f90 b/test/interoperability_with_c/001_fortran_call_c_scalar/fortran_main009.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/fortran_main009.f90 b/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/fortran_main009.f90 new file mode 100644 index 0000000..ff8e413 --- /dev/null -+++ b/test/interoperability_with_c/001_fortran_call_c_scalar/fortran_main009.f90 ++++ b/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/fortran_main009.f90 @@ -0,0 +1,12 @@ +! Test fortran call c for the scalar type and the scalar type is +! int32_t @@ -461,11 +461,11 @@ index 0000000..ff8e413 + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/001_fortran_call_c_scalar/fortran_main010.f90 b/test/interoperability_with_c/001_fortran_call_c_scalar/fortran_main010.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/fortran_main010.f90 b/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/fortran_main010.f90 new file mode 100644 index 0000000..b2bb503 --- /dev/null -+++ b/test/interoperability_with_c/001_fortran_call_c_scalar/fortran_main010.f90 ++++ b/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/fortran_main010.f90 @@ -0,0 +1,12 @@ +! Test fortran call c for the scalar type and the scalar type is +! int64_t @@ -479,11 +479,11 @@ index 0000000..b2bb503 + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/001_fortran_call_c_scalar/fortran_main011.f90 b/test/interoperability_with_c/001_fortran_call_c_scalar/fortran_main011.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/fortran_main011.f90 b/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/fortran_main011.f90 new file mode 100644 index 0000000..b63979f --- /dev/null -+++ b/test/interoperability_with_c/001_fortran_call_c_scalar/fortran_main011.f90 ++++ b/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/fortran_main011.f90 @@ -0,0 +1,12 @@ +! Test fortran call c for the scalar type and the scalar type is +! int_least8_t @@ -497,11 +497,11 @@ index 0000000..b63979f + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/001_fortran_call_c_scalar/fortran_main012.f90 b/test/interoperability_with_c/001_fortran_call_c_scalar/fortran_main012.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/fortran_main012.f90 b/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/fortran_main012.f90 new file mode 100644 index 0000000..4b57843 --- /dev/null -+++ b/test/interoperability_with_c/001_fortran_call_c_scalar/fortran_main012.f90 ++++ b/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/fortran_main012.f90 @@ -0,0 +1,12 @@ +! Test fortran call c for the scalar type and the scalar type is +! int_least16_t @@ -515,11 +515,11 @@ index 0000000..4b57843 + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/001_fortran_call_c_scalar/fortran_main013.f90 b/test/interoperability_with_c/001_fortran_call_c_scalar/fortran_main013.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/fortran_main013.f90 b/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/fortran_main013.f90 new file mode 100644 index 0000000..38f4dbf --- /dev/null -+++ b/test/interoperability_with_c/001_fortran_call_c_scalar/fortran_main013.f90 ++++ b/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/fortran_main013.f90 @@ -0,0 +1,12 @@ +! Test fortran call c for the scalar type and the scalar type is +! int_least32_t @@ -533,11 +533,11 @@ index 0000000..38f4dbf + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/001_fortran_call_c_scalar/fortran_main014.f90 b/test/interoperability_with_c/001_fortran_call_c_scalar/fortran_main014.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/fortran_main014.f90 b/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/fortran_main014.f90 new file mode 100644 index 0000000..76db856 --- /dev/null -+++ b/test/interoperability_with_c/001_fortran_call_c_scalar/fortran_main014.f90 ++++ b/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/fortran_main014.f90 @@ -0,0 +1,12 @@ +! Test fortran call c for the scalar type and the scalar type is +! int_least64_t @@ -551,11 +551,11 @@ index 0000000..76db856 + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/001_fortran_call_c_scalar/fortran_main015.f90 b/test/interoperability_with_c/001_fortran_call_c_scalar/fortran_main015.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/fortran_main015.f90 b/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/fortran_main015.f90 new file mode 100644 index 0000000..22edd3a --- /dev/null -+++ b/test/interoperability_with_c/001_fortran_call_c_scalar/fortran_main015.f90 ++++ b/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/fortran_main015.f90 @@ -0,0 +1,12 @@ +! Test fortran call c for the scalar type and the scalar type is +! int_fast8_t @@ -569,11 +569,11 @@ index 0000000..22edd3a + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/001_fortran_call_c_scalar/fortran_main016.f90 b/test/interoperability_with_c/001_fortran_call_c_scalar/fortran_main016.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/fortran_main016.f90 b/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/fortran_main016.f90 new file mode 100644 index 0000000..16194de --- /dev/null -+++ b/test/interoperability_with_c/001_fortran_call_c_scalar/fortran_main016.f90 ++++ b/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/fortran_main016.f90 @@ -0,0 +1,12 @@ +! Test fortran call c for the scalar type and the scalar type is +! int_fast_16_t @@ -587,11 +587,11 @@ index 0000000..16194de + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/001_fortran_call_c_scalar/fortran_main017.f90 b/test/interoperability_with_c/001_fortran_call_c_scalar/fortran_main017.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/fortran_main017.f90 b/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/fortran_main017.f90 new file mode 100644 index 0000000..d26c6f2 --- /dev/null -+++ b/test/interoperability_with_c/001_fortran_call_c_scalar/fortran_main017.f90 ++++ b/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/fortran_main017.f90 @@ -0,0 +1,12 @@ +! Test fortran call c for the scalar type and the scalar type is +! int_fast32_t @@ -605,11 +605,11 @@ index 0000000..d26c6f2 + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/001_fortran_call_c_scalar/fortran_main018.f90 b/test/interoperability_with_c/001_fortran_call_c_scalar/fortran_main018.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/fortran_main018.f90 b/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/fortran_main018.f90 new file mode 100644 index 0000000..1fa0b83 --- /dev/null -+++ b/test/interoperability_with_c/001_fortran_call_c_scalar/fortran_main018.f90 ++++ b/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/fortran_main018.f90 @@ -0,0 +1,12 @@ +! Test fortran call c for the scalar type and the scalar type is +! int_fast64_t @@ -623,11 +623,11 @@ index 0000000..1fa0b83 + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/001_fortran_call_c_scalar/fortran_main019.f90 b/test/interoperability_with_c/001_fortran_call_c_scalar/fortran_main019.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/fortran_main019.f90 b/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/fortran_main019.f90 new file mode 100644 index 0000000..5e4dd89 --- /dev/null -+++ b/test/interoperability_with_c/001_fortran_call_c_scalar/fortran_main019.f90 ++++ b/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/fortran_main019.f90 @@ -0,0 +1,12 @@ +! Test fortran call c for the scalar type and the scalar type is +! intmax_t @@ -641,11 +641,11 @@ index 0000000..5e4dd89 + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/001_fortran_call_c_scalar/fortran_main020.f90 b/test/interoperability_with_c/001_fortran_call_c_scalar/fortran_main020.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/fortran_main020.f90 b/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/fortran_main020.f90 new file mode 100644 index 0000000..12e4c74 --- /dev/null -+++ b/test/interoperability_with_c/001_fortran_call_c_scalar/fortran_main020.f90 ++++ b/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/fortran_main020.f90 @@ -0,0 +1,12 @@ +! Test fortran call c for the scalar type and the scalar type is +! intptr_t @@ -659,11 +659,11 @@ index 0000000..12e4c74 + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/001_fortran_call_c_scalar/fortran_main021.f90 b/test/interoperability_with_c/001_fortran_call_c_scalar/fortran_main021.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/fortran_main021.f90 b/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/fortran_main021.f90 new file mode 100644 index 0000000..d702c52 --- /dev/null -+++ b/test/interoperability_with_c/001_fortran_call_c_scalar/fortran_main021.f90 ++++ b/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/fortran_main021.f90 @@ -0,0 +1,11 @@ +! Test fortran call c for the scalar type and the scalar type is float +! @@ -676,11 +676,11 @@ index 0000000..d702c52 + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/001_fortran_call_c_scalar/fortran_main022.f90 b/test/interoperability_with_c/001_fortran_call_c_scalar/fortran_main022.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/fortran_main022.f90 b/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/fortran_main022.f90 new file mode 100644 index 0000000..fb9895b --- /dev/null -+++ b/test/interoperability_with_c/001_fortran_call_c_scalar/fortran_main022.f90 ++++ b/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/fortran_main022.f90 @@ -0,0 +1,11 @@ +! Test fortran call c for the scalar type and the scalar type is double +! @@ -693,11 +693,11 @@ index 0000000..fb9895b + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/001_fortran_call_c_scalar/fortran_main023.f90 b/test/interoperability_with_c/001_fortran_call_c_scalar/fortran_main023.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/fortran_main023.f90 b/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/fortran_main023.f90 new file mode 100644 index 0000000..bc2c2b7 --- /dev/null -+++ b/test/interoperability_with_c/001_fortran_call_c_scalar/fortran_main023.f90 ++++ b/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/fortran_main023.f90 @@ -0,0 +1,14 @@ +! Test fortran call c for the scalar type and the scalar type is +! long double @@ -713,11 +713,11 @@ index 0000000..bc2c2b7 + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/001_fortran_call_c_scalar/fortran_main024.f90 b/test/interoperability_with_c/001_fortran_call_c_scalar/fortran_main024.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/fortran_main024.f90 b/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/fortran_main024.f90 new file mode 100644 index 0000000..3b9f2d4 --- /dev/null -+++ b/test/interoperability_with_c/001_fortran_call_c_scalar/fortran_main024.f90 ++++ b/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/fortran_main024.f90 @@ -0,0 +1,12 @@ +! Test fortran call c for the scalar type and the scalar type is +! float _Complex @@ -731,11 +731,11 @@ index 0000000..3b9f2d4 + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/001_fortran_call_c_scalar/fortran_main025.f90 b/test/interoperability_with_c/001_fortran_call_c_scalar/fortran_main025.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/fortran_main025.f90 b/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/fortran_main025.f90 new file mode 100644 index 0000000..f4f3f9f --- /dev/null -+++ b/test/interoperability_with_c/001_fortran_call_c_scalar/fortran_main025.f90 ++++ b/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/fortran_main025.f90 @@ -0,0 +1,12 @@ +! Test fortran call c for the scalar type and the scalar type is +! double _Complex @@ -749,11 +749,11 @@ index 0000000..f4f3f9f + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/001_fortran_call_c_scalar/fortran_main026.f90 b/test/interoperability_with_c/001_fortran_call_c_scalar/fortran_main026.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/fortran_main026.f90 b/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/fortran_main026.f90 new file mode 100644 index 0000000..b02bca6 --- /dev/null -+++ b/test/interoperability_with_c/001_fortran_call_c_scalar/fortran_main026.f90 ++++ b/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/fortran_main026.f90 @@ -0,0 +1,14 @@ +! Test fortran call c for the scalar type and the scalar type is +! long double _Complex @@ -769,11 +769,11 @@ index 0000000..b02bca6 + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/001_fortran_call_c_scalar/fortran_main027.f90 b/test/interoperability_with_c/001_fortran_call_c_scalar/fortran_main027.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/fortran_main027.f90 b/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/fortran_main027.f90 new file mode 100644 index 0000000..e9aaf8e --- /dev/null -+++ b/test/interoperability_with_c/001_fortran_call_c_scalar/fortran_main027.f90 ++++ b/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/fortran_main027.f90 @@ -0,0 +1,11 @@ +! Test fortran call c for the scalar type and the scalar type is _Bool +! @@ -786,11 +786,11 @@ index 0000000..e9aaf8e + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/001_fortran_call_c_scalar/fortran_main028.f90 b/test/interoperability_with_c/001_fortran_call_c_scalar/fortran_main028.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/fortran_main028.f90 b/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/fortran_main028.f90 new file mode 100644 index 0000000..6fab824 --- /dev/null -+++ b/test/interoperability_with_c/001_fortran_call_c_scalar/fortran_main028.f90 ++++ b/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/fortran_main028.f90 @@ -0,0 +1,11 @@ +! Test fortran call c for the scalar type and the scalar type is char +! @@ -803,12 +803,12 @@ index 0000000..6fab824 + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/001_fortran_call_c_scalar/run.sh b/test/interoperability_with_c/001_fortran_call_c_scalar/run.sh +diff --git a/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/run.sh b/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/run.sh new file mode 100644 -index 0000000..632b582 +index 0000000..b865403 --- /dev/null -+++ b/test/interoperability_with_c/001_fortran_call_c_scalar/run.sh -@@ -0,0 +1,17 @@ ++++ b/test/interoperability_with_c_fortran_call_c/001_fortran_call_c_scalar/run.sh +@@ -0,0 +1,16 @@ +for i in {001..028} +do +echo "------- test $i ------." @@ -825,313 +825,313 @@ index 0000000..632b582 +./a.out +rm *.o a.out +done -+ -diff --git a/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/c_func001.c b/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/c_func001.c +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/c_func001.c b/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/c_func001.c new file mode 100644 index 0000000..5acb3c0 --- /dev/null -+++ b/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/c_func001.c ++++ b/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/c_func001.c @@ -0,0 +1,4 @@ +#include +void c_func_(int *a) { + printf("%d\n", *a); +} -diff --git a/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/c_func002.c b/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/c_func002.c +diff --git a/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/c_func002.c b/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/c_func002.c new file mode 100644 index 0000000..a695d21 --- /dev/null -+++ b/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/c_func002.c ++++ b/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/c_func002.c @@ -0,0 +1,5 @@ +#include +#include +void c_func_(short *a) { + printf("%hd\n", *a); +} -diff --git a/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/c_func003.c b/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/c_func003.c +diff --git a/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/c_func003.c b/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/c_func003.c new file mode 100644 index 0000000..c3e2b1b --- /dev/null -+++ b/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/c_func003.c ++++ b/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/c_func003.c @@ -0,0 +1,5 @@ +#include +#include +void c_func_(long *a) { + printf("%ld\n", *a); +} -diff --git a/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/c_func004.c b/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/c_func004.c +diff --git a/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/c_func004.c b/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/c_func004.c new file mode 100644 index 0000000..c83f515 --- /dev/null -+++ b/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/c_func004.c ++++ b/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/c_func004.c @@ -0,0 +1,5 @@ +#include +#include +void c_func_(long long *a) { + printf("%lld\n", *a); +} -diff --git a/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/c_func005.c b/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/c_func005.c +diff --git a/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/c_func005.c b/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/c_func005.c new file mode 100644 index 0000000..df53145 --- /dev/null -+++ b/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/c_func005.c ++++ b/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/c_func005.c @@ -0,0 +1,4 @@ +#include +void c_func_(signed char *a) { + printf("%c\n", *a); +} -diff --git a/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/c_func006.c b/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/c_func006.c +diff --git a/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/c_func006.c b/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/c_func006.c new file mode 100644 index 0000000..bf8fe98 --- /dev/null -+++ b/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/c_func006.c ++++ b/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/c_func006.c @@ -0,0 +1,5 @@ +#include +#include +void c_func_(size_t *a) { + printf("%ld\n", *a); +} -diff --git a/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/c_func007.c b/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/c_func007.c +diff --git a/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/c_func007.c b/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/c_func007.c new file mode 100644 index 0000000..1ccc2d3 --- /dev/null -+++ b/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/c_func007.c ++++ b/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/c_func007.c @@ -0,0 +1,5 @@ +#include +#include +void c_func_(int8_t *a) { + printf("%hhd\n", *a); +} -diff --git a/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/c_func008.c b/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/c_func008.c +diff --git a/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/c_func008.c b/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/c_func008.c new file mode 100644 index 0000000..5b4a477 --- /dev/null -+++ b/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/c_func008.c ++++ b/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/c_func008.c @@ -0,0 +1,5 @@ +#include +#include +void c_func_(int16_t *a) { + printf("%hd\n", *a); +} -diff --git a/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/c_func009.c b/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/c_func009.c +diff --git a/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/c_func009.c b/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/c_func009.c new file mode 100644 index 0000000..ef5dbab --- /dev/null -+++ b/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/c_func009.c ++++ b/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/c_func009.c @@ -0,0 +1,5 @@ +#include +#include +void c_func_(int32_t *a) { + printf("%d\n", *a); +} -diff --git a/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/c_func010.c b/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/c_func010.c +diff --git a/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/c_func010.c b/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/c_func010.c new file mode 100644 index 0000000..ff0c5b2 --- /dev/null -+++ b/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/c_func010.c ++++ b/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/c_func010.c @@ -0,0 +1,5 @@ +#include +#include +void c_func_(int64_t *a) { + printf("%ld\n", *a); +} -diff --git a/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/c_func011.c b/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/c_func011.c +diff --git a/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/c_func011.c b/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/c_func011.c new file mode 100644 index 0000000..648e234 --- /dev/null -+++ b/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/c_func011.c ++++ b/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/c_func011.c @@ -0,0 +1,5 @@ +#include +#include +void c_func_(int_least8_t *a) { + printf("%hhd\n", *a); +} -diff --git a/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/c_func012.c b/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/c_func012.c +diff --git a/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/c_func012.c b/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/c_func012.c new file mode 100644 index 0000000..175d427 --- /dev/null -+++ b/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/c_func012.c ++++ b/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/c_func012.c @@ -0,0 +1,5 @@ +#include +#include +void c_func_(int_least16_t *a) { + printf("%hd\n", *a); +} -diff --git a/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/c_func013.c b/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/c_func013.c +diff --git a/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/c_func013.c b/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/c_func013.c new file mode 100644 index 0000000..3e63c13 --- /dev/null -+++ b/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/c_func013.c ++++ b/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/c_func013.c @@ -0,0 +1,5 @@ +#include +#include +void c_func_(int_least32_t *a) { + printf("%d\n", *a); +} -diff --git a/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/c_func014.c b/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/c_func014.c +diff --git a/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/c_func014.c b/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/c_func014.c new file mode 100644 index 0000000..ac6a62b --- /dev/null -+++ b/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/c_func014.c ++++ b/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/c_func014.c @@ -0,0 +1,5 @@ +#include +#include +void c_func_(int_least64_t *a) { + printf("%ld\n", *a); +} -diff --git a/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/c_func015.c b/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/c_func015.c +diff --git a/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/c_func015.c b/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/c_func015.c new file mode 100644 index 0000000..85b98cc --- /dev/null -+++ b/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/c_func015.c ++++ b/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/c_func015.c @@ -0,0 +1,5 @@ +#include +#include +void c_func_(int_fast8_t *a) { + printf("%hhd\n", *a); +} -diff --git a/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/c_func016.c b/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/c_func016.c +diff --git a/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/c_func016.c b/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/c_func016.c new file mode 100644 index 0000000..ce358c3 --- /dev/null -+++ b/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/c_func016.c ++++ b/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/c_func016.c @@ -0,0 +1,5 @@ +#include +#include +void c_func_(int_fast16_t *a) { + printf("%ld\n", *a); +} -diff --git a/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/c_func017.c b/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/c_func017.c +diff --git a/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/c_func017.c b/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/c_func017.c new file mode 100644 index 0000000..9576185 --- /dev/null -+++ b/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/c_func017.c ++++ b/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/c_func017.c @@ -0,0 +1,5 @@ +#include +#include +void c_func_(int_fast32_t *a) { + printf("%ld\n", *a); +} -diff --git a/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/c_func018.c b/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/c_func018.c +diff --git a/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/c_func018.c b/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/c_func018.c new file mode 100644 index 0000000..84469ba --- /dev/null -+++ b/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/c_func018.c ++++ b/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/c_func018.c @@ -0,0 +1,5 @@ +#include +#include +void c_func_(int_fast64_t *a) { + printf("%ld\n", *a); +} -diff --git a/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/c_func019.c b/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/c_func019.c +diff --git a/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/c_func019.c b/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/c_func019.c new file mode 100644 index 0000000..acd8949 --- /dev/null -+++ b/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/c_func019.c ++++ b/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/c_func019.c @@ -0,0 +1,5 @@ +#include +#include +void c_func_(intmax_t *a) { + printf("%ld\n", *a); +} -diff --git a/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/c_func020.c b/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/c_func020.c +diff --git a/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/c_func020.c b/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/c_func020.c new file mode 100644 index 0000000..43c01a7 --- /dev/null -+++ b/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/c_func020.c ++++ b/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/c_func020.c @@ -0,0 +1,5 @@ +#include +#include +void c_func_(intptr_t *a) { + printf("%ld\n", *a); +} -diff --git a/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/c_func021.c b/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/c_func021.c +diff --git a/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/c_func021.c b/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/c_func021.c new file mode 100644 index 0000000..af99025 --- /dev/null -+++ b/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/c_func021.c ++++ b/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/c_func021.c @@ -0,0 +1,4 @@ +#include +void c_func_(float *a) { + printf("%f\n", *a); +} -diff --git a/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/c_func022.c b/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/c_func022.c +diff --git a/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/c_func022.c b/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/c_func022.c new file mode 100644 index 0000000..4b65d00 --- /dev/null -+++ b/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/c_func022.c ++++ b/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/c_func022.c @@ -0,0 +1,4 @@ +#include +void c_func_(double *a) { + printf("%0.20lf\n", *a); +} -diff --git a/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/c_func023.c b/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/c_func023.c +diff --git a/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/c_func023.c b/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/c_func023.c new file mode 100644 index 0000000..be8b2b1 --- /dev/null -+++ b/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/c_func023.c ++++ b/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/c_func023.c @@ -0,0 +1,4 @@ +#include +void c_func_(long double *a) { + printf("%0.20Lf\n", *a); +} -diff --git a/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/c_func024.c b/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/c_func024.c +diff --git a/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/c_func024.c b/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/c_func024.c new file mode 100644 index 0000000..1e65f36 --- /dev/null -+++ b/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/c_func024.c ++++ b/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/c_func024.c @@ -0,0 +1,5 @@ +#include +#include +void c_func_(float _Complex *t) { + printf("%f + %fi\n", creal(*t), cimag(*t)); +} -diff --git a/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/c_func025.c b/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/c_func025.c +diff --git a/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/c_func025.c b/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/c_func025.c new file mode 100644 index 0000000..b3f9944 --- /dev/null -+++ b/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/c_func025.c ++++ b/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/c_func025.c @@ -0,0 +1,5 @@ +#include +#include +void c_func_(double _Complex *t) { + printf("%0.20lf + %0.20lfi\n", creal(*t), cimag(*t)); +} -diff --git a/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/c_func026.c b/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/c_func026.c +diff --git a/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/c_func026.c b/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/c_func026.c new file mode 100644 index 0000000..c049c6f --- /dev/null -+++ b/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/c_func026.c ++++ b/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/c_func026.c @@ -0,0 +1,5 @@ +#include +#include +void c_func_(long double _Complex *t) { + printf("%0.20f + %0.20fi\n", creal(*t), cimag(*t)); +} -diff --git a/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/c_func027.c b/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/c_func027.c +diff --git a/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/c_func027.c b/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/c_func027.c new file mode 100644 index 0000000..a3a8596 --- /dev/null -+++ b/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/c_func027.c ++++ b/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/c_func027.c @@ -0,0 +1,4 @@ +#include +void c_func_(_Bool *a) { + printf("%d\n", *a); +} -diff --git a/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/c_func028.c b/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/c_func028.c +diff --git a/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/c_func028.c b/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/c_func028.c new file mode 100644 index 0000000..0abbf89 --- /dev/null -+++ b/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/c_func028.c ++++ b/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/c_func028.c @@ -0,0 +1,4 @@ +#include +void c_func_(char *a) { + printf("%c\n", *a); +} -diff --git a/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/fortran_main001.f90 b/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/fortran_main001.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/fortran_main001.f90 b/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/fortran_main001.f90 new file mode 100644 index 0000000..6f79a57 --- /dev/null -+++ b/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/fortran_main001.f90 ++++ b/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/fortran_main001.f90 @@ -0,0 +1,14 @@ +! Test fortran call c for the scalar type and the scalar type is int +! with iso_c_binding @@ -1147,11 +1147,11 @@ index 0000000..6f79a57 + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/fortran_main002.f90 b/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/fortran_main002.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/fortran_main002.f90 b/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/fortran_main002.f90 new file mode 100644 index 0000000..61250b0 --- /dev/null -+++ b/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/fortran_main002.f90 ++++ b/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/fortran_main002.f90 @@ -0,0 +1,14 @@ +! Test fortran call c for the scalar type and the scalar type is short +! with iso_c_binding @@ -1167,11 +1167,11 @@ index 0000000..61250b0 + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/fortran_main003.f90 b/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/fortran_main003.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/fortran_main003.f90 b/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/fortran_main003.f90 new file mode 100644 index 0000000..8620d6d --- /dev/null -+++ b/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/fortran_main003.f90 ++++ b/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/fortran_main003.f90 @@ -0,0 +1,14 @@ +! Test fortran call c for the scalar type and the scalar type is long +! with iso_c_binding @@ -1187,11 +1187,11 @@ index 0000000..8620d6d + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/fortran_main004.f90 b/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/fortran_main004.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/fortran_main004.f90 b/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/fortran_main004.f90 new file mode 100644 index 0000000..bc27cec --- /dev/null -+++ b/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/fortran_main004.f90 ++++ b/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/fortran_main004.f90 @@ -0,0 +1,14 @@ +! Test fortran call c for the scalar type and the scalar type is +! long long with iso_c_binding @@ -1207,11 +1207,11 @@ index 0000000..bc27cec + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/fortran_main005.f90 b/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/fortran_main005.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/fortran_main005.f90 b/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/fortran_main005.f90 new file mode 100644 index 0000000..8b74204 --- /dev/null -+++ b/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/fortran_main005.f90 ++++ b/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/fortran_main005.f90 @@ -0,0 +1,14 @@ +! Test fortran call c for the scalar type and the scalar type is +! signed char with iso_c_binding @@ -1227,11 +1227,11 @@ index 0000000..8b74204 + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/fortran_main006.f90 b/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/fortran_main006.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/fortran_main006.f90 b/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/fortran_main006.f90 new file mode 100644 index 0000000..29062ec --- /dev/null -+++ b/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/fortran_main006.f90 ++++ b/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/fortran_main006.f90 @@ -0,0 +1,14 @@ +! Test fortran call c for the scalar type and the scalar type is size_t +! with iso_c_binding @@ -1247,11 +1247,11 @@ index 0000000..29062ec + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/fortran_main007.f90 b/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/fortran_main007.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/fortran_main007.f90 b/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/fortran_main007.f90 new file mode 100644 index 0000000..55d0f75 --- /dev/null -+++ b/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/fortran_main007.f90 ++++ b/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/fortran_main007.f90 @@ -0,0 +1,14 @@ +! Test fortran call c for the scalar type and the scalar type is int8_t +! with iso_c_binding @@ -1267,11 +1267,11 @@ index 0000000..55d0f75 + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/fortran_main008.f90 b/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/fortran_main008.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/fortran_main008.f90 b/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/fortran_main008.f90 new file mode 100644 index 0000000..436e139 --- /dev/null -+++ b/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/fortran_main008.f90 ++++ b/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/fortran_main008.f90 @@ -0,0 +1,14 @@ +! Test fortran call c for the scalar type and the scalar type is +! int16_t with iso_c_binding @@ -1287,11 +1287,11 @@ index 0000000..436e139 + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/fortran_main009.f90 b/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/fortran_main009.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/fortran_main009.f90 b/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/fortran_main009.f90 new file mode 100644 index 0000000..0a02bc2 --- /dev/null -+++ b/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/fortran_main009.f90 ++++ b/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/fortran_main009.f90 @@ -0,0 +1,14 @@ +! Test fortran call c for the scalar type and the scalar type is +! int32_t with iso_c_binding @@ -1307,11 +1307,11 @@ index 0000000..0a02bc2 + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/fortran_main010.f90 b/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/fortran_main010.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/fortran_main010.f90 b/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/fortran_main010.f90 new file mode 100644 index 0000000..2d29eef --- /dev/null -+++ b/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/fortran_main010.f90 ++++ b/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/fortran_main010.f90 @@ -0,0 +1,14 @@ +! Test fortran call c for the scalar type and the scalar type is +! int64_t with iso_c_binding @@ -1327,11 +1327,11 @@ index 0000000..2d29eef + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/fortran_main011.f90 b/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/fortran_main011.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/fortran_main011.f90 b/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/fortran_main011.f90 new file mode 100644 index 0000000..36b1865 --- /dev/null -+++ b/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/fortran_main011.f90 ++++ b/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/fortran_main011.f90 @@ -0,0 +1,14 @@ +! Test fortran call c for the scalar type and the scalar type is +! int_least_8_t with iso_c_binding @@ -1347,11 +1347,11 @@ index 0000000..36b1865 + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/fortran_main012.f90 b/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/fortran_main012.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/fortran_main012.f90 b/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/fortran_main012.f90 new file mode 100644 index 0000000..4c199ae --- /dev/null -+++ b/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/fortran_main012.f90 ++++ b/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/fortran_main012.f90 @@ -0,0 +1,14 @@ +! Test fortran call c for the scalar type and the scalar type is +! int_least16_t with iso_c_binding @@ -1367,11 +1367,11 @@ index 0000000..4c199ae + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/fortran_main013.f90 b/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/fortran_main013.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/fortran_main013.f90 b/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/fortran_main013.f90 new file mode 100644 index 0000000..935f899 --- /dev/null -+++ b/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/fortran_main013.f90 ++++ b/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/fortran_main013.f90 @@ -0,0 +1,14 @@ +! Test fortran call c for the scalar type and the scalar type is +! int_least32_t with iso_c_binding @@ -1387,11 +1387,11 @@ index 0000000..935f899 + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/fortran_main014.f90 b/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/fortran_main014.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/fortran_main014.f90 b/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/fortran_main014.f90 new file mode 100644 index 0000000..71767d8 --- /dev/null -+++ b/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/fortran_main014.f90 ++++ b/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/fortran_main014.f90 @@ -0,0 +1,14 @@ +! Test fortran call c for the scalar type and the scalar type is +! int_least64_t with iso_c_binding @@ -1407,11 +1407,11 @@ index 0000000..71767d8 + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/fortran_main015.f90 b/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/fortran_main015.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/fortran_main015.f90 b/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/fortran_main015.f90 new file mode 100644 index 0000000..a4fa2c8 --- /dev/null -+++ b/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/fortran_main015.f90 ++++ b/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/fortran_main015.f90 @@ -0,0 +1,14 @@ +! Test fortran call c for the scalar type and the scalar type is +! int_fast8_t with iso_c_binding @@ -1427,11 +1427,11 @@ index 0000000..a4fa2c8 + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/fortran_main016.f90 b/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/fortran_main016.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/fortran_main016.f90 b/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/fortran_main016.f90 new file mode 100644 index 0000000..a249371 --- /dev/null -+++ b/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/fortran_main016.f90 ++++ b/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/fortran_main016.f90 @@ -0,0 +1,14 @@ +! Test fortran call c for the scalar type and the scalar type is +! int_fast16_t with iso_c_binding @@ -1447,11 +1447,11 @@ index 0000000..a249371 + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/fortran_main017.f90 b/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/fortran_main017.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/fortran_main017.f90 b/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/fortran_main017.f90 new file mode 100644 index 0000000..5054223 --- /dev/null -+++ b/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/fortran_main017.f90 ++++ b/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/fortran_main017.f90 @@ -0,0 +1,14 @@ +! Test fortran call c for the scalar type and the scalar type is +! int_fast32_t with iso_c_binding @@ -1467,11 +1467,11 @@ index 0000000..5054223 + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/fortran_main018.f90 b/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/fortran_main018.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/fortran_main018.f90 b/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/fortran_main018.f90 new file mode 100644 index 0000000..a4c7df9 --- /dev/null -+++ b/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/fortran_main018.f90 ++++ b/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/fortran_main018.f90 @@ -0,0 +1,14 @@ +! Test fortran call c for the scalar type and the scalar type is +! int_fast64_t with iso_c_binding @@ -1487,11 +1487,11 @@ index 0000000..a4c7df9 + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/fortran_main019.f90 b/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/fortran_main019.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/fortran_main019.f90 b/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/fortran_main019.f90 new file mode 100644 index 0000000..d01dc8b --- /dev/null -+++ b/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/fortran_main019.f90 ++++ b/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/fortran_main019.f90 @@ -0,0 +1,14 @@ +! Test fortran call c for the scalar type and the scalar type is +! intmax_t with iso_c_binding @@ -1507,11 +1507,11 @@ index 0000000..d01dc8b + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/fortran_main020.f90 b/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/fortran_main020.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/fortran_main020.f90 b/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/fortran_main020.f90 new file mode 100644 index 0000000..8724899 --- /dev/null -+++ b/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/fortran_main020.f90 ++++ b/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/fortran_main020.f90 @@ -0,0 +1,14 @@ +! Test fortran call c for the scalar type and the scalar type is +! intptr_t with iso_c_binding @@ -1527,11 +1527,11 @@ index 0000000..8724899 + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/fortran_main021.f90 b/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/fortran_main021.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/fortran_main021.f90 b/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/fortran_main021.f90 new file mode 100644 index 0000000..3aa93f5 --- /dev/null -+++ b/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/fortran_main021.f90 ++++ b/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/fortran_main021.f90 @@ -0,0 +1,14 @@ +! Test fortran call c for the scalar type and the scalar type is float +! with iso_c_binding @@ -1547,11 +1547,11 @@ index 0000000..3aa93f5 + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/fortran_main022.f90 b/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/fortran_main022.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/fortran_main022.f90 b/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/fortran_main022.f90 new file mode 100644 index 0000000..d38e122 --- /dev/null -+++ b/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/fortran_main022.f90 ++++ b/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/fortran_main022.f90 @@ -0,0 +1,14 @@ +! Test fortran call c for the scalar type and the scalar type is double +! with iso_c_binding @@ -1567,11 +1567,11 @@ index 0000000..d38e122 + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/fortran_main023.f90 b/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/fortran_main023.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/fortran_main023.f90 b/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/fortran_main023.f90 new file mode 100644 index 0000000..ab97171 --- /dev/null -+++ b/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/fortran_main023.f90 ++++ b/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/fortran_main023.f90 @@ -0,0 +1,14 @@ +! Test fortran call c for the scalar type and the scalar type is +! long double with iso_c_binding @@ -1587,11 +1587,11 @@ index 0000000..ab97171 + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/fortran_main024.f90 b/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/fortran_main024.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/fortran_main024.f90 b/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/fortran_main024.f90 new file mode 100644 index 0000000..fa413ee --- /dev/null -+++ b/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/fortran_main024.f90 ++++ b/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/fortran_main024.f90 @@ -0,0 +1,14 @@ +! Test fortran call c for the scalar type and the scalar type is +! float _Complex with iso_c_binding @@ -1607,11 +1607,11 @@ index 0000000..fa413ee + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/fortran_main025.f90 b/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/fortran_main025.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/fortran_main025.f90 b/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/fortran_main025.f90 new file mode 100644 index 0000000..1f07917 --- /dev/null -+++ b/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/fortran_main025.f90 ++++ b/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/fortran_main025.f90 @@ -0,0 +1,14 @@ +! Test fortran call c for the scalar type and the scalar type is +! double _Complex with iso_c_binding @@ -1627,11 +1627,11 @@ index 0000000..1f07917 + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/fortran_main026.f90 b/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/fortran_main026.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/fortran_main026.f90 b/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/fortran_main026.f90 new file mode 100644 index 0000000..7a1d999 --- /dev/null -+++ b/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/fortran_main026.f90 ++++ b/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/fortran_main026.f90 @@ -0,0 +1,14 @@ +! Test fortran call c for the scalar type and the scalar type is +! long double _Complex with iso_c_binding @@ -1647,11 +1647,11 @@ index 0000000..7a1d999 + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/fortran_main027.f90 b/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/fortran_main027.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/fortran_main027.f90 b/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/fortran_main027.f90 new file mode 100644 index 0000000..5c5b626 --- /dev/null -+++ b/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/fortran_main027.f90 ++++ b/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/fortran_main027.f90 @@ -0,0 +1,14 @@ +! Test fortran call c for the scalar type and the scalar type is _Bool +! with iso_c_binding @@ -1667,11 +1667,11 @@ index 0000000..5c5b626 + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/fortran_main028.f90 b/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/fortran_main028.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/fortran_main028.f90 b/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/fortran_main028.f90 new file mode 100644 index 0000000..cea2d0b --- /dev/null -+++ b/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/fortran_main028.f90 ++++ b/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/fortran_main028.f90 @@ -0,0 +1,14 @@ +! Test fortran call c for the scalar type and the scalar type is char +! with iso_c_binding @@ -1687,12 +1687,12 @@ index 0000000..cea2d0b + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/run.sh b/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/run.sh +diff --git a/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/run.sh b/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/run.sh new file mode 100644 -index 0000000..632b582 +index 0000000..b865403 --- /dev/null -+++ b/test/interoperability_with_c/002_fortran_call_c_scalar_bindc/run.sh -@@ -0,0 +1,17 @@ ++++ b/test/interoperability_with_c_fortran_call_c/002_fortran_call_c_scalar_iso_c_binding/run.sh +@@ -0,0 +1,16 @@ +for i in {001..028} +do +echo "------- test $i ------." @@ -1709,313 +1709,313 @@ index 0000000..632b582 +./a.out +rm *.o a.out +done -+ -diff --git a/test/interoperability_with_c/003_fortran_call_c_scalar_value/c_func001.c b/test/interoperability_with_c/003_fortran_call_c_scalar_value/c_func001.c +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/c_func001.c b/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/c_func001.c new file mode 100644 index 0000000..6b34fe7 --- /dev/null -+++ b/test/interoperability_with_c/003_fortran_call_c_scalar_value/c_func001.c ++++ b/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/c_func001.c @@ -0,0 +1,4 @@ +#include +void c_func_(int a) { + printf("%d\n", a); +} -diff --git a/test/interoperability_with_c/003_fortran_call_c_scalar_value/c_func002.c b/test/interoperability_with_c/003_fortran_call_c_scalar_value/c_func002.c +diff --git a/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/c_func002.c b/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/c_func002.c new file mode 100644 index 0000000..0a82fd6 --- /dev/null -+++ b/test/interoperability_with_c/003_fortran_call_c_scalar_value/c_func002.c ++++ b/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/c_func002.c @@ -0,0 +1,5 @@ +#include +#include +void c_func_(short a) { + printf("%hd\n", a); +} -diff --git a/test/interoperability_with_c/003_fortran_call_c_scalar_value/c_func003.c b/test/interoperability_with_c/003_fortran_call_c_scalar_value/c_func003.c +diff --git a/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/c_func003.c b/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/c_func003.c new file mode 100644 index 0000000..e945b70 --- /dev/null -+++ b/test/interoperability_with_c/003_fortran_call_c_scalar_value/c_func003.c ++++ b/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/c_func003.c @@ -0,0 +1,5 @@ +#include +#include +void c_func_(long a) { + printf("%ld\n", a); +} -diff --git a/test/interoperability_with_c/003_fortran_call_c_scalar_value/c_func004.c b/test/interoperability_with_c/003_fortran_call_c_scalar_value/c_func004.c +diff --git a/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/c_func004.c b/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/c_func004.c new file mode 100644 index 0000000..6d5f734 --- /dev/null -+++ b/test/interoperability_with_c/003_fortran_call_c_scalar_value/c_func004.c ++++ b/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/c_func004.c @@ -0,0 +1,5 @@ +#include +#include +void c_func_(long long a) { + printf("%lld\n", a); +} -diff --git a/test/interoperability_with_c/003_fortran_call_c_scalar_value/c_func005.c b/test/interoperability_with_c/003_fortran_call_c_scalar_value/c_func005.c +diff --git a/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/c_func005.c b/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/c_func005.c new file mode 100644 index 0000000..aa46418 --- /dev/null -+++ b/test/interoperability_with_c/003_fortran_call_c_scalar_value/c_func005.c ++++ b/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/c_func005.c @@ -0,0 +1,4 @@ +#include +void c_func_(signed char a) { + printf("%c\n", a); +} -diff --git a/test/interoperability_with_c/003_fortran_call_c_scalar_value/c_func006.c b/test/interoperability_with_c/003_fortran_call_c_scalar_value/c_func006.c +diff --git a/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/c_func006.c b/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/c_func006.c new file mode 100644 index 0000000..d78d3d5 --- /dev/null -+++ b/test/interoperability_with_c/003_fortran_call_c_scalar_value/c_func006.c ++++ b/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/c_func006.c @@ -0,0 +1,5 @@ +#include +#include +void c_func_(size_t a) { + printf("%ld\n", a); +} -diff --git a/test/interoperability_with_c/003_fortran_call_c_scalar_value/c_func007.c b/test/interoperability_with_c/003_fortran_call_c_scalar_value/c_func007.c +diff --git a/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/c_func007.c b/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/c_func007.c new file mode 100644 index 0000000..2e08462 --- /dev/null -+++ b/test/interoperability_with_c/003_fortran_call_c_scalar_value/c_func007.c ++++ b/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/c_func007.c @@ -0,0 +1,5 @@ +#include +#include +void c_func_(int8_t a) { + printf("%hhd\n", a); +} -diff --git a/test/interoperability_with_c/003_fortran_call_c_scalar_value/c_func008.c b/test/interoperability_with_c/003_fortran_call_c_scalar_value/c_func008.c +diff --git a/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/c_func008.c b/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/c_func008.c new file mode 100644 index 0000000..9b10264 --- /dev/null -+++ b/test/interoperability_with_c/003_fortran_call_c_scalar_value/c_func008.c ++++ b/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/c_func008.c @@ -0,0 +1,5 @@ +#include +#include +void c_func_(int16_t a) { + printf("%hd\n", a); +} -diff --git a/test/interoperability_with_c/003_fortran_call_c_scalar_value/c_func009.c b/test/interoperability_with_c/003_fortran_call_c_scalar_value/c_func009.c +diff --git a/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/c_func009.c b/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/c_func009.c new file mode 100644 index 0000000..7ed8d51 --- /dev/null -+++ b/test/interoperability_with_c/003_fortran_call_c_scalar_value/c_func009.c ++++ b/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/c_func009.c @@ -0,0 +1,5 @@ +#include +#include +void c_func_(int32_t a) { + printf("%d\n", a); +} -diff --git a/test/interoperability_with_c/003_fortran_call_c_scalar_value/c_func010.c b/test/interoperability_with_c/003_fortran_call_c_scalar_value/c_func010.c +diff --git a/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/c_func010.c b/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/c_func010.c new file mode 100644 index 0000000..426f6ae --- /dev/null -+++ b/test/interoperability_with_c/003_fortran_call_c_scalar_value/c_func010.c ++++ b/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/c_func010.c @@ -0,0 +1,5 @@ +#include +#include +void c_func_(int64_t a) { + printf("%ld\n", a); +} -diff --git a/test/interoperability_with_c/003_fortran_call_c_scalar_value/c_func011.c b/test/interoperability_with_c/003_fortran_call_c_scalar_value/c_func011.c +diff --git a/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/c_func011.c b/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/c_func011.c new file mode 100644 index 0000000..660f33e --- /dev/null -+++ b/test/interoperability_with_c/003_fortran_call_c_scalar_value/c_func011.c ++++ b/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/c_func011.c @@ -0,0 +1,5 @@ +#include +#include +void c_func_(int_least8_t a) { + printf("%hhd\n", a); +} -diff --git a/test/interoperability_with_c/003_fortran_call_c_scalar_value/c_func012.c b/test/interoperability_with_c/003_fortran_call_c_scalar_value/c_func012.c +diff --git a/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/c_func012.c b/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/c_func012.c new file mode 100644 index 0000000..abf7d13 --- /dev/null -+++ b/test/interoperability_with_c/003_fortran_call_c_scalar_value/c_func012.c ++++ b/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/c_func012.c @@ -0,0 +1,5 @@ +#include +#include +void c_func_(int_least16_t a) { + printf("%hd\n", a); +} -diff --git a/test/interoperability_with_c/003_fortran_call_c_scalar_value/c_func013.c b/test/interoperability_with_c/003_fortran_call_c_scalar_value/c_func013.c +diff --git a/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/c_func013.c b/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/c_func013.c new file mode 100644 index 0000000..638f7d0 --- /dev/null -+++ b/test/interoperability_with_c/003_fortran_call_c_scalar_value/c_func013.c ++++ b/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/c_func013.c @@ -0,0 +1,5 @@ +#include +#include +void c_func_(int_least32_t a) { + printf("%d\n", a); +} -diff --git a/test/interoperability_with_c/003_fortran_call_c_scalar_value/c_func014.c b/test/interoperability_with_c/003_fortran_call_c_scalar_value/c_func014.c +diff --git a/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/c_func014.c b/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/c_func014.c new file mode 100644 index 0000000..c0401de --- /dev/null -+++ b/test/interoperability_with_c/003_fortran_call_c_scalar_value/c_func014.c ++++ b/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/c_func014.c @@ -0,0 +1,5 @@ +#include +#include +void c_func_(int_least64_t a) { + printf("%ld\n", a); +} -diff --git a/test/interoperability_with_c/003_fortran_call_c_scalar_value/c_func015.c b/test/interoperability_with_c/003_fortran_call_c_scalar_value/c_func015.c +diff --git a/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/c_func015.c b/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/c_func015.c new file mode 100644 index 0000000..f7b7caa --- /dev/null -+++ b/test/interoperability_with_c/003_fortran_call_c_scalar_value/c_func015.c ++++ b/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/c_func015.c @@ -0,0 +1,5 @@ +#include +#include +void c_func_(int_fast8_t a) { + printf("%hhd\n", a); +} -diff --git a/test/interoperability_with_c/003_fortran_call_c_scalar_value/c_func016.c b/test/interoperability_with_c/003_fortran_call_c_scalar_value/c_func016.c +diff --git a/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/c_func016.c b/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/c_func016.c new file mode 100644 index 0000000..ef70772 --- /dev/null -+++ b/test/interoperability_with_c/003_fortran_call_c_scalar_value/c_func016.c ++++ b/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/c_func016.c @@ -0,0 +1,5 @@ +#include +#include +void c_func_(int_fast16_t a) { + printf("%ld\n", a); +} -diff --git a/test/interoperability_with_c/003_fortran_call_c_scalar_value/c_func017.c b/test/interoperability_with_c/003_fortran_call_c_scalar_value/c_func017.c +diff --git a/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/c_func017.c b/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/c_func017.c new file mode 100644 index 0000000..86e6cd6 --- /dev/null -+++ b/test/interoperability_with_c/003_fortran_call_c_scalar_value/c_func017.c ++++ b/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/c_func017.c @@ -0,0 +1,5 @@ +#include +#include +void c_func_(int_fast32_t a) { + printf("%ld\n", a); +} -diff --git a/test/interoperability_with_c/003_fortran_call_c_scalar_value/c_func018.c b/test/interoperability_with_c/003_fortran_call_c_scalar_value/c_func018.c +diff --git a/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/c_func018.c b/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/c_func018.c new file mode 100644 index 0000000..c8ae092 --- /dev/null -+++ b/test/interoperability_with_c/003_fortran_call_c_scalar_value/c_func018.c ++++ b/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/c_func018.c @@ -0,0 +1,5 @@ +#include +#include +void c_func_(int_fast64_t a) { + printf("%ld\n", a); +} -diff --git a/test/interoperability_with_c/003_fortran_call_c_scalar_value/c_func019.c b/test/interoperability_with_c/003_fortran_call_c_scalar_value/c_func019.c +diff --git a/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/c_func019.c b/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/c_func019.c new file mode 100644 index 0000000..0b0fa15 --- /dev/null -+++ b/test/interoperability_with_c/003_fortran_call_c_scalar_value/c_func019.c ++++ b/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/c_func019.c @@ -0,0 +1,5 @@ +#include +#include +void c_func_(intmax_t a) { + printf("%ld\n", a); +} -diff --git a/test/interoperability_with_c/003_fortran_call_c_scalar_value/c_func020.c b/test/interoperability_with_c/003_fortran_call_c_scalar_value/c_func020.c +diff --git a/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/c_func020.c b/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/c_func020.c new file mode 100644 index 0000000..bde599d --- /dev/null -+++ b/test/interoperability_with_c/003_fortran_call_c_scalar_value/c_func020.c ++++ b/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/c_func020.c @@ -0,0 +1,5 @@ +#include +#include +void c_func_(intptr_t a) { + printf("%ld\n", a); +} -diff --git a/test/interoperability_with_c/003_fortran_call_c_scalar_value/c_func021.c b/test/interoperability_with_c/003_fortran_call_c_scalar_value/c_func021.c +diff --git a/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/c_func021.c b/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/c_func021.c new file mode 100644 index 0000000..ae5bf11 --- /dev/null -+++ b/test/interoperability_with_c/003_fortran_call_c_scalar_value/c_func021.c ++++ b/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/c_func021.c @@ -0,0 +1,4 @@ +#include +void c_func_(float a) { + printf("%f\n", a); +} -diff --git a/test/interoperability_with_c/003_fortran_call_c_scalar_value/c_func022.c b/test/interoperability_with_c/003_fortran_call_c_scalar_value/c_func022.c +diff --git a/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/c_func022.c b/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/c_func022.c new file mode 100644 index 0000000..b3bdc55 --- /dev/null -+++ b/test/interoperability_with_c/003_fortran_call_c_scalar_value/c_func022.c ++++ b/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/c_func022.c @@ -0,0 +1,4 @@ +#include +void c_func_(double a) { + printf("%0.20lf\n", a); +} -diff --git a/test/interoperability_with_c/003_fortran_call_c_scalar_value/c_func023.c b/test/interoperability_with_c/003_fortran_call_c_scalar_value/c_func023.c +diff --git a/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/c_func023.c b/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/c_func023.c new file mode 100644 index 0000000..af99efc --- /dev/null -+++ b/test/interoperability_with_c/003_fortran_call_c_scalar_value/c_func023.c ++++ b/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/c_func023.c @@ -0,0 +1,4 @@ +#include +void c_func_(long double a) { + printf("%0.20Lf\n", a); +} -diff --git a/test/interoperability_with_c/003_fortran_call_c_scalar_value/c_func024.c b/test/interoperability_with_c/003_fortran_call_c_scalar_value/c_func024.c +diff --git a/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/c_func024.c b/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/c_func024.c new file mode 100644 index 0000000..af69eac --- /dev/null -+++ b/test/interoperability_with_c/003_fortran_call_c_scalar_value/c_func024.c ++++ b/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/c_func024.c @@ -0,0 +1,5 @@ +#include +#include +void c_func_(float _Complex t) { + printf("%0.20f + %0.20fi\n", creal(t), cimag(t)); +} -diff --git a/test/interoperability_with_c/003_fortran_call_c_scalar_value/c_func025.c b/test/interoperability_with_c/003_fortran_call_c_scalar_value/c_func025.c +diff --git a/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/c_func025.c b/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/c_func025.c new file mode 100644 index 0000000..55a85e9 --- /dev/null -+++ b/test/interoperability_with_c/003_fortran_call_c_scalar_value/c_func025.c ++++ b/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/c_func025.c @@ -0,0 +1,5 @@ +#include +#include +void c_func_(double _Complex t) { + printf("%0.20lf + %0.20lfi\n", creal(t), cimag(t)); +} -diff --git a/test/interoperability_with_c/003_fortran_call_c_scalar_value/c_func026.c b/test/interoperability_with_c/003_fortran_call_c_scalar_value/c_func026.c +diff --git a/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/c_func026.c b/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/c_func026.c new file mode 100644 index 0000000..5b7017a --- /dev/null -+++ b/test/interoperability_with_c/003_fortran_call_c_scalar_value/c_func026.c ++++ b/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/c_func026.c @@ -0,0 +1,5 @@ +#include +#include +void c_func_(long double _Complex t) { + printf("%0.20f + %0.20fi\n", creal(t), cimag(t)); +} -diff --git a/test/interoperability_with_c/003_fortran_call_c_scalar_value/c_func027.c b/test/interoperability_with_c/003_fortran_call_c_scalar_value/c_func027.c +diff --git a/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/c_func027.c b/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/c_func027.c new file mode 100644 index 0000000..ff95fd7 --- /dev/null -+++ b/test/interoperability_with_c/003_fortran_call_c_scalar_value/c_func027.c ++++ b/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/c_func027.c @@ -0,0 +1,4 @@ +#include +void c_func_(_Bool a) { + printf("%d\n", a); +} -diff --git a/test/interoperability_with_c/003_fortran_call_c_scalar_value/c_func028.c b/test/interoperability_with_c/003_fortran_call_c_scalar_value/c_func028.c +diff --git a/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/c_func028.c b/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/c_func028.c new file mode 100644 index 0000000..b92caf7 --- /dev/null -+++ b/test/interoperability_with_c/003_fortran_call_c_scalar_value/c_func028.c ++++ b/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/c_func028.c @@ -0,0 +1,4 @@ +#include +void c_func_(char a) { + printf("%c\n", a); +} -diff --git a/test/interoperability_with_c/003_fortran_call_c_scalar_value/fortran_main001.f90 b/test/interoperability_with_c/003_fortran_call_c_scalar_value/fortran_main001.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/fortran_main001.f90 b/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/fortran_main001.f90 new file mode 100644 index 0000000..68a4e65 --- /dev/null -+++ b/test/interoperability_with_c/003_fortran_call_c_scalar_value/fortran_main001.f90 ++++ b/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/fortran_main001.f90 @@ -0,0 +1,12 @@ +! Test fortran call c for the scalar type with value attribute and the +! scalar type is int without iso_c_binding @@ -2029,11 +2029,11 @@ index 0000000..68a4e65 + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/003_fortran_call_c_scalar_value/fortran_main002.f90 b/test/interoperability_with_c/003_fortran_call_c_scalar_value/fortran_main002.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/fortran_main002.f90 b/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/fortran_main002.f90 new file mode 100644 index 0000000..f98661e --- /dev/null -+++ b/test/interoperability_with_c/003_fortran_call_c_scalar_value/fortran_main002.f90 ++++ b/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/fortran_main002.f90 @@ -0,0 +1,12 @@ +! Test fortran call c for the scalar type with value attribute and the +! scalar type is short without iso_c_binding @@ -2047,11 +2047,11 @@ index 0000000..f98661e + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/003_fortran_call_c_scalar_value/fortran_main003.f90 b/test/interoperability_with_c/003_fortran_call_c_scalar_value/fortran_main003.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/fortran_main003.f90 b/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/fortran_main003.f90 new file mode 100644 index 0000000..56d73bb --- /dev/null -+++ b/test/interoperability_with_c/003_fortran_call_c_scalar_value/fortran_main003.f90 ++++ b/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/fortran_main003.f90 @@ -0,0 +1,12 @@ +! Test fortran call c for the scalar type with value attribute and the +! scalar type is long without iso_c_binding @@ -2065,11 +2065,11 @@ index 0000000..56d73bb + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/003_fortran_call_c_scalar_value/fortran_main004.f90 b/test/interoperability_with_c/003_fortran_call_c_scalar_value/fortran_main004.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/fortran_main004.f90 b/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/fortran_main004.f90 new file mode 100644 index 0000000..bd26e3d --- /dev/null -+++ b/test/interoperability_with_c/003_fortran_call_c_scalar_value/fortran_main004.f90 ++++ b/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/fortran_main004.f90 @@ -0,0 +1,12 @@ +! Test fortran call c for the scalar type with value attribute and the +! scalar type is long long without iso_c_binding @@ -2083,11 +2083,11 @@ index 0000000..bd26e3d + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/003_fortran_call_c_scalar_value/fortran_main005.f90 b/test/interoperability_with_c/003_fortran_call_c_scalar_value/fortran_main005.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/fortran_main005.f90 b/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/fortran_main005.f90 new file mode 100644 index 0000000..c603a40 --- /dev/null -+++ b/test/interoperability_with_c/003_fortran_call_c_scalar_value/fortran_main005.f90 ++++ b/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/fortran_main005.f90 @@ -0,0 +1,12 @@ +! Test fortran call c for the scalar type with value attribute and the +! scalar type is signed char without iso_c_binding @@ -2101,11 +2101,11 @@ index 0000000..c603a40 + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/003_fortran_call_c_scalar_value/fortran_main006.f90 b/test/interoperability_with_c/003_fortran_call_c_scalar_value/fortran_main006.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/fortran_main006.f90 b/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/fortran_main006.f90 new file mode 100644 index 0000000..08e4cab --- /dev/null -+++ b/test/interoperability_with_c/003_fortran_call_c_scalar_value/fortran_main006.f90 ++++ b/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/fortran_main006.f90 @@ -0,0 +1,12 @@ +! Test fortran call c for the scalar type with value attribute and the +! scalar type is size_t without iso_c_binding @@ -2119,11 +2119,11 @@ index 0000000..08e4cab + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/003_fortran_call_c_scalar_value/fortran_main007.f90 b/test/interoperability_with_c/003_fortran_call_c_scalar_value/fortran_main007.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/fortran_main007.f90 b/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/fortran_main007.f90 new file mode 100644 index 0000000..6fbc4f1 --- /dev/null -+++ b/test/interoperability_with_c/003_fortran_call_c_scalar_value/fortran_main007.f90 ++++ b/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/fortran_main007.f90 @@ -0,0 +1,12 @@ +! Test fortran call c for the scalar type with value attribute and the +! scalar type is int8_t without iso_c_binding @@ -2137,11 +2137,11 @@ index 0000000..6fbc4f1 + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/003_fortran_call_c_scalar_value/fortran_main008.f90 b/test/interoperability_with_c/003_fortran_call_c_scalar_value/fortran_main008.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/fortran_main008.f90 b/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/fortran_main008.f90 new file mode 100644 index 0000000..dadfeb3 --- /dev/null -+++ b/test/interoperability_with_c/003_fortran_call_c_scalar_value/fortran_main008.f90 ++++ b/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/fortran_main008.f90 @@ -0,0 +1,12 @@ +! Test fortran call c for the scalar type with value attribute and the +! scalar type is int16_t without iso_c_binding @@ -2155,11 +2155,11 @@ index 0000000..dadfeb3 + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/003_fortran_call_c_scalar_value/fortran_main009.f90 b/test/interoperability_with_c/003_fortran_call_c_scalar_value/fortran_main009.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/fortran_main009.f90 b/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/fortran_main009.f90 new file mode 100644 index 0000000..b9589e6 --- /dev/null -+++ b/test/interoperability_with_c/003_fortran_call_c_scalar_value/fortran_main009.f90 ++++ b/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/fortran_main009.f90 @@ -0,0 +1,12 @@ +! Test fortran call c for the scalar type with value attribute and the +! scalar type is int32_t @@ -2173,11 +2173,11 @@ index 0000000..b9589e6 + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/003_fortran_call_c_scalar_value/fortran_main010.f90 b/test/interoperability_with_c/003_fortran_call_c_scalar_value/fortran_main010.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/fortran_main010.f90 b/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/fortran_main010.f90 new file mode 100644 index 0000000..a756881 --- /dev/null -+++ b/test/interoperability_with_c/003_fortran_call_c_scalar_value/fortran_main010.f90 ++++ b/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/fortran_main010.f90 @@ -0,0 +1,12 @@ +! Test fortran call c for the scalar type with value attribute and the +! scalar type is int64_t without iso_c_binding @@ -2191,11 +2191,11 @@ index 0000000..a756881 + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/003_fortran_call_c_scalar_value/fortran_main011.f90 b/test/interoperability_with_c/003_fortran_call_c_scalar_value/fortran_main011.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/fortran_main011.f90 b/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/fortran_main011.f90 new file mode 100644 index 0000000..58a7483 --- /dev/null -+++ b/test/interoperability_with_c/003_fortran_call_c_scalar_value/fortran_main011.f90 ++++ b/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/fortran_main011.f90 @@ -0,0 +1,12 @@ +! Test fortran call c for the scalar type with value attribute and the +! scalar type is int_least8_t without iso_c_binding @@ -2209,11 +2209,11 @@ index 0000000..58a7483 + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/003_fortran_call_c_scalar_value/fortran_main012.f90 b/test/interoperability_with_c/003_fortran_call_c_scalar_value/fortran_main012.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/fortran_main012.f90 b/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/fortran_main012.f90 new file mode 100644 index 0000000..a5c8e34 --- /dev/null -+++ b/test/interoperability_with_c/003_fortran_call_c_scalar_value/fortran_main012.f90 ++++ b/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/fortran_main012.f90 @@ -0,0 +1,12 @@ +! Test fortran call c for the scalar type with value attribute and the +! scalar type is int_least16_t without iso_c_binding @@ -2227,11 +2227,11 @@ index 0000000..a5c8e34 + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/003_fortran_call_c_scalar_value/fortran_main013.f90 b/test/interoperability_with_c/003_fortran_call_c_scalar_value/fortran_main013.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/fortran_main013.f90 b/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/fortran_main013.f90 new file mode 100644 index 0000000..8705110 --- /dev/null -+++ b/test/interoperability_with_c/003_fortran_call_c_scalar_value/fortran_main013.f90 ++++ b/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/fortran_main013.f90 @@ -0,0 +1,12 @@ +! Test fortran call c for the scalar type with value attribute and the +! scalar type is int_least32_t without iso_c_binding @@ -2245,11 +2245,11 @@ index 0000000..8705110 + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/003_fortran_call_c_scalar_value/fortran_main014.f90 b/test/interoperability_with_c/003_fortran_call_c_scalar_value/fortran_main014.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/fortran_main014.f90 b/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/fortran_main014.f90 new file mode 100644 index 0000000..327434e --- /dev/null -+++ b/test/interoperability_with_c/003_fortran_call_c_scalar_value/fortran_main014.f90 ++++ b/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/fortran_main014.f90 @@ -0,0 +1,12 @@ +! Test fortran call c for the scalar type with value attribute and the +! scalar type is int_least64_t without iso_c_binding @@ -2263,11 +2263,11 @@ index 0000000..327434e + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/003_fortran_call_c_scalar_value/fortran_main015.f90 b/test/interoperability_with_c/003_fortran_call_c_scalar_value/fortran_main015.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/fortran_main015.f90 b/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/fortran_main015.f90 new file mode 100644 index 0000000..b911744 --- /dev/null -+++ b/test/interoperability_with_c/003_fortran_call_c_scalar_value/fortran_main015.f90 ++++ b/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/fortran_main015.f90 @@ -0,0 +1,12 @@ +! Test fortran call c for the scalar type with value attribute and the +! scalar type is int_fast8_t without iso_c_binding @@ -2281,11 +2281,11 @@ index 0000000..b911744 + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/003_fortran_call_c_scalar_value/fortran_main016.f90 b/test/interoperability_with_c/003_fortran_call_c_scalar_value/fortran_main016.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/fortran_main016.f90 b/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/fortran_main016.f90 new file mode 100644 index 0000000..43c1d3f --- /dev/null -+++ b/test/interoperability_with_c/003_fortran_call_c_scalar_value/fortran_main016.f90 ++++ b/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/fortran_main016.f90 @@ -0,0 +1,12 @@ +! Test fortran call c for the scalar type with value attribute and the +! scalar type is int_fast16_t without iso_c_binding @@ -2299,11 +2299,11 @@ index 0000000..43c1d3f + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/003_fortran_call_c_scalar_value/fortran_main017.f90 b/test/interoperability_with_c/003_fortran_call_c_scalar_value/fortran_main017.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/fortran_main017.f90 b/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/fortran_main017.f90 new file mode 100644 index 0000000..dd03c20 --- /dev/null -+++ b/test/interoperability_with_c/003_fortran_call_c_scalar_value/fortran_main017.f90 ++++ b/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/fortran_main017.f90 @@ -0,0 +1,12 @@ +! Test fortran call c for the scalar type with value attribute and the +! scalar type is int_fast32_t without iso_c_binding @@ -2317,11 +2317,11 @@ index 0000000..dd03c20 + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/003_fortran_call_c_scalar_value/fortran_main018.f90 b/test/interoperability_with_c/003_fortran_call_c_scalar_value/fortran_main018.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/fortran_main018.f90 b/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/fortran_main018.f90 new file mode 100644 index 0000000..aed4502 --- /dev/null -+++ b/test/interoperability_with_c/003_fortran_call_c_scalar_value/fortran_main018.f90 ++++ b/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/fortran_main018.f90 @@ -0,0 +1,12 @@ +! Test fortran call c for the scalar type with value attribute and the +! scalar type is int_fast64_t without iso_c_binding @@ -2335,11 +2335,11 @@ index 0000000..aed4502 + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/003_fortran_call_c_scalar_value/fortran_main019.f90 b/test/interoperability_with_c/003_fortran_call_c_scalar_value/fortran_main019.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/fortran_main019.f90 b/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/fortran_main019.f90 new file mode 100644 index 0000000..47f84e9 --- /dev/null -+++ b/test/interoperability_with_c/003_fortran_call_c_scalar_value/fortran_main019.f90 ++++ b/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/fortran_main019.f90 @@ -0,0 +1,12 @@ +! Test fortran call c for the scalar type with value attribute and the +! scalar type is intmax_t without iso_c_binding @@ -2353,11 +2353,11 @@ index 0000000..47f84e9 + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/003_fortran_call_c_scalar_value/fortran_main020.f90 b/test/interoperability_with_c/003_fortran_call_c_scalar_value/fortran_main020.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/fortran_main020.f90 b/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/fortran_main020.f90 new file mode 100644 index 0000000..2d3d9fa --- /dev/null -+++ b/test/interoperability_with_c/003_fortran_call_c_scalar_value/fortran_main020.f90 ++++ b/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/fortran_main020.f90 @@ -0,0 +1,12 @@ +! Test fortran call c for the scalar type with value attribute and the +! scalar type is intptr_t without iso_c_binding @@ -2371,11 +2371,11 @@ index 0000000..2d3d9fa + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/003_fortran_call_c_scalar_value/fortran_main021.f90 b/test/interoperability_with_c/003_fortran_call_c_scalar_value/fortran_main021.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/fortran_main021.f90 b/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/fortran_main021.f90 new file mode 100644 index 0000000..4bb2e37 --- /dev/null -+++ b/test/interoperability_with_c/003_fortran_call_c_scalar_value/fortran_main021.f90 ++++ b/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/fortran_main021.f90 @@ -0,0 +1,12 @@ +! Test fortran call c for the scalar type with value attribute and the +! scalar type is float without iso_c_binding @@ -2389,11 +2389,11 @@ index 0000000..4bb2e37 + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/003_fortran_call_c_scalar_value/fortran_main022.f90 b/test/interoperability_with_c/003_fortran_call_c_scalar_value/fortran_main022.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/fortran_main022.f90 b/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/fortran_main022.f90 new file mode 100644 index 0000000..33d79e5 --- /dev/null -+++ b/test/interoperability_with_c/003_fortran_call_c_scalar_value/fortran_main022.f90 ++++ b/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/fortran_main022.f90 @@ -0,0 +1,12 @@ +! Test fortran call c for the scalar type with value attribute and the +! scalar type is double without iso_c_binding @@ -2407,11 +2407,11 @@ index 0000000..33d79e5 + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/003_fortran_call_c_scalar_value/fortran_main023.f90 b/test/interoperability_with_c/003_fortran_call_c_scalar_value/fortran_main023.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/fortran_main023.f90 b/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/fortran_main023.f90 new file mode 100644 index 0000000..9d090e9 --- /dev/null -+++ b/test/interoperability_with_c/003_fortran_call_c_scalar_value/fortran_main023.f90 ++++ b/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/fortran_main023.f90 @@ -0,0 +1,14 @@ +! Test fortran call c for the scalar type with value attribute and the +! scalar type is long double without iso_c_binding @@ -2427,11 +2427,11 @@ index 0000000..9d090e9 + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/003_fortran_call_c_scalar_value/fortran_main024.f90 b/test/interoperability_with_c/003_fortran_call_c_scalar_value/fortran_main024.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/fortran_main024.f90 b/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/fortran_main024.f90 new file mode 100644 index 0000000..7a6d9e4 --- /dev/null -+++ b/test/interoperability_with_c/003_fortran_call_c_scalar_value/fortran_main024.f90 ++++ b/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/fortran_main024.f90 @@ -0,0 +1,12 @@ +! Test fortran call c for the scalar type with value attribute and the +! scalar type is float _Complex without iso_c_binding @@ -2445,11 +2445,11 @@ index 0000000..7a6d9e4 + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/003_fortran_call_c_scalar_value/fortran_main025.f90 b/test/interoperability_with_c/003_fortran_call_c_scalar_value/fortran_main025.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/fortran_main025.f90 b/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/fortran_main025.f90 new file mode 100644 index 0000000..cf1ae5c --- /dev/null -+++ b/test/interoperability_with_c/003_fortran_call_c_scalar_value/fortran_main025.f90 ++++ b/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/fortran_main025.f90 @@ -0,0 +1,12 @@ +! Test fortran call c for the scalar type with value attribute and the +! scalar type is double _Complex without iso_c_binding @@ -2463,11 +2463,11 @@ index 0000000..cf1ae5c + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/003_fortran_call_c_scalar_value/fortran_main026.f90 b/test/interoperability_with_c/003_fortran_call_c_scalar_value/fortran_main026.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/fortran_main026.f90 b/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/fortran_main026.f90 new file mode 100644 index 0000000..e46d83c --- /dev/null -+++ b/test/interoperability_with_c/003_fortran_call_c_scalar_value/fortran_main026.f90 ++++ b/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/fortran_main026.f90 @@ -0,0 +1,14 @@ +! Test fortran call c for the scalar type with value attribute and the +! scalar type is long double _Complex without iso_c_binding @@ -2483,11 +2483,11 @@ index 0000000..e46d83c + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/003_fortran_call_c_scalar_value/fortran_main027.f90 b/test/interoperability_with_c/003_fortran_call_c_scalar_value/fortran_main027.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/fortran_main027.f90 b/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/fortran_main027.f90 new file mode 100644 index 0000000..fc3103e --- /dev/null -+++ b/test/interoperability_with_c/003_fortran_call_c_scalar_value/fortran_main027.f90 ++++ b/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/fortran_main027.f90 @@ -0,0 +1,12 @@ +! Test fortran call c for the scalar type with value attribute and the +! scalar type is _Bool without iso_c_binding @@ -2501,14 +2501,14 @@ index 0000000..fc3103e + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/003_fortran_call_c_scalar_value/fortran_main028.f90 b/test/interoperability_with_c/003_fortran_call_c_scalar_value/fortran_main028.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/fortran_main028.f90 b/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/fortran_main028.f90 new file mode 100644 -index 0000000..39a3c40 +index 0000000..e0269d5 --- /dev/null -+++ b/test/interoperability_with_c/003_fortran_call_c_scalar_value/fortran_main028.f90 ++++ b/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/fortran_main028.f90 @@ -0,0 +1,12 @@ +! Test fortran call c for the scalar type with value attribute and the -+! scalar type is _char without iso_c_binding ++! scalar type is char without iso_c_binding +! +program main + character(1) :: my_x = 'a' @@ -2519,12 +2519,12 @@ index 0000000..39a3c40 + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/003_fortran_call_c_scalar_value/run.sh b/test/interoperability_with_c/003_fortran_call_c_scalar_value/run.sh +diff --git a/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/run.sh b/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/run.sh new file mode 100644 -index 0000000..632b582 +index 0000000..b865403 --- /dev/null -+++ b/test/interoperability_with_c/003_fortran_call_c_scalar_value/run.sh -@@ -0,0 +1,17 @@ ++++ b/test/interoperability_with_c_fortran_call_c/003_fortran_call_c_scalar_value/run.sh +@@ -0,0 +1,16 @@ +for i in {001..028} +do +echo "------- test $i ------." @@ -2541,1079 +2541,822 @@ index 0000000..632b582 +./a.out +rm *.o a.out +done -+ -diff --git a/test/interoperability_with_c/004_fortran_call_c_scalar_struct/c_func001.c b/test/interoperability_with_c/004_fortran_call_c_scalar_struct/c_func001.c -new file mode 100755 -index 0000000..042849e +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/c_func001.c b/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/c_func001.c +new file mode 100644 +index 0000000..5acb3c0 --- /dev/null -+++ b/test/interoperability_with_c/004_fortran_call_c_scalar_struct/c_func001.c -@@ -0,0 +1,8 @@ ++++ b/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/c_func001.c +@@ -0,0 +1,4 @@ +#include -+struct Ty { -+ int x, y; -+}; -+void c_func_(struct Ty *t) { -+ printf("%d\t", t->x); -+ printf("%d\n", t->y); ++void c_func_(int *a) { ++ printf("%d\n", *a); +} -diff --git a/test/interoperability_with_c/004_fortran_call_c_scalar_struct/c_func002.c b/test/interoperability_with_c/004_fortran_call_c_scalar_struct/c_func002.c -new file mode 100755 -index 0000000..ad72ffd +diff --git a/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/c_func002.c b/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/c_func002.c +new file mode 100644 +index 0000000..a695d21 --- /dev/null -+++ b/test/interoperability_with_c/004_fortran_call_c_scalar_struct/c_func002.c -@@ -0,0 +1,9 @@ ++++ b/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/c_func002.c +@@ -0,0 +1,5 @@ +#include +#include -+struct Ty { -+ short x, y; -+}; -+void c_func_(struct Ty *t) { -+ printf("%hd\t", t->x); -+ printf("%hd\n", t->y); ++void c_func_(short *a) { ++ printf("%hd\n", *a); +} -diff --git a/test/interoperability_with_c/004_fortran_call_c_scalar_struct/c_func003.c b/test/interoperability_with_c/004_fortran_call_c_scalar_struct/c_func003.c -new file mode 100755 -index 0000000..78540c0 +diff --git a/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/c_func003.c b/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/c_func003.c +new file mode 100644 +index 0000000..c3e2b1b --- /dev/null -+++ b/test/interoperability_with_c/004_fortran_call_c_scalar_struct/c_func003.c -@@ -0,0 +1,9 @@ ++++ b/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/c_func003.c +@@ -0,0 +1,5 @@ +#include +#include -+struct Ty { -+ long x, y; -+}; -+void c_func_(struct Ty *t) { -+ printf("%ld\t", t->x); -+ printf("%ld\n", t->y); ++void c_func_(long *a) { ++ printf("%ld\n", *a); +} -diff --git a/test/interoperability_with_c/004_fortran_call_c_scalar_struct/c_func004.c b/test/interoperability_with_c/004_fortran_call_c_scalar_struct/c_func004.c -new file mode 100755 -index 0000000..83bc034 +diff --git a/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/c_func004.c b/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/c_func004.c +new file mode 100644 +index 0000000..c83f515 --- /dev/null -+++ b/test/interoperability_with_c/004_fortran_call_c_scalar_struct/c_func004.c -@@ -0,0 +1,9 @@ ++++ b/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/c_func004.c +@@ -0,0 +1,5 @@ +#include +#include -+struct Ty { -+ long long x, y; -+}; -+void c_func_(struct Ty *t) { -+ printf("%lld\t", t->x); -+ printf("%lld\n", t->y); ++void c_func_(long long *a) { ++ printf("%lld\n", *a); +} -diff --git a/test/interoperability_with_c/004_fortran_call_c_scalar_struct/c_func005.c b/test/interoperability_with_c/004_fortran_call_c_scalar_struct/c_func005.c -new file mode 100755 -index 0000000..f0ec8b1 +diff --git a/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/c_func005.c b/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/c_func005.c +new file mode 100644 +index 0000000..df53145 --- /dev/null -+++ b/test/interoperability_with_c/004_fortran_call_c_scalar_struct/c_func005.c -@@ -0,0 +1,9 @@ ++++ b/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/c_func005.c +@@ -0,0 +1,4 @@ +#include -+#include -+struct Ty { -+ signed char x, y; -+}; -+void c_func_(struct Ty *t) { -+ printf("%c\t", t->x); -+ printf("%c\n", t->y); ++void c_func_(signed char *a) { ++ printf("%c\n", *a); +} -diff --git a/test/interoperability_with_c/004_fortran_call_c_scalar_struct/c_func006.c b/test/interoperability_with_c/004_fortran_call_c_scalar_struct/c_func006.c -new file mode 100755 -index 0000000..a37766e +diff --git a/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/c_func006.c b/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/c_func006.c +new file mode 100644 +index 0000000..bf8fe98 --- /dev/null -+++ b/test/interoperability_with_c/004_fortran_call_c_scalar_struct/c_func006.c -@@ -0,0 +1,9 @@ ++++ b/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/c_func006.c +@@ -0,0 +1,5 @@ +#include +#include -+struct Ty { -+ size_t x, y; -+}; -+void c_func_(struct Ty *t) { -+ printf("%ld\t", t->x); -+ printf("%ld\n", t->y); ++void c_func_(size_t *a) { ++ printf("%ld\n", *a); +} -diff --git a/test/interoperability_with_c/004_fortran_call_c_scalar_struct/c_func007.c b/test/interoperability_with_c/004_fortran_call_c_scalar_struct/c_func007.c -new file mode 100755 -index 0000000..71c4460 +diff --git a/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/c_func007.c b/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/c_func007.c +new file mode 100644 +index 0000000..1ccc2d3 --- /dev/null -+++ b/test/interoperability_with_c/004_fortran_call_c_scalar_struct/c_func007.c -@@ -0,0 +1,9 @@ ++++ b/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/c_func007.c +@@ -0,0 +1,5 @@ +#include +#include -+struct Ty { -+ int8_t x, y; -+}; -+void c_func_(struct Ty *t) { -+ printf("%hhd\t", t->x); -+ printf("%hhd\n", t->y); ++void c_func_(int8_t *a) { ++ printf("%hhd\n", *a); +} -diff --git a/test/interoperability_with_c/004_fortran_call_c_scalar_struct/c_func008.c b/test/interoperability_with_c/004_fortran_call_c_scalar_struct/c_func008.c -new file mode 100755 -index 0000000..cc4c156 +diff --git a/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/c_func008.c b/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/c_func008.c +new file mode 100644 +index 0000000..5b4a477 --- /dev/null -+++ b/test/interoperability_with_c/004_fortran_call_c_scalar_struct/c_func008.c -@@ -0,0 +1,9 @@ ++++ b/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/c_func008.c +@@ -0,0 +1,5 @@ +#include +#include -+struct Ty { -+ int16_t x, y; -+}; -+void c_func_(struct Ty *t) { -+ printf("%hd\t", t->x); -+ printf("%hd\n", t->y); ++void c_func_(int16_t *a) { ++ printf("%hd\n", *a); +} -diff --git a/test/interoperability_with_c/004_fortran_call_c_scalar_struct/c_func009.c b/test/interoperability_with_c/004_fortran_call_c_scalar_struct/c_func009.c -new file mode 100755 -index 0000000..81c3db1 +diff --git a/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/c_func009.c b/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/c_func009.c +new file mode 100644 +index 0000000..ef5dbab --- /dev/null -+++ b/test/interoperability_with_c/004_fortran_call_c_scalar_struct/c_func009.c -@@ -0,0 +1,9 @@ ++++ b/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/c_func009.c +@@ -0,0 +1,5 @@ +#include +#include -+struct Ty { -+ int32_t x, y; -+}; -+void c_func_(struct Ty *t) { -+ printf("%d\t", t->x); -+ printf("%d\n", t->y); ++void c_func_(int32_t *a) { ++ printf("%d\n", *a); +} -diff --git a/test/interoperability_with_c/004_fortran_call_c_scalar_struct/c_func010.c b/test/interoperability_with_c/004_fortran_call_c_scalar_struct/c_func010.c -new file mode 100755 -index 0000000..0d8b990 +diff --git a/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/c_func010.c b/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/c_func010.c +new file mode 100644 +index 0000000..ff0c5b2 --- /dev/null -+++ b/test/interoperability_with_c/004_fortran_call_c_scalar_struct/c_func010.c -@@ -0,0 +1,9 @@ ++++ b/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/c_func010.c +@@ -0,0 +1,5 @@ +#include +#include -+struct Ty { -+ int64_t x,y; -+}; -+void c_func_(struct Ty *t) { -+ printf("%ld\t", t->x); -+ printf("%ld\n", t->y); ++void c_func_(int64_t *a) { ++ printf("%ld\n", *a); +} -diff --git a/test/interoperability_with_c/004_fortran_call_c_scalar_struct/c_func011.c b/test/interoperability_with_c/004_fortran_call_c_scalar_struct/c_func011.c -new file mode 100755 -index 0000000..9d65b2a +diff --git a/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/c_func011.c b/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/c_func011.c +new file mode 100644 +index 0000000..648e234 --- /dev/null -+++ b/test/interoperability_with_c/004_fortran_call_c_scalar_struct/c_func011.c -@@ -0,0 +1,9 @@ ++++ b/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/c_func011.c +@@ -0,0 +1,5 @@ +#include +#include -+struct Ty { -+ int_least8_t x, y; -+}; -+void c_func_(struct Ty *t) { -+ printf("%hhd\t", t->x); -+ printf("%hhd\n", t->y); ++void c_func_(int_least8_t *a) { ++ printf("%hhd\n", *a); +} -diff --git a/test/interoperability_with_c/004_fortran_call_c_scalar_struct/c_func012.c b/test/interoperability_with_c/004_fortran_call_c_scalar_struct/c_func012.c -new file mode 100755 -index 0000000..e77ab58 +diff --git a/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/c_func012.c b/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/c_func012.c +new file mode 100644 +index 0000000..175d427 --- /dev/null -+++ b/test/interoperability_with_c/004_fortran_call_c_scalar_struct/c_func012.c -@@ -0,0 +1,9 @@ ++++ b/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/c_func012.c +@@ -0,0 +1,5 @@ +#include +#include -+struct Ty { -+ int_least16_t x, y; -+}; -+void c_func_(struct Ty *t) { -+ printf("%hd\t", t->x); -+ printf("%hd\n", t->y); ++void c_func_(int_least16_t *a) { ++ printf("%hd\n", *a); +} -diff --git a/test/interoperability_with_c/004_fortran_call_c_scalar_struct/c_func013.c b/test/interoperability_with_c/004_fortran_call_c_scalar_struct/c_func013.c -new file mode 100755 -index 0000000..c37c94e +diff --git a/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/c_func013.c b/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/c_func013.c +new file mode 100644 +index 0000000..3e63c13 --- /dev/null -+++ b/test/interoperability_with_c/004_fortran_call_c_scalar_struct/c_func013.c -@@ -0,0 +1,9 @@ ++++ b/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/c_func013.c +@@ -0,0 +1,5 @@ +#include +#include -+struct Ty { -+ int_least32_t x, y; -+}; -+void c_func_(struct Ty *t) { -+ printf("%d\t", t->x); -+ printf("%d\n", t->y); ++void c_func_(int_least32_t *a) { ++ printf("%d\n", *a); +} -diff --git a/test/interoperability_with_c/004_fortran_call_c_scalar_struct/c_func014.c b/test/interoperability_with_c/004_fortran_call_c_scalar_struct/c_func014.c -new file mode 100755 -index 0000000..6f8a5b4 +diff --git a/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/c_func014.c b/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/c_func014.c +new file mode 100644 +index 0000000..ac6a62b --- /dev/null -+++ b/test/interoperability_with_c/004_fortran_call_c_scalar_struct/c_func014.c -@@ -0,0 +1,9 @@ ++++ b/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/c_func014.c +@@ -0,0 +1,5 @@ +#include +#include -+struct Ty { -+ int_least64_t x, y; -+}; -+void c_func_(struct Ty *t) { -+ printf("%ld\t", t->x); -+ printf("%ld\n", t->y); ++void c_func_(int_least64_t *a) { ++ printf("%ld\n", *a); +} -diff --git a/test/interoperability_with_c/004_fortran_call_c_scalar_struct/c_func015.c b/test/interoperability_with_c/004_fortran_call_c_scalar_struct/c_func015.c -new file mode 100755 -index 0000000..9308c5b +diff --git a/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/c_func015.c b/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/c_func015.c +new file mode 100644 +index 0000000..85b98cc --- /dev/null -+++ b/test/interoperability_with_c/004_fortran_call_c_scalar_struct/c_func015.c -@@ -0,0 +1,9 @@ ++++ b/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/c_func015.c +@@ -0,0 +1,5 @@ +#include +#include -+struct Ty { -+ int_fast8_t x, y; -+}; -+void c_func_(struct Ty *t) { -+ printf("%hhd\t", t->x); -+ printf("%hhd\n", t->y); ++void c_func_(int_fast8_t *a) { ++ printf("%hhd\n", *a); +} -diff --git a/test/interoperability_with_c/004_fortran_call_c_scalar_struct/c_func016.c b/test/interoperability_with_c/004_fortran_call_c_scalar_struct/c_func016.c -new file mode 100755 -index 0000000..1bdc74a +diff --git a/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/c_func016.c b/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/c_func016.c +new file mode 100644 +index 0000000..ce358c3 --- /dev/null -+++ b/test/interoperability_with_c/004_fortran_call_c_scalar_struct/c_func016.c -@@ -0,0 +1,9 @@ ++++ b/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/c_func016.c +@@ -0,0 +1,5 @@ +#include +#include -+struct Ty { -+ int_fast16_t x, y; -+}; -+void c_func_(struct Ty *t) { -+ printf("%ld\t", t->x); -+ printf("%ld\n", t->y); ++void c_func_(int_fast16_t *a) { ++ printf("%ld\n", *a); +} -diff --git a/test/interoperability_with_c/004_fortran_call_c_scalar_struct/c_func017.c b/test/interoperability_with_c/004_fortran_call_c_scalar_struct/c_func017.c -new file mode 100755 -index 0000000..017daeb +diff --git a/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/c_func017.c b/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/c_func017.c +new file mode 100644 +index 0000000..9576185 --- /dev/null -+++ b/test/interoperability_with_c/004_fortran_call_c_scalar_struct/c_func017.c -@@ -0,0 +1,9 @@ ++++ b/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/c_func017.c +@@ -0,0 +1,5 @@ +#include +#include -+struct Ty { -+ int_fast32_t x, y; -+}; -+void c_func_(struct Ty *t) { -+ printf("%ld\t", t->x); -+ printf("%ld\n", t->y); ++void c_func_(int_fast32_t *a) { ++ printf("%ld\n", *a); +} -diff --git a/test/interoperability_with_c/004_fortran_call_c_scalar_struct/c_func018.c b/test/interoperability_with_c/004_fortran_call_c_scalar_struct/c_func018.c -new file mode 100755 -index 0000000..3ab58e9 +diff --git a/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/c_func018.c b/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/c_func018.c +new file mode 100644 +index 0000000..84469ba --- /dev/null -+++ b/test/interoperability_with_c/004_fortran_call_c_scalar_struct/c_func018.c -@@ -0,0 +1,9 @@ ++++ b/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/c_func018.c +@@ -0,0 +1,5 @@ +#include +#include -+struct Ty { -+ int_fast64_t x, y; -+}; -+void c_func_(struct Ty *t) { -+ printf("%ld\t", t->x); -+ printf("%ld\n", t->y); ++void c_func_(int_fast64_t *a) { ++ printf("%ld\n", *a); +} -diff --git a/test/interoperability_with_c/004_fortran_call_c_scalar_struct/c_func019.c b/test/interoperability_with_c/004_fortran_call_c_scalar_struct/c_func019.c -new file mode 100755 -index 0000000..9c68e8d +diff --git a/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/c_func019.c b/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/c_func019.c +new file mode 100644 +index 0000000..acd8949 --- /dev/null -+++ b/test/interoperability_with_c/004_fortran_call_c_scalar_struct/c_func019.c -@@ -0,0 +1,9 @@ ++++ b/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/c_func019.c +@@ -0,0 +1,5 @@ +#include +#include -+struct Ty { -+ intmax_t x, y; -+}; -+void c_func_(struct Ty *t) { -+ printf("%ld\t", t->x); -+ printf("%ld\n", t->y); ++void c_func_(intmax_t *a) { ++ printf("%ld\n", *a); +} -diff --git a/test/interoperability_with_c/004_fortran_call_c_scalar_struct/c_func020.c b/test/interoperability_with_c/004_fortran_call_c_scalar_struct/c_func020.c -new file mode 100755 -index 0000000..9c41124 +diff --git a/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/c_func020.c b/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/c_func020.c +new file mode 100644 +index 0000000..43c01a7 --- /dev/null -+++ b/test/interoperability_with_c/004_fortran_call_c_scalar_struct/c_func020.c -@@ -0,0 +1,9 @@ ++++ b/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/c_func020.c +@@ -0,0 +1,5 @@ +#include +#include -+struct Ty { -+ intptr_t x, y; -+}; -+void c_func_(struct Ty *t) { -+ printf("%ld\t", t->x); -+ printf("%ld\n", t->y); ++void c_func_(intptr_t *a) { ++ printf("%ld\n", *a); +} -diff --git a/test/interoperability_with_c/004_fortran_call_c_scalar_struct/c_func021.c b/test/interoperability_with_c/004_fortran_call_c_scalar_struct/c_func021.c -new file mode 100755 -index 0000000..33704de +diff --git a/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/c_func021.c b/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/c_func021.c +new file mode 100644 +index 0000000..af99025 --- /dev/null -+++ b/test/interoperability_with_c/004_fortran_call_c_scalar_struct/c_func021.c -@@ -0,0 +1,9 @@ ++++ b/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/c_func021.c +@@ -0,0 +1,4 @@ +#include -+#include -+struct Ty { -+ float x, y; -+}; -+void c_func_(struct Ty *t) { -+ printf("%f\t", t->x); -+ printf("%f\n", t->y); ++void c_func_(float *a) { ++ printf("%f\n", *a); +} -diff --git a/test/interoperability_with_c/004_fortran_call_c_scalar_struct/c_func022.c b/test/interoperability_with_c/004_fortran_call_c_scalar_struct/c_func022.c -new file mode 100755 -index 0000000..e8beea1 +diff --git a/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/c_func022.c b/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/c_func022.c +new file mode 100644 +index 0000000..7ae046f --- /dev/null -+++ b/test/interoperability_with_c/004_fortran_call_c_scalar_struct/c_func022.c -@@ -0,0 +1,9 @@ ++++ b/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/c_func022.c +@@ -0,0 +1,4 @@ +#include -+#include -+struct Ty { -+ double x, y; -+}; -+void c_func_(struct Ty *t) { -+ printf("%0.20lf\t", t->x); -+ printf("%0.20lf\n", t->y); ++void c_func_(double *a) { ++ printf("%0.20f\n", *a); +} -diff --git a/test/interoperability_with_c/004_fortran_call_c_scalar_struct/c_func023.c b/test/interoperability_with_c/004_fortran_call_c_scalar_struct/c_func023.c -new file mode 100755 -index 0000000..a735b8d +diff --git a/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/c_func023.c b/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/c_func023.c +new file mode 100644 +index 0000000..be8b2b1 --- /dev/null -+++ b/test/interoperability_with_c/004_fortran_call_c_scalar_struct/c_func023.c -@@ -0,0 +1,9 @@ ++++ b/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/c_func023.c +@@ -0,0 +1,4 @@ +#include -+#include -+struct Ty { -+ long double x, y; -+}; -+void c_func_(struct Ty *t) { -+ printf("%0.20Lf\t", t->x); -+ printf("%0.20Lf\n", t->y); ++void c_func_(long double *a) { ++ printf("%0.20Lf\n", *a); +} -diff --git a/test/interoperability_with_c/004_fortran_call_c_scalar_struct/c_func024.c b/test/interoperability_with_c/004_fortran_call_c_scalar_struct/c_func024.c -new file mode 100755 -index 0000000..aff5eaf +diff --git a/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/c_func024.c b/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/c_func024.c +new file mode 100644 +index 0000000..1e65f36 --- /dev/null -+++ b/test/interoperability_with_c/004_fortran_call_c_scalar_struct/c_func024.c -@@ -0,0 +1,9 @@ ++++ b/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/c_func024.c +@@ -0,0 +1,5 @@ +#include +#include -+struct Ty { -+ float _Complex x, y; -+}; -+void c_func_(struct Ty *t) { -+ printf("%f + %fi\n", creal(t->x), cimag(t->x)); -+ printf("%f + %fi\n", creal(t->y), cimag(t->y)); ++void c_func_(float _Complex *t) { ++ printf("%f + %fi\n", creal(*t), cimag(*t)); +} -diff --git a/test/interoperability_with_c/004_fortran_call_c_scalar_struct/c_func025.c b/test/interoperability_with_c/004_fortran_call_c_scalar_struct/c_func025.c -new file mode 100755 -index 0000000..cac2da2 +diff --git a/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/c_func025.c b/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/c_func025.c +new file mode 100644 +index 0000000..b3f9944 --- /dev/null -+++ b/test/interoperability_with_c/004_fortran_call_c_scalar_struct/c_func025.c -@@ -0,0 +1,9 @@ ++++ b/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/c_func025.c +@@ -0,0 +1,5 @@ +#include +#include -+struct Ty { -+ double _Complex x, y; -+}; -+void c_func_(struct Ty *t) { -+ printf("%lf + %lfi\n", creal(t->x), cimag(t->x)); -+ printf("%lf + %lfi\n", creal(t->y), cimag(t->y)); ++void c_func_(double _Complex *t) { ++ printf("%0.20lf + %0.20lfi\n", creal(*t), cimag(*t)); +} -diff --git a/test/interoperability_with_c/004_fortran_call_c_scalar_struct/c_func026.c b/test/interoperability_with_c/004_fortran_call_c_scalar_struct/c_func026.c -new file mode 100755 -index 0000000..886667b +diff --git a/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/c_func026.c b/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/c_func026.c +new file mode 100644 +index 0000000..c049c6f --- /dev/null -+++ b/test/interoperability_with_c/004_fortran_call_c_scalar_struct/c_func026.c -@@ -0,0 +1,9 @@ ++++ b/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/c_func026.c +@@ -0,0 +1,5 @@ +#include +#include -+struct Ty { -+ long double _Complex x, y; -+}; -+void c_func_(struct Ty *t) { -+ printf("%f + %fi\n", creal(t->x), cimag(t->x)); -+ printf("%f + %fi\n", creal(t->y), cimag(t->y)); ++void c_func_(long double _Complex *t) { ++ printf("%0.20f + %0.20fi\n", creal(*t), cimag(*t)); +} -diff --git a/test/interoperability_with_c/004_fortran_call_c_scalar_struct/c_func027.c b/test/interoperability_with_c/004_fortran_call_c_scalar_struct/c_func027.c -new file mode 100755 -index 0000000..ef8ac27 +diff --git a/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/c_func027.c b/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/c_func027.c +new file mode 100644 +index 0000000..a3a8596 --- /dev/null -+++ b/test/interoperability_with_c/004_fortran_call_c_scalar_struct/c_func027.c -@@ -0,0 +1,9 @@ ++++ b/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/c_func027.c +@@ -0,0 +1,4 @@ +#include -+#include -+struct Ty { -+ _Bool x, y; -+}; -+void c_func_(struct Ty *t) { -+ printf("%d\t", t->x); -+ printf("%d\n", t->y); ++void c_func_(_Bool *a) { ++ printf("%d\n", *a); +} -diff --git a/test/interoperability_with_c/004_fortran_call_c_scalar_struct/c_func028.c b/test/interoperability_with_c/004_fortran_call_c_scalar_struct/c_func028.c -new file mode 100755 -index 0000000..1b00b60 +diff --git a/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/c_func028.c b/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/c_func028.c +new file mode 100644 +index 0000000..0abbf89 --- /dev/null -+++ b/test/interoperability_with_c/004_fortran_call_c_scalar_struct/c_func028.c -@@ -0,0 +1,9 @@ ++++ b/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/c_func028.c +@@ -0,0 +1,4 @@ +#include -+#include -+struct Ty { -+ char x, y; -+}; -+void c_func_(struct Ty *t) { -+ printf("%c\t", t->x); -+ printf("%c\n", t->y); ++void c_func_(char *a) { ++ printf("%c\n", *a); +} -diff --git a/test/interoperability_with_c/004_fortran_call_c_scalar_struct/fortran_main001.f90 b/test/interoperability_with_c/004_fortran_call_c_scalar_struct/fortran_main001.f90 -new file mode 100755 -index 0000000..f231f83 +diff --git a/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/fortran_main001.f90 b/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/fortran_main001.f90 +new file mode 100644 +index 0000000..9255a56 --- /dev/null -+++ b/test/interoperability_with_c/004_fortran_call_c_scalar_struct/fortran_main001.f90 -@@ -0,0 +1,17 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type int without iso_c_binding ++++ b/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/fortran_main001.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the scalar type and the scalar type is int ++! with bindc +! +program main -+ type, bind(c) :: t -+ integer :: x = -2147483647 -+ integer :: y = 2147483647 -+ end type t -+ type(t) :: my_t ++ integer(4) :: my_x = 1 + interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a ++ subroutine c_func(b) bind(c, name = "c_func_") ++ integer(4) :: b + end + end interface -+ call c_func(my_t) ++ call c_func(my_x) +end -diff --git a/test/interoperability_with_c/004_fortran_call_c_scalar_struct/fortran_main002.f90 b/test/interoperability_with_c/004_fortran_call_c_scalar_struct/fortran_main002.f90 -new file mode 100755 -index 0000000..35ed794 +diff --git a/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/fortran_main002.f90 b/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/fortran_main002.f90 +new file mode 100644 +index 0000000..a265d80 --- /dev/null -+++ b/test/interoperability_with_c/004_fortran_call_c_scalar_struct/fortran_main002.f90 -@@ -0,0 +1,17 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type short without iso_c_binding ++++ b/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/fortran_main002.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the scalar type and the scalar type is short ++! with bindc +! +program main -+ type, bind(c) :: t -+ integer(2) :: x = -32768 -+ integer(2) :: y = 32767 -+ end type t -+ type(t) :: my_t ++ integer(2) :: my_x = 1 + interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a ++ subroutine c_func(b) bind(c, name = "c_func_") ++ integer(2) :: b + end + end interface -+ call c_func(my_t) ++ call c_func(my_x) +end -diff --git a/test/interoperability_with_c/004_fortran_call_c_scalar_struct/fortran_main003.f90 b/test/interoperability_with_c/004_fortran_call_c_scalar_struct/fortran_main003.f90 -new file mode 100755 -index 0000000..7ead233 +diff --git a/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/fortran_main003.f90 b/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/fortran_main003.f90 +new file mode 100644 +index 0000000..5ea0bb8 --- /dev/null -+++ b/test/interoperability_with_c/004_fortran_call_c_scalar_struct/fortran_main003.f90 -@@ -0,0 +1,17 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type long without iso_c_binding ++++ b/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/fortran_main003.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the scalar type and the scalar type is long ++! with bindc +! +program main -+ type, bind(c) :: t -+ integer(8) :: x = -2147483647 -+ integer(8) :: y = 2147483647 -+ end type t -+ type(t) :: my_t ++ integer(8) :: my_x = 1 + interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a ++ subroutine c_func(b) bind(c, name = "c_func_") ++ integer(8) :: b + end + end interface -+ call c_func(my_t) ++ call c_func(my_x) +end -diff --git a/test/interoperability_with_c/004_fortran_call_c_scalar_struct/fortran_main004.f90 b/test/interoperability_with_c/004_fortran_call_c_scalar_struct/fortran_main004.f90 -new file mode 100755 -index 0000000..36b0ad2 +diff --git a/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/fortran_main004.f90 b/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/fortran_main004.f90 +new file mode 100644 +index 0000000..355c37a --- /dev/null -+++ b/test/interoperability_with_c/004_fortran_call_c_scalar_struct/fortran_main004.f90 -@@ -0,0 +1,17 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type long long without iso_c_binding ++++ b/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/fortran_main004.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the scalar type and the scalar type is ++! long long with bindc +! +program main -+ type, bind(c) :: t -+ integer(8) :: x = -9223372036854775807 -+ integer(8) :: y = 9223372036854775807 -+ end type t -+ type(t) :: my_t ++ integer(8) :: my_x = 1 + interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a ++ subroutine c_func(b) bind(c, name = "c_func_") ++ integer(8) :: b + end + end interface -+ call c_func(my_t) ++ call c_func(my_x) +end -diff --git a/test/interoperability_with_c/004_fortran_call_c_scalar_struct/fortran_main005.f90 b/test/interoperability_with_c/004_fortran_call_c_scalar_struct/fortran_main005.f90 -new file mode 100755 -index 0000000..2bf3dc8 +diff --git a/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/fortran_main005.f90 b/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/fortran_main005.f90 +new file mode 100644 +index 0000000..b3f965b --- /dev/null -+++ b/test/interoperability_with_c/004_fortran_call_c_scalar_struct/fortran_main005.f90 -@@ -0,0 +1,17 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type signed char without iso_c_binding ++++ b/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/fortran_main005.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the scalar type and the scalar type is ++! signed char with bindc +! +program main -+ type, bind(c) :: t -+ integer(1) :: x = 65 -+ integer(1) :: y = 66 -+ end type t -+ type(t) :: my_t ++ integer(1) :: my_x = 65 + interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a ++ subroutine c_func(b) bind(c, name = "c_func_") ++ integer(1) :: b + end + end interface -+ call c_func(my_t) ++ call c_func(my_x) +end -diff --git a/test/interoperability_with_c/004_fortran_call_c_scalar_struct/fortran_main006.f90 b/test/interoperability_with_c/004_fortran_call_c_scalar_struct/fortran_main006.f90 -new file mode 100755 -index 0000000..38fae19 +diff --git a/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/fortran_main006.f90 b/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/fortran_main006.f90 +new file mode 100644 +index 0000000..0ff532d --- /dev/null -+++ b/test/interoperability_with_c/004_fortran_call_c_scalar_struct/fortran_main006.f90 -@@ -0,0 +1,17 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type size_t without iso_c_binding ++++ b/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/fortran_main006.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the scalar type and the scalar type is size_t ++! with bindc +! +program main -+ type, bind(c) :: t -+ integer(8) :: x = 0 -+ integer(8) :: y = 9223372036854775807 -+ end type t -+ type(t) :: my_t ++ integer(8) :: my_x = 1 + interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a ++ subroutine c_func(b) bind(c, name = "c_func_") ++ integer(8) :: b + end + end interface -+ call c_func(my_t) ++ call c_func(my_x) +end -diff --git a/test/interoperability_with_c/004_fortran_call_c_scalar_struct/fortran_main007.f90 b/test/interoperability_with_c/004_fortran_call_c_scalar_struct/fortran_main007.f90 -new file mode 100755 -index 0000000..67aed08 +diff --git a/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/fortran_main007.f90 b/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/fortran_main007.f90 +new file mode 100644 +index 0000000..3fa2acf --- /dev/null -+++ b/test/interoperability_with_c/004_fortran_call_c_scalar_struct/fortran_main007.f90 -@@ -0,0 +1,17 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type int8_t without iso_c_binding ++++ b/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/fortran_main007.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the scalar type and the scalar type is int8_t ++! with bindc +! +program main -+ type, bind(c) :: t -+ integer(1) :: x = -128 -+ integer(1) :: y = 127 -+ end type t -+ type(t) :: my_t ++ integer(1) :: my_x = 1 + interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a ++ subroutine c_func(b) bind(c, name = "c_func_") ++ integer(1) :: b + end + end interface -+ call c_func(my_t) ++ call c_func(my_x) +end -diff --git a/test/interoperability_with_c/004_fortran_call_c_scalar_struct/fortran_main008.f90 b/test/interoperability_with_c/004_fortran_call_c_scalar_struct/fortran_main008.f90 -new file mode 100755 -index 0000000..023d8ed +diff --git a/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/fortran_main008.f90 b/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/fortran_main008.f90 +new file mode 100644 +index 0000000..28febbd --- /dev/null -+++ b/test/interoperability_with_c/004_fortran_call_c_scalar_struct/fortran_main008.f90 -@@ -0,0 +1,17 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type int16_t without iso_c_binding ++++ b/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/fortran_main008.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the scalar type and the scalar type is ++! int16_t with bindc +! +program main -+ type, bind(c) :: t -+ integer(2) :: x = -32768 -+ integer(2) :: y = 32767 -+ end type t -+ type(t) :: my_t ++ integer(2) :: my_x = 1 + interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a ++ subroutine c_func(b) bind(c, name = "c_func_") ++ integer(2) :: b + end + end interface -+ call c_func(my_t) ++ call c_func(my_x) +end -diff --git a/test/interoperability_with_c/004_fortran_call_c_scalar_struct/fortran_main009.f90 b/test/interoperability_with_c/004_fortran_call_c_scalar_struct/fortran_main009.f90 -new file mode 100755 -index 0000000..031594a +diff --git a/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/fortran_main009.f90 b/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/fortran_main009.f90 +new file mode 100644 +index 0000000..a25eb5b --- /dev/null -+++ b/test/interoperability_with_c/004_fortran_call_c_scalar_struct/fortran_main009.f90 -@@ -0,0 +1,17 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type int32_t without iso_c_binding ++++ b/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/fortran_main009.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the scalar type and the scalar type is ++! int32_t with bindc +! +program main -+ type, bind(c) :: t -+ integer(4) :: x = -2147483647 -+ integer(4) :: y = 2147483647 -+ end type t -+ type(t) :: my_t ++ integer(4) :: my_x = 1 + interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a ++ subroutine c_func(b) bind(c, name = "c_func_") ++ integer(4) :: b + end + end interface -+ call c_func(my_t) ++ call c_func(my_x) +end -diff --git a/test/interoperability_with_c/004_fortran_call_c_scalar_struct/fortran_main010.f90 b/test/interoperability_with_c/004_fortran_call_c_scalar_struct/fortran_main010.f90 -new file mode 100755 -index 0000000..71d48ae +diff --git a/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/fortran_main010.f90 b/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/fortran_main010.f90 +new file mode 100644 +index 0000000..89d324d --- /dev/null -+++ b/test/interoperability_with_c/004_fortran_call_c_scalar_struct/fortran_main010.f90 -@@ -0,0 +1,17 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type int64_t without iso_c_binding ++++ b/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/fortran_main010.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the scalar type and the scalar type is ++! int64_t with bindc +! +program main -+ type, bind(c) :: t -+ integer(8) :: x = -9223372036854775807 -+ integer(8) :: y = 9223372036854775807 -+ end type t -+ type(t) :: my_t ++ integer(8) :: my_x = 1 + interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a ++ subroutine c_func(b) bind(c, name = "c_func_") ++ integer(8) :: b + end + end interface -+ call c_func(my_t) ++ call c_func(my_x) +end -diff --git a/test/interoperability_with_c/004_fortran_call_c_scalar_struct/fortran_main011.f90 b/test/interoperability_with_c/004_fortran_call_c_scalar_struct/fortran_main011.f90 -new file mode 100755 -index 0000000..de94b0f +diff --git a/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/fortran_main011.f90 b/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/fortran_main011.f90 +new file mode 100644 +index 0000000..451ef1e --- /dev/null -+++ b/test/interoperability_with_c/004_fortran_call_c_scalar_struct/fortran_main011.f90 -@@ -0,0 +1,17 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type int_least_8_t without iso_c_binding ++++ b/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/fortran_main011.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the scalar type and the scalar type is ++! int_least8_t with bindc +! +program main -+ type, bind(c) :: t -+ integer(1) :: x = -128 -+ integer(1) :: y = 127 -+ end type t -+ type(t) :: my_t ++ integer(1) :: my_x = 1 + interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a ++ subroutine c_func(b) bind(c, name = "c_func_") ++ integer(1) :: b + end + end interface -+ call c_func(my_t) ++ call c_func(my_x) +end -diff --git a/test/interoperability_with_c/004_fortran_call_c_scalar_struct/fortran_main012.f90 b/test/interoperability_with_c/004_fortran_call_c_scalar_struct/fortran_main012.f90 -new file mode 100755 -index 0000000..b824e33 +diff --git a/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/fortran_main012.f90 b/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/fortran_main012.f90 +new file mode 100644 +index 0000000..df2f5fd --- /dev/null -+++ b/test/interoperability_with_c/004_fortran_call_c_scalar_struct/fortran_main012.f90 -@@ -0,0 +1,17 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type int_least16_t without iso_c_binding ++++ b/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/fortran_main012.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the scalar type and the scalar type is ++! int_least16_t with bindc +! +program main -+ type, bind(c) :: t -+ integer(2) :: x = -32768 -+ integer(2) :: y = 32767 -+ end type t -+ type(t) :: my_t ++ integer(2) :: my_x = 1 + interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a ++ subroutine c_func(b) bind(c, name = "c_func_") ++ integer(2) :: b + end + end interface -+ call c_func(my_t) ++ call c_func(my_x) +end -diff --git a/test/interoperability_with_c/004_fortran_call_c_scalar_struct/fortran_main013.f90 b/test/interoperability_with_c/004_fortran_call_c_scalar_struct/fortran_main013.f90 -new file mode 100755 -index 0000000..87b0d0e +diff --git a/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/fortran_main013.f90 b/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/fortran_main013.f90 +new file mode 100644 +index 0000000..f333dda --- /dev/null -+++ b/test/interoperability_with_c/004_fortran_call_c_scalar_struct/fortran_main013.f90 -@@ -0,0 +1,17 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type int_least32_t without iso_c_binding ++++ b/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/fortran_main013.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the scalar type and the scalar type is ++! int_least32_t with bindc +! +program main -+ type, bind(c) :: t -+ integer(4) :: x = -2147483647 -+ integer(4) :: y = 2147483647 -+ end type t -+ type(t) :: my_t ++ integer(4) :: my_x = 1 + interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a ++ subroutine c_func(b) bind(c, name = "c_func_") ++ integer(4) :: b + end + end interface -+ call c_func(my_t) ++ call c_func(my_x) +end -diff --git a/test/interoperability_with_c/004_fortran_call_c_scalar_struct/fortran_main014.f90 b/test/interoperability_with_c/004_fortran_call_c_scalar_struct/fortran_main014.f90 -new file mode 100755 -index 0000000..311421d +diff --git a/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/fortran_main014.f90 b/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/fortran_main014.f90 +new file mode 100644 +index 0000000..9af1234 --- /dev/null -+++ b/test/interoperability_with_c/004_fortran_call_c_scalar_struct/fortran_main014.f90 -@@ -0,0 +1,17 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type int_least_64_t without iso_c_binding ++++ b/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/fortran_main014.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the scalar type and the scalar type is ++! int_least64_t with bindc +! +program main -+ type, bind(c) :: t -+ integer(8) :: x = -9223372036854775807 -+ integer(8) :: y = 9223372036854775807 -+ end type t -+ type(t) :: my_t ++ integer(8) :: my_x = 1 + interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a ++ subroutine c_func(b) bind(c, name = "c_func_") ++ integer(8) :: b + end + end interface -+ call c_func(my_t) ++ call c_func(my_x) +end -diff --git a/test/interoperability_with_c/004_fortran_call_c_scalar_struct/fortran_main015.f90 b/test/interoperability_with_c/004_fortran_call_c_scalar_struct/fortran_main015.f90 -new file mode 100755 -index 0000000..cf6ce40 +diff --git a/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/fortran_main015.f90 b/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/fortran_main015.f90 +new file mode 100644 +index 0000000..84d3954 --- /dev/null -+++ b/test/interoperability_with_c/004_fortran_call_c_scalar_struct/fortran_main015.f90 -@@ -0,0 +1,17 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type int_fast8_t without iso_c_binding ++++ b/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/fortran_main015.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the scalar type and the scalar type is ++! int_fast8_t with bindc +! +program main -+ type, bind(c) :: t -+ integer(1) :: x = -128 -+ integer(1) :: y = 127 -+ end type t -+ type(t) :: my_t ++ integer(1) :: my_x = 1 + interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a ++ subroutine c_func(b) bind(c, name = "c_func_") ++ integer(1) :: b + end + end interface -+ call c_func(my_t) ++ call c_func(my_x) +end -diff --git a/test/interoperability_with_c/004_fortran_call_c_scalar_struct/fortran_main016.f90 b/test/interoperability_with_c/004_fortran_call_c_scalar_struct/fortran_main016.f90 -new file mode 100755 -index 0000000..42ee76b +diff --git a/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/fortran_main016.f90 b/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/fortran_main016.f90 +new file mode 100644 +index 0000000..8d848d3 --- /dev/null -+++ b/test/interoperability_with_c/004_fortran_call_c_scalar_struct/fortran_main016.f90 -@@ -0,0 +1,17 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type int_fast16_t without iso_c_binding ++++ b/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/fortran_main016.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the scalar type and the scalar type is ++! int_fast_16_t with bindc +! +program main -+ type, bind(c) :: t -+ integer(8) :: x = -32768 -+ integer(8) :: y = 32767 -+ end type t -+ type(t) :: my_t ++ integer(8) :: my_x = 1 + interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a ++ subroutine c_func(b) bind(c, name = "c_func_") ++ integer(8) :: b + end + end interface -+ call c_func(my_t) ++ call c_func(my_x) +end -diff --git a/test/interoperability_with_c/004_fortran_call_c_scalar_struct/fortran_main017.f90 b/test/interoperability_with_c/004_fortran_call_c_scalar_struct/fortran_main017.f90 -new file mode 100755 -index 0000000..875933c +diff --git a/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/fortran_main017.f90 b/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/fortran_main017.f90 +new file mode 100644 +index 0000000..b62653c --- /dev/null -+++ b/test/interoperability_with_c/004_fortran_call_c_scalar_struct/fortran_main017.f90 -@@ -0,0 +1,17 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type int_fast32_t without iso_c_binding ++++ b/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/fortran_main017.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the scalar type and the scalar type is ++! int_fast32_t with bindc +! +program main -+ type, bind(c) :: t -+ integer(8) :: x = -2147483647 -+ integer(8) :: y = 2147483647 -+ end type t -+ type(t) :: my_t ++ integer(8) :: my_x = 1 + interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a ++ subroutine c_func(b) bind(c, name = "c_func_") ++ integer(8) :: b + end + end interface -+ call c_func(my_t) ++ call c_func(my_x) +end -diff --git a/test/interoperability_with_c/004_fortran_call_c_scalar_struct/fortran_main018.f90 b/test/interoperability_with_c/004_fortran_call_c_scalar_struct/fortran_main018.f90 -new file mode 100755 -index 0000000..82a9960 +diff --git a/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/fortran_main018.f90 b/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/fortran_main018.f90 +new file mode 100644 +index 0000000..5343c78 --- /dev/null -+++ b/test/interoperability_with_c/004_fortran_call_c_scalar_struct/fortran_main018.f90 -@@ -0,0 +1,17 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type int_fast64_t without iso_c_binding ++++ b/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/fortran_main018.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the scalar type and the scalar type is ++! int_fast64_t with bindc +! +program main -+ type, bind(c) :: t -+ integer(8) :: x = -9223372036854775807 -+ integer(8) :: y = 9223372036854775807 -+ end type t -+ type(t) :: my_t ++ integer(8) :: my_x = 1 + interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a ++ subroutine c_func(b) bind(c, name = "c_func_") ++ integer(8) :: b + end + end interface -+ call c_func(my_t) ++ call c_func(my_x) +end -diff --git a/test/interoperability_with_c/004_fortran_call_c_scalar_struct/fortran_main019.f90 b/test/interoperability_with_c/004_fortran_call_c_scalar_struct/fortran_main019.f90 -new file mode 100755 -index 0000000..ec188ae +diff --git a/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/fortran_main019.f90 b/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/fortran_main019.f90 +new file mode 100644 +index 0000000..ace3d4e --- /dev/null -+++ b/test/interoperability_with_c/004_fortran_call_c_scalar_struct/fortran_main019.f90 -@@ -0,0 +1,17 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type intmax_t without iso_c_binding ++++ b/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/fortran_main019.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the scalar type and the scalar type is ++! intmax_t with bindc +! +program main -+ type, bind(c) :: t -+ integer(8) :: x = -9223372036854775807 -+ integer(8) :: y = 9223372036854775807 -+ end type t -+ type(t) :: my_t ++ integer(8) :: my_x = 1 + interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a ++ subroutine c_func(b) bind(c, name = "c_func_") ++ integer(8) :: b + end + end interface -+ call c_func(my_t) ++ call c_func(my_x) +end -diff --git a/test/interoperability_with_c/004_fortran_call_c_scalar_struct/fortran_main020.f90 b/test/interoperability_with_c/004_fortran_call_c_scalar_struct/fortran_main020.f90 -new file mode 100755 -index 0000000..a8fa89b +diff --git a/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/fortran_main020.f90 b/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/fortran_main020.f90 +new file mode 100644 +index 0000000..9c936f7 --- /dev/null -+++ b/test/interoperability_with_c/004_fortran_call_c_scalar_struct/fortran_main020.f90 -@@ -0,0 +1,17 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type intptr_t without iso_c_binding ++++ b/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/fortran_main020.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the scalar type and the scalar type is ++! intptr_t with bindc +! +program main -+ type, bind(c) :: t -+ integer(8) :: x = -9223372036854775807 -+ integer(8) :: y = 9223372036854775807 -+ end type t -+ type(t) :: my_t ++ integer(8) :: my_x = 1 + interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a ++ subroutine c_func(b) bind(c, name = "c_func_") ++ integer(8) :: b + end + end interface -+ call c_func(my_t) ++ call c_func(my_x) +end -diff --git a/test/interoperability_with_c/004_fortran_call_c_scalar_struct/fortran_main021.f90 b/test/interoperability_with_c/004_fortran_call_c_scalar_struct/fortran_main021.f90 -new file mode 100755 -index 0000000..19df542 +diff --git a/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/fortran_main021.f90 b/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/fortran_main021.f90 +new file mode 100644 +index 0000000..30f8860 --- /dev/null -+++ b/test/interoperability_with_c/004_fortran_call_c_scalar_struct/fortran_main021.f90 -@@ -0,0 +1,17 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type float without iso_c_binding ++++ b/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/fortran_main021.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the scalar type and the scalar type is float ++! with bindc +! +program main -+ type, bind(c) :: t -+ real(4) :: x = 3.14 -+ real(4) :: y = 12345678.7654321 -+ end type t -+ type(t) :: my_t ++ real(4) :: my_x = 3.1415926535 + interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a ++ subroutine c_func(b) bind(c, name = "c_func_") ++ real(4) :: b + end + end interface -+ call c_func(my_t) ++ call c_func(my_x) +end -diff --git a/test/interoperability_with_c/004_fortran_call_c_scalar_struct/fortran_main022.f90 b/test/interoperability_with_c/004_fortran_call_c_scalar_struct/fortran_main022.f90 -new file mode 100755 -index 0000000..52269a7 +diff --git a/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/fortran_main022.f90 b/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/fortran_main022.f90 +new file mode 100644 +index 0000000..bb30edf --- /dev/null -+++ b/test/interoperability_with_c/004_fortran_call_c_scalar_struct/fortran_main022.f90 -@@ -0,0 +1,17 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type double without iso_c_binding ++++ b/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/fortran_main022.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the scalar type and the scalar type is double ++! with bindc +! +program main -+ type, bind(c) :: t -+ real(8) :: x = 3.14159265358979626 -+ real(8) :: y = 12345678.7654321 -+ end type t -+ type(t) :: my_t ++ real(8) :: my_x = 3.14159265358979 + interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a ++ subroutine c_func(b) bind(c, name = "c_func_") ++ real(8) :: b + end + end interface -+ call c_func(my_t) ++ call c_func(my_x) +end -diff --git a/test/interoperability_with_c/004_fortran_call_c_scalar_struct/fortran_main023.f90 b/test/interoperability_with_c/004_fortran_call_c_scalar_struct/fortran_main023.f90 -new file mode 100755 -index 0000000..63cc169 +diff --git a/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/fortran_main023.f90 b/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/fortran_main023.f90 +new file mode 100644 +index 0000000..ddc85c4 --- /dev/null -+++ b/test/interoperability_with_c/004_fortran_call_c_scalar_struct/fortran_main023.f90 -@@ -0,0 +1,18 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type long double without iso_c_binding ++++ b/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/fortran_main023.f90 +@@ -0,0 +1,14 @@ ++! Test fortran call c for the scalar type and the scalar type is ++! long double with bindc +! +program main + integer, parameter :: K = selected_real_kind(16) -+ type, bind(c) :: t -+ real(K) :: x = 3.14159265358979626 -+ real(K) :: y = 12345678.7654321 -+ end type t -+ type(t) :: my_t ++ real(K) :: my_x = 3.14159265358979 + interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a ++ subroutine c_func(b) bind(c, name = "c_func_") ++ integer, parameter :: K = selected_real_kind(16) ++ real(K) :: b + end + end interface -+ call c_func(my_t) ++ call c_func(my_x) +end -diff --git a/test/interoperability_with_c/004_fortran_call_c_scalar_struct/fortran_main024.f90 b/test/interoperability_with_c/004_fortran_call_c_scalar_struct/fortran_main024.f90 -new file mode 100755 -index 0000000..499c66a +diff --git a/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/fortran_main024.f90 b/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/fortran_main024.f90 +new file mode 100644 +index 0000000..298dc40 --- /dev/null -+++ b/test/interoperability_with_c/004_fortran_call_c_scalar_struct/fortran_main024.f90 -@@ -0,0 +1,17 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type float _Complex without iso_c_binding ++++ b/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/fortran_main024.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the scalar type and the scalar type is ++! float _Complex with bindc +! +program main -+ type, bind(c) :: t -+ complex(4) :: x = (-3, 1) -+ complex(4) :: y = (3, 1) -+ end type t -+ type(t) :: my_t ++ complex(4) :: my_x = (-12345678.7654321, 1) + interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a ++ subroutine c_func(b) bind(c, name = "c_func_") ++ complex(4) :: b + end + end interface -+ call c_func(my_t) ++ call c_func(my_x) +end -diff --git a/test/interoperability_with_c/004_fortran_call_c_scalar_struct/fortran_main025.f90 b/test/interoperability_with_c/004_fortran_call_c_scalar_struct/fortran_main025.f90 -new file mode 100755 -index 0000000..e90cd94 +diff --git a/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/fortran_main025.f90 b/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/fortran_main025.f90 +new file mode 100644 +index 0000000..270a89b --- /dev/null -+++ b/test/interoperability_with_c/004_fortran_call_c_scalar_struct/fortran_main025.f90 -@@ -0,0 +1,17 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type double _Complex without iso_c_binding ++++ b/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/fortran_main025.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the scalar type and the scalar type is ++! double _Complex with bindc +! +program main -+ type, bind(c) :: t -+ complex(8) :: x = (-3, 1) -+ complex(8) :: y = (3, 1) -+ end type t -+ type(t) :: my_t ++ complex(8) :: my_x = (-3.14159265358979, 1) + interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a ++ subroutine c_func(b) bind(c, name = "c_func_") ++ complex(8) :: b + end + end interface -+ call c_func(my_t) ++ call c_func(my_x) +end -diff --git a/test/interoperability_with_c/004_fortran_call_c_scalar_struct/fortran_main026.f90 b/test/interoperability_with_c/004_fortran_call_c_scalar_struct/fortran_main026.f90 -new file mode 100755 -index 0000000..aead29b +diff --git a/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/fortran_main026.f90 b/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/fortran_main026.f90 +new file mode 100644 +index 0000000..23755fe --- /dev/null -+++ b/test/interoperability_with_c/004_fortran_call_c_scalar_struct/fortran_main026.f90 -@@ -0,0 +1,19 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type long double _Complex without -+! iso_c_binding ++++ b/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/fortran_main026.f90 +@@ -0,0 +1,14 @@ ++! Test fortran call c for the scalar type and the scalar type is ++! long double _Complex with bindc +! +program main + integer, parameter :: K = selected_real_kind(16) -+ type, bind(c) :: t -+ complex(K) :: x = (-3.1415926, 1.654) -+ complex(K) :: y = (3, 1) -+ end type t -+ type(t) :: my_t ++ complex(K) :: my_x = (-3.14159265358979, 1) + interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a ++ subroutine c_func(b) bind(c, name = "c_func_") ++ integer, parameter :: K = selected_real_kind(16) ++ complex(K) :: b + end + end interface -+ call c_func(my_t) ++ call c_func(my_x) +end -diff --git a/test/interoperability_with_c/004_fortran_call_c_scalar_struct/fortran_main027.f90 b/test/interoperability_with_c/004_fortran_call_c_scalar_struct/fortran_main027.f90 -new file mode 100755 -index 0000000..de0a887 +diff --git a/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/fortran_main027.f90 b/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/fortran_main027.f90 +new file mode 100644 +index 0000000..207f386 --- /dev/null -+++ b/test/interoperability_with_c/004_fortran_call_c_scalar_struct/fortran_main027.f90 -@@ -0,0 +1,17 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type bool without iso_c_binding ++++ b/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/fortran_main027.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the scalar type and the scalar type is _Bool ++! with bindc +! +program main -+ type, bind(c) :: t -+ logical(1) :: x = .TRUE. -+ logical(1) :: y = .FALSE. -+ end type t -+ type(t) :: my_t ++ logical(1) :: my_x = .FALSE. + interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a ++ subroutine c_func(b) bind(c, name = "c_func_") ++ logical(1) :: b + end + end interface -+ call c_func(my_t) ++ call c_func(my_x) +end -diff --git a/test/interoperability_with_c/004_fortran_call_c_scalar_struct/fortran_main028.f90 b/test/interoperability_with_c/004_fortran_call_c_scalar_struct/fortran_main028.f90 -new file mode 100755 -index 0000000..b4319ed +diff --git a/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/fortran_main028.f90 b/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/fortran_main028.f90 +new file mode 100644 +index 0000000..19ab3a6 --- /dev/null -+++ b/test/interoperability_with_c/004_fortran_call_c_scalar_struct/fortran_main028.f90 -@@ -0,0 +1,17 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type char without iso_c_binding ++++ b/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/fortran_main028.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the scalar type and the scalar type is char ++! with bindc +! +program main -+ type, bind(c) :: t -+ character(1) :: x = 'b' -+ character(1) :: y = 'c' -+ end type t -+ type(t) :: my_t ++ character(1) :: my_x = 'a' + interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a ++ subroutine c_func(b) bind(c, name = "c_func_") ++ character(1) :: b + end + end interface -+ call c_func(my_t) ++ call c_func(my_x) +end -diff --git a/test/interoperability_with_c/004_fortran_call_c_scalar_struct/run.sh b/test/interoperability_with_c/004_fortran_call_c_scalar_struct/run.sh +diff --git a/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/run.sh b/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/run.sh new file mode 100644 -index 0000000..632b582 +index 0000000..b865403 --- /dev/null -+++ b/test/interoperability_with_c/004_fortran_call_c_scalar_struct/run.sh -@@ -0,0 +1,17 @@ ++++ b/test/interoperability_with_c_fortran_call_c/004_fortran_call_c_scalar_bindc/run.sh +@@ -0,0 +1,16 @@ +for i in {001..028} +do +echo "------- test $i ------." @@ -3630,838 +3373,822 @@ index 0000000..632b582 +./a.out +rm *.o a.out +done -+ -diff --git a/test/interoperability_with_c/005_fortran_call_c_array/c_func001.c b/test/interoperability_with_c/005_fortran_call_c_array/c_func001.c +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/c_func001.c b/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/c_func001.c new file mode 100644 -index 0000000..c7cf73f +index 0000000..6b34fe7 --- /dev/null -+++ b/test/interoperability_with_c/005_fortran_call_c_array/c_func001.c -@@ -0,0 +1,5 @@ ++++ b/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/c_func001.c +@@ -0,0 +1,4 @@ +#include -+void c_func_(int *a) { -+ printf("%d\n", a[0]); -+ printf("%d\n", a[1]); ++void c_func_(int a) { ++ printf("%d\n", a); +} -diff --git a/test/interoperability_with_c/005_fortran_call_c_array/c_func002.c b/test/interoperability_with_c/005_fortran_call_c_array/c_func002.c +diff --git a/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/c_func002.c b/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/c_func002.c new file mode 100644 -index 0000000..010cdf7 +index 0000000..0a82fd6 --- /dev/null -+++ b/test/interoperability_with_c/005_fortran_call_c_array/c_func002.c -@@ -0,0 +1,6 @@ ++++ b/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/c_func002.c +@@ -0,0 +1,5 @@ +#include +#include -+void c_func_(short *a) { -+ printf("%hd\n", a[0]); -+ printf("%hd\n", a[1]); ++void c_func_(short a) { ++ printf("%hd\n", a); +} -diff --git a/test/interoperability_with_c/005_fortran_call_c_array/c_func003.c b/test/interoperability_with_c/005_fortran_call_c_array/c_func003.c +diff --git a/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/c_func003.c b/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/c_func003.c new file mode 100644 -index 0000000..5e69081 +index 0000000..e945b70 --- /dev/null -+++ b/test/interoperability_with_c/005_fortran_call_c_array/c_func003.c -@@ -0,0 +1,6 @@ ++++ b/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/c_func003.c +@@ -0,0 +1,5 @@ +#include +#include -+void c_func_(long *a) { -+ printf("%ld\n", a[0]); -+ printf("%ld\n", a[1]); ++void c_func_(long a) { ++ printf("%ld\n", a); +} -diff --git a/test/interoperability_with_c/005_fortran_call_c_array/c_func004.c b/test/interoperability_with_c/005_fortran_call_c_array/c_func004.c +diff --git a/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/c_func004.c b/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/c_func004.c new file mode 100644 -index 0000000..3f74c8e +index 0000000..6d5f734 --- /dev/null -+++ b/test/interoperability_with_c/005_fortran_call_c_array/c_func004.c -@@ -0,0 +1,6 @@ ++++ b/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/c_func004.c +@@ -0,0 +1,5 @@ +#include +#include -+void c_func_(long long *a) { -+ printf("%lld\n", a[0]); -+ printf("%lld\n", a[1]); ++void c_func_(long long a) { ++ printf("%lld\n", a); +} -diff --git a/test/interoperability_with_c/005_fortran_call_c_array/c_func005.c b/test/interoperability_with_c/005_fortran_call_c_array/c_func005.c +diff --git a/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/c_func005.c b/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/c_func005.c new file mode 100644 -index 0000000..77794d4 +index 0000000..aa46418 --- /dev/null -+++ b/test/interoperability_with_c/005_fortran_call_c_array/c_func005.c -@@ -0,0 +1,5 @@ ++++ b/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/c_func005.c +@@ -0,0 +1,4 @@ +#include -+void c_func_(signed char *a) { -+ printf("%c\n", a[0]); -+ printf("%c\n", a[1]); ++void c_func_(signed char a) { ++ printf("%c\n", a); +} -diff --git a/test/interoperability_with_c/005_fortran_call_c_array/c_func006.c b/test/interoperability_with_c/005_fortran_call_c_array/c_func006.c +diff --git a/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/c_func006.c b/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/c_func006.c new file mode 100644 -index 0000000..27c475f +index 0000000..d78d3d5 --- /dev/null -+++ b/test/interoperability_with_c/005_fortran_call_c_array/c_func006.c -@@ -0,0 +1,6 @@ ++++ b/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/c_func006.c +@@ -0,0 +1,5 @@ +#include +#include -+void c_func_(size_t *a) { -+ printf("%ld\n", a[0]); -+ printf("%ld\n", a[1]); ++void c_func_(size_t a) { ++ printf("%ld\n", a); +} -diff --git a/test/interoperability_with_c/005_fortran_call_c_array/c_func007.c b/test/interoperability_with_c/005_fortran_call_c_array/c_func007.c +diff --git a/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/c_func007.c b/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/c_func007.c new file mode 100644 -index 0000000..f7c4384 +index 0000000..2e08462 --- /dev/null -+++ b/test/interoperability_with_c/005_fortran_call_c_array/c_func007.c -@@ -0,0 +1,6 @@ ++++ b/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/c_func007.c +@@ -0,0 +1,5 @@ +#include +#include -+void c_func_(int8_t *a) { -+ printf("%hhd\n", a[0]); -+ printf("%hhd\n", a[1]); ++void c_func_(int8_t a) { ++ printf("%hhd\n", a); +} -diff --git a/test/interoperability_with_c/005_fortran_call_c_array/c_func008.c b/test/interoperability_with_c/005_fortran_call_c_array/c_func008.c +diff --git a/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/c_func008.c b/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/c_func008.c new file mode 100644 -index 0000000..e29971f +index 0000000..9b10264 --- /dev/null -+++ b/test/interoperability_with_c/005_fortran_call_c_array/c_func008.c -@@ -0,0 +1,6 @@ ++++ b/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/c_func008.c +@@ -0,0 +1,5 @@ +#include +#include -+void c_func_(int16_t *a) { -+ printf("%hd\n", a[0]); -+ printf("%hd\n", a[1]); ++void c_func_(int16_t a) { ++ printf("%hd\n", a); +} -diff --git a/test/interoperability_with_c/005_fortran_call_c_array/c_func009.c b/test/interoperability_with_c/005_fortran_call_c_array/c_func009.c +diff --git a/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/c_func009.c b/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/c_func009.c new file mode 100644 -index 0000000..3b84c1a +index 0000000..7ed8d51 --- /dev/null -+++ b/test/interoperability_with_c/005_fortran_call_c_array/c_func009.c -@@ -0,0 +1,6 @@ ++++ b/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/c_func009.c +@@ -0,0 +1,5 @@ +#include +#include -+void c_func_(int32_t *a) { -+ printf("%d\n", a[0]); -+ printf("%d\n", a[1]); ++void c_func_(int32_t a) { ++ printf("%d\n", a); +} -diff --git a/test/interoperability_with_c/005_fortran_call_c_array/c_func010.c b/test/interoperability_with_c/005_fortran_call_c_array/c_func010.c +diff --git a/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/c_func010.c b/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/c_func010.c new file mode 100644 -index 0000000..11ca3e1 +index 0000000..426f6ae --- /dev/null -+++ b/test/interoperability_with_c/005_fortran_call_c_array/c_func010.c -@@ -0,0 +1,6 @@ ++++ b/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/c_func010.c +@@ -0,0 +1,5 @@ +#include +#include -+void c_func_(int64_t *a) { -+ printf("%ld\n", a[0]); -+ printf("%ld\n", a[1]); ++void c_func_(int64_t a) { ++ printf("%ld\n", a); +} -diff --git a/test/interoperability_with_c/005_fortran_call_c_array/c_func011.c b/test/interoperability_with_c/005_fortran_call_c_array/c_func011.c +diff --git a/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/c_func011.c b/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/c_func011.c new file mode 100644 -index 0000000..f830d74 +index 0000000..660f33e --- /dev/null -+++ b/test/interoperability_with_c/005_fortran_call_c_array/c_func011.c -@@ -0,0 +1,6 @@ ++++ b/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/c_func011.c +@@ -0,0 +1,5 @@ +#include +#include -+void c_func_(int_least8_t *a) { -+ printf("%hhd\n", a[0]); -+ printf("%hhd\n", a[1]); ++void c_func_(int_least8_t a) { ++ printf("%hhd\n", a); +} -diff --git a/test/interoperability_with_c/005_fortran_call_c_array/c_func012.c b/test/interoperability_with_c/005_fortran_call_c_array/c_func012.c +diff --git a/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/c_func012.c b/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/c_func012.c new file mode 100644 -index 0000000..6ffd7e3 +index 0000000..abf7d13 --- /dev/null -+++ b/test/interoperability_with_c/005_fortran_call_c_array/c_func012.c -@@ -0,0 +1,6 @@ ++++ b/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/c_func012.c +@@ -0,0 +1,5 @@ +#include +#include -+void c_func_(int_least16_t *a) { -+ printf("%hd\n", a[0]); -+ printf("%hd\n", a[1]); ++void c_func_(int_least16_t a) { ++ printf("%hd\n", a); +} -diff --git a/test/interoperability_with_c/005_fortran_call_c_array/c_func013.c b/test/interoperability_with_c/005_fortran_call_c_array/c_func013.c +diff --git a/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/c_func013.c b/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/c_func013.c new file mode 100644 -index 0000000..4b367cb +index 0000000..638f7d0 --- /dev/null -+++ b/test/interoperability_with_c/005_fortran_call_c_array/c_func013.c -@@ -0,0 +1,6 @@ ++++ b/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/c_func013.c +@@ -0,0 +1,5 @@ +#include +#include -+void c_func_(int_least32_t *a) { -+ printf("%d\n", a[0]); -+ printf("%d\n", a[1]); ++void c_func_(int_least32_t a) { ++ printf("%d\n", a); +} -diff --git a/test/interoperability_with_c/005_fortran_call_c_array/c_func014.c b/test/interoperability_with_c/005_fortran_call_c_array/c_func014.c +diff --git a/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/c_func014.c b/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/c_func014.c new file mode 100644 -index 0000000..6b2d5b3 +index 0000000..c0401de --- /dev/null -+++ b/test/interoperability_with_c/005_fortran_call_c_array/c_func014.c -@@ -0,0 +1,6 @@ ++++ b/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/c_func014.c +@@ -0,0 +1,5 @@ +#include +#include -+void c_func_(int_least64_t *a) { -+ printf("%ld\n", a[0]); -+ printf("%ld\n", a[1]); ++void c_func_(int_least64_t a) { ++ printf("%ld\n", a); +} -diff --git a/test/interoperability_with_c/005_fortran_call_c_array/c_func015.c b/test/interoperability_with_c/005_fortran_call_c_array/c_func015.c +diff --git a/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/c_func015.c b/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/c_func015.c new file mode 100644 -index 0000000..81d223a +index 0000000..f7b7caa --- /dev/null -+++ b/test/interoperability_with_c/005_fortran_call_c_array/c_func015.c -@@ -0,0 +1,6 @@ ++++ b/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/c_func015.c +@@ -0,0 +1,5 @@ +#include +#include -+void c_func_(int_fast8_t *a) { -+ printf("%hhd\n", a[0]); -+ printf("%hhd\n", a[1]); ++void c_func_(int_fast8_t a) { ++ printf("%hhd\n", a); +} -diff --git a/test/interoperability_with_c/005_fortran_call_c_array/c_func016.c b/test/interoperability_with_c/005_fortran_call_c_array/c_func016.c +diff --git a/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/c_func016.c b/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/c_func016.c new file mode 100644 -index 0000000..297be3a +index 0000000..ef70772 --- /dev/null -+++ b/test/interoperability_with_c/005_fortran_call_c_array/c_func016.c -@@ -0,0 +1,6 @@ ++++ b/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/c_func016.c +@@ -0,0 +1,5 @@ +#include +#include -+void c_func_(int_fast16_t *a) { -+ printf("%ld\n", a[0]); -+ printf("%ld\n", a[1]); ++void c_func_(int_fast16_t a) { ++ printf("%ld\n", a); +} -diff --git a/test/interoperability_with_c/005_fortran_call_c_array/c_func017.c b/test/interoperability_with_c/005_fortran_call_c_array/c_func017.c +diff --git a/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/c_func017.c b/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/c_func017.c new file mode 100644 -index 0000000..8eb5818 +index 0000000..86e6cd6 --- /dev/null -+++ b/test/interoperability_with_c/005_fortran_call_c_array/c_func017.c -@@ -0,0 +1,6 @@ ++++ b/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/c_func017.c +@@ -0,0 +1,5 @@ +#include +#include -+void c_func_(int_fast32_t *a) { -+ printf("%ld\n", a[0]); -+ printf("%ld\n", a[1]); ++void c_func_(int_fast32_t a) { ++ printf("%ld\n", a); +} -diff --git a/test/interoperability_with_c/005_fortran_call_c_array/c_func018.c b/test/interoperability_with_c/005_fortran_call_c_array/c_func018.c +diff --git a/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/c_func018.c b/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/c_func018.c new file mode 100644 -index 0000000..030b1f7 +index 0000000..c8ae092 --- /dev/null -+++ b/test/interoperability_with_c/005_fortran_call_c_array/c_func018.c -@@ -0,0 +1,6 @@ ++++ b/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/c_func018.c +@@ -0,0 +1,5 @@ +#include +#include -+void c_func_(int_fast64_t *a) { -+ printf("%ld\n", a[0]); -+ printf("%ld\n", a[1]); ++void c_func_(int_fast64_t a) { ++ printf("%ld\n", a); +} -diff --git a/test/interoperability_with_c/005_fortran_call_c_array/c_func019.c b/test/interoperability_with_c/005_fortran_call_c_array/c_func019.c +diff --git a/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/c_func019.c b/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/c_func019.c new file mode 100644 -index 0000000..babfc75 +index 0000000..0b0fa15 --- /dev/null -+++ b/test/interoperability_with_c/005_fortran_call_c_array/c_func019.c -@@ -0,0 +1,6 @@ ++++ b/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/c_func019.c +@@ -0,0 +1,5 @@ +#include +#include -+void c_func_(intmax_t *a) { -+ printf("%ld\n", a[0]); -+ printf("%ld\n", a[1]); ++void c_func_(intmax_t a) { ++ printf("%ld\n", a); +} -diff --git a/test/interoperability_with_c/005_fortran_call_c_array/c_func020.c b/test/interoperability_with_c/005_fortran_call_c_array/c_func020.c +diff --git a/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/c_func020.c b/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/c_func020.c new file mode 100644 -index 0000000..26c7726 +index 0000000..bde599d --- /dev/null -+++ b/test/interoperability_with_c/005_fortran_call_c_array/c_func020.c -@@ -0,0 +1,6 @@ ++++ b/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/c_func020.c +@@ -0,0 +1,5 @@ +#include +#include -+void c_func_(intptr_t *a) { -+ printf("%ld\n", a[0]); -+ printf("%ld\n", a[1]); ++void c_func_(intptr_t a) { ++ printf("%ld\n", a); +} -diff --git a/test/interoperability_with_c/005_fortran_call_c_array/c_func021.c b/test/interoperability_with_c/005_fortran_call_c_array/c_func021.c +diff --git a/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/c_func021.c b/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/c_func021.c new file mode 100644 -index 0000000..a73f11b +index 0000000..ae5bf11 --- /dev/null -+++ b/test/interoperability_with_c/005_fortran_call_c_array/c_func021.c -@@ -0,0 +1,5 @@ ++++ b/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/c_func021.c +@@ -0,0 +1,4 @@ +#include -+void c_func_(float *a) { -+ printf("%f\n", a[0]); -+ printf("%f\n", a[1]); ++void c_func_(float a) { ++ printf("%f\n", a); +} -diff --git a/test/interoperability_with_c/005_fortran_call_c_array/c_func022.c b/test/interoperability_with_c/005_fortran_call_c_array/c_func022.c +diff --git a/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/c_func022.c b/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/c_func022.c new file mode 100644 -index 0000000..688f3c0 +index 0000000..b3bdc55 --- /dev/null -+++ b/test/interoperability_with_c/005_fortran_call_c_array/c_func022.c -@@ -0,0 +1,5 @@ ++++ b/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/c_func022.c +@@ -0,0 +1,4 @@ +#include -+void c_func_(double *a) { -+ printf("%20lf\n", a[0]); -+ printf("%20lf\n", a[1]); ++void c_func_(double a) { ++ printf("%0.20lf\n", a); +} -diff --git a/test/interoperability_with_c/005_fortran_call_c_array/c_func023.c b/test/interoperability_with_c/005_fortran_call_c_array/c_func023.c +diff --git a/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/c_func023.c b/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/c_func023.c new file mode 100644 -index 0000000..af86ba3 +index 0000000..af99efc --- /dev/null -+++ b/test/interoperability_with_c/005_fortran_call_c_array/c_func023.c -@@ -0,0 +1,5 @@ ++++ b/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/c_func023.c +@@ -0,0 +1,4 @@ +#include -+void c_func_(long double *a) { -+ printf("%20Lf\n", a[0]); -+ printf("%20Lf\n", a[1]); ++void c_func_(long double a) { ++ printf("%0.20Lf\n", a); +} -diff --git a/test/interoperability_with_c/005_fortran_call_c_array/c_func024.c b/test/interoperability_with_c/005_fortran_call_c_array/c_func024.c +diff --git a/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/c_func024.c b/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/c_func024.c new file mode 100644 -index 0000000..1d34f02 +index 0000000..af69eac --- /dev/null -+++ b/test/interoperability_with_c/005_fortran_call_c_array/c_func024.c -@@ -0,0 +1,6 @@ ++++ b/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/c_func024.c +@@ -0,0 +1,5 @@ +#include +#include -+void c_func_(float _Complex *t) { -+ printf("%0.20f + %0.20fi\n", creal(t[0]), cimag(t[0])); -+ printf("%0.20f + %0.20fi\n", creal(t[1]), cimag(t[1])); ++void c_func_(float _Complex t) { ++ printf("%0.20f + %0.20fi\n", creal(t), cimag(t)); +} -diff --git a/test/interoperability_with_c/005_fortran_call_c_array/c_func025.c b/test/interoperability_with_c/005_fortran_call_c_array/c_func025.c +diff --git a/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/c_func025.c b/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/c_func025.c new file mode 100644 -index 0000000..12b9abb +index 0000000..55a85e9 --- /dev/null -+++ b/test/interoperability_with_c/005_fortran_call_c_array/c_func025.c -@@ -0,0 +1,6 @@ ++++ b/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/c_func025.c +@@ -0,0 +1,5 @@ +#include +#include -+void c_func_(double _Complex *t) { -+ printf("%20lf + %20lfi\n", creal(t[0]), cimag(t[0])); -+ printf("%20lf + %20lfi\n", creal(t[1]), cimag(t[1])); ++void c_func_(double _Complex t) { ++ printf("%0.20lf + %0.20lfi\n", creal(t), cimag(t)); +} -diff --git a/test/interoperability_with_c/005_fortran_call_c_array/c_func026.c b/test/interoperability_with_c/005_fortran_call_c_array/c_func026.c +diff --git a/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/c_func026.c b/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/c_func026.c new file mode 100644 -index 0000000..78011d4 +index 0000000..5b7017a --- /dev/null -+++ b/test/interoperability_with_c/005_fortran_call_c_array/c_func026.c -@@ -0,0 +1,6 @@ ++++ b/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/c_func026.c +@@ -0,0 +1,5 @@ +#include +#include -+void c_func_(long double _Complex *t) { -+ printf("%20f + %20fi\n", creal(t[0]), cimag(t[0])); -+ printf("%20f + %20fi\n", creal(t[1]), cimag(t[1])); ++void c_func_(long double _Complex t) { ++ printf("%0.20f + %0.20fi\n", creal(t), cimag(t)); +} -diff --git a/test/interoperability_with_c/005_fortran_call_c_array/c_func027.c b/test/interoperability_with_c/005_fortran_call_c_array/c_func027.c +diff --git a/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/c_func027.c b/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/c_func027.c new file mode 100644 -index 0000000..91a49b5 +index 0000000..ff95fd7 --- /dev/null -+++ b/test/interoperability_with_c/005_fortran_call_c_array/c_func027.c -@@ -0,0 +1,5 @@ ++++ b/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/c_func027.c +@@ -0,0 +1,4 @@ +#include -+void c_func_(_Bool *a) { -+ printf("%d\n", a[0]); -+ printf("%d\n", a[1]); ++void c_func_(_Bool a) { ++ printf("%d\n", a); +} -diff --git a/test/interoperability_with_c/005_fortran_call_c_array/c_func028.c b/test/interoperability_with_c/005_fortran_call_c_array/c_func028.c +diff --git a/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/c_func028.c b/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/c_func028.c new file mode 100644 -index 0000000..9335307 +index 0000000..b92caf7 --- /dev/null -+++ b/test/interoperability_with_c/005_fortran_call_c_array/c_func028.c -@@ -0,0 +1,5 @@ ++++ b/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/c_func028.c +@@ -0,0 +1,4 @@ +#include -+void c_func_(char *a) { -+ printf("%c\n", a[0]); -+ printf("%c\n", a[1]); ++void c_func_(char a) { ++ printf("%c\n", a); +} -diff --git a/test/interoperability_with_c/005_fortran_call_c_array/fortran_main001.f90 b/test/interoperability_with_c/005_fortran_call_c_array/fortran_main001.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/fortran_main001.f90 b/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/fortran_main001.f90 new file mode 100644 -index 0000000..6e1f16f +index 0000000..9b2b33f --- /dev/null -+++ b/test/interoperability_with_c/005_fortran_call_c_array/fortran_main001.f90 -@@ -0,0 +1,11 @@ -+! Test fortran call c for the array type and the array type is int ++++ b/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/fortran_main001.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the scalar type with value attribute and the ++! scalar type is int with bindc +! +program main -+ integer :: my_x(2) = 1 ++ integer :: my_x = 1 + interface -+ subroutine c_func(b) -+ integer :: b(2) ++ subroutine c_func(b) bind(c, name = "c_func_") ++ integer, value :: b + end + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/005_fortran_call_c_array/fortran_main002.f90 b/test/interoperability_with_c/005_fortran_call_c_array/fortran_main002.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/fortran_main002.f90 b/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/fortran_main002.f90 new file mode 100644 -index 0000000..50f36f6 +index 0000000..48736e1 --- /dev/null -+++ b/test/interoperability_with_c/005_fortran_call_c_array/fortran_main002.f90 -@@ -0,0 +1,11 @@ -+! Test fortran call c for the array type and the array type is short ++++ b/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/fortran_main002.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the scalar type with value attribute and the ++! scalar type is short with with bindc +! +program main -+ integer(2) :: my_x(2) = 1 ++ integer(2) :: my_x = 1 + interface -+ subroutine c_func(b) -+ integer(2) :: b(2) ++ subroutine c_func(b) bind(c, name = "c_func_") ++ integer(2), value :: b + end + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/005_fortran_call_c_array/fortran_main003.f90 b/test/interoperability_with_c/005_fortran_call_c_array/fortran_main003.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/fortran_main003.f90 b/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/fortran_main003.f90 new file mode 100644 -index 0000000..5109bc3 +index 0000000..feca432 --- /dev/null -+++ b/test/interoperability_with_c/005_fortran_call_c_array/fortran_main003.f90 -@@ -0,0 +1,11 @@ -+! Test fortran call c for the array type and the array type is long ++++ b/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/fortran_main003.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the scalar type with value attribute and the ++! scalar type is long with bindc +! +program main -+ integer(8) :: my_x(2) = 1 ++ integer(8) :: my_x = 1 + interface -+ subroutine c_func(b) -+ integer(8) :: b(2) ++ subroutine c_func(b) bind(c, name = "c_func_") ++ integer(8), value :: b + end + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/005_fortran_call_c_array/fortran_main004.f90 b/test/interoperability_with_c/005_fortran_call_c_array/fortran_main004.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/fortran_main004.f90 b/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/fortran_main004.f90 new file mode 100644 -index 0000000..a4e1bc6 +index 0000000..0926bd3 --- /dev/null -+++ b/test/interoperability_with_c/005_fortran_call_c_array/fortran_main004.f90 ++++ b/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/fortran_main004.f90 @@ -0,0 +1,12 @@ -+! Test fortran call c for the array type and the array type is -+! long long ++! Test fortran call c for the scalar type with value attribute and the ++! scalar type is long long with bindc +! +program main -+ integer(8) :: my_x(2) = 1 ++ integer(8) :: my_x = 1 + interface -+ subroutine c_func(b) -+ integer(8) :: b(2) ++ subroutine c_func(b) bind(c, name = "c_func_") ++ integer(8), value :: b + end + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/005_fortran_call_c_array/fortran_main005.f90 b/test/interoperability_with_c/005_fortran_call_c_array/fortran_main005.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/fortran_main005.f90 b/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/fortran_main005.f90 new file mode 100644 -index 0000000..6f52cca +index 0000000..8308cf7 --- /dev/null -+++ b/test/interoperability_with_c/005_fortran_call_c_array/fortran_main005.f90 ++++ b/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/fortran_main005.f90 @@ -0,0 +1,12 @@ -+! Test fortran call c for the array type and the array type is -+! signed char ++! Test fortran call c for the scalar type with value attribute and the ++! scalar type is signed char with bindc +! +program main -+ integer(1) :: my_x(2) = 65 ++ integer(1) :: my_x = 65 + interface -+ subroutine c_func(b) -+ integer(1) :: b(2) ++ subroutine c_func(b) bind(c, name = "c_func_") ++ integer(1), value :: b + end + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/005_fortran_call_c_array/fortran_main006.f90 b/test/interoperability_with_c/005_fortran_call_c_array/fortran_main006.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/fortran_main006.f90 b/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/fortran_main006.f90 new file mode 100644 -index 0000000..3505849 +index 0000000..ac3bda1 --- /dev/null -+++ b/test/interoperability_with_c/005_fortran_call_c_array/fortran_main006.f90 -@@ -0,0 +1,11 @@ -+! Test fortran call c for the array type and the array type is size_t ++++ b/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/fortran_main006.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the scalar type with value attribute and the ++! scalar type is size_t with bindc +! +program main -+ integer(8) :: my_x(2) = 3 ++ integer(8) :: my_x = 3 + interface -+ subroutine c_func(b) -+ integer(8) :: b(2) ++ subroutine c_func(b) bind(c, name = "c_func_") ++ integer(8), value :: b + end + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/005_fortran_call_c_array/fortran_main007.f90 b/test/interoperability_with_c/005_fortran_call_c_array/fortran_main007.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/fortran_main007.f90 b/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/fortran_main007.f90 new file mode 100644 -index 0000000..3ce82ad +index 0000000..e70a093 --- /dev/null -+++ b/test/interoperability_with_c/005_fortran_call_c_array/fortran_main007.f90 -@@ -0,0 +1,11 @@ -+! Test fortran call c for the array type and the array type is int8_t ++++ b/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/fortran_main007.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the scalar type with value attribute and the ++! scalar type is int8_t with bindc +! +program main -+ integer(1) :: my_x(2) = 1 ++ integer(1) :: my_x = 1 + interface -+ subroutine c_func(b) -+ integer(1) :: b(2) ++ subroutine c_func(b) bind(c, name = "c_func_") ++ integer(1), value :: b + end + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/005_fortran_call_c_array/fortran_main008.f90 b/test/interoperability_with_c/005_fortran_call_c_array/fortran_main008.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/fortran_main008.f90 b/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/fortran_main008.f90 new file mode 100644 -index 0000000..12a52ee +index 0000000..4e9554e --- /dev/null -+++ b/test/interoperability_with_c/005_fortran_call_c_array/fortran_main008.f90 -@@ -0,0 +1,11 @@ -+! Test fortran call c for the array type and the array type is int16_t ++++ b/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/fortran_main008.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the scalar type with value attribute and the ++! scalar type is int16_t with bindc +! +program main -+ integer(2) :: my_x(2) = 1 ++ integer(2) :: my_x = 1 + interface -+ subroutine c_func(b) -+ integer(2) :: b(2) ++ subroutine c_func(b) bind(c, name = "c_func_") ++ integer(2), value :: b + end + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/005_fortran_call_c_array/fortran_main009.f90 b/test/interoperability_with_c/005_fortran_call_c_array/fortran_main009.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/fortran_main009.f90 b/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/fortran_main009.f90 new file mode 100644 -index 0000000..139d7f9 +index 0000000..f1084a6 --- /dev/null -+++ b/test/interoperability_with_c/005_fortran_call_c_array/fortran_main009.f90 -@@ -0,0 +1,11 @@ -+! Test fortran call c for the array type and the array type is int32_t ++++ b/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/fortran_main009.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the scalar type with value attribute and the ++! scalar type is int32_t with bindc +! +program main -+ integer(4) :: my_x(2) = 1 ++ integer(4) :: my_x = 1 + interface -+ subroutine c_func(b) -+ integer(4) :: b(2) ++ subroutine c_func(b) bind(c, name = "c_func_") ++ integer(4), value :: b + end + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/005_fortran_call_c_array/fortran_main010.f90 b/test/interoperability_with_c/005_fortran_call_c_array/fortran_main010.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/fortran_main010.f90 b/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/fortran_main010.f90 new file mode 100644 -index 0000000..81859b7 +index 0000000..8d2ece3 --- /dev/null -+++ b/test/interoperability_with_c/005_fortran_call_c_array/fortran_main010.f90 -@@ -0,0 +1,11 @@ -+! Test fortran call c for the array type and the array type is int64_t ++++ b/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/fortran_main010.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the scalar type with value attribute and the ++! scalar type is int64_t with bindc +! +program main -+ integer(8) :: my_x(2) = 1 ++ integer(8) :: my_x = 1 + interface -+ subroutine c_func(b) -+ integer(8) :: b(2) ++ subroutine c_func(b) bind(c, name = "c_func_") ++ integer(8), value :: b + end + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/005_fortran_call_c_array/fortran_main011.f90 b/test/interoperability_with_c/005_fortran_call_c_array/fortran_main011.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/fortran_main011.f90 b/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/fortran_main011.f90 new file mode 100644 -index 0000000..cee5bab +index 0000000..cd82f35 --- /dev/null -+++ b/test/interoperability_with_c/005_fortran_call_c_array/fortran_main011.f90 ++++ b/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/fortran_main011.f90 @@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type and the scalar type is -+! int_least8_t ++! Test fortran call c for the scalar type with value attribute and the ++! scalar type is int_least8_t with bindc +! +program main -+ integer(1) :: my_x(2) = 1 ++ integer(1) :: my_x = 1 + interface -+ subroutine c_func(b) -+ integer(1) :: b(2) ++ subroutine c_func(b) bind(c, name = "c_func_") ++ integer(1), value :: b + end + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/005_fortran_call_c_array/fortran_main012.f90 b/test/interoperability_with_c/005_fortran_call_c_array/fortran_main012.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/fortran_main012.f90 b/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/fortran_main012.f90 new file mode 100644 -index 0000000..fd005f2 +index 0000000..00da761 --- /dev/null -+++ b/test/interoperability_with_c/005_fortran_call_c_array/fortran_main012.f90 ++++ b/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/fortran_main012.f90 @@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type and the scalar type is -+! int_least16_t ++! Test fortran call c for the scalar type with value attribute and the ++! scalar type is int_least16_t with bindc +! +program main -+ integer(2) :: my_x(2) = 1 ++ integer(2) :: my_x = 1 + interface -+ subroutine c_func(b) -+ integer(2) :: b(2) ++ subroutine c_func(b) bind(c, name = "c_func_") ++ integer(2), value :: b + end + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/005_fortran_call_c_array/fortran_main013.f90 b/test/interoperability_with_c/005_fortran_call_c_array/fortran_main013.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/fortran_main013.f90 b/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/fortran_main013.f90 new file mode 100644 -index 0000000..1fe884b +index 0000000..28b7535 --- /dev/null -+++ b/test/interoperability_with_c/005_fortran_call_c_array/fortran_main013.f90 ++++ b/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/fortran_main013.f90 @@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type and the scalar type is -+! int_least32_t ++! Test fortran call c for the scalar type with value attribute and the ++! scalar type is int_least32_t with bindc +! +program main -+ integer(4) :: my_x(2) = 1 ++ integer(4) :: my_x = 1 + interface -+ subroutine c_func(b) -+ integer(4) :: b(2) ++ subroutine c_func(b) bind(c, name = "c_func_") ++ integer(4), value :: b + end + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/005_fortran_call_c_array/fortran_main014.f90 b/test/interoperability_with_c/005_fortran_call_c_array/fortran_main014.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/fortran_main014.f90 b/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/fortran_main014.f90 new file mode 100644 -index 0000000..ada1c56 +index 0000000..6336001 --- /dev/null -+++ b/test/interoperability_with_c/005_fortran_call_c_array/fortran_main014.f90 ++++ b/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/fortran_main014.f90 @@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type and the scalar type is -+! int_least64_t ++! Test fortran call c for the scalar type with value attribute and the ++! scalar type is int_least64_t with bindc +! +program main -+ integer(8) :: my_x(2) = 1 ++ integer(8) :: my_x = 1 + interface -+ subroutine c_func(b) -+ integer(8) :: b(2) ++ subroutine c_func(b) bind(c, name = "c_func_") ++ integer(8), value :: b + end + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/005_fortran_call_c_array/fortran_main015.f90 b/test/interoperability_with_c/005_fortran_call_c_array/fortran_main015.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/fortran_main015.f90 b/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/fortran_main015.f90 new file mode 100644 -index 0000000..a025c8a +index 0000000..bcf23f1 --- /dev/null -+++ b/test/interoperability_with_c/005_fortran_call_c_array/fortran_main015.f90 ++++ b/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/fortran_main015.f90 @@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type and the scalar type is -+! int_fast8_t ++! Test fortran call c for the scalar type with value attribute and the ++! scalar type is int_fast8_t with bindc +! +program main -+ integer(1) :: my_x(2) = 1 ++ integer(1) :: my_x = 1 + interface -+ subroutine c_func(b) -+ integer(1) :: b(2) ++ subroutine c_func(b) bind(c, name = "c_func_") ++ integer(1), value :: b + end + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/005_fortran_call_c_array/fortran_main016.f90 b/test/interoperability_with_c/005_fortran_call_c_array/fortran_main016.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/fortran_main016.f90 b/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/fortran_main016.f90 new file mode 100644 -index 0000000..d6d3f63 +index 0000000..09b77c7 --- /dev/null -+++ b/test/interoperability_with_c/005_fortran_call_c_array/fortran_main016.f90 ++++ b/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/fortran_main016.f90 @@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type and the scalar type is -+! int_fast16_t ++! Test fortran call c for the scalar type with value attribute and the ++! scalar type is int_fast16_t with bindc +! +program main -+ integer(8) :: my_x(2) = 1 ++ integer(8) :: my_x = 1 + interface -+ subroutine c_func(b) -+ integer(8) :: b(2) ++ subroutine c_func(b) bind(c, name = "c_func_") ++ integer(8), value :: b + end + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/005_fortran_call_c_array/fortran_main017.f90 b/test/interoperability_with_c/005_fortran_call_c_array/fortran_main017.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/fortran_main017.f90 b/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/fortran_main017.f90 new file mode 100644 -index 0000000..851d06d +index 0000000..26c67eb --- /dev/null -+++ b/test/interoperability_with_c/005_fortran_call_c_array/fortran_main017.f90 ++++ b/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/fortran_main017.f90 @@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type and the scalar type is -+! int_fast32_t ++! Test fortran call c for the scalar type with value attribute and the ++! scalar type is int_fast32_t with bindc +! +program main -+ integer(8) :: my_x(2) = 1 ++ integer(8) :: my_x = 1 + interface -+ subroutine c_func(b) -+ integer(8) :: b(2) ++ subroutine c_func(b) bind(c, name = "c_func_") ++ integer(8), value :: b + end + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/005_fortran_call_c_array/fortran_main018.f90 b/test/interoperability_with_c/005_fortran_call_c_array/fortran_main018.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/fortran_main018.f90 b/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/fortran_main018.f90 new file mode 100644 -index 0000000..9b62610 +index 0000000..7d94f50 --- /dev/null -+++ b/test/interoperability_with_c/005_fortran_call_c_array/fortran_main018.f90 ++++ b/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/fortran_main018.f90 @@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type and the scalar type is -+! int_fast64_t ++! Test fortran call c for the scalar type with value attribute and the ++! scalar type is int_fast64_t with bindc +! +program main -+ integer(8) :: my_x(2) = 1 ++ integer(8) :: my_x = 1 + interface -+ subroutine c_func(b) -+ integer(8) :: b(2) ++ subroutine c_func(b) bind(c, name = "c_func_") ++ integer(8), value :: b + end + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/005_fortran_call_c_array/fortran_main019.f90 b/test/interoperability_with_c/005_fortran_call_c_array/fortran_main019.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/fortran_main019.f90 b/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/fortran_main019.f90 new file mode 100644 -index 0000000..41f77aa +index 0000000..d77ae94 --- /dev/null -+++ b/test/interoperability_with_c/005_fortran_call_c_array/fortran_main019.f90 ++++ b/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/fortran_main019.f90 @@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type and the scalar type is -+! intmax_t ++! Test fortran call c for the scalar type with value attribute and the ++! scalar type is intmax_t with bindc +! +program main -+ integer(8) :: my_x(2) = 1 ++ integer(8) :: my_x = 3 + interface -+ subroutine c_func(b) -+ integer(8) :: b(2) ++ subroutine c_func(b) bind(c, name = "c_func_") ++ integer(8), value :: b + end + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/005_fortran_call_c_array/fortran_main020.f90 b/test/interoperability_with_c/005_fortran_call_c_array/fortran_main020.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/fortran_main020.f90 b/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/fortran_main020.f90 new file mode 100644 -index 0000000..3a48805 +index 0000000..d4b887d --- /dev/null -+++ b/test/interoperability_with_c/005_fortran_call_c_array/fortran_main020.f90 ++++ b/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/fortran_main020.f90 @@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type and the scalar type is -+! intptr_t ++! Test fortran call c for the scalar type with value attribute and the ++! scalar type is intptr_t with bindc +! +program main -+ integer(8) :: my_x(2) = 1 ++ integer(8) :: my_x = 3 + interface -+ subroutine c_func(b) -+ integer(8) :: b(2) ++ subroutine c_func(b) bind(c, name = "c_func_") ++ integer(8), value :: b + end + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/005_fortran_call_c_array/fortran_main021.f90 b/test/interoperability_with_c/005_fortran_call_c_array/fortran_main021.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/fortran_main021.f90 b/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/fortran_main021.f90 new file mode 100644 -index 0000000..86a9cf5 +index 0000000..7c17ff0 --- /dev/null -+++ b/test/interoperability_with_c/005_fortran_call_c_array/fortran_main021.f90 -@@ -0,0 +1,11 @@ -+! Test fortran call c for the array type and the array type is float ++++ b/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/fortran_main021.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the scalar type with value attribute and the ++! scalar type is float with bindc +! +program main -+ real(4) :: my_x(2) = 12345678.7654321 ++ real(4) :: my_x = 12345678.7654321 + interface -+ subroutine c_func(b) -+ real(4) :: b(2) ++ subroutine c_func(b) bind(c, name = "c_func_") ++ real(4), value :: b + end + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/005_fortran_call_c_array/fortran_main022.f90 b/test/interoperability_with_c/005_fortran_call_c_array/fortran_main022.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/fortran_main022.f90 b/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/fortran_main022.f90 new file mode 100644 -index 0000000..ad70ca5 +index 0000000..713cc1a --- /dev/null -+++ b/test/interoperability_with_c/005_fortran_call_c_array/fortran_main022.f90 -@@ -0,0 +1,11 @@ -+! Test fortran call c for the array type and the array type is double ++++ b/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/fortran_main022.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the scalar type with value attribute and the ++! scalar type is double with bindc +! +program main -+ real(8) :: my_x(2) = 12345678.7654321 ++ real(8) :: my_x = 3.14159265358979 + interface -+ subroutine c_func(b) -+ real(8) :: b(2) ++ subroutine c_func(b) bind(c, name = "c_func_") ++ real(8), value :: b + end + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/005_fortran_call_c_array/fortran_main023.f90 b/test/interoperability_with_c/005_fortran_call_c_array/fortran_main023.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/fortran_main023.f90 b/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/fortran_main023.f90 new file mode 100644 -index 0000000..e44608b +index 0000000..48633c1 --- /dev/null -+++ b/test/interoperability_with_c/005_fortran_call_c_array/fortran_main023.f90 ++++ b/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/fortran_main023.f90 @@ -0,0 +1,14 @@ -+! Test fortran call c for the array type and the array type is -+! long double ++! Test fortran call c for the scalar type with value attribute and the ++! scalar type is long double with bindc +! +program main + integer, parameter :: K = selected_real_kind(16) -+ real(K) :: my_x(2) = 12345678.7654321 ++ real(K) :: my_x = 3.14159265358979 + interface -+ subroutine c_func(b) ++ subroutine c_func(b) bind(c, name = "c_func_") + integer, parameter :: K = selected_real_kind(16) -+ real(K) :: b(2) ++ real(K), value :: b + end + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/005_fortran_call_c_array/fortran_main024.f90 b/test/interoperability_with_c/005_fortran_call_c_array/fortran_main024.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/fortran_main024.f90 b/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/fortran_main024.f90 new file mode 100644 -index 0000000..19df422 +index 0000000..545bfed --- /dev/null -+++ b/test/interoperability_with_c/005_fortran_call_c_array/fortran_main024.f90 ++++ b/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/fortran_main024.f90 @@ -0,0 +1,12 @@ -+! Test fortran call c for the array type and the array type is -+! float _Complex ++! Test fortran call c for the scalar type with value attribute and the ++! scalar type is float _Complex with bindc +! +program main -+ complex(4) :: my_x(2) = (-3.14159265358979, 1) ++ complex(4) :: my_x = (-3.14159265358979, 1) + interface -+ subroutine c_func(b) -+ complex(4) :: b(2) ++ subroutine c_func(b) bind(c, name = "c_func_") ++ complex(4), value :: b + end + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/005_fortran_call_c_array/fortran_main025.f90 b/test/interoperability_with_c/005_fortran_call_c_array/fortran_main025.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/fortran_main025.f90 b/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/fortran_main025.f90 new file mode 100644 -index 0000000..b335a51 +index 0000000..b32f5af --- /dev/null -+++ b/test/interoperability_with_c/005_fortran_call_c_array/fortran_main025.f90 ++++ b/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/fortran_main025.f90 @@ -0,0 +1,12 @@ -+! Test fortran call c for the array type and the array type is -+! double _Complex ++! Test fortran call c for the scalar type with value attribute and the ++! scalar type is double _Complex with bindc +! +program main -+ complex(8) :: my_x(2) = (-3.14159265358979, 1) ++ complex(8) :: my_x = (-3.14159265358979, 1) + interface -+ subroutine c_func(b) -+ complex(8) :: b(2) ++ subroutine c_func(b) bind(c, name = "c_func_") ++ complex(8), value :: b + end + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/005_fortran_call_c_array/fortran_main026.f90 b/test/interoperability_with_c/005_fortran_call_c_array/fortran_main026.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/fortran_main026.f90 b/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/fortran_main026.f90 new file mode 100644 -index 0000000..7482ce8 +index 0000000..e04bf6d --- /dev/null -+++ b/test/interoperability_with_c/005_fortran_call_c_array/fortran_main026.f90 ++++ b/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/fortran_main026.f90 @@ -0,0 +1,14 @@ -+! Test fortran call c for the array type and the array type is -+! long double _Complex ++! Test fortran call c for the scalar type with value attribute and the ++! scalar type is long double _Complex with bindc +! +program main + integer, parameter :: K = selected_real_kind(16) -+ complex(K) :: my_x(2) = (-3.14159265358979, 1) ++ complex(K) :: my_x = (-3.14159265358979, 1) + interface -+ subroutine c_func(b) ++ subroutine c_func(b) bind(c, name = "c_func_") + integer, parameter :: K = selected_real_kind(16) -+ complex(K) :: b(2) ++ complex(K), value :: b + end + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/005_fortran_call_c_array/fortran_main027.f90 b/test/interoperability_with_c/005_fortran_call_c_array/fortran_main027.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/fortran_main027.f90 b/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/fortran_main027.f90 new file mode 100644 -index 0000000..d3249d1 +index 0000000..300b8fa --- /dev/null -+++ b/test/interoperability_with_c/005_fortran_call_c_array/fortran_main027.f90 -@@ -0,0 +1,11 @@ -+! Test fortran call c for the array type and the array type is _Bool ++++ b/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/fortran_main027.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the scalar type with value attribute and the ++! scalar type is _Bool with bindc +! +program main -+ logical(1) :: my_x(2) = .TRUE. ++ logical(1) :: my_x = .FALSE. + interface -+ subroutine c_func(b) -+ logical(1) :: b(2) ++ subroutine c_func(b) bind(c, name = "c_func_") ++ logical(1), value :: b + end + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/005_fortran_call_c_array/fortran_main028.f90 b/test/interoperability_with_c/005_fortran_call_c_array/fortran_main028.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/fortran_main028.f90 b/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/fortran_main028.f90 new file mode 100644 -index 0000000..a854e09 +index 0000000..0a53f44 --- /dev/null -+++ b/test/interoperability_with_c/005_fortran_call_c_array/fortran_main028.f90 -@@ -0,0 +1,11 @@ -+! Test fortran call c for the array type and the array type is char ++++ b/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/fortran_main028.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the scalar type with value attribute and the ++! scalar type is char with bindc +! +program main -+ character(1) :: my_x(2) = 'a' ++ character(1) :: my_x = 'a' + interface -+ subroutine c_func(b) -+ character(1) :: b(2) ++ subroutine c_func(b) bind(c, name = "c_func_") ++ character(1), value :: b + end + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/005_fortran_call_c_array/run.sh b/test/interoperability_with_c/005_fortran_call_c_array/run.sh +diff --git a/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/run.sh b/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/run.sh new file mode 100644 -index 0000000..632b582 +index 0000000..b865403 --- /dev/null -+++ b/test/interoperability_with_c/005_fortran_call_c_array/run.sh -@@ -0,0 +1,17 @@ ++++ b/test/interoperability_with_c_fortran_call_c/005_fortran_call_c_scalar_bindc_value/run.sh +@@ -0,0 +1,16 @@ +for i in {001..028} +do +echo "------- test $i ------." @@ -4478,23 +4205,23 @@ index 0000000..632b582 +./a.out +rm *.o a.out +done -+ -diff --git a/test/interoperability_with_c/006_fortran_call_c_array_bindc/c_func001.c b/test/interoperability_with_c/006_fortran_call_c_array_bindc/c_func001.c +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/c_func001.c b/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/c_func001.c new file mode 100644 index 0000000..c7cf73f --- /dev/null -+++ b/test/interoperability_with_c/006_fortran_call_c_array_bindc/c_func001.c ++++ b/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/c_func001.c @@ -0,0 +1,5 @@ +#include +void c_func_(int *a) { + printf("%d\n", a[0]); + printf("%d\n", a[1]); +} -diff --git a/test/interoperability_with_c/006_fortran_call_c_array_bindc/c_func002.c b/test/interoperability_with_c/006_fortran_call_c_array_bindc/c_func002.c +diff --git a/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/c_func002.c b/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/c_func002.c new file mode 100644 index 0000000..010cdf7 --- /dev/null -+++ b/test/interoperability_with_c/006_fortran_call_c_array_bindc/c_func002.c ++++ b/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/c_func002.c @@ -0,0 +1,6 @@ +#include +#include @@ -4502,11 +4229,11 @@ index 0000000..010cdf7 + printf("%hd\n", a[0]); + printf("%hd\n", a[1]); +} -diff --git a/test/interoperability_with_c/006_fortran_call_c_array_bindc/c_func003.c b/test/interoperability_with_c/006_fortran_call_c_array_bindc/c_func003.c +diff --git a/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/c_func003.c b/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/c_func003.c new file mode 100644 index 0000000..5e69081 --- /dev/null -+++ b/test/interoperability_with_c/006_fortran_call_c_array_bindc/c_func003.c ++++ b/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/c_func003.c @@ -0,0 +1,6 @@ +#include +#include @@ -4514,11 +4241,11 @@ index 0000000..5e69081 + printf("%ld\n", a[0]); + printf("%ld\n", a[1]); +} -diff --git a/test/interoperability_with_c/006_fortran_call_c_array_bindc/c_func004.c b/test/interoperability_with_c/006_fortran_call_c_array_bindc/c_func004.c +diff --git a/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/c_func004.c b/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/c_func004.c new file mode 100644 index 0000000..3f74c8e --- /dev/null -+++ b/test/interoperability_with_c/006_fortran_call_c_array_bindc/c_func004.c ++++ b/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/c_func004.c @@ -0,0 +1,6 @@ +#include +#include @@ -4526,22 +4253,22 @@ index 0000000..3f74c8e + printf("%lld\n", a[0]); + printf("%lld\n", a[1]); +} -diff --git a/test/interoperability_with_c/006_fortran_call_c_array_bindc/c_func005.c b/test/interoperability_with_c/006_fortran_call_c_array_bindc/c_func005.c +diff --git a/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/c_func005.c b/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/c_func005.c new file mode 100644 index 0000000..77794d4 --- /dev/null -+++ b/test/interoperability_with_c/006_fortran_call_c_array_bindc/c_func005.c ++++ b/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/c_func005.c @@ -0,0 +1,5 @@ +#include +void c_func_(signed char *a) { + printf("%c\n", a[0]); + printf("%c\n", a[1]); +} -diff --git a/test/interoperability_with_c/006_fortran_call_c_array_bindc/c_func006.c b/test/interoperability_with_c/006_fortran_call_c_array_bindc/c_func006.c +diff --git a/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/c_func006.c b/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/c_func006.c new file mode 100644 index 0000000..27c475f --- /dev/null -+++ b/test/interoperability_with_c/006_fortran_call_c_array_bindc/c_func006.c ++++ b/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/c_func006.c @@ -0,0 +1,6 @@ +#include +#include @@ -4549,11 +4276,11 @@ index 0000000..27c475f + printf("%ld\n", a[0]); + printf("%ld\n", a[1]); +} -diff --git a/test/interoperability_with_c/006_fortran_call_c_array_bindc/c_func007.c b/test/interoperability_with_c/006_fortran_call_c_array_bindc/c_func007.c +diff --git a/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/c_func007.c b/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/c_func007.c new file mode 100644 index 0000000..f7c4384 --- /dev/null -+++ b/test/interoperability_with_c/006_fortran_call_c_array_bindc/c_func007.c ++++ b/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/c_func007.c @@ -0,0 +1,6 @@ +#include +#include @@ -4561,11 +4288,11 @@ index 0000000..f7c4384 + printf("%hhd\n", a[0]); + printf("%hhd\n", a[1]); +} -diff --git a/test/interoperability_with_c/006_fortran_call_c_array_bindc/c_func008.c b/test/interoperability_with_c/006_fortran_call_c_array_bindc/c_func008.c +diff --git a/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/c_func008.c b/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/c_func008.c new file mode 100644 index 0000000..e29971f --- /dev/null -+++ b/test/interoperability_with_c/006_fortran_call_c_array_bindc/c_func008.c ++++ b/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/c_func008.c @@ -0,0 +1,6 @@ +#include +#include @@ -4573,11 +4300,11 @@ index 0000000..e29971f + printf("%hd\n", a[0]); + printf("%hd\n", a[1]); +} -diff --git a/test/interoperability_with_c/006_fortran_call_c_array_bindc/c_func009.c b/test/interoperability_with_c/006_fortran_call_c_array_bindc/c_func009.c +diff --git a/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/c_func009.c b/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/c_func009.c new file mode 100644 index 0000000..3b84c1a --- /dev/null -+++ b/test/interoperability_with_c/006_fortran_call_c_array_bindc/c_func009.c ++++ b/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/c_func009.c @@ -0,0 +1,6 @@ +#include +#include @@ -4585,11 +4312,11 @@ index 0000000..3b84c1a + printf("%d\n", a[0]); + printf("%d\n", a[1]); +} -diff --git a/test/interoperability_with_c/006_fortran_call_c_array_bindc/c_func010.c b/test/interoperability_with_c/006_fortran_call_c_array_bindc/c_func010.c +diff --git a/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/c_func010.c b/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/c_func010.c new file mode 100644 index 0000000..11ca3e1 --- /dev/null -+++ b/test/interoperability_with_c/006_fortran_call_c_array_bindc/c_func010.c ++++ b/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/c_func010.c @@ -0,0 +1,6 @@ +#include +#include @@ -4597,11 +4324,11 @@ index 0000000..11ca3e1 + printf("%ld\n", a[0]); + printf("%ld\n", a[1]); +} -diff --git a/test/interoperability_with_c/006_fortran_call_c_array_bindc/c_func011.c b/test/interoperability_with_c/006_fortran_call_c_array_bindc/c_func011.c +diff --git a/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/c_func011.c b/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/c_func011.c new file mode 100644 index 0000000..f830d74 --- /dev/null -+++ b/test/interoperability_with_c/006_fortran_call_c_array_bindc/c_func011.c ++++ b/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/c_func011.c @@ -0,0 +1,6 @@ +#include +#include @@ -4609,11 +4336,11 @@ index 0000000..f830d74 + printf("%hhd\n", a[0]); + printf("%hhd\n", a[1]); +} -diff --git a/test/interoperability_with_c/006_fortran_call_c_array_bindc/c_func012.c b/test/interoperability_with_c/006_fortran_call_c_array_bindc/c_func012.c +diff --git a/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/c_func012.c b/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/c_func012.c new file mode 100644 index 0000000..6ffd7e3 --- /dev/null -+++ b/test/interoperability_with_c/006_fortran_call_c_array_bindc/c_func012.c ++++ b/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/c_func012.c @@ -0,0 +1,6 @@ +#include +#include @@ -4621,11 +4348,11 @@ index 0000000..6ffd7e3 + printf("%hd\n", a[0]); + printf("%hd\n", a[1]); +} -diff --git a/test/interoperability_with_c/006_fortran_call_c_array_bindc/c_func013.c b/test/interoperability_with_c/006_fortran_call_c_array_bindc/c_func013.c +diff --git a/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/c_func013.c b/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/c_func013.c new file mode 100644 index 0000000..4b367cb --- /dev/null -+++ b/test/interoperability_with_c/006_fortran_call_c_array_bindc/c_func013.c ++++ b/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/c_func013.c @@ -0,0 +1,6 @@ +#include +#include @@ -4633,11 +4360,11 @@ index 0000000..4b367cb + printf("%d\n", a[0]); + printf("%d\n", a[1]); +} -diff --git a/test/interoperability_with_c/006_fortran_call_c_array_bindc/c_func014.c b/test/interoperability_with_c/006_fortran_call_c_array_bindc/c_func014.c +diff --git a/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/c_func014.c b/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/c_func014.c new file mode 100644 index 0000000..6b2d5b3 --- /dev/null -+++ b/test/interoperability_with_c/006_fortran_call_c_array_bindc/c_func014.c ++++ b/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/c_func014.c @@ -0,0 +1,6 @@ +#include +#include @@ -4645,11 +4372,11 @@ index 0000000..6b2d5b3 + printf("%ld\n", a[0]); + printf("%ld\n", a[1]); +} -diff --git a/test/interoperability_with_c/006_fortran_call_c_array_bindc/c_func015.c b/test/interoperability_with_c/006_fortran_call_c_array_bindc/c_func015.c +diff --git a/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/c_func015.c b/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/c_func015.c new file mode 100644 index 0000000..81d223a --- /dev/null -+++ b/test/interoperability_with_c/006_fortran_call_c_array_bindc/c_func015.c ++++ b/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/c_func015.c @@ -0,0 +1,6 @@ +#include +#include @@ -4657,11 +4384,11 @@ index 0000000..81d223a + printf("%hhd\n", a[0]); + printf("%hhd\n", a[1]); +} -diff --git a/test/interoperability_with_c/006_fortran_call_c_array_bindc/c_func016.c b/test/interoperability_with_c/006_fortran_call_c_array_bindc/c_func016.c +diff --git a/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/c_func016.c b/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/c_func016.c new file mode 100644 index 0000000..297be3a --- /dev/null -+++ b/test/interoperability_with_c/006_fortran_call_c_array_bindc/c_func016.c ++++ b/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/c_func016.c @@ -0,0 +1,6 @@ +#include +#include @@ -4669,11 +4396,11 @@ index 0000000..297be3a + printf("%ld\n", a[0]); + printf("%ld\n", a[1]); +} -diff --git a/test/interoperability_with_c/006_fortran_call_c_array_bindc/c_func017.c b/test/interoperability_with_c/006_fortran_call_c_array_bindc/c_func017.c +diff --git a/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/c_func017.c b/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/c_func017.c new file mode 100644 index 0000000..8eb5818 --- /dev/null -+++ b/test/interoperability_with_c/006_fortran_call_c_array_bindc/c_func017.c ++++ b/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/c_func017.c @@ -0,0 +1,6 @@ +#include +#include @@ -4681,11 +4408,11 @@ index 0000000..8eb5818 + printf("%ld\n", a[0]); + printf("%ld\n", a[1]); +} -diff --git a/test/interoperability_with_c/006_fortran_call_c_array_bindc/c_func018.c b/test/interoperability_with_c/006_fortran_call_c_array_bindc/c_func018.c +diff --git a/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/c_func018.c b/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/c_func018.c new file mode 100644 index 0000000..030b1f7 --- /dev/null -+++ b/test/interoperability_with_c/006_fortran_call_c_array_bindc/c_func018.c ++++ b/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/c_func018.c @@ -0,0 +1,6 @@ +#include +#include @@ -4693,11 +4420,11 @@ index 0000000..030b1f7 + printf("%ld\n", a[0]); + printf("%ld\n", a[1]); +} -diff --git a/test/interoperability_with_c/006_fortran_call_c_array_bindc/c_func019.c b/test/interoperability_with_c/006_fortran_call_c_array_bindc/c_func019.c +diff --git a/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/c_func019.c b/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/c_func019.c new file mode 100644 index 0000000..babfc75 --- /dev/null -+++ b/test/interoperability_with_c/006_fortran_call_c_array_bindc/c_func019.c ++++ b/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/c_func019.c @@ -0,0 +1,6 @@ +#include +#include @@ -4705,11 +4432,11 @@ index 0000000..babfc75 + printf("%ld\n", a[0]); + printf("%ld\n", a[1]); +} -diff --git a/test/interoperability_with_c/006_fortran_call_c_array_bindc/c_func020.c b/test/interoperability_with_c/006_fortran_call_c_array_bindc/c_func020.c +diff --git a/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/c_func020.c b/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/c_func020.c new file mode 100644 index 0000000..26c7726 --- /dev/null -+++ b/test/interoperability_with_c/006_fortran_call_c_array_bindc/c_func020.c ++++ b/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/c_func020.c @@ -0,0 +1,6 @@ +#include +#include @@ -4717,44 +4444,44 @@ index 0000000..26c7726 + printf("%ld\n", a[0]); + printf("%ld\n", a[1]); +} -diff --git a/test/interoperability_with_c/006_fortran_call_c_array_bindc/c_func021.c b/test/interoperability_with_c/006_fortran_call_c_array_bindc/c_func021.c +diff --git a/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/c_func021.c b/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/c_func021.c new file mode 100644 index 0000000..a73f11b --- /dev/null -+++ b/test/interoperability_with_c/006_fortran_call_c_array_bindc/c_func021.c ++++ b/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/c_func021.c @@ -0,0 +1,5 @@ +#include +void c_func_(float *a) { + printf("%f\n", a[0]); + printf("%f\n", a[1]); +} -diff --git a/test/interoperability_with_c/006_fortran_call_c_array_bindc/c_func022.c b/test/interoperability_with_c/006_fortran_call_c_array_bindc/c_func022.c +diff --git a/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/c_func022.c b/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/c_func022.c new file mode 100644 -index 0000000..b600f94 +index 0000000..688f3c0 --- /dev/null -+++ b/test/interoperability_with_c/006_fortran_call_c_array_bindc/c_func022.c ++++ b/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/c_func022.c @@ -0,0 +1,5 @@ +#include +void c_func_(double *a) { -+ printf("%0.20lf\n", a[0]); -+ printf("%0.20lf\n", a[1]); ++ printf("%20lf\n", a[0]); ++ printf("%20lf\n", a[1]); +} -diff --git a/test/interoperability_with_c/006_fortran_call_c_array_bindc/c_func023.c b/test/interoperability_with_c/006_fortran_call_c_array_bindc/c_func023.c +diff --git a/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/c_func023.c b/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/c_func023.c new file mode 100644 -index 0000000..b34c388 +index 0000000..af86ba3 --- /dev/null -+++ b/test/interoperability_with_c/006_fortran_call_c_array_bindc/c_func023.c ++++ b/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/c_func023.c @@ -0,0 +1,5 @@ +#include +void c_func_(long double *a) { -+ printf("%.20Lf\n", a[0]); -+ printf("%.20Lf\n", a[1]); ++ printf("%20Lf\n", a[0]); ++ printf("%20Lf\n", a[1]); +} -diff --git a/test/interoperability_with_c/006_fortran_call_c_array_bindc/c_func024.c b/test/interoperability_with_c/006_fortran_call_c_array_bindc/c_func024.c +diff --git a/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/c_func024.c b/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/c_func024.c new file mode 100644 index 0000000..1d34f02 --- /dev/null -+++ b/test/interoperability_with_c/006_fortran_call_c_array_bindc/c_func024.c ++++ b/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/c_func024.c @@ -0,0 +1,6 @@ +#include +#include @@ -4762,618 +4489,554 @@ index 0000000..1d34f02 + printf("%0.20f + %0.20fi\n", creal(t[0]), cimag(t[0])); + printf("%0.20f + %0.20fi\n", creal(t[1]), cimag(t[1])); +} -diff --git a/test/interoperability_with_c/006_fortran_call_c_array_bindc/c_func025.c b/test/interoperability_with_c/006_fortran_call_c_array_bindc/c_func025.c +diff --git a/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/c_func025.c b/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/c_func025.c new file mode 100644 -index 0000000..582096e +index 0000000..12b9abb --- /dev/null -+++ b/test/interoperability_with_c/006_fortran_call_c_array_bindc/c_func025.c ++++ b/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/c_func025.c @@ -0,0 +1,6 @@ +#include +#include +void c_func_(double _Complex *t) { -+ printf("%0.20lf + %0.20lfi\n", creal(t[0]), cimag(t[0])); -+ printf("%0.20lf + %0.20lfi\n", creal(t[1]), cimag(t[1])); ++ printf("%20lf + %20lfi\n", creal(t[0]), cimag(t[0])); ++ printf("%20lf + %20lfi\n", creal(t[1]), cimag(t[1])); +} -diff --git a/test/interoperability_with_c/006_fortran_call_c_array_bindc/c_func026.c b/test/interoperability_with_c/006_fortran_call_c_array_bindc/c_func026.c +diff --git a/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/c_func026.c b/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/c_func026.c new file mode 100644 -index 0000000..b665220 +index 0000000..78011d4 --- /dev/null -+++ b/test/interoperability_with_c/006_fortran_call_c_array_bindc/c_func026.c ++++ b/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/c_func026.c @@ -0,0 +1,6 @@ +#include +#include +void c_func_(long double _Complex *t) { -+ printf("%0.20f + %0.20fi\n", creal(t[0]), cimag(t[0])); -+ printf("%0.20f + %0.20fi\n", creal(t[1]), cimag(t[1])); ++ printf("%20f + %20fi\n", creal(t[0]), cimag(t[0])); ++ printf("%20f + %20fi\n", creal(t[1]), cimag(t[1])); +} -diff --git a/test/interoperability_with_c/006_fortran_call_c_array_bindc/c_func027.c b/test/interoperability_with_c/006_fortran_call_c_array_bindc/c_func027.c +diff --git a/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/c_func027.c b/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/c_func027.c new file mode 100644 index 0000000..91a49b5 --- /dev/null -+++ b/test/interoperability_with_c/006_fortran_call_c_array_bindc/c_func027.c ++++ b/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/c_func027.c @@ -0,0 +1,5 @@ +#include +void c_func_(_Bool *a) { + printf("%d\n", a[0]); + printf("%d\n", a[1]); +} -diff --git a/test/interoperability_with_c/006_fortran_call_c_array_bindc/c_func028.c b/test/interoperability_with_c/006_fortran_call_c_array_bindc/c_func028.c +diff --git a/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/c_func028.c b/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/c_func028.c new file mode 100644 index 0000000..9335307 --- /dev/null -+++ b/test/interoperability_with_c/006_fortran_call_c_array_bindc/c_func028.c ++++ b/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/c_func028.c @@ -0,0 +1,5 @@ +#include +void c_func_(char *a) { + printf("%c\n", a[0]); + printf("%c\n", a[1]); +} -diff --git a/test/interoperability_with_c/006_fortran_call_c_array_bindc/fortran_main001.f90 b/test/interoperability_with_c/006_fortran_call_c_array_bindc/fortran_main001.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/fortran_main001.f90 b/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/fortran_main001.f90 new file mode 100644 -index 0000000..c1c866f +index 0000000..6e1f16f --- /dev/null -+++ b/test/interoperability_with_c/006_fortran_call_c_array_bindc/fortran_main001.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the scalar type and the scalar type is int -+! with iso_c_binding ++++ b/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/fortran_main001.f90 +@@ -0,0 +1,11 @@ ++! Test fortran call c for the array type and the array type is int +! +program main -+ use iso_c_binding -+ integer(C_INT) :: my_x(2) = 1 ++ integer :: my_x(2) = 1 + interface + subroutine c_func(b) -+ use iso_c_binding -+ integer(C_INT) :: b(2) ++ integer :: b(2) + end + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/006_fortran_call_c_array_bindc/fortran_main002.f90 b/test/interoperability_with_c/006_fortran_call_c_array_bindc/fortran_main002.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/fortran_main002.f90 b/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/fortran_main002.f90 new file mode 100644 -index 0000000..cb9976e +index 0000000..50f36f6 --- /dev/null -+++ b/test/interoperability_with_c/006_fortran_call_c_array_bindc/fortran_main002.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the scalar type and the scalar type is short -+! with iso_c_binding ++++ b/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/fortran_main002.f90 +@@ -0,0 +1,11 @@ ++! Test fortran call c for the array type and the array type is short +! +program main -+ use iso_c_binding -+ integer(C_SHORT) :: my_x(2) = 1 ++ integer(2) :: my_x(2) = 1 + interface + subroutine c_func(b) -+ use iso_c_binding -+ integer(C_SHORT) :: b(2) ++ integer(2) :: b(2) + end + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/006_fortran_call_c_array_bindc/fortran_main003.f90 b/test/interoperability_with_c/006_fortran_call_c_array_bindc/fortran_main003.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/fortran_main003.f90 b/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/fortran_main003.f90 new file mode 100644 -index 0000000..fd935af +index 0000000..5109bc3 --- /dev/null -+++ b/test/interoperability_with_c/006_fortran_call_c_array_bindc/fortran_main003.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the scalar type and the scalar type is long -+! with iso_c_binding ++++ b/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/fortran_main003.f90 +@@ -0,0 +1,11 @@ ++! Test fortran call c for the array type and the array type is long +! +program main -+ use iso_c_binding -+ integer(C_LONG) :: my_x(2) = 1 ++ integer(8) :: my_x(2) = 1 + interface + subroutine c_func(b) -+ use iso_c_binding -+ integer(C_LONG) :: b(2) ++ integer(8) :: b(2) + end + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/006_fortran_call_c_array_bindc/fortran_main004.f90 b/test/interoperability_with_c/006_fortran_call_c_array_bindc/fortran_main004.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/fortran_main004.f90 b/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/fortran_main004.f90 new file mode 100644 -index 0000000..fd72ea7 +index 0000000..a4e1bc6 --- /dev/null -+++ b/test/interoperability_with_c/006_fortran_call_c_array_bindc/fortran_main004.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the scalar type and the scalar type is -+! long long with iso_c_binding ++++ b/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/fortran_main004.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the array type and the array type is ++! long long +! +program main -+ use iso_c_binding -+ integer(C_LONG_LONG) :: my_x(2) = 1 ++ integer(8) :: my_x(2) = 1 + interface + subroutine c_func(b) -+ use iso_c_binding -+ integer(C_LONG_LONG) :: b(2) ++ integer(8) :: b(2) + end + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/006_fortran_call_c_array_bindc/fortran_main005.f90 b/test/interoperability_with_c/006_fortran_call_c_array_bindc/fortran_main005.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/fortran_main005.f90 b/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/fortran_main005.f90 new file mode 100644 -index 0000000..f6e923d +index 0000000..6f52cca --- /dev/null -+++ b/test/interoperability_with_c/006_fortran_call_c_array_bindc/fortran_main005.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the scalar type and the scalar type is -+! signed char with iso_c_binding ++++ b/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/fortran_main005.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the array type and the array type is ++! signed char +! +program main -+ use iso_c_binding -+ integer(C_SIGNED_CHAR) :: my_x(2) = 65 ++ integer(1) :: my_x(2) = 65 + interface + subroutine c_func(b) -+ use iso_c_binding -+ integer(C_SIGNED_CHAR) :: b(2) ++ integer(1) :: b(2) + end + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/006_fortran_call_c_array_bindc/fortran_main006.f90 b/test/interoperability_with_c/006_fortran_call_c_array_bindc/fortran_main006.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/fortran_main006.f90 b/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/fortran_main006.f90 new file mode 100644 -index 0000000..421534d +index 0000000..3505849 --- /dev/null -+++ b/test/interoperability_with_c/006_fortran_call_c_array_bindc/fortran_main006.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the scalar type and the scalar type is size_t -+! with iso_c_binding ++++ b/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/fortran_main006.f90 +@@ -0,0 +1,11 @@ ++! Test fortran call c for the array type and the array type is size_t +! +program main -+ use iso_c_binding -+ integer(C_SIZE_T) :: my_x(2) = 3 ++ integer(8) :: my_x(2) = 3 + interface + subroutine c_func(b) -+ use iso_c_binding -+ integer(C_SIZE_T) :: b(2) ++ integer(8) :: b(2) + end + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/006_fortran_call_c_array_bindc/fortran_main007.f90 b/test/interoperability_with_c/006_fortran_call_c_array_bindc/fortran_main007.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/fortran_main007.f90 b/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/fortran_main007.f90 new file mode 100644 -index 0000000..d7b5b93 +index 0000000..3ce82ad --- /dev/null -+++ b/test/interoperability_with_c/006_fortran_call_c_array_bindc/fortran_main007.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the scalar type and the scalar type is int8_t -+! with iso_c_binding ++++ b/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/fortran_main007.f90 +@@ -0,0 +1,11 @@ ++! Test fortran call c for the array type and the array type is int8_t +! +program main -+ use iso_c_binding -+ integer(C_INT8_T) :: my_x(2) = 1 ++ integer(1) :: my_x(2) = 1 + interface + subroutine c_func(b) -+ use iso_c_binding -+ integer(C_INT8_T) :: b(2) ++ integer(1) :: b(2) + end + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/006_fortran_call_c_array_bindc/fortran_main008.f90 b/test/interoperability_with_c/006_fortran_call_c_array_bindc/fortran_main008.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/fortran_main008.f90 b/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/fortran_main008.f90 new file mode 100644 -index 0000000..d7f7492 +index 0000000..12a52ee --- /dev/null -+++ b/test/interoperability_with_c/006_fortran_call_c_array_bindc/fortran_main008.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the scalar type and the scalar type is -+! int16_t with iso_c_binding ++++ b/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/fortran_main008.f90 +@@ -0,0 +1,11 @@ ++! Test fortran call c for the array type and the array type is int16_t +! +program main -+ use iso_c_binding -+ integer(C_INT16_T) :: my_x(2) = 1 ++ integer(2) :: my_x(2) = 1 + interface + subroutine c_func(b) -+ use iso_c_binding -+ integer(C_INT16_T) :: b(2) ++ integer(2) :: b(2) + end + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/006_fortran_call_c_array_bindc/fortran_main009.f90 b/test/interoperability_with_c/006_fortran_call_c_array_bindc/fortran_main009.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/fortran_main009.f90 b/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/fortran_main009.f90 new file mode 100644 -index 0000000..35233f5 +index 0000000..139d7f9 --- /dev/null -+++ b/test/interoperability_with_c/006_fortran_call_c_array_bindc/fortran_main009.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the scalar type and the scalar type is -+! int32_t with iso_c_binding ++++ b/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/fortran_main009.f90 +@@ -0,0 +1,11 @@ ++! Test fortran call c for the array type and the array type is int32_t +! +program main -+ use iso_c_binding -+ integer(C_INT32_T) :: my_x(2) = 1 ++ integer(4) :: my_x(2) = 1 + interface + subroutine c_func(b) -+ use iso_c_binding -+ integer(C_INT32_T) :: b(2) ++ integer(4) :: b(2) + end + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/006_fortran_call_c_array_bindc/fortran_main010.f90 b/test/interoperability_with_c/006_fortran_call_c_array_bindc/fortran_main010.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/fortran_main010.f90 b/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/fortran_main010.f90 new file mode 100644 -index 0000000..f0c5cb2 +index 0000000..81859b7 --- /dev/null -+++ b/test/interoperability_with_c/006_fortran_call_c_array_bindc/fortran_main010.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the scalar type and the scalar type is -+! int64_t with iso_c_binding ++++ b/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/fortran_main010.f90 +@@ -0,0 +1,11 @@ ++! Test fortran call c for the array type and the array type is int64_t +! +program main -+ use iso_c_binding -+ integer(C_INT64_T) :: my_x(2) = 1 ++ integer(8) :: my_x(2) = 1 + interface + subroutine c_func(b) -+ use iso_c_binding -+ integer(C_INT64_T) :: b(2) ++ integer(8) :: b(2) + end + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/006_fortran_call_c_array_bindc/fortran_main011.f90 b/test/interoperability_with_c/006_fortran_call_c_array_bindc/fortran_main011.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/fortran_main011.f90 b/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/fortran_main011.f90 new file mode 100644 -index 0000000..9b6e534 +index 0000000..cee5bab --- /dev/null -+++ b/test/interoperability_with_c/006_fortran_call_c_array_bindc/fortran_main011.f90 -@@ -0,0 +1,14 @@ ++++ b/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/fortran_main011.f90 +@@ -0,0 +1,12 @@ +! Test fortran call c for the scalar type and the scalar type is -+! int_least_8_t with iso_c_binding ++! int_least8_t +! +program main -+ use iso_c_binding -+ integer(C_INT_LEAST8_T) :: my_x(2) = 1 ++ integer(1) :: my_x(2) = 1 + interface + subroutine c_func(b) -+ use iso_c_binding -+ integer(C_INT_LEAST8_T) :: b(2) ++ integer(1) :: b(2) + end + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/006_fortran_call_c_array_bindc/fortran_main012.f90 b/test/interoperability_with_c/006_fortran_call_c_array_bindc/fortran_main012.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/fortran_main012.f90 b/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/fortran_main012.f90 new file mode 100644 -index 0000000..d0b4d29 +index 0000000..fd005f2 --- /dev/null -+++ b/test/interoperability_with_c/006_fortran_call_c_array_bindc/fortran_main012.f90 -@@ -0,0 +1,14 @@ ++++ b/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/fortran_main012.f90 +@@ -0,0 +1,12 @@ +! Test fortran call c for the scalar type and the scalar type is -+! int_least16_t with iso_c_binding ++! int_least16_t +! +program main -+ use iso_c_binding -+ integer(C_INT_LEAST16_T) :: my_x(2) = 1 ++ integer(2) :: my_x(2) = 1 + interface + subroutine c_func(b) -+ use iso_c_binding -+ integer(C_INT_LEAST16_T) :: b(2) ++ integer(2) :: b(2) + end + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/006_fortran_call_c_array_bindc/fortran_main013.f90 b/test/interoperability_with_c/006_fortran_call_c_array_bindc/fortran_main013.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/fortran_main013.f90 b/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/fortran_main013.f90 new file mode 100644 -index 0000000..74e2a82 +index 0000000..1fe884b --- /dev/null -+++ b/test/interoperability_with_c/006_fortran_call_c_array_bindc/fortran_main013.f90 -@@ -0,0 +1,14 @@ ++++ b/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/fortran_main013.f90 +@@ -0,0 +1,12 @@ +! Test fortran call c for the scalar type and the scalar type is -+! int_least32_t with iso_c_binding ++! int_least32_t +! +program main -+ use iso_c_binding -+ integer(C_INT_LEAST32_T) :: my_x(2) = 1 ++ integer(4) :: my_x(2) = 1 + interface + subroutine c_func(b) -+ use iso_c_binding -+ integer(C_INT_LEAST32_T) :: b(2) ++ integer(4) :: b(2) + end + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/006_fortran_call_c_array_bindc/fortran_main014.f90 b/test/interoperability_with_c/006_fortran_call_c_array_bindc/fortran_main014.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/fortran_main014.f90 b/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/fortran_main014.f90 new file mode 100644 -index 0000000..09830a3 +index 0000000..ada1c56 --- /dev/null -+++ b/test/interoperability_with_c/006_fortran_call_c_array_bindc/fortran_main014.f90 -@@ -0,0 +1,14 @@ ++++ b/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/fortran_main014.f90 +@@ -0,0 +1,12 @@ +! Test fortran call c for the scalar type and the scalar type is -+! int_least64_t with iso_c_binding ++! int_least64_t +! +program main -+ use iso_c_binding -+ integer(C_INT_LEAST64_T) :: my_x(2) = 1 ++ integer(8) :: my_x(2) = 1 + interface + subroutine c_func(b) -+ use iso_c_binding -+ integer(C_INT_LEAST64_T) :: b(2) ++ integer(8) :: b(2) + end + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/006_fortran_call_c_array_bindc/fortran_main015.f90 b/test/interoperability_with_c/006_fortran_call_c_array_bindc/fortran_main015.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/fortran_main015.f90 b/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/fortran_main015.f90 new file mode 100644 -index 0000000..0663936 +index 0000000..a025c8a --- /dev/null -+++ b/test/interoperability_with_c/006_fortran_call_c_array_bindc/fortran_main015.f90 -@@ -0,0 +1,14 @@ ++++ b/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/fortran_main015.f90 +@@ -0,0 +1,12 @@ +! Test fortran call c for the scalar type and the scalar type is -+! int_fast8_t with iso_c_binding ++! int_fast8_t +! +program main -+ use iso_c_binding -+ integer(C_INT_FAST8_T) :: my_x(2) = 1 ++ integer(1) :: my_x(2) = 1 + interface + subroutine c_func(b) -+ use iso_c_binding -+ integer(C_INT_FAST8_T) :: b(2) ++ integer(1) :: b(2) + end + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/006_fortran_call_c_array_bindc/fortran_main016.f90 b/test/interoperability_with_c/006_fortran_call_c_array_bindc/fortran_main016.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/fortran_main016.f90 b/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/fortran_main016.f90 new file mode 100644 -index 0000000..3ed798b +index 0000000..d6d3f63 --- /dev/null -+++ b/test/interoperability_with_c/006_fortran_call_c_array_bindc/fortran_main016.f90 -@@ -0,0 +1,14 @@ ++++ b/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/fortran_main016.f90 +@@ -0,0 +1,12 @@ +! Test fortran call c for the scalar type and the scalar type is -+! int_fast16_t with iso_c_binding ++! int_fast16_t +! +program main -+ use iso_c_binding -+ integer(C_INT_FAST16_T) :: my_x(2) = 1 ++ integer(8) :: my_x(2) = 1 + interface + subroutine c_func(b) -+ use iso_c_binding -+ integer(C_INT_FAST16_T) :: b(2) ++ integer(8) :: b(2) + end + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/006_fortran_call_c_array_bindc/fortran_main017.f90 b/test/interoperability_with_c/006_fortran_call_c_array_bindc/fortran_main017.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/fortran_main017.f90 b/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/fortran_main017.f90 new file mode 100644 -index 0000000..ad04f7a +index 0000000..851d06d --- /dev/null -+++ b/test/interoperability_with_c/006_fortran_call_c_array_bindc/fortran_main017.f90 -@@ -0,0 +1,14 @@ ++++ b/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/fortran_main017.f90 +@@ -0,0 +1,12 @@ +! Test fortran call c for the scalar type and the scalar type is -+! int_fast32_t with iso_c_binding ++! int_fast32_t +! +program main -+ use iso_c_binding -+ integer(C_INT_FAST32_T) :: my_x(2) = 1 ++ integer(8) :: my_x(2) = 1 + interface + subroutine c_func(b) -+ use iso_c_binding -+ integer(C_INT_FAST32_T) :: b(2) ++ integer(8) :: b(2) + end + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/006_fortran_call_c_array_bindc/fortran_main018.f90 b/test/interoperability_with_c/006_fortran_call_c_array_bindc/fortran_main018.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/fortran_main018.f90 b/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/fortran_main018.f90 new file mode 100644 -index 0000000..21bccab +index 0000000..9b62610 --- /dev/null -+++ b/test/interoperability_with_c/006_fortran_call_c_array_bindc/fortran_main018.f90 -@@ -0,0 +1,14 @@ ++++ b/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/fortran_main018.f90 +@@ -0,0 +1,12 @@ +! Test fortran call c for the scalar type and the scalar type is -+! int_fast64_t with iso_c_binding ++! int_fast64_t +! +program main -+ use iso_c_binding -+ integer(C_INT_FAST64_T) :: my_x(2) = 1 ++ integer(8) :: my_x(2) = 1 + interface + subroutine c_func(b) -+ use iso_c_binding -+ integer(C_INT_FAST64_T) :: b(2) ++ integer(8) :: b(2) + end + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/006_fortran_call_c_array_bindc/fortran_main019.f90 b/test/interoperability_with_c/006_fortran_call_c_array_bindc/fortran_main019.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/fortran_main019.f90 b/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/fortran_main019.f90 new file mode 100644 -index 0000000..0ec82b6 +index 0000000..41f77aa --- /dev/null -+++ b/test/interoperability_with_c/006_fortran_call_c_array_bindc/fortran_main019.f90 -@@ -0,0 +1,14 @@ ++++ b/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/fortran_main019.f90 +@@ -0,0 +1,12 @@ +! Test fortran call c for the scalar type and the scalar type is -+! intmax_t with iso_c_binding ++! intmax_t +! +program main -+ use iso_c_binding -+ integer(C_INTMAX_T) :: my_x(2) = 1 ++ integer(8) :: my_x(2) = 1 + interface + subroutine c_func(b) -+ use iso_c_binding -+ integer(C_INTMAX_T) :: b(2) ++ integer(8) :: b(2) + end + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/006_fortran_call_c_array_bindc/fortran_main020.f90 b/test/interoperability_with_c/006_fortran_call_c_array_bindc/fortran_main020.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/fortran_main020.f90 b/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/fortran_main020.f90 new file mode 100644 -index 0000000..dabd45d +index 0000000..3a48805 --- /dev/null -+++ b/test/interoperability_with_c/006_fortran_call_c_array_bindc/fortran_main020.f90 -@@ -0,0 +1,14 @@ ++++ b/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/fortran_main020.f90 +@@ -0,0 +1,12 @@ +! Test fortran call c for the scalar type and the scalar type is -+! intptr_t with iso_c_binding ++! intptr_t +! +program main -+ use iso_c_binding -+ integer(C_INTPTR_T) :: my_x(2) = 1 ++ integer(8) :: my_x(2) = 1 + interface + subroutine c_func(b) -+ use iso_c_binding -+ integer(C_INTPTR_T) :: b(2) ++ integer(8) :: b(2) + end + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/006_fortran_call_c_array_bindc/fortran_main021.f90 b/test/interoperability_with_c/006_fortran_call_c_array_bindc/fortran_main021.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/fortran_main021.f90 b/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/fortran_main021.f90 new file mode 100644 -index 0000000..e0b4407 +index 0000000..86a9cf5 --- /dev/null -+++ b/test/interoperability_with_c/006_fortran_call_c_array_bindc/fortran_main021.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the scalar type and the scalar type is float -+! with iso_c_binding ++++ b/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/fortran_main021.f90 +@@ -0,0 +1,11 @@ ++! Test fortran call c for the array type and the array type is float +! +program main -+ use iso_c_binding -+ real(C_FLOAT) :: my_x(2) = 12345678.7654321 ++ real(4) :: my_x(2) = 12345678.7654321 + interface + subroutine c_func(b) -+ use iso_c_binding -+ real(C_FLOAT) :: b(2) ++ real(4) :: b(2) + end + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/006_fortran_call_c_array_bindc/fortran_main022.f90 b/test/interoperability_with_c/006_fortran_call_c_array_bindc/fortran_main022.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/fortran_main022.f90 b/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/fortran_main022.f90 new file mode 100644 -index 0000000..453383e +index 0000000..ad70ca5 --- /dev/null -+++ b/test/interoperability_with_c/006_fortran_call_c_array_bindc/fortran_main022.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the scalar type and the scalar type is double -+! with iso_c_binding ++++ b/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/fortran_main022.f90 +@@ -0,0 +1,11 @@ ++! Test fortran call c for the array type and the array type is double +! +program main -+ use iso_c_binding -+ real(C_DOUBLE) :: my_x(2) = 3.14159265358979 ++ real(8) :: my_x(2) = 12345678.7654321 + interface + subroutine c_func(b) -+ use iso_c_binding -+ real(C_DOUBLE) :: b(2) ++ real(8) :: b(2) + end + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/006_fortran_call_c_array_bindc/fortran_main023.f90 b/test/interoperability_with_c/006_fortran_call_c_array_bindc/fortran_main023.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/fortran_main023.f90 b/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/fortran_main023.f90 new file mode 100644 -index 0000000..527cb8a +index 0000000..e44608b --- /dev/null -+++ b/test/interoperability_with_c/006_fortran_call_c_array_bindc/fortran_main023.f90 ++++ b/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/fortran_main023.f90 @@ -0,0 +1,14 @@ -+! Test fortran call c for the scalar type and the scalar type is -+! long double with iso_c_binding ++! Test fortran call c for the array type and the array type is ++! long double +! +program main -+ use iso_c_binding -+ real(C_LONG_DOUBLE) :: my_x(2) = 3.14159265358979 ++ integer, parameter :: K = selected_real_kind(16) ++ real(K) :: my_x(2) = 12345678.7654321 + interface + subroutine c_func(b) -+ use iso_c_binding -+ real(C_LONG_DOUBLE) :: b(2) ++ integer, parameter :: K = selected_real_kind(16) ++ real(K) :: b(2) + end + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/006_fortran_call_c_array_bindc/fortran_main024.f90 b/test/interoperability_with_c/006_fortran_call_c_array_bindc/fortran_main024.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/fortran_main024.f90 b/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/fortran_main024.f90 new file mode 100644 -index 0000000..a1d726f +index 0000000..19df422 --- /dev/null -+++ b/test/interoperability_with_c/006_fortran_call_c_array_bindc/fortran_main024.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the scalar type and the scalar type is -+! float _Complex with iso_c_binding ++++ b/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/fortran_main024.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the array type and the array type is ++! float _Complex +! +program main -+ use iso_c_binding -+ complex(C_FLOAT_COMPLEX) :: my_x(2) = (-12345678.7654321, 1) ++ complex(4) :: my_x(2) = (-3.14159265358979, 1) + interface + subroutine c_func(b) -+ use iso_c_binding -+ complex(C_FLOAT_COMPLEX) :: b(2) ++ complex(4) :: b(2) + end + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/006_fortran_call_c_array_bindc/fortran_main025.f90 b/test/interoperability_with_c/006_fortran_call_c_array_bindc/fortran_main025.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/fortran_main025.f90 b/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/fortran_main025.f90 new file mode 100644 -index 0000000..d8e8d58 +index 0000000..b335a51 --- /dev/null -+++ b/test/interoperability_with_c/006_fortran_call_c_array_bindc/fortran_main025.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the scalar type and the scalar type is -+! double _Complex with iso_c_binding ++++ b/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/fortran_main025.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the array type and the array type is ++! double _Complex +! +program main -+ use iso_c_binding -+ complex(C_DOUBLE_COMPLEX) :: my_x(2) = (-3.14159265358979, 1) ++ complex(8) :: my_x(2) = (-3.14159265358979, 1) + interface + subroutine c_func(b) -+ use iso_c_binding -+ complex(C_DOUBLE_COMPLEX) :: b(2) ++ complex(8) :: b(2) + end + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/006_fortran_call_c_array_bindc/fortran_main026.f90 b/test/interoperability_with_c/006_fortran_call_c_array_bindc/fortran_main026.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/fortran_main026.f90 b/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/fortran_main026.f90 new file mode 100644 -index 0000000..b90c2ce +index 0000000..7482ce8 --- /dev/null -+++ b/test/interoperability_with_c/006_fortran_call_c_array_bindc/fortran_main026.f90 ++++ b/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/fortran_main026.f90 @@ -0,0 +1,14 @@ -+! Test fortran call c for the scalar type and the scalar type is -+! long double _Complex with iso_c_binding ++! Test fortran call c for the array type and the array type is ++! long double _Complex +! +program main -+ use iso_c_binding -+ complex(C_LONG_DOUBLE_COMPLEX) :: my_x(2) = (-3.14159265358979, 1) ++ integer, parameter :: K = selected_real_kind(16) ++ complex(K) :: my_x(2) = (-3.14159265358979, 1) + interface + subroutine c_func(b) -+ use iso_c_binding -+ complex(C_LONG_DOUBLE_COMPLEX) :: b(2) ++ integer, parameter :: K = selected_real_kind(16) ++ complex(K) :: b(2) + end + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/006_fortran_call_c_array_bindc/fortran_main027.f90 b/test/interoperability_with_c/006_fortran_call_c_array_bindc/fortran_main027.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/fortran_main027.f90 b/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/fortran_main027.f90 new file mode 100644 -index 0000000..ad4ac52 +index 0000000..d3249d1 --- /dev/null -+++ b/test/interoperability_with_c/006_fortran_call_c_array_bindc/fortran_main027.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the scalar type and the scalar type is _Bool -+! with iso_c_binding ++++ b/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/fortran_main027.f90 +@@ -0,0 +1,11 @@ ++! Test fortran call c for the array type and the array type is _Bool +! +program main -+ use iso_c_binding -+ logical(C_BOOL) :: my_x(2) = .FALSE. ++ logical(1) :: my_x(2) = .TRUE. + interface + subroutine c_func(b) -+ use iso_c_binding -+ logical(C_BOOL) :: b(2) ++ logical(1) :: b(2) + end + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/006_fortran_call_c_array_bindc/fortran_main028.f90 b/test/interoperability_with_c/006_fortran_call_c_array_bindc/fortran_main028.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/fortran_main028.f90 b/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/fortran_main028.f90 new file mode 100644 -index 0000000..d7a220b +index 0000000..a854e09 --- /dev/null -+++ b/test/interoperability_with_c/006_fortran_call_c_array_bindc/fortran_main028.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the scalar type and the scalar type is char -+! with iso_c_binding ++++ b/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/fortran_main028.f90 +@@ -0,0 +1,11 @@ ++! Test fortran call c for the array type and the array type is char +! +program main -+ use iso_c_binding -+ character(C_CHAR) :: my_x(2) = 'a' ++ character(1) :: my_x(2) = 'a' + interface + subroutine c_func(b) -+ use iso_c_binding -+ character(C_CHAR) :: b(2) ++ character(1) :: b(2) + end + end interface + call c_func(my_x) +end -diff --git a/test/interoperability_with_c/006_fortran_call_c_array_bindc/run.sh b/test/interoperability_with_c/006_fortran_call_c_array_bindc/run.sh +diff --git a/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/run.sh b/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/run.sh new file mode 100644 -index 0000000..632b582 +index 0000000..b865403 --- /dev/null -+++ b/test/interoperability_with_c/006_fortran_call_c_array_bindc/run.sh -@@ -0,0 +1,17 @@ ++++ b/test/interoperability_with_c_fortran_call_c/006_fortran_call_c_array/run.sh +@@ -0,0 +1,16 @@ +for i in {001..028} +do +echo "------- test $i ------." @@ -5390,1049 +5053,902 @@ index 0000000..632b582 +./a.out +rm *.o a.out +done -+ -diff --git a/test/interoperability_with_c/007_fortran_call_c_array_struct/c_func001.c b/test/interoperability_with_c/007_fortran_call_c_array_struct/c_func001.c +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/c_func001.c b/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/c_func001.c new file mode 100644 -index 0000000..af6f0af +index 0000000..c7cf73f --- /dev/null -+++ b/test/interoperability_with_c/007_fortran_call_c_array_struct/c_func001.c -@@ -0,0 +1,8 @@ ++++ b/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/c_func001.c +@@ -0,0 +1,5 @@ +#include -+struct Ty { -+ int x[2]; -+}; -+void c_func_(struct Ty *t) { -+ printf("%d\t", t->x[0]); -+ printf("%d\n", t->x[1]); ++void c_func_(int *a) { ++ printf("%d\n", a[0]); ++ printf("%d\n", a[1]); +} -diff --git a/test/interoperability_with_c/007_fortran_call_c_array_struct/c_func002.c b/test/interoperability_with_c/007_fortran_call_c_array_struct/c_func002.c +diff --git a/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/c_func002.c b/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/c_func002.c new file mode 100644 -index 0000000..8a69b38 +index 0000000..010cdf7 --- /dev/null -+++ b/test/interoperability_with_c/007_fortran_call_c_array_struct/c_func002.c -@@ -0,0 +1,9 @@ ++++ b/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/c_func002.c +@@ -0,0 +1,6 @@ +#include +#include -+struct Ty { -+ short x[2]; -+}; -+void c_func_(struct Ty *t) { -+ printf("%hd\t", t->x[0]); -+ printf("%hd\n", t->x[1]); ++void c_func_(short *a) { ++ printf("%hd\n", a[0]); ++ printf("%hd\n", a[1]); +} -diff --git a/test/interoperability_with_c/007_fortran_call_c_array_struct/c_func003.c b/test/interoperability_with_c/007_fortran_call_c_array_struct/c_func003.c +diff --git a/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/c_func003.c b/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/c_func003.c new file mode 100644 -index 0000000..2daf4d0 +index 0000000..5e69081 --- /dev/null -+++ b/test/interoperability_with_c/007_fortran_call_c_array_struct/c_func003.c -@@ -0,0 +1,8 @@ ++++ b/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/c_func003.c +@@ -0,0 +1,6 @@ +#include -+struct Ty { -+ long x[2]; -+}; -+void c_func_(struct Ty *t) { -+ printf("%ld\t", t->x[0]); -+ printf("%ld\n", t->x[1]); ++#include ++void c_func_(long *a) { ++ printf("%ld\n", a[0]); ++ printf("%ld\n", a[1]); +} -diff --git a/test/interoperability_with_c/007_fortran_call_c_array_struct/c_func004.c b/test/interoperability_with_c/007_fortran_call_c_array_struct/c_func004.c +diff --git a/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/c_func004.c b/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/c_func004.c new file mode 100644 -index 0000000..2dba23e +index 0000000..3f74c8e --- /dev/null -+++ b/test/interoperability_with_c/007_fortran_call_c_array_struct/c_func004.c -@@ -0,0 +1,9 @@ ++++ b/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/c_func004.c +@@ -0,0 +1,6 @@ +#include +#include -+struct Ty { -+ long long x[2]; -+}; -+void c_func_(struct Ty *t) { -+ printf("%lld\t", t->x[0]); -+ printf("%lld\n", t->x[1]); ++void c_func_(long long *a) { ++ printf("%lld\n", a[0]); ++ printf("%lld\n", a[1]); +} -diff --git a/test/interoperability_with_c/007_fortran_call_c_array_struct/c_func005.c b/test/interoperability_with_c/007_fortran_call_c_array_struct/c_func005.c +diff --git a/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/c_func005.c b/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/c_func005.c new file mode 100644 -index 0000000..3ff03dc +index 0000000..77794d4 --- /dev/null -+++ b/test/interoperability_with_c/007_fortran_call_c_array_struct/c_func005.c -@@ -0,0 +1,9 @@ ++++ b/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/c_func005.c +@@ -0,0 +1,5 @@ +#include -+#include -+struct Ty { -+ signed char x[2]; -+}; -+void c_func_(struct Ty *t) { -+ printf("%c\t", t->x[0]); -+ printf("%c\n", t->x[1]); ++void c_func_(signed char *a) { ++ printf("%c\n", a[0]); ++ printf("%c\n", a[1]); +} -diff --git a/test/interoperability_with_c/007_fortran_call_c_array_struct/c_func006.c b/test/interoperability_with_c/007_fortran_call_c_array_struct/c_func006.c +diff --git a/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/c_func006.c b/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/c_func006.c new file mode 100644 -index 0000000..15c7b76 +index 0000000..27c475f --- /dev/null -+++ b/test/interoperability_with_c/007_fortran_call_c_array_struct/c_func006.c -@@ -0,0 +1,9 @@ ++++ b/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/c_func006.c +@@ -0,0 +1,6 @@ +#include +#include -+struct Ty { -+ size_t x[2]; -+}; -+void c_func_(struct Ty *t) { -+ printf("%ld\t", t->x[0]); -+ printf("%ld\n", t->x[1]); ++void c_func_(size_t *a) { ++ printf("%ld\n", a[0]); ++ printf("%ld\n", a[1]); +} -diff --git a/test/interoperability_with_c/007_fortran_call_c_array_struct/c_func007.c b/test/interoperability_with_c/007_fortran_call_c_array_struct/c_func007.c +diff --git a/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/c_func007.c b/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/c_func007.c new file mode 100644 -index 0000000..ab5a40e +index 0000000..f7c4384 --- /dev/null -+++ b/test/interoperability_with_c/007_fortran_call_c_array_struct/c_func007.c -@@ -0,0 +1,9 @@ ++++ b/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/c_func007.c +@@ -0,0 +1,6 @@ +#include +#include -+struct Ty { -+ int8_t x[2]; -+}; -+void c_func_(struct Ty *t) { -+ printf("%hhd\t", t->x[0]); -+ printf("%hhd\n", t->x[1]); ++void c_func_(int8_t *a) { ++ printf("%hhd\n", a[0]); ++ printf("%hhd\n", a[1]); +} -diff --git a/test/interoperability_with_c/007_fortran_call_c_array_struct/c_func008.c b/test/interoperability_with_c/007_fortran_call_c_array_struct/c_func008.c +diff --git a/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/c_func008.c b/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/c_func008.c new file mode 100644 -index 0000000..48e1926 +index 0000000..e29971f --- /dev/null -+++ b/test/interoperability_with_c/007_fortran_call_c_array_struct/c_func008.c -@@ -0,0 +1,9 @@ ++++ b/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/c_func008.c +@@ -0,0 +1,6 @@ +#include +#include -+struct Ty { -+ int16_t x[2]; -+}; -+void c_func_(struct Ty *t) { -+ printf("%hd\t", t->x[0]); -+ printf("%hd\n", t->x[1]); ++void c_func_(int16_t *a) { ++ printf("%hd\n", a[0]); ++ printf("%hd\n", a[1]); +} -diff --git a/test/interoperability_with_c/007_fortran_call_c_array_struct/c_func009.c b/test/interoperability_with_c/007_fortran_call_c_array_struct/c_func009.c +diff --git a/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/c_func009.c b/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/c_func009.c new file mode 100644 -index 0000000..0cb1972 +index 0000000..3b84c1a --- /dev/null -+++ b/test/interoperability_with_c/007_fortran_call_c_array_struct/c_func009.c -@@ -0,0 +1,9 @@ ++++ b/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/c_func009.c +@@ -0,0 +1,6 @@ +#include +#include -+struct Ty { -+ int32_t x[2]; -+}; -+void c_func_(struct Ty *t) { -+ printf("%d\t", t->x[0]); -+ printf("%d\n", t->x[1]); ++void c_func_(int32_t *a) { ++ printf("%d\n", a[0]); ++ printf("%d\n", a[1]); +} -diff --git a/test/interoperability_with_c/007_fortran_call_c_array_struct/c_func010.c b/test/interoperability_with_c/007_fortran_call_c_array_struct/c_func010.c +diff --git a/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/c_func010.c b/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/c_func010.c new file mode 100644 -index 0000000..c158eee +index 0000000..11ca3e1 --- /dev/null -+++ b/test/interoperability_with_c/007_fortran_call_c_array_struct/c_func010.c -@@ -0,0 +1,9 @@ ++++ b/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/c_func010.c +@@ -0,0 +1,6 @@ +#include +#include -+struct Ty { -+ int64_t x[2]; -+}; -+void c_func_(struct Ty *t) { -+ printf("%ld\t", t->x[0]); -+ printf("%ld\n", t->x[1]); ++void c_func_(int64_t *a) { ++ printf("%ld\n", a[0]); ++ printf("%ld\n", a[1]); +} -diff --git a/test/interoperability_with_c/007_fortran_call_c_array_struct/c_func011.c b/test/interoperability_with_c/007_fortran_call_c_array_struct/c_func011.c +diff --git a/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/c_func011.c b/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/c_func011.c new file mode 100644 -index 0000000..7fb9f41 +index 0000000..f830d74 --- /dev/null -+++ b/test/interoperability_with_c/007_fortran_call_c_array_struct/c_func011.c -@@ -0,0 +1,9 @@ ++++ b/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/c_func011.c +@@ -0,0 +1,6 @@ +#include +#include -+struct Ty { -+ int_least8_t x[2]; -+}; -+void c_func_(struct Ty *t) { -+ printf("%hhd\t", t->x[0]); -+ printf("%hhd\n", t->x[1]); ++void c_func_(int_least8_t *a) { ++ printf("%hhd\n", a[0]); ++ printf("%hhd\n", a[1]); +} -diff --git a/test/interoperability_with_c/007_fortran_call_c_array_struct/c_func012.c b/test/interoperability_with_c/007_fortran_call_c_array_struct/c_func012.c +diff --git a/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/c_func012.c b/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/c_func012.c new file mode 100644 -index 0000000..1ab424d +index 0000000..6ffd7e3 --- /dev/null -+++ b/test/interoperability_with_c/007_fortran_call_c_array_struct/c_func012.c -@@ -0,0 +1,9 @@ ++++ b/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/c_func012.c +@@ -0,0 +1,6 @@ +#include +#include -+struct Ty { -+ int_least16_t x[2]; -+}; -+void c_func_(struct Ty *t) { -+ printf("%hd\t", t->x[0]); -+ printf("%hd\n", t->x[1]); ++void c_func_(int_least16_t *a) { ++ printf("%hd\n", a[0]); ++ printf("%hd\n", a[1]); +} -diff --git a/test/interoperability_with_c/007_fortran_call_c_array_struct/c_func013.c b/test/interoperability_with_c/007_fortran_call_c_array_struct/c_func013.c +diff --git a/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/c_func013.c b/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/c_func013.c new file mode 100644 -index 0000000..98a7568 +index 0000000..4b367cb --- /dev/null -+++ b/test/interoperability_with_c/007_fortran_call_c_array_struct/c_func013.c -@@ -0,0 +1,9 @@ ++++ b/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/c_func013.c +@@ -0,0 +1,6 @@ +#include +#include -+struct Ty { -+ int_least32_t x[2]; -+}; -+void c_func_(struct Ty *t) { -+ printf("%d\t", t->x[0]); -+ printf("%d\n", t->x[1]); ++void c_func_(int_least32_t *a) { ++ printf("%d\n", a[0]); ++ printf("%d\n", a[1]); +} -diff --git a/test/interoperability_with_c/007_fortran_call_c_array_struct/c_func014.c b/test/interoperability_with_c/007_fortran_call_c_array_struct/c_func014.c +diff --git a/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/c_func014.c b/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/c_func014.c new file mode 100644 -index 0000000..56cd691 +index 0000000..6b2d5b3 --- /dev/null -+++ b/test/interoperability_with_c/007_fortran_call_c_array_struct/c_func014.c -@@ -0,0 +1,9 @@ ++++ b/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/c_func014.c +@@ -0,0 +1,6 @@ +#include +#include -+struct Ty { -+ int_least64_t x[2]; -+}; -+void c_func_(struct Ty *t) { -+ printf("%ld\t", t->x[0]); -+ printf("%ld\n", t->x[1]); ++void c_func_(int_least64_t *a) { ++ printf("%ld\n", a[0]); ++ printf("%ld\n", a[1]); +} -diff --git a/test/interoperability_with_c/007_fortran_call_c_array_struct/c_func015.c b/test/interoperability_with_c/007_fortran_call_c_array_struct/c_func015.c +diff --git a/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/c_func015.c b/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/c_func015.c new file mode 100644 -index 0000000..91823ae +index 0000000..81d223a --- /dev/null -+++ b/test/interoperability_with_c/007_fortran_call_c_array_struct/c_func015.c -@@ -0,0 +1,9 @@ ++++ b/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/c_func015.c +@@ -0,0 +1,6 @@ +#include +#include -+struct Ty { -+ int_fast8_t x[2]; -+}; -+void c_func_(struct Ty *t) { -+ printf("%hhd\t", t->x[0]); -+ printf("%hhd\n", t->x[1]); ++void c_func_(int_fast8_t *a) { ++ printf("%hhd\n", a[0]); ++ printf("%hhd\n", a[1]); +} -diff --git a/test/interoperability_with_c/007_fortran_call_c_array_struct/c_func016.c b/test/interoperability_with_c/007_fortran_call_c_array_struct/c_func016.c +diff --git a/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/c_func016.c b/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/c_func016.c new file mode 100644 -index 0000000..99bd5f1 +index 0000000..297be3a --- /dev/null -+++ b/test/interoperability_with_c/007_fortran_call_c_array_struct/c_func016.c -@@ -0,0 +1,9 @@ ++++ b/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/c_func016.c +@@ -0,0 +1,6 @@ +#include +#include -+struct Ty { -+ int_fast16_t x[2]; -+}; -+void c_func_(struct Ty *t) { -+ printf("%ld\t", t->x[0]); -+ printf("%ld\n", t->x[1]); ++void c_func_(int_fast16_t *a) { ++ printf("%ld\n", a[0]); ++ printf("%ld\n", a[1]); +} -diff --git a/test/interoperability_with_c/007_fortran_call_c_array_struct/c_func017.c b/test/interoperability_with_c/007_fortran_call_c_array_struct/c_func017.c +diff --git a/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/c_func017.c b/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/c_func017.c new file mode 100644 -index 0000000..51c3977 +index 0000000..8eb5818 --- /dev/null -+++ b/test/interoperability_with_c/007_fortran_call_c_array_struct/c_func017.c -@@ -0,0 +1,9 @@ ++++ b/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/c_func017.c +@@ -0,0 +1,6 @@ +#include +#include -+struct Ty { -+ int_fast32_t x[2]; -+}; -+void c_func_(struct Ty *t) { -+ printf("%ld\t", t->x[0]); -+ printf("%ld\n", t->x[1]); ++void c_func_(int_fast32_t *a) { ++ printf("%ld\n", a[0]); ++ printf("%ld\n", a[1]); +} -diff --git a/test/interoperability_with_c/007_fortran_call_c_array_struct/c_func018.c b/test/interoperability_with_c/007_fortran_call_c_array_struct/c_func018.c +diff --git a/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/c_func018.c b/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/c_func018.c new file mode 100644 -index 0000000..575e915 +index 0000000..030b1f7 --- /dev/null -+++ b/test/interoperability_with_c/007_fortran_call_c_array_struct/c_func018.c -@@ -0,0 +1,9 @@ ++++ b/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/c_func018.c +@@ -0,0 +1,6 @@ +#include +#include -+struct Ty { -+ int_fast64_t x[2]; -+}; -+void c_func_(struct Ty *t) { -+ printf("%ld\t", t->x[0]); -+ printf("%ld\n", t->x[1]); ++void c_func_(int_fast64_t *a) { ++ printf("%ld\n", a[0]); ++ printf("%ld\n", a[1]); +} -diff --git a/test/interoperability_with_c/007_fortran_call_c_array_struct/c_func019.c b/test/interoperability_with_c/007_fortran_call_c_array_struct/c_func019.c +diff --git a/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/c_func019.c b/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/c_func019.c new file mode 100644 -index 0000000..45f0beb +index 0000000..babfc75 --- /dev/null -+++ b/test/interoperability_with_c/007_fortran_call_c_array_struct/c_func019.c -@@ -0,0 +1,9 @@ ++++ b/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/c_func019.c +@@ -0,0 +1,6 @@ +#include +#include -+struct Ty { -+ intmax_t x[2]; -+}; -+void c_func_(struct Ty *t) { -+ printf("%ld\t", t->x[0]); -+ printf("%ld\n", t->x[1]); ++void c_func_(intmax_t *a) { ++ printf("%ld\n", a[0]); ++ printf("%ld\n", a[1]); +} -diff --git a/test/interoperability_with_c/007_fortran_call_c_array_struct/c_func020.c b/test/interoperability_with_c/007_fortran_call_c_array_struct/c_func020.c +diff --git a/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/c_func020.c b/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/c_func020.c new file mode 100644 -index 0000000..553b51b +index 0000000..26c7726 --- /dev/null -+++ b/test/interoperability_with_c/007_fortran_call_c_array_struct/c_func020.c -@@ -0,0 +1,9 @@ ++++ b/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/c_func020.c +@@ -0,0 +1,6 @@ +#include +#include -+struct Ty { -+ intptr_t x[2]; -+}; -+void c_func_(struct Ty *t) { -+ printf("%ld\t", t->x[0]); -+ printf("%ld\n", t->x[1]); ++void c_func_(intptr_t *a) { ++ printf("%ld\n", a[0]); ++ printf("%ld\n", a[1]); +} -diff --git a/test/interoperability_with_c/007_fortran_call_c_array_struct/c_func021.c b/test/interoperability_with_c/007_fortran_call_c_array_struct/c_func021.c +diff --git a/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/c_func021.c b/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/c_func021.c new file mode 100644 -index 0000000..13cce4d +index 0000000..a73f11b --- /dev/null -+++ b/test/interoperability_with_c/007_fortran_call_c_array_struct/c_func021.c -@@ -0,0 +1,9 @@ ++++ b/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/c_func021.c +@@ -0,0 +1,5 @@ +#include -+#include -+struct Ty { -+ float x[2]; -+}; -+void c_func_(struct Ty *t) { -+ printf("%f\t", t->x[0]); -+ printf("%f\n", t->x[1]); ++void c_func_(float *a) { ++ printf("%f\n", a[0]); ++ printf("%f\n", a[1]); +} -diff --git a/test/interoperability_with_c/007_fortran_call_c_array_struct/c_func022.c b/test/interoperability_with_c/007_fortran_call_c_array_struct/c_func022.c +diff --git a/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/c_func022.c b/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/c_func022.c new file mode 100644 -index 0000000..d1f7b9d +index 0000000..b600f94 --- /dev/null -+++ b/test/interoperability_with_c/007_fortran_call_c_array_struct/c_func022.c -@@ -0,0 +1,9 @@ ++++ b/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/c_func022.c +@@ -0,0 +1,5 @@ +#include -+#include -+struct Ty { -+ double x[2]; -+}; -+void c_func_(struct Ty *t) { -+ printf("%lf\t", t->x[0]); -+ printf("%lf\n", t->x[1]); ++void c_func_(double *a) { ++ printf("%0.20lf\n", a[0]); ++ printf("%0.20lf\n", a[1]); +} -diff --git a/test/interoperability_with_c/007_fortran_call_c_array_struct/c_func023.c b/test/interoperability_with_c/007_fortran_call_c_array_struct/c_func023.c +diff --git a/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/c_func023.c b/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/c_func023.c new file mode 100644 -index 0000000..5f383b1 +index 0000000..b34c388 --- /dev/null -+++ b/test/interoperability_with_c/007_fortran_call_c_array_struct/c_func023.c -@@ -0,0 +1,9 @@ ++++ b/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/c_func023.c +@@ -0,0 +1,5 @@ +#include -+#include -+struct Ty { -+ long double x[2]; -+}; -+void c_func_(struct Ty *t) { -+ printf("%Lf\t", t->x[0]); -+ printf("%Lf\n", t->x[1]); ++void c_func_(long double *a) { ++ printf("%.20Lf\n", a[0]); ++ printf("%.20Lf\n", a[1]); +} -diff --git a/test/interoperability_with_c/007_fortran_call_c_array_struct/c_func024.c b/test/interoperability_with_c/007_fortran_call_c_array_struct/c_func024.c +diff --git a/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/c_func024.c b/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/c_func024.c new file mode 100644 -index 0000000..65309d7 +index 0000000..1d34f02 --- /dev/null -+++ b/test/interoperability_with_c/007_fortran_call_c_array_struct/c_func024.c -@@ -0,0 +1,9 @@ ++++ b/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/c_func024.c +@@ -0,0 +1,6 @@ +#include +#include -+struct Ty { -+ float _Complex x[2]; -+}; -+void c_func_(struct Ty *t) { -+ printf("%f + %fi\n", creal(t->x[0]), cimag(t->x[0])); -+ printf("%f + %fi\n", creal(t->x[1]), cimag(t->x[1])); ++void c_func_(float _Complex *t) { ++ printf("%0.20f + %0.20fi\n", creal(t[0]), cimag(t[0])); ++ printf("%0.20f + %0.20fi\n", creal(t[1]), cimag(t[1])); +} -diff --git a/test/interoperability_with_c/007_fortran_call_c_array_struct/c_func025.c b/test/interoperability_with_c/007_fortran_call_c_array_struct/c_func025.c +diff --git a/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/c_func025.c b/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/c_func025.c new file mode 100644 -index 0000000..b36c40e +index 0000000..582096e --- /dev/null -+++ b/test/interoperability_with_c/007_fortran_call_c_array_struct/c_func025.c -@@ -0,0 +1,9 @@ ++++ b/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/c_func025.c +@@ -0,0 +1,6 @@ +#include +#include -+struct Ty { -+ double _Complex x[2]; -+}; -+void c_func_(struct Ty *t) { -+ printf("%lf + %lfi\n", creal(t->x[0]), cimag(t->x[0])); -+ printf("%lf + %lfi\n", creal(t->x[1]), cimag(t->x[1])); ++void c_func_(double _Complex *t) { ++ printf("%0.20lf + %0.20lfi\n", creal(t[0]), cimag(t[0])); ++ printf("%0.20lf + %0.20lfi\n", creal(t[1]), cimag(t[1])); +} -diff --git a/test/interoperability_with_c/007_fortran_call_c_array_struct/c_func026.c b/test/interoperability_with_c/007_fortran_call_c_array_struct/c_func026.c +diff --git a/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/c_func026.c b/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/c_func026.c new file mode 100644 -index 0000000..a7bcf01 +index 0000000..b665220 --- /dev/null -+++ b/test/interoperability_with_c/007_fortran_call_c_array_struct/c_func026.c -@@ -0,0 +1,9 @@ ++++ b/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/c_func026.c +@@ -0,0 +1,6 @@ +#include +#include -+struct Ty { -+ long double _Complex x[2]; -+}; -+void c_func_(struct Ty *t) { -+ printf("%f + %fi\n", creal(t->x[0]), cimag(t->x[0])); -+ printf("%f + %fi\n", creal(t->x[1]), cimag(t->x[1])); ++void c_func_(long double _Complex *t) { ++ printf("%0.20f + %0.20fi\n", creal(t[0]), cimag(t[0])); ++ printf("%0.20f + %0.20fi\n", creal(t[1]), cimag(t[1])); +} -diff --git a/test/interoperability_with_c/007_fortran_call_c_array_struct/c_func027.c b/test/interoperability_with_c/007_fortran_call_c_array_struct/c_func027.c +diff --git a/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/c_func027.c b/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/c_func027.c new file mode 100644 -index 0000000..5723427 +index 0000000..91a49b5 --- /dev/null -+++ b/test/interoperability_with_c/007_fortran_call_c_array_struct/c_func027.c -@@ -0,0 +1,9 @@ ++++ b/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/c_func027.c +@@ -0,0 +1,5 @@ +#include -+#include -+struct Ty { -+ _Bool x[2]; -+}; -+void c_func_(struct Ty *t) { -+ printf("%d\t", t->x[0]); -+ printf("%d\n", t->x[1]); ++void c_func_(_Bool *a) { ++ printf("%d\n", a[0]); ++ printf("%d\n", a[1]); +} -diff --git a/test/interoperability_with_c/007_fortran_call_c_array_struct/c_func028.c b/test/interoperability_with_c/007_fortran_call_c_array_struct/c_func028.c +diff --git a/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/c_func028.c b/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/c_func028.c new file mode 100644 -index 0000000..47138e9 +index 0000000..9335307 --- /dev/null -+++ b/test/interoperability_with_c/007_fortran_call_c_array_struct/c_func028.c -@@ -0,0 +1,9 @@ ++++ b/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/c_func028.c +@@ -0,0 +1,5 @@ +#include -+#include -+struct Ty { -+ char x[2]; -+}; -+void c_func_(struct Ty *t) { -+ printf("%c\t", t->x[0]); -+ printf("%c\n", t->x[1]); ++void c_func_(char *a) { ++ printf("%c\n", a[0]); ++ printf("%c\n", a[1]); +} -diff --git a/test/interoperability_with_c/007_fortran_call_c_array_struct/fortran_main001.f90 b/test/interoperability_with_c/007_fortran_call_c_array_struct/fortran_main001.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/fortran_main001.f90 b/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/fortran_main001.f90 new file mode 100644 -index 0000000..6c8c711 +index 0000000..c1c866f --- /dev/null -+++ b/test/interoperability_with_c/007_fortran_call_c_array_struct/fortran_main001.f90 -@@ -0,0 +1,16 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is array of type int without iso_c_binding ++++ b/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/fortran_main001.f90 +@@ -0,0 +1,14 @@ ++! Test fortran call c for the scalar type and the scalar type is int ++! with iso_c_binding +! +program main -+ type, bind(c) :: t -+ integer :: x(2) = 1 -+ end type t -+ type(t) :: my_t ++ use iso_c_binding ++ integer(C_INT) :: my_x(2) = 1 + interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a ++ subroutine c_func(b) ++ use iso_c_binding ++ integer(C_INT) :: b(2) + end + end interface -+ call c_func(my_t) ++ call c_func(my_x) +end -diff --git a/test/interoperability_with_c/007_fortran_call_c_array_struct/fortran_main002.f90 b/test/interoperability_with_c/007_fortran_call_c_array_struct/fortran_main002.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/fortran_main002.f90 b/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/fortran_main002.f90 new file mode 100644 -index 0000000..4c9f0b9 +index 0000000..cb9976e --- /dev/null -+++ b/test/interoperability_with_c/007_fortran_call_c_array_struct/fortran_main002.f90 -@@ -0,0 +1,16 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is array of type short without iso_c_binding ++++ b/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/fortran_main002.f90 +@@ -0,0 +1,14 @@ ++! Test fortran call c for the scalar type and the scalar type is short ++! with iso_c_binding +! +program main -+ type, bind(c) :: t -+ integer(2) :: x(2) = -32768 -+ end type t -+ type(t) :: my_t ++ use iso_c_binding ++ integer(C_SHORT) :: my_x(2) = 1 + interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a ++ subroutine c_func(b) ++ use iso_c_binding ++ integer(C_SHORT) :: b(2) + end + end interface -+ call c_func(my_t) ++ call c_func(my_x) +end -diff --git a/test/interoperability_with_c/007_fortran_call_c_array_struct/fortran_main003.f90 b/test/interoperability_with_c/007_fortran_call_c_array_struct/fortran_main003.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/fortran_main003.f90 b/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/fortran_main003.f90 new file mode 100644 -index 0000000..f8962b2 +index 0000000..fd935af --- /dev/null -+++ b/test/interoperability_with_c/007_fortran_call_c_array_struct/fortran_main003.f90 -@@ -0,0 +1,16 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is array of type long without iso_c_binding ++++ b/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/fortran_main003.f90 +@@ -0,0 +1,14 @@ ++! Test fortran call c for the scalar type and the scalar type is long ++! with iso_c_binding +! +program main -+ type, bind(c) :: t -+ integer(8) :: x(2) = -2147483647 -+ end type t -+ type(t) :: my_t ++ use iso_c_binding ++ integer(C_LONG) :: my_x(2) = 1 + interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a ++ subroutine c_func(b) ++ use iso_c_binding ++ integer(C_LONG) :: b(2) + end + end interface -+ call c_func(my_t) ++ call c_func(my_x) +end -diff --git a/test/interoperability_with_c/007_fortran_call_c_array_struct/fortran_main004.f90 b/test/interoperability_with_c/007_fortran_call_c_array_struct/fortran_main004.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/fortran_main004.f90 b/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/fortran_main004.f90 new file mode 100644 -index 0000000..1bdf578 +index 0000000..fd72ea7 --- /dev/null -+++ b/test/interoperability_with_c/007_fortran_call_c_array_struct/fortran_main004.f90 -@@ -0,0 +1,16 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is array of type long long without iso_c_binding ++++ b/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/fortran_main004.f90 +@@ -0,0 +1,14 @@ ++! Test fortran call c for the scalar type and the scalar type is ++! long long with iso_c_binding +! +program main -+ type, bind(c) :: t -+ integer(8) :: x(2) = -9223372036854775807 -+ end type t -+ type(t) :: my_t ++ use iso_c_binding ++ integer(C_LONG_LONG) :: my_x(2) = 1 + interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a ++ subroutine c_func(b) ++ use iso_c_binding ++ integer(C_LONG_LONG) :: b(2) + end + end interface -+ call c_func(my_t) ++ call c_func(my_x) +end -diff --git a/test/interoperability_with_c/007_fortran_call_c_array_struct/fortran_main005.f90 b/test/interoperability_with_c/007_fortran_call_c_array_struct/fortran_main005.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/fortran_main005.f90 b/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/fortran_main005.f90 new file mode 100644 -index 0000000..b8d6d20 +index 0000000..f6e923d --- /dev/null -+++ b/test/interoperability_with_c/007_fortran_call_c_array_struct/fortran_main005.f90 -@@ -0,0 +1,16 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is array of type signed char without iso_c_binding ++++ b/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/fortran_main005.f90 +@@ -0,0 +1,14 @@ ++! Test fortran call c for the scalar type and the scalar type is ++! signed char with iso_c_binding +! +program main -+ type, bind(c) :: t -+ integer(1) :: x(2) = 65 -+ end type t -+ type(t) :: my_t ++ use iso_c_binding ++ integer(C_SIGNED_CHAR) :: my_x(2) = 65 + interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a ++ subroutine c_func(b) ++ use iso_c_binding ++ integer(C_SIGNED_CHAR) :: b(2) + end + end interface -+ call c_func(my_t) ++ call c_func(my_x) +end -diff --git a/test/interoperability_with_c/007_fortran_call_c_array_struct/fortran_main006.f90 b/test/interoperability_with_c/007_fortran_call_c_array_struct/fortran_main006.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/fortran_main006.f90 b/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/fortran_main006.f90 new file mode 100644 -index 0000000..24f4d74 +index 0000000..421534d --- /dev/null -+++ b/test/interoperability_with_c/007_fortran_call_c_array_struct/fortran_main006.f90 -@@ -0,0 +1,16 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is array of type size_t without iso_c_binding ++++ b/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/fortran_main006.f90 +@@ -0,0 +1,14 @@ ++! Test fortran call c for the scalar type and the scalar type is size_t ++! with iso_c_binding +! +program main -+ type, bind(c) :: t -+ integer(8) :: x(2) = 0 -+ end type t -+ type(t) :: my_t ++ use iso_c_binding ++ integer(C_SIZE_T) :: my_x(2) = 3 + interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a ++ subroutine c_func(b) ++ use iso_c_binding ++ integer(C_SIZE_T) :: b(2) + end + end interface -+ call c_func(my_t) ++ call c_func(my_x) +end -diff --git a/test/interoperability_with_c/007_fortran_call_c_array_struct/fortran_main007.f90 b/test/interoperability_with_c/007_fortran_call_c_array_struct/fortran_main007.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/fortran_main007.f90 b/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/fortran_main007.f90 new file mode 100644 -index 0000000..4c868b3 +index 0000000..d7b5b93 --- /dev/null -+++ b/test/interoperability_with_c/007_fortran_call_c_array_struct/fortran_main007.f90 -@@ -0,0 +1,16 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is array of type int8_t without iso_c_binding ++++ b/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/fortran_main007.f90 +@@ -0,0 +1,14 @@ ++! Test fortran call c for the scalar type and the scalar type is int8_t ++! with iso_c_binding +! +program main -+ type, bind(c) :: t -+ integer(1) :: x(2) = -128 -+ end type t -+ type(t) :: my_t ++ use iso_c_binding ++ integer(C_INT8_T) :: my_x(2) = 1 + interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a ++ subroutine c_func(b) ++ use iso_c_binding ++ integer(C_INT8_T) :: b(2) + end + end interface -+ call c_func(my_t) ++ call c_func(my_x) +end -diff --git a/test/interoperability_with_c/007_fortran_call_c_array_struct/fortran_main008.f90 b/test/interoperability_with_c/007_fortran_call_c_array_struct/fortran_main008.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/fortran_main008.f90 b/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/fortran_main008.f90 new file mode 100644 -index 0000000..0fd89db +index 0000000..d7f7492 --- /dev/null -+++ b/test/interoperability_with_c/007_fortran_call_c_array_struct/fortran_main008.f90 -@@ -0,0 +1,16 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is array of type int16_t without iso_c_binding ++++ b/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/fortran_main008.f90 +@@ -0,0 +1,14 @@ ++! Test fortran call c for the scalar type and the scalar type is ++! int16_t with iso_c_binding +! +program main -+ type, bind(c) :: t -+ integer(2) :: x(2) = -32768 -+ end type t -+ type(t) :: my_t ++ use iso_c_binding ++ integer(C_INT16_T) :: my_x(2) = 1 + interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a ++ subroutine c_func(b) ++ use iso_c_binding ++ integer(C_INT16_T) :: b(2) + end + end interface -+ call c_func(my_t) ++ call c_func(my_x) +end -diff --git a/test/interoperability_with_c/007_fortran_call_c_array_struct/fortran_main009.f90 b/test/interoperability_with_c/007_fortran_call_c_array_struct/fortran_main009.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/fortran_main009.f90 b/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/fortran_main009.f90 new file mode 100644 -index 0000000..2dee9f6 +index 0000000..35233f5 --- /dev/null -+++ b/test/interoperability_with_c/007_fortran_call_c_array_struct/fortran_main009.f90 -@@ -0,0 +1,16 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is array of type int32_t without iso_c_binding ++++ b/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/fortran_main009.f90 +@@ -0,0 +1,14 @@ ++! Test fortran call c for the scalar type and the scalar type is ++! int32_t with iso_c_binding +! +program main -+ type, bind(c) :: t -+ integer(4) :: x(2) = -2147483647 -+ end type t -+ type(t) :: my_t ++ use iso_c_binding ++ integer(C_INT32_T) :: my_x(2) = 1 + interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a ++ subroutine c_func(b) ++ use iso_c_binding ++ integer(C_INT32_T) :: b(2) + end + end interface -+ call c_func(my_t) ++ call c_func(my_x) +end -diff --git a/test/interoperability_with_c/007_fortran_call_c_array_struct/fortran_main010.f90 b/test/interoperability_with_c/007_fortran_call_c_array_struct/fortran_main010.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/fortran_main010.f90 b/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/fortran_main010.f90 new file mode 100644 -index 0000000..60b3af9 +index 0000000..f0c5cb2 --- /dev/null -+++ b/test/interoperability_with_c/007_fortran_call_c_array_struct/fortran_main010.f90 -@@ -0,0 +1,16 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is array of type int64_t without iso_c_binding ++++ b/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/fortran_main010.f90 +@@ -0,0 +1,14 @@ ++! Test fortran call c for the scalar type and the scalar type is ++! int64_t with iso_c_binding +! +program main -+ type, bind(c) :: t -+ integer(8) :: x(2) = -9223372036854775807 -+ end type t -+ type(t) :: my_t ++ use iso_c_binding ++ integer(C_INT64_T) :: my_x(2) = 1 + interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a ++ subroutine c_func(b) ++ use iso_c_binding ++ integer(C_INT64_T) :: b(2) + end + end interface -+ call c_func(my_t) ++ call c_func(my_x) +end -diff --git a/test/interoperability_with_c/007_fortran_call_c_array_struct/fortran_main011.f90 b/test/interoperability_with_c/007_fortran_call_c_array_struct/fortran_main011.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/fortran_main011.f90 b/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/fortran_main011.f90 new file mode 100644 -index 0000000..2ac8242 +index 0000000..9b6e534 --- /dev/null -+++ b/test/interoperability_with_c/007_fortran_call_c_array_struct/fortran_main011.f90 -@@ -0,0 +1,16 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is array of type int_least8_t without iso_c_binding ++++ b/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/fortran_main011.f90 +@@ -0,0 +1,14 @@ ++! Test fortran call c for the scalar type and the scalar type is ++! int_least_8_t with iso_c_binding +! +program main -+ type, bind(c) :: t -+ integer(1) :: x(2) = -128 -+ end type t -+ type(t) :: my_t ++ use iso_c_binding ++ integer(C_INT_LEAST8_T) :: my_x(2) = 1 + interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a ++ subroutine c_func(b) ++ use iso_c_binding ++ integer(C_INT_LEAST8_T) :: b(2) + end + end interface -+ call c_func(my_t) ++ call c_func(my_x) +end -diff --git a/test/interoperability_with_c/007_fortran_call_c_array_struct/fortran_main012.f90 b/test/interoperability_with_c/007_fortran_call_c_array_struct/fortran_main012.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/fortran_main012.f90 b/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/fortran_main012.f90 new file mode 100644 -index 0000000..50c6ca8 +index 0000000..d0b4d29 --- /dev/null -+++ b/test/interoperability_with_c/007_fortran_call_c_array_struct/fortran_main012.f90 -@@ -0,0 +1,16 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is array of type int_least16_t without iso_c_binding ++++ b/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/fortran_main012.f90 +@@ -0,0 +1,14 @@ ++! Test fortran call c for the scalar type and the scalar type is ++! int_least16_t with iso_c_binding +! +program main -+ type, bind(c) :: t -+ integer(2) :: x(2) = -32768 -+ end type t -+ type(t) :: my_t ++ use iso_c_binding ++ integer(C_INT_LEAST16_T) :: my_x(2) = 1 + interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a ++ subroutine c_func(b) ++ use iso_c_binding ++ integer(C_INT_LEAST16_T) :: b(2) + end + end interface -+ call c_func(my_t) ++ call c_func(my_x) +end -diff --git a/test/interoperability_with_c/007_fortran_call_c_array_struct/fortran_main013.f90 b/test/interoperability_with_c/007_fortran_call_c_array_struct/fortran_main013.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/fortran_main013.f90 b/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/fortran_main013.f90 new file mode 100644 -index 0000000..ff3b140 +index 0000000..74e2a82 --- /dev/null -+++ b/test/interoperability_with_c/007_fortran_call_c_array_struct/fortran_main013.f90 -@@ -0,0 +1,16 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is array of type int_least32_t without iso_c_binding ++++ b/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/fortran_main013.f90 +@@ -0,0 +1,14 @@ ++! Test fortran call c for the scalar type and the scalar type is ++! int_least32_t with iso_c_binding +! +program main -+ type, bind(c) :: t -+ integer(4) :: x(2) = -2147483647 -+ end type t -+ type(t) :: my_t ++ use iso_c_binding ++ integer(C_INT_LEAST32_T) :: my_x(2) = 1 + interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a ++ subroutine c_func(b) ++ use iso_c_binding ++ integer(C_INT_LEAST32_T) :: b(2) + end + end interface -+ call c_func(my_t) ++ call c_func(my_x) +end -diff --git a/test/interoperability_with_c/007_fortran_call_c_array_struct/fortran_main014.f90 b/test/interoperability_with_c/007_fortran_call_c_array_struct/fortran_main014.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/fortran_main014.f90 b/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/fortran_main014.f90 new file mode 100644 -index 0000000..366a7a3 +index 0000000..09830a3 --- /dev/null -+++ b/test/interoperability_with_c/007_fortran_call_c_array_struct/fortran_main014.f90 -@@ -0,0 +1,16 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is array of type int_least64_t without iso_c_binding ++++ b/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/fortran_main014.f90 +@@ -0,0 +1,14 @@ ++! Test fortran call c for the scalar type and the scalar type is ++! int_least64_t with iso_c_binding +! +program main -+ type, bind(c) :: t -+ integer(8) :: x(2) = -9223372036854775807 -+ end type t -+ type(t) :: my_t ++ use iso_c_binding ++ integer(C_INT_LEAST64_T) :: my_x(2) = 1 + interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a ++ subroutine c_func(b) ++ use iso_c_binding ++ integer(C_INT_LEAST64_T) :: b(2) + end + end interface -+ call c_func(my_t) ++ call c_func(my_x) +end -diff --git a/test/interoperability_with_c/007_fortran_call_c_array_struct/fortran_main015.f90 b/test/interoperability_with_c/007_fortran_call_c_array_struct/fortran_main015.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/fortran_main015.f90 b/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/fortran_main015.f90 new file mode 100644 -index 0000000..654302d +index 0000000..0663936 --- /dev/null -+++ b/test/interoperability_with_c/007_fortran_call_c_array_struct/fortran_main015.f90 -@@ -0,0 +1,16 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is array of type int_fast8_t without iso_c_binding ++++ b/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/fortran_main015.f90 +@@ -0,0 +1,14 @@ ++! Test fortran call c for the scalar type and the scalar type is ++! int_fast8_t with iso_c_binding +! +program main -+ type, bind(c) :: t -+ integer(1) :: x(2) = -128 -+ end type t -+ type(t) :: my_t ++ use iso_c_binding ++ integer(C_INT_FAST8_T) :: my_x(2) = 1 + interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a ++ subroutine c_func(b) ++ use iso_c_binding ++ integer(C_INT_FAST8_T) :: b(2) + end + end interface -+ call c_func(my_t) ++ call c_func(my_x) +end -diff --git a/test/interoperability_with_c/007_fortran_call_c_array_struct/fortran_main016.f90 b/test/interoperability_with_c/007_fortran_call_c_array_struct/fortran_main016.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/fortran_main016.f90 b/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/fortran_main016.f90 new file mode 100644 -index 0000000..78727d9 +index 0000000..3ed798b --- /dev/null -+++ b/test/interoperability_with_c/007_fortran_call_c_array_struct/fortran_main016.f90 -@@ -0,0 +1,16 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is array of type int_fast16_t without iso_c_binding ++++ b/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/fortran_main016.f90 +@@ -0,0 +1,14 @@ ++! Test fortran call c for the scalar type and the scalar type is ++! int_fast16_t with iso_c_binding +! +program main -+ type, bind(c) :: t -+ integer(8) :: x(2) = -32768 -+ end type t -+ type(t) :: my_t ++ use iso_c_binding ++ integer(C_INT_FAST16_T) :: my_x(2) = 1 + interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a ++ subroutine c_func(b) ++ use iso_c_binding ++ integer(C_INT_FAST16_T) :: b(2) + end + end interface -+ call c_func(my_t) ++ call c_func(my_x) +end -diff --git a/test/interoperability_with_c/007_fortran_call_c_array_struct/fortran_main017.f90 b/test/interoperability_with_c/007_fortran_call_c_array_struct/fortran_main017.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/fortran_main017.f90 b/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/fortran_main017.f90 new file mode 100644 -index 0000000..122b60d +index 0000000..ad04f7a --- /dev/null -+++ b/test/interoperability_with_c/007_fortran_call_c_array_struct/fortran_main017.f90 -@@ -0,0 +1,16 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is array of type int_fast32_t without iso_c_binding -+! ++++ b/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/fortran_main017.f90 +@@ -0,0 +1,14 @@ ++! Test fortran call c for the scalar type and the scalar type is ++! int_fast32_t with iso_c_binding ++! +program main -+ type, bind(c) :: t -+ integer(8) :: x(2) = -2147483647 -+ end type t -+ type(t) :: my_t ++ use iso_c_binding ++ integer(C_INT_FAST32_T) :: my_x(2) = 1 + interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a ++ subroutine c_func(b) ++ use iso_c_binding ++ integer(C_INT_FAST32_T) :: b(2) + end + end interface -+ call c_func(my_t) ++ call c_func(my_x) +end -diff --git a/test/interoperability_with_c/007_fortran_call_c_array_struct/fortran_main018.f90 b/test/interoperability_with_c/007_fortran_call_c_array_struct/fortran_main018.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/fortran_main018.f90 b/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/fortran_main018.f90 new file mode 100644 -index 0000000..245cca8 +index 0000000..21bccab --- /dev/null -+++ b/test/interoperability_with_c/007_fortran_call_c_array_struct/fortran_main018.f90 -@@ -0,0 +1,16 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is array of type int_fast64_t without iso_c_binding ++++ b/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/fortran_main018.f90 +@@ -0,0 +1,14 @@ ++! Test fortran call c for the scalar type and the scalar type is ++! int_fast64_t with iso_c_binding +! +program main -+ type, bind(c) :: t -+ integer(8) :: x(2) = -9223372036854775807 -+ end type t -+ type(t) :: my_t ++ use iso_c_binding ++ integer(C_INT_FAST64_T) :: my_x(2) = 1 + interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a ++ subroutine c_func(b) ++ use iso_c_binding ++ integer(C_INT_FAST64_T) :: b(2) + end + end interface -+ call c_func(my_t) ++ call c_func(my_x) +end -diff --git a/test/interoperability_with_c/007_fortran_call_c_array_struct/fortran_main019.f90 b/test/interoperability_with_c/007_fortran_call_c_array_struct/fortran_main019.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/fortran_main019.f90 b/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/fortran_main019.f90 new file mode 100644 -index 0000000..f46b68f +index 0000000..0ec82b6 --- /dev/null -+++ b/test/interoperability_with_c/007_fortran_call_c_array_struct/fortran_main019.f90 -@@ -0,0 +1,16 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is array of type intmax_t without iso_c_binding ++++ b/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/fortran_main019.f90 +@@ -0,0 +1,14 @@ ++! Test fortran call c for the scalar type and the scalar type is ++! intmax_t with iso_c_binding +! +program main -+ type, bind(c) :: t -+ integer(8) :: x(2) = -9223372036854775807 -+ end type t -+ type(t) :: my_t ++ use iso_c_binding ++ integer(C_INTMAX_T) :: my_x(2) = 1 + interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a ++ subroutine c_func(b) ++ use iso_c_binding ++ integer(C_INTMAX_T) :: b(2) + end + end interface -+ call c_func(my_t) ++ call c_func(my_x) +end -diff --git a/test/interoperability_with_c/007_fortran_call_c_array_struct/fortran_main020.f90 b/test/interoperability_with_c/007_fortran_call_c_array_struct/fortran_main020.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/fortran_main020.f90 b/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/fortran_main020.f90 new file mode 100644 -index 0000000..21ec77a +index 0000000..dabd45d --- /dev/null -+++ b/test/interoperability_with_c/007_fortran_call_c_array_struct/fortran_main020.f90 -@@ -0,0 +1,16 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is array of type intptr_t without iso_c_binding ++++ b/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/fortran_main020.f90 +@@ -0,0 +1,14 @@ ++! Test fortran call c for the scalar type and the scalar type is ++! intptr_t with iso_c_binding +! +program main -+ type, bind(c) :: t -+ integer(8) :: x(2) = -9223372036854775807 -+ end type t -+ type(t) :: my_t ++ use iso_c_binding ++ integer(C_INTPTR_T) :: my_x(2) = 1 + interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a ++ subroutine c_func(b) ++ use iso_c_binding ++ integer(C_INTPTR_T) :: b(2) + end + end interface -+ call c_func(my_t) ++ call c_func(my_x) +end -diff --git a/test/interoperability_with_c/007_fortran_call_c_array_struct/fortran_main021.f90 b/test/interoperability_with_c/007_fortran_call_c_array_struct/fortran_main021.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/fortran_main021.f90 b/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/fortran_main021.f90 new file mode 100644 -index 0000000..fe827d4 +index 0000000..e0b4407 --- /dev/null -+++ b/test/interoperability_with_c/007_fortran_call_c_array_struct/fortran_main021.f90 -@@ -0,0 +1,16 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is array of type float without iso_c_binding ++++ b/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/fortran_main021.f90 +@@ -0,0 +1,14 @@ ++! Test fortran call c for the scalar type and the scalar type is float ++! with iso_c_binding +! +program main -+ type, bind(c) :: t -+ real(4) :: x(2) = 3.14 -+ end type t -+ type(t) :: my_t ++ use iso_c_binding ++ real(C_FLOAT) :: my_x(2) = 12345678.7654321 + interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a ++ subroutine c_func(b) ++ use iso_c_binding ++ real(C_FLOAT) :: b(2) + end + end interface -+ call c_func(my_t) ++ call c_func(my_x) +end -diff --git a/test/interoperability_with_c/007_fortran_call_c_array_struct/fortran_main022.f90 b/test/interoperability_with_c/007_fortran_call_c_array_struct/fortran_main022.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/fortran_main022.f90 b/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/fortran_main022.f90 new file mode 100644 -index 0000000..55bd7d1 +index 0000000..453383e --- /dev/null -+++ b/test/interoperability_with_c/007_fortran_call_c_array_struct/fortran_main022.f90 -@@ -0,0 +1,16 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is array of type double without iso_c_binding ++++ b/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/fortran_main022.f90 +@@ -0,0 +1,14 @@ ++! Test fortran call c for the scalar type and the scalar type is double ++! with iso_c_binding +! +program main -+ type, bind(c) :: t -+ real(8) :: x(2) = 450359962737049.621345 -+ end type t -+ type(t) :: my_t ++ use iso_c_binding ++ real(C_DOUBLE) :: my_x(2) = 3.14159265358979 + interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a ++ subroutine c_func(b) ++ use iso_c_binding ++ real(C_DOUBLE) :: b(2) + end + end interface -+ call c_func(my_t) ++ call c_func(my_x) +end -diff --git a/test/interoperability_with_c/007_fortran_call_c_array_struct/fortran_main023.f90 b/test/interoperability_with_c/007_fortran_call_c_array_struct/fortran_main023.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/fortran_main023.f90 b/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/fortran_main023.f90 new file mode 100644 -index 0000000..8f17598 +index 0000000..527cb8a --- /dev/null -+++ b/test/interoperability_with_c/007_fortran_call_c_array_struct/fortran_main023.f90 -@@ -0,0 +1,17 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is array of type long double without iso_c_binding ++++ b/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/fortran_main023.f90 +@@ -0,0 +1,14 @@ ++! Test fortran call c for the scalar type and the scalar type is ++! long double with iso_c_binding +! +program main -+ integer, parameter :: K = selected_real_kind(16) -+ type, bind(c) :: t -+ real(K) :: x(2) = 450359962737049.621345 -+ end type t -+ type(t) :: my_t ++ use iso_c_binding ++ real(C_LONG_DOUBLE) :: my_x(2) = 3.14159265358979 + interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a ++ subroutine c_func(b) ++ use iso_c_binding ++ real(C_LONG_DOUBLE) :: b(2) + end + end interface -+ call c_func(my_t) ++ call c_func(my_x) +end -diff --git a/test/interoperability_with_c/007_fortran_call_c_array_struct/fortran_main024.f90 b/test/interoperability_with_c/007_fortran_call_c_array_struct/fortran_main024.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/fortran_main024.f90 b/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/fortran_main024.f90 new file mode 100644 -index 0000000..635ac18 +index 0000000..a1d726f --- /dev/null -+++ b/test/interoperability_with_c/007_fortran_call_c_array_struct/fortran_main024.f90 -@@ -0,0 +1,16 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is array of type float _Complex without iso_c_binding ++++ b/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/fortran_main024.f90 +@@ -0,0 +1,14 @@ ++! Test fortran call c for the scalar type and the scalar type is ++! float _Complex with iso_c_binding +! +program main -+ type, bind(c) :: t -+ complex(4) :: x(2) = (-3, 1) -+ end type t -+ type(t) :: my_t ++ use iso_c_binding ++ complex(C_FLOAT_COMPLEX) :: my_x(2) = (-12345678.7654321, 1) + interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a ++ subroutine c_func(b) ++ use iso_c_binding ++ complex(C_FLOAT_COMPLEX) :: b(2) + end + end interface -+ call c_func(my_t) ++ call c_func(my_x) +end -diff --git a/test/interoperability_with_c/007_fortran_call_c_array_struct/fortran_main025.f90 b/test/interoperability_with_c/007_fortran_call_c_array_struct/fortran_main025.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/fortran_main025.f90 b/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/fortran_main025.f90 new file mode 100644 -index 0000000..66ec48b +index 0000000..d8e8d58 --- /dev/null -+++ b/test/interoperability_with_c/007_fortran_call_c_array_struct/fortran_main025.f90 -@@ -0,0 +1,16 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is array of type double _Complex without iso_c_binding ++++ b/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/fortran_main025.f90 +@@ -0,0 +1,14 @@ ++! Test fortran call c for the scalar type and the scalar type is ++! double _Complex with iso_c_binding +! +program main -+ type, bind(c) :: t -+ complex(8) :: x(2) = (-3, 1) -+ end type t -+ type(t) :: my_t ++ use iso_c_binding ++ complex(C_DOUBLE_COMPLEX) :: my_x(2) = (-3.14159265358979, 1) + interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a ++ subroutine c_func(b) ++ use iso_c_binding ++ complex(C_DOUBLE_COMPLEX) :: b(2) + end + end interface -+ call c_func(my_t) ++ call c_func(my_x) +end -diff --git a/test/interoperability_with_c/007_fortran_call_c_array_struct/fortran_main026.f90 b/test/interoperability_with_c/007_fortran_call_c_array_struct/fortran_main026.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/fortran_main026.f90 b/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/fortran_main026.f90 new file mode 100644 -index 0000000..304647b +index 0000000..b90c2ce --- /dev/null -+++ b/test/interoperability_with_c/007_fortran_call_c_array_struct/fortran_main026.f90 -@@ -0,0 +1,18 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is array of type long double _Complex without -+! iso_c_binding ++++ b/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/fortran_main026.f90 +@@ -0,0 +1,14 @@ ++! Test fortran call c for the scalar type and the scalar type is ++! long double _Complex with iso_c_binding +! +program main -+ integer, parameter :: K = selected_real_kind(16) -+ type, bind(c) :: t -+ complex(K) :: x(2) = (-3.1415926, 1.654) -+ end type t -+ type(t) :: my_t ++ use iso_c_binding ++ complex(C_LONG_DOUBLE_COMPLEX) :: my_x(2) = (-3.14159265358979, 1) + interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a ++ subroutine c_func(b) ++ use iso_c_binding ++ complex(C_LONG_DOUBLE_COMPLEX) :: b(2) + end + end interface -+ call c_func(my_t) ++ call c_func(my_x) +end -diff --git a/test/interoperability_with_c/007_fortran_call_c_array_struct/fortran_main027.f90 b/test/interoperability_with_c/007_fortran_call_c_array_struct/fortran_main027.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/fortran_main027.f90 b/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/fortran_main027.f90 new file mode 100644 -index 0000000..e454591 +index 0000000..ad4ac52 --- /dev/null -+++ b/test/interoperability_with_c/007_fortran_call_c_array_struct/fortran_main027.f90 -@@ -0,0 +1,15 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is array of type _Bool without iso_c_binding ++++ b/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/fortran_main027.f90 +@@ -0,0 +1,14 @@ ++! Test fortran call c for the scalar type and the scalar type is _Bool ++! with iso_c_binding +! -+ type, bind(c) :: t -+ logical(1) :: x(2) = .TRUE. -+ end type t -+ type(t) :: my_t ++program main ++ use iso_c_binding ++ logical(C_BOOL) :: my_x(2) = .FALSE. + interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a ++ subroutine c_func(b) ++ use iso_c_binding ++ logical(C_BOOL) :: b(2) + end + end interface -+ call c_func(my_t) ++ call c_func(my_x) +end -diff --git a/test/interoperability_with_c/007_fortran_call_c_array_struct/fortran_main028.f90 b/test/interoperability_with_c/007_fortran_call_c_array_struct/fortran_main028.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/fortran_main028.f90 b/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/fortran_main028.f90 new file mode 100644 -index 0000000..e2ee053 +index 0000000..d7a220b --- /dev/null -+++ b/test/interoperability_with_c/007_fortran_call_c_array_struct/fortran_main028.f90 -@@ -0,0 +1,16 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is array of type char without iso_c_binding ++++ b/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/fortran_main028.f90 +@@ -0,0 +1,14 @@ ++! Test fortran call c for the scalar type and the scalar type is char ++! with iso_c_binding +! +program main -+ type, bind(c) :: t -+ character :: x(2) = 'b' -+ end type t -+ type(t) :: my_t ++ use iso_c_binding ++ character(C_CHAR) :: my_x(2) = 'a' + interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a ++ subroutine c_func(b) ++ use iso_c_binding ++ character(C_CHAR) :: b(2) + end + end interface -+ call c_func(my_t) ++ call c_func(my_x) +end -diff --git a/test/interoperability_with_c/007_fortran_call_c_array_struct/run.sh b/test/interoperability_with_c/007_fortran_call_c_array_struct/run.sh +diff --git a/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/run.sh b/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/run.sh new file mode 100644 -index 0000000..632b582 +index 0000000..b865403 --- /dev/null -+++ b/test/interoperability_with_c/007_fortran_call_c_array_struct/run.sh -@@ -0,0 +1,17 @@ ++++ b/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/run.sh +@@ -0,0 +1,16 @@ +for i in {001..028} +do +echo "------- test $i ------." @@ -6449,1212 +5965,850 @@ index 0000000..632b582 +./a.out +rm *.o a.out +done -+ -diff --git a/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/c_func001.c b/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/c_func001.c +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/c_func001.c b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/c_func001.c new file mode 100644 -index 0000000..6535dd7 +index 0000000..c7cf73f --- /dev/null -+++ b/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/c_func001.c -@@ -0,0 +1,10 @@ ++++ b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/c_func001.c +@@ -0,0 +1,5 @@ +#include -+struct BaseTy { -+ int j; -+}; -+struct Ty { -+ struct BaseTy bt; -+}; -+void c_func_(struct Ty *t) { -+ printf("%d\n", t->bt.j); ++void c_func_(int *a) { ++ printf("%d\n", a[0]); ++ printf("%d\n", a[1]); +} -diff --git a/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/c_func002.c b/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/c_func002.c +diff --git a/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/c_func002.c b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/c_func002.c new file mode 100644 -index 0000000..e9bb160 +index 0000000..010cdf7 --- /dev/null -+++ b/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/c_func002.c -@@ -0,0 +1,10 @@ ++++ b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/c_func002.c +@@ -0,0 +1,6 @@ +#include -+struct BaseTy { -+ short j; -+}; -+struct Ty { -+ struct BaseTy bt; -+}; -+void c_func_(struct Ty *t) { -+ printf("%hd\n", t->bt.j); ++#include ++void c_func_(short *a) { ++ printf("%hd\n", a[0]); ++ printf("%hd\n", a[1]); +} -diff --git a/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/c_func003.c b/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/c_func003.c +diff --git a/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/c_func003.c b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/c_func003.c new file mode 100644 -index 0000000..99c95b0 +index 0000000..5e69081 --- /dev/null -+++ b/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/c_func003.c -@@ -0,0 +1,10 @@ ++++ b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/c_func003.c +@@ -0,0 +1,6 @@ +#include -+struct BaseTy { -+ long j; -+}; -+struct Ty { -+ struct BaseTy bt; -+}; -+void c_func_(struct Ty *t) { -+ printf("%ld\n", t->bt.j); ++#include ++void c_func_(long *a) { ++ printf("%ld\n", a[0]); ++ printf("%ld\n", a[1]); +} -diff --git a/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/c_func004.c b/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/c_func004.c +diff --git a/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/c_func004.c b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/c_func004.c new file mode 100644 -index 0000000..69a1176 +index 0000000..3f74c8e --- /dev/null -+++ b/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/c_func004.c -@@ -0,0 +1,10 @@ ++++ b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/c_func004.c +@@ -0,0 +1,6 @@ +#include -+struct BaseTy { -+ long long j; -+}; -+struct Ty { -+ struct BaseTy bt; -+}; -+void c_func_(struct Ty *t) { -+ printf("%lld\n", t->bt.j); ++#include ++void c_func_(long long *a) { ++ printf("%lld\n", a[0]); ++ printf("%lld\n", a[1]); +} -diff --git a/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/c_func005.c b/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/c_func005.c +diff --git a/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/c_func005.c b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/c_func005.c new file mode 100644 -index 0000000..d5e28b1 +index 0000000..77794d4 --- /dev/null -+++ b/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/c_func005.c -@@ -0,0 +1,10 @@ ++++ b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/c_func005.c +@@ -0,0 +1,5 @@ +#include -+struct BaseTy { -+ signed char j; -+}; -+struct Ty { -+ struct BaseTy bt; -+}; -+void c_func_(struct Ty *t) { -+ printf("%c\n", t->bt.j); ++void c_func_(signed char *a) { ++ printf("%c\n", a[0]); ++ printf("%c\n", a[1]); +} -diff --git a/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/c_func006.c b/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/c_func006.c +diff --git a/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/c_func006.c b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/c_func006.c new file mode 100644 -index 0000000..542ddbc +index 0000000..27c475f --- /dev/null -+++ b/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/c_func006.c -@@ -0,0 +1,10 @@ ++++ b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/c_func006.c +@@ -0,0 +1,6 @@ +#include -+struct BaseTy { -+ size_t j; -+}; -+struct Ty { -+ struct BaseTy bt; -+}; -+void c_func_(struct Ty *t) { -+ printf("%ld\n", t->bt.j); ++#include ++void c_func_(size_t *a) { ++ printf("%ld\n", a[0]); ++ printf("%ld\n", a[1]); +} -diff --git a/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/c_func007.c b/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/c_func007.c +diff --git a/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/c_func007.c b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/c_func007.c new file mode 100644 -index 0000000..71ceb1c +index 0000000..f7c4384 --- /dev/null -+++ b/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/c_func007.c -@@ -0,0 +1,11 @@ ++++ b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/c_func007.c +@@ -0,0 +1,6 @@ +#include +#include -+struct BaseTy { -+ int8_t j; -+}; -+struct Ty { -+ struct BaseTy bt; -+}; -+void c_func_(struct Ty *t) { -+ printf("%hhd\n", t->bt.j); ++void c_func_(int8_t *a) { ++ printf("%hhd\n", a[0]); ++ printf("%hhd\n", a[1]); +} -diff --git a/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/c_func008.c b/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/c_func008.c +diff --git a/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/c_func008.c b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/c_func008.c new file mode 100644 -index 0000000..b6489b2 +index 0000000..e29971f --- /dev/null -+++ b/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/c_func008.c -@@ -0,0 +1,11 @@ ++++ b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/c_func008.c +@@ -0,0 +1,6 @@ +#include +#include -+struct BaseTy { -+ int16_t j; -+}; -+struct Ty { -+ struct BaseTy bt; -+}; -+void c_func_(struct Ty *t) { -+ printf("%hd\n", t->bt.j); ++void c_func_(int16_t *a) { ++ printf("%hd\n", a[0]); ++ printf("%hd\n", a[1]); +} -diff --git a/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/c_func009.c b/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/c_func009.c +diff --git a/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/c_func009.c b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/c_func009.c new file mode 100644 -index 0000000..7ba6646 +index 0000000..3b84c1a --- /dev/null -+++ b/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/c_func009.c -@@ -0,0 +1,11 @@ ++++ b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/c_func009.c +@@ -0,0 +1,6 @@ +#include +#include -+struct BaseTy { -+ int32_t j; -+}; -+struct Ty { -+ struct BaseTy bt; -+}; -+void c_func_(struct Ty *t) { -+ printf("%d\n", t->bt.j); ++void c_func_(int32_t *a) { ++ printf("%d\n", a[0]); ++ printf("%d\n", a[1]); +} -diff --git a/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/c_func010.c b/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/c_func010.c +diff --git a/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/c_func010.c b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/c_func010.c new file mode 100644 -index 0000000..672e95b +index 0000000..11ca3e1 --- /dev/null -+++ b/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/c_func010.c -@@ -0,0 +1,11 @@ ++++ b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/c_func010.c +@@ -0,0 +1,6 @@ +#include +#include -+struct BaseTy { -+ int64_t j; -+}; -+struct Ty { -+ struct BaseTy bt; -+}; -+void c_func_(struct Ty *t) { -+ printf("%ld\n", t->bt.j); ++void c_func_(int64_t *a) { ++ printf("%ld\n", a[0]); ++ printf("%ld\n", a[1]); +} -diff --git a/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/c_func011.c b/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/c_func011.c +diff --git a/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/c_func011.c b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/c_func011.c new file mode 100644 -index 0000000..802995a +index 0000000..f830d74 --- /dev/null -+++ b/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/c_func011.c -@@ -0,0 +1,11 @@ ++++ b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/c_func011.c +@@ -0,0 +1,6 @@ +#include +#include -+struct BaseTy { -+ int_least8_t j; -+}; -+struct Ty { -+ struct BaseTy bt; -+}; -+void c_func_(struct Ty *t) { -+ printf("%hhd\n", t->bt.j); ++void c_func_(int_least8_t *a) { ++ printf("%hhd\n", a[0]); ++ printf("%hhd\n", a[1]); +} -diff --git a/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/c_func012.c b/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/c_func012.c +diff --git a/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/c_func012.c b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/c_func012.c new file mode 100644 -index 0000000..bcc8dbd +index 0000000..6ffd7e3 --- /dev/null -+++ b/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/c_func012.c -@@ -0,0 +1,11 @@ ++++ b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/c_func012.c +@@ -0,0 +1,6 @@ +#include +#include -+struct BaseTy { -+ int_least16_t j; -+}; -+struct Ty { -+ struct BaseTy bt; -+}; -+void c_func_(struct Ty *t) { -+ printf("%hd\n", t->bt.j); ++void c_func_(int_least16_t *a) { ++ printf("%hd\n", a[0]); ++ printf("%hd\n", a[1]); +} -diff --git a/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/c_func013.c b/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/c_func013.c +diff --git a/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/c_func013.c b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/c_func013.c new file mode 100644 -index 0000000..4688138 +index 0000000..4b367cb --- /dev/null -+++ b/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/c_func013.c -@@ -0,0 +1,11 @@ ++++ b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/c_func013.c +@@ -0,0 +1,6 @@ +#include +#include -+struct BaseTy { -+ int_least32_t j; -+}; -+struct Ty { -+ struct BaseTy bt; -+}; -+void c_func_(struct Ty *t) { -+ printf("%d\n", t->bt.j); ++void c_func_(int_least32_t *a) { ++ printf("%d\n", a[0]); ++ printf("%d\n", a[1]); +} -diff --git a/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/c_func014.c b/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/c_func014.c +diff --git a/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/c_func014.c b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/c_func014.c new file mode 100644 -index 0000000..1c30ccc +index 0000000..6b2d5b3 --- /dev/null -+++ b/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/c_func014.c -@@ -0,0 +1,11 @@ ++++ b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/c_func014.c +@@ -0,0 +1,6 @@ +#include +#include -+struct BaseTy { -+ int_least64_t j; -+}; -+struct Ty { -+ struct BaseTy bt; -+}; -+void c_func_(struct Ty *t) { -+ printf("%ld\n", t->bt.j); ++void c_func_(int_least64_t *a) { ++ printf("%ld\n", a[0]); ++ printf("%ld\n", a[1]); +} -diff --git a/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/c_func015.c b/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/c_func015.c +diff --git a/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/c_func015.c b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/c_func015.c new file mode 100644 -index 0000000..0d3e522 +index 0000000..81d223a --- /dev/null -+++ b/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/c_func015.c -@@ -0,0 +1,11 @@ ++++ b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/c_func015.c +@@ -0,0 +1,6 @@ +#include +#include -+struct BaseTy { -+ int_fast8_t j; -+}; -+struct Ty { -+ struct BaseTy bt; -+}; -+void c_func_(struct Ty *t) { -+ printf("%hhd\n", t->bt.j); ++void c_func_(int_fast8_t *a) { ++ printf("%hhd\n", a[0]); ++ printf("%hhd\n", a[1]); +} -diff --git a/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/c_func016.c b/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/c_func016.c +diff --git a/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/c_func016.c b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/c_func016.c new file mode 100644 -index 0000000..e98a73b +index 0000000..297be3a --- /dev/null -+++ b/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/c_func016.c -@@ -0,0 +1,11 @@ ++++ b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/c_func016.c +@@ -0,0 +1,6 @@ +#include +#include -+struct BaseTy { -+ int_fast16_t j; -+}; -+struct Ty { -+ struct BaseTy bt; -+}; -+void c_func_(struct Ty *t) { -+ printf("%ld\n", t->bt.j); ++void c_func_(int_fast16_t *a) { ++ printf("%ld\n", a[0]); ++ printf("%ld\n", a[1]); +} -diff --git a/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/c_func017.c b/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/c_func017.c +diff --git a/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/c_func017.c b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/c_func017.c new file mode 100644 -index 0000000..ef890d5 +index 0000000..8eb5818 --- /dev/null -+++ b/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/c_func017.c -@@ -0,0 +1,11 @@ ++++ b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/c_func017.c +@@ -0,0 +1,6 @@ +#include +#include -+struct BaseTy { -+ int_fast32_t j; -+}; -+struct Ty { -+ struct BaseTy bt; -+}; -+void c_func_(struct Ty *t) { -+ printf("%ld\n", t->bt.j); ++void c_func_(int_fast32_t *a) { ++ printf("%ld\n", a[0]); ++ printf("%ld\n", a[1]); +} -diff --git a/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/c_func018.c b/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/c_func018.c +diff --git a/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/c_func018.c b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/c_func018.c new file mode 100644 -index 0000000..4eb17aa +index 0000000..030b1f7 --- /dev/null -+++ b/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/c_func018.c -@@ -0,0 +1,11 @@ ++++ b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/c_func018.c +@@ -0,0 +1,6 @@ +#include +#include -+struct BaseTy { -+ int_fast64_t j; -+}; -+struct Ty { -+ struct BaseTy bt; -+}; -+void c_func_(struct Ty *t) { -+ printf("%ld\n", t->bt.j); ++void c_func_(int_fast64_t *a) { ++ printf("%ld\n", a[0]); ++ printf("%ld\n", a[1]); +} -diff --git a/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/c_func019.c b/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/c_func019.c +diff --git a/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/c_func019.c b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/c_func019.c new file mode 100644 -index 0000000..e88ed31 +index 0000000..babfc75 --- /dev/null -+++ b/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/c_func019.c -@@ -0,0 +1,11 @@ ++++ b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/c_func019.c +@@ -0,0 +1,6 @@ +#include +#include -+struct BaseTy { -+ intmax_t j; -+}; -+struct Ty { -+ struct BaseTy bt; -+}; -+void c_func_(struct Ty *t) { -+ printf("%ld\n", t->bt.j); ++void c_func_(intmax_t *a) { ++ printf("%ld\n", a[0]); ++ printf("%ld\n", a[1]); +} -diff --git a/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/c_func020.c b/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/c_func020.c +diff --git a/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/c_func020.c b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/c_func020.c new file mode 100644 -index 0000000..8a50887 +index 0000000..26c7726 --- /dev/null -+++ b/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/c_func020.c -@@ -0,0 +1,11 @@ ++++ b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/c_func020.c +@@ -0,0 +1,6 @@ +#include +#include -+struct BaseTy { -+ intptr_t j; -+}; -+struct Ty { -+ struct BaseTy bt; -+}; -+void c_func_(struct Ty *t) { -+ printf("%ld\n", t->bt.j); ++void c_func_(intptr_t *a) { ++ printf("%ld\n", a[0]); ++ printf("%ld\n", a[1]); +} -diff --git a/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/c_func021.c b/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/c_func021.c +diff --git a/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/c_func021.c b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/c_func021.c new file mode 100644 -index 0000000..c8f6dac +index 0000000..a73f11b --- /dev/null -+++ b/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/c_func021.c -@@ -0,0 +1,10 @@ ++++ b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/c_func021.c +@@ -0,0 +1,5 @@ +#include -+struct BaseTy { -+ float j; -+}; -+struct Ty { -+ struct BaseTy bt; -+}; -+void c_func_(struct Ty *t) { -+ printf("%.2f\n", t->bt.j); ++void c_func_(float *a) { ++ printf("%f\n", a[0]); ++ printf("%f\n", a[1]); +} -diff --git a/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/c_func022.c b/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/c_func022.c +diff --git a/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/c_func022.c b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/c_func022.c new file mode 100644 -index 0000000..72ce135 +index 0000000..688f3c0 --- /dev/null -+++ b/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/c_func022.c -@@ -0,0 +1,10 @@ ++++ b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/c_func022.c +@@ -0,0 +1,5 @@ +#include -+struct BaseTy { -+ double j; -+}; -+struct Ty { -+ struct BaseTy bt; -+}; -+void c_func_(struct Ty *t) { -+ printf("%.2f\n", t->bt.j); ++void c_func_(double *a) { ++ printf("%20lf\n", a[0]); ++ printf("%20lf\n", a[1]); +} -diff --git a/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/c_func023.c b/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/c_func023.c +diff --git a/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/c_func023.c b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/c_func023.c new file mode 100644 -index 0000000..b3f0db5 +index 0000000..af86ba3 --- /dev/null -+++ b/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/c_func023.c -@@ -0,0 +1,10 @@ ++++ b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/c_func023.c +@@ -0,0 +1,5 @@ +#include -+struct BaseTy { -+ long double j; -+}; -+struct Ty { -+ struct BaseTy bt; -+}; -+void c_func_(struct Ty *t) { -+ printf("%.2Lf\n", t->bt.j); ++void c_func_(long double *a) { ++ printf("%20Lf\n", a[0]); ++ printf("%20Lf\n", a[1]); +} -diff --git a/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/c_func024.c b/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/c_func024.c +diff --git a/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/c_func024.c b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/c_func024.c new file mode 100644 -index 0000000..315c5c4 +index 0000000..1d34f02 --- /dev/null -+++ b/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/c_func024.c -@@ -0,0 +1,11 @@ ++++ b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/c_func024.c +@@ -0,0 +1,6 @@ +#include +#include -+struct BaseTy { -+ float _Complex j; -+}; -+struct Ty { -+ struct BaseTy bt; -+}; -+void c_func_(struct Ty *t) { -+ printf("%f + %fi\n", creal(t->bt.j), cimag(t->bt.j)); ++void c_func_(float _Complex *t) { ++ printf("%0.20f + %0.20fi\n", creal(t[0]), cimag(t[0])); ++ printf("%0.20f + %0.20fi\n", creal(t[1]), cimag(t[1])); +} -diff --git a/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/c_func025.c b/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/c_func025.c +diff --git a/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/c_func025.c b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/c_func025.c new file mode 100644 -index 0000000..4bfcf58 +index 0000000..12b9abb --- /dev/null -+++ b/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/c_func025.c -@@ -0,0 +1,11 @@ ++++ b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/c_func025.c +@@ -0,0 +1,6 @@ +#include +#include -+struct BaseTy { -+ double _Complex j; -+}; -+struct Ty { -+ struct BaseTy bt; -+}; -+void c_func_(struct Ty *t) { -+ printf("%.20lf + %.20lfi\n", creal(t->bt.j), cimag(t->bt.j)); ++void c_func_(double _Complex *t) { ++ printf("%20lf + %20lfi\n", creal(t[0]), cimag(t[0])); ++ printf("%20lf + %20lfi\n", creal(t[1]), cimag(t[1])); +} -diff --git a/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/c_func026.c b/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/c_func026.c +diff --git a/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/c_func026.c b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/c_func026.c new file mode 100644 -index 0000000..40b4a7b +index 0000000..78011d4 --- /dev/null -+++ b/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/c_func026.c -@@ -0,0 +1,11 @@ ++++ b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/c_func026.c +@@ -0,0 +1,6 @@ +#include +#include -+struct BaseTy { -+ long double _Complex j; -+}; -+struct Ty { -+ struct BaseTy bt; -+}; -+void c_func_(struct Ty *t) { -+ printf("%f + %fi\n", creal(t->bt.j), cimag(t->bt.j)); ++void c_func_(long double _Complex *t) { ++ printf("%20f + %20fi\n", creal(t[0]), cimag(t[0])); ++ printf("%20f + %20fi\n", creal(t[1]), cimag(t[1])); +} -diff --git a/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/c_func027.c b/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/c_func027.c +diff --git a/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/c_func027.c b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/c_func027.c new file mode 100644 -index 0000000..5614736 +index 0000000..91a49b5 --- /dev/null -+++ b/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/c_func027.c -@@ -0,0 +1,10 @@ ++++ b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/c_func027.c +@@ -0,0 +1,5 @@ +#include -+struct BaseTy { -+ _Bool j; -+}; -+struct Ty { -+ struct BaseTy bt; -+}; -+void c_func_(struct Ty *t, _Bool *a) { -+ printf("%d\n", t->bt.j); ++void c_func_(_Bool *a) { ++ printf("%d\n", a[0]); ++ printf("%d\n", a[1]); +} -diff --git a/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/c_func028.c b/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/c_func028.c +diff --git a/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/c_func028.c b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/c_func028.c new file mode 100644 -index 0000000..82233e7 +index 0000000..9335307 --- /dev/null -+++ b/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/c_func028.c -@@ -0,0 +1,11 @@ ++++ b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/c_func028.c +@@ -0,0 +1,5 @@ +#include -+#include -+struct BaseTy { -+ char j; -+}; -+struct Ty { -+ struct BaseTy bt; -+}; -+void c_func_(struct Ty *t) { -+ printf("%c\n", t->bt.j); ++void c_func_(char *a) { ++ printf("%c\n", a[0]); ++ printf("%c\n", a[1]); +} -diff --git a/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/fortran_main001.f90 b/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/fortran_main001.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/fortran_main001.f90 b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/fortran_main001.f90 new file mode 100644 -index 0000000..a87b80c +index 0000000..de41e30 --- /dev/null -+++ b/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/fortran_main001.f90 -@@ -0,0 +1,20 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is derived type the other component of derived type is -+! scalar type of int ++++ b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/fortran_main001.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the array type and the array type is int with ++! bindc +! +program main -+ type, bind(c) :: base -+ integer :: j = -2 -+ end type base -+ type, bind(c) :: t -+ type(base) :: bt -+ end type t -+ type(t) :: my_t ++ integer :: my_x(2) = 1 + interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a ++ subroutine c_func(b) bind(c, name = "c_func_") ++ integer :: b(2) + end + end interface -+ call c_func(my_t) ++ call c_func(my_x) +end -diff --git a/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/fortran_main002.f90 b/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/fortran_main002.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/fortran_main002.f90 b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/fortran_main002.f90 new file mode 100644 -index 0000000..eba5ed5 +index 0000000..5cbfa78 --- /dev/null -+++ b/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/fortran_main002.f90 -@@ -0,0 +1,20 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is derived type the other component of derived type is -+! scalar type of short ++++ b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/fortran_main002.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the array type and the array type is short ++! with bindc +! +program main -+ type, bind(c) :: base -+ integer(2) :: j = -2 -+ end type base -+ type, bind(c) :: t -+ type(base) :: bt -+ end type t -+ type(t) :: my_t ++ integer(2) :: my_x(2) = 1 + interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a ++ subroutine c_func(b) bind(c, name = "c_func_") ++ integer(2) :: b(2) + end + end interface -+ call c_func(my_t) ++ call c_func(my_x) +end -diff --git a/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/fortran_main003.f90 b/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/fortran_main003.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/fortran_main003.f90 b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/fortran_main003.f90 new file mode 100644 -index 0000000..73a5bcf +index 0000000..d7c5825 --- /dev/null -+++ b/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/fortran_main003.f90 -@@ -0,0 +1,20 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is derived type the other component of derived type is -+! scalar type of long ++++ b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/fortran_main003.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the array type and the array type is long ++! with bindc +! +program main -+ type, bind(c) :: base -+ integer(8) :: j = -2 -+ end type base -+ type, bind(c) :: t -+ type(base) :: bt -+ end type t -+ type(t) :: my_t ++ integer(8) :: my_x(2) = 1 + interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a ++ subroutine c_func(b) bind(c, name = "c_func_") ++ integer(8) :: b(2) + end + end interface -+ call c_func(my_t) ++ call c_func(my_x) +end -diff --git a/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/fortran_main004.f90 b/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/fortran_main004.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/fortran_main004.f90 b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/fortran_main004.f90 new file mode 100644 -index 0000000..55a915f +index 0000000..6f54746 --- /dev/null -+++ b/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/fortran_main004.f90 -@@ -0,0 +1,20 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is derived type the other component of derived type is -+! scalar type of long long ++++ b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/fortran_main004.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the array type and the array type is ++! long long with bindc +! +program main -+ type, bind(c) :: base -+ integer(8) :: j = -2 -+ end type base -+ type, bind(c) :: t -+ type(base) :: bt -+ end type t -+ type(t) :: my_t ++ integer(8) :: my_x(2) = 1 + interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a ++ subroutine c_func(b) bind(c, name = "c_func_") ++ integer(8) :: b(2) + end + end interface -+ call c_func(my_t) ++ call c_func(my_x) +end -diff --git a/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/fortran_main005.f90 b/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/fortran_main005.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/fortran_main005.f90 b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/fortran_main005.f90 new file mode 100644 -index 0000000..2531e8c +index 0000000..14607e5 --- /dev/null -+++ b/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/fortran_main005.f90 -@@ -0,0 +1,20 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is derived type the other component of derived type is -+! scalar type of signed char ++++ b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/fortran_main005.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the array type and the array type is ++! signed char with bindc +! +program main -+ type, bind(c) :: base -+ integer(1) :: j = 65 -+ end type base -+ type, bind(c) :: t -+ type(base) :: bt -+ end type t -+ type(t) :: my_t ++ integer(1) :: my_x(2) = 65 + interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a ++ subroutine c_func(b) bind(c, name = "c_func_") ++ integer(1) :: b(2) + end + end interface -+ call c_func(my_t) ++ call c_func(my_x) +end -diff --git a/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/fortran_main006.f90 b/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/fortran_main006.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/fortran_main006.f90 b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/fortran_main006.f90 new file mode 100644 -index 0000000..c9ae956 +index 0000000..56d0f08 --- /dev/null -+++ b/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/fortran_main006.f90 -@@ -0,0 +1,20 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is derived type the other component of derived type is -+! scalar type of size_t ++++ b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/fortran_main006.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the array type and the array type is size_t ++! with bindc +! +program main -+ type, bind(c) :: base -+ integer(8) :: j = 0 -+ end type base -+ type, bind(c) :: t -+ type(base) :: bt -+ end type t -+ type(t) :: my_t ++ integer(8) :: my_x(2) = 3 + interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a ++ subroutine c_func(b) bind(c, name = "c_func_") ++ integer(8) :: b(2) + end + end interface -+ call c_func(my_t) ++ call c_func(my_x) +end -diff --git a/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/fortran_main007.f90 b/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/fortran_main007.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/fortran_main007.f90 b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/fortran_main007.f90 new file mode 100644 -index 0000000..c864163 +index 0000000..73dd12f --- /dev/null -+++ b/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/fortran_main007.f90 -@@ -0,0 +1,20 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is derived type the other component of derived type is -+! scalar type of int8_t ++++ b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/fortran_main007.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the array type and the array type is int8_t ++! with bindc +! +program main -+ type, bind(c) :: base -+ integer(1) :: j = -2 -+ end type base -+ type, bind(c) :: t -+ type(base) :: bt -+ end type t -+ type(t) :: my_t ++ integer(1) :: my_x(2) = 1 + interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a ++ subroutine c_func(b) bind(c, name = "c_func_") ++ integer(1) :: b(2) + end + end interface -+ call c_func(my_t) ++ call c_func(my_x) +end -diff --git a/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/fortran_main008.f90 b/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/fortran_main008.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/fortran_main008.f90 b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/fortran_main008.f90 new file mode 100644 -index 0000000..4adf5fe +index 0000000..c496284 --- /dev/null -+++ b/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/fortran_main008.f90 -@@ -0,0 +1,20 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is derived type the other component of derived type is -+! scalar type of int16_t ++++ b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/fortran_main008.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the array type and the array type is int16_t ++! with bindc +! +program main -+ type, bind(c) :: base -+ integer(2) :: j = -2 -+ end type base -+ type, bind(c) :: t -+ type(base) :: bt -+ end type t -+ type(t) :: my_t ++ integer(2) :: my_x(2) = 1 + interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a ++ subroutine c_func(b) bind(c, name = "c_func_") ++ integer(2) :: b(2) + end + end interface -+ call c_func(my_t) ++ call c_func(my_x) +end -diff --git a/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/fortran_main009.f90 b/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/fortran_main009.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/fortran_main009.f90 b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/fortran_main009.f90 new file mode 100644 -index 0000000..57b4035 +index 0000000..aad0c4a --- /dev/null -+++ b/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/fortran_main009.f90 -@@ -0,0 +1,20 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is derived type the other component of derived type is -+! scalar type of int32_t ++++ b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/fortran_main009.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the array type and the array type is int32_t ++! with bindc +! +program main -+ type, bind(c) :: base -+ integer(4) :: j = -2 -+ end type base -+ type, bind(c) :: t -+ type(base) :: bt -+ end type t -+ type(t) :: my_t ++ integer(4) :: my_x(2) = 1 + interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a ++ subroutine c_func(b) bind(c, name = "c_func_") ++ integer(4) :: b(2) + end + end interface -+ call c_func(my_t) ++ call c_func(my_x) +end -diff --git a/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/fortran_main010.f90 b/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/fortran_main010.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/fortran_main010.f90 b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/fortran_main010.f90 new file mode 100644 -index 0000000..0183cad +index 0000000..495b43a --- /dev/null -+++ b/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/fortran_main010.f90 -@@ -0,0 +1,20 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is derived type the other component of derived type is -+! scalar type of int64_t ++++ b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/fortran_main010.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the array type and the array type is int64_t ++! with bindc +! +program main -+ type, bind(c) :: base -+ integer(8) :: j = -2 -+ end type base -+ type, bind(c) :: t -+ type(base) :: bt -+ end type t -+ type(t) :: my_t ++ integer(8) :: my_x(2) = 1 + interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a ++ subroutine c_func(b) bind(c, name = "c_func_") ++ integer(8) :: b(2) + end + end interface -+ call c_func(my_t) ++ call c_func(my_x) +end -diff --git a/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/fortran_main011.f90 b/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/fortran_main011.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/fortran_main011.f90 b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/fortran_main011.f90 new file mode 100644 -index 0000000..7b5942f +index 0000000..dcde21c --- /dev/null -+++ b/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/fortran_main011.f90 -@@ -0,0 +1,20 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is derived type the other component of derived type is -+! scalar type of int_least_8 ++++ b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/fortran_main011.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the scalar type and the scalar type is ++! int_least8_t with bindc +! +program main -+ type, bind(c) :: base -+ integer(1) :: j = -2 -+ end type base -+ type, bind(c) :: t -+ type(base) :: bt -+ end type t -+ type(t) :: my_t ++ integer(1) :: my_x(2) = 1 + interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a ++ subroutine c_func(b) bind(c, name = "c_func_") ++ integer(1) :: b(2) + end + end interface -+ call c_func(my_t) ++ call c_func(my_x) +end -diff --git a/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/fortran_main012.f90 b/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/fortran_main012.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/fortran_main012.f90 b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/fortran_main012.f90 new file mode 100644 -index 0000000..44c8378 +index 0000000..6399871 --- /dev/null -+++ b/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/fortran_main012.f90 -@@ -0,0 +1,20 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is derived type the other component of derived type is -+! scalar type of int_least16_t ++++ b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/fortran_main012.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the scalar type and the scalar type is ++! int_least16_t with bindc +! +program main -+ type, bind(c) :: base -+ integer(2) :: j = -2 -+ end type base -+ type, bind(c) :: t -+ type(base) :: bt -+ end type t -+ type(t) :: my_t ++ integer(2) :: my_x(2) = 1 + interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a ++ subroutine c_func(b) bind(c, name = "c_func_") ++ integer(2) :: b(2) + end + end interface -+ call c_func(my_t) ++ call c_func(my_x) +end -diff --git a/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/fortran_main013.f90 b/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/fortran_main013.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/fortran_main013.f90 b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/fortran_main013.f90 new file mode 100644 -index 0000000..f3e8018 +index 0000000..b49842e --- /dev/null -+++ b/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/fortran_main013.f90 -@@ -0,0 +1,20 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is derived type the other component of derived type is -+! scalar type of int_least32_t ++++ b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/fortran_main013.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the scalar type and the scalar type is ++! int_least32_t with bindc +! +program main -+ type, bind(c) :: base -+ integer(4) :: j = -2 -+ end type base -+ type, bind(c) :: t -+ type(base) :: bt -+ end type t -+ type(t) :: my_t ++ integer(4) :: my_x(2) = 1 + interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a ++ subroutine c_func(b) bind(c, name = "c_func_") ++ integer(4) :: b(2) + end + end interface -+ call c_func(my_t) ++ call c_func(my_x) +end -diff --git a/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/fortran_main014.f90 b/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/fortran_main014.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/fortran_main014.f90 b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/fortran_main014.f90 new file mode 100644 -index 0000000..143d75e +index 0000000..66fe325 --- /dev/null -+++ b/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/fortran_main014.f90 -@@ -0,0 +1,20 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is derived type the other component of derived type is -+! scalar type of int_least64_t ++++ b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/fortran_main014.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the scalar type and the scalar type is ++! int_least64_t with bindc +! +program main -+ type, bind(c) :: base -+ integer(8) :: j = -2 -+ end type base -+ type, bind(c) :: t -+ type(base) :: bt -+ end type t -+ type(t) :: my_t ++ integer(8) :: my_x(2) = 1 + interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a ++ subroutine c_func(b) bind(c, name = "c_func_") ++ integer(8) :: b(2) + end + end interface -+ call c_func(my_t) ++ call c_func(my_x) +end -diff --git a/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/fortran_main015.f90 b/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/fortran_main015.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/fortran_main015.f90 b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/fortran_main015.f90 new file mode 100644 -index 0000000..ded38dd +index 0000000..bfcf6a3 --- /dev/null -+++ b/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/fortran_main015.f90 -@@ -0,0 +1,20 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is derived type the other component of derived type is -+! scalar type of int_fast8_t ++++ b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/fortran_main015.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the scalar type and the scalar type is ++! int_fast8_t with bindc +! +program main -+ type, bind(c) :: base -+ integer(1) :: j = -2 -+ end type base -+ type, bind(c) :: t -+ type(base) :: bt -+ end type t -+ type(t) :: my_t ++ integer(1) :: my_x(2) = 1 + interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a ++ subroutine c_func(b) bind(c, name = "c_func_") ++ integer(1) :: b(2) + end + end interface -+ call c_func(my_t) ++ call c_func(my_x) +end -diff --git a/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/fortran_main016.f90 b/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/fortran_main016.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/fortran_main016.f90 b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/fortran_main016.f90 new file mode 100644 -index 0000000..79d6f7f +index 0000000..f9eef1c --- /dev/null -+++ b/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/fortran_main016.f90 -@@ -0,0 +1,20 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is derived type the other component of derived type is -+! scalar type of int_fast16_t ++++ b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/fortran_main016.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the scalar type and the scalar type is ++! int_fast16_t with bindc +! +program main -+ type, bind(c) :: base -+ integer(8) :: j = -2 -+ end type base -+ type, bind(c) :: t -+ type(base) :: bt -+ end type t -+ type(t) :: my_t ++ integer(8) :: my_x(2) = 1 + interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a ++ subroutine c_func(b) bind(c, name = "c_func_") ++ integer(8) :: b(2) + end + end interface -+ call c_func(my_t) ++ call c_func(my_x) +end -diff --git a/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/fortran_main017.f90 b/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/fortran_main017.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/fortran_main017.f90 b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/fortran_main017.f90 new file mode 100644 -index 0000000..b48cc58 +index 0000000..8f293c1 --- /dev/null -+++ b/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/fortran_main017.f90 -@@ -0,0 +1,20 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is derived type the other component of derived type is -+! scalar type of int_fast32_t ++++ b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/fortran_main017.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the scalar type and the scalar type is ++! int_fast32_t with bindc +! +program main -+ type, bind(c) :: base -+ integer(8) :: j = -2 -+ end type base -+ type, bind(c) :: t -+ type(base) :: bt -+ end type t -+ type(t) :: my_t ++ integer(8) :: my_x(2) = 1 + interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a ++ subroutine c_func(b) bind(c, name = "c_func_") ++ integer(8) :: b(2) + end + end interface -+ call c_func(my_t) ++ call c_func(my_x) +end -diff --git a/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/fortran_main018.f90 b/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/fortran_main018.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/fortran_main018.f90 b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/fortran_main018.f90 new file mode 100644 -index 0000000..82878b7 +index 0000000..8f01271 --- /dev/null -+++ b/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/fortran_main018.f90 -@@ -0,0 +1,20 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is derived type the other component of derived type is -+! scalar type of int_fast64_t ++++ b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/fortran_main018.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the scalar type and the scalar type is ++! int_fast64_t with bindc +! +program main -+ type, bind(c) :: base -+ integer(8) :: j = -2 -+ end type base -+ type, bind(c) :: t -+ type(base) :: bt -+ end type t -+ type(t) :: my_t ++ integer(8) :: my_x(2) = 1 + interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a ++ subroutine c_func(b) bind(c, name = "c_func_") ++ integer(8) :: b(2) + end + end interface -+ call c_func(my_t) ++ call c_func(my_x) +end -diff --git a/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/fortran_main019.f90 b/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/fortran_main019.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/fortran_main019.f90 b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/fortran_main019.f90 new file mode 100644 -index 0000000..b60089f +index 0000000..1102216 --- /dev/null -+++ b/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/fortran_main019.f90 -@@ -0,0 +1,20 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is derived type the other component of derived type is -+! scalar type of intmax_t ++++ b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/fortran_main019.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the scalar type and the scalar type is ++! intmax_t with bindc +! +program main -+ type, bind(c) :: base -+ integer(8) :: j = -2 -+ end type base -+ type, bind(c) :: t -+ type(base) :: bt -+ end type t -+ type(t) :: my_t ++ integer(8) :: my_x(2) = 1 + interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a ++ subroutine c_func(b) bind(c, name = "c_func_") ++ integer(8) :: b(2) + end + end interface -+ call c_func(my_t) ++ call c_func(my_x) +end -diff --git a/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/fortran_main020.f90 b/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/fortran_main020.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/fortran_main020.f90 b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/fortran_main020.f90 new file mode 100644 -index 0000000..277b313 +index 0000000..8976d63 --- /dev/null -+++ b/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/fortran_main020.f90 -@@ -0,0 +1,20 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is derived type the other component of derived type is -+! scalar type of intptr_t ++++ b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/fortran_main020.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the scalar type and the scalar type is ++! intptr_t with bindc +! +program main -+ type, bind(c) :: base -+ integer(8) :: j = -2 -+ end type base -+ type, bind(c) :: t -+ type(base) :: bt -+ end type t -+ type(t) :: my_t ++ integer(8) :: my_x(2) = 1 + interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a ++ subroutine c_func(b) bind(c, name = "c_func_") ++ integer(8) :: b(2) + end + end interface -+ call c_func(my_t) ++ call c_func(my_x) +end -diff --git a/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/fortran_main021.f90 b/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/fortran_main021.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/fortran_main021.f90 b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/fortran_main021.f90 new file mode 100644 -index 0000000..a191c0d +index 0000000..ae733f9 --- /dev/null -+++ b/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/fortran_main021.f90 -@@ -0,0 +1,20 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is derived type the other component of derived type is -+! scalar type of float ++++ b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/fortran_main021.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the array type and the array type is float ++! with bindc +! +program main -+ type, bind(c) :: base -+ real(4) :: j = -2.36 -+ end type base -+ type, bind(c) :: t -+ type(base) :: bt -+ end type t -+ type(t) :: my_t ++ real(4) :: my_x(2) = 12345678.7654321 + interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a ++ subroutine c_func(b) bind(c, name = "c_func_") ++ real(4) :: b(2) + end + end interface -+ call c_func(my_t) ++ call c_func(my_x) +end -diff --git a/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/fortran_main022.f90 b/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/fortran_main022.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/fortran_main022.f90 b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/fortran_main022.f90 new file mode 100644 -index 0000000..e8df525 +index 0000000..319d83a --- /dev/null -+++ b/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/fortran_main022.f90 -@@ -0,0 +1,20 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is derived type the other component of derived type is -+! scalar type of float ++++ b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/fortran_main022.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the array type and the array type is double ++! with bindc +! +program main -+ type, bind(c) :: base -+ real(8) :: j = -2.36 -+ end type base -+ type, bind(c) :: t -+ type(base) :: bt -+ end type t -+ type(t) :: my_t ++ real(8) :: my_x(2) = 12345678.7654321 + interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a ++ subroutine c_func(b) bind(c, name = "c_func_") ++ real(8) :: b(2) + end + end interface -+ call c_func(my_t) ++ call c_func(my_x) +end -diff --git a/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/fortran_main023.f90 b/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/fortran_main023.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/fortran_main023.f90 b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/fortran_main023.f90 new file mode 100644 -index 0000000..90e2060 +index 0000000..9aad10e --- /dev/null -+++ b/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/fortran_main023.f90 -@@ -0,0 +1,21 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is derived type the other component of derived type is -+! scalar type of long double ++++ b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/fortran_main023.f90 +@@ -0,0 +1,14 @@ ++! Test fortran call c for the array type and the array type is ++! long double with bindc +! +program main + integer, parameter :: K = selected_real_kind(16) -+ type, bind(c) :: base -+ real(K) :: j = -2.36 -+ end type base -+ type, bind(c) :: t -+ type(base) :: bt -+ end type t -+ type(t) :: my_t ++ real(K) :: my_x(2) = 12345678.7654321 + interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a ++ subroutine c_func(b) bind(c, name = "c_func_") ++ integer, parameter :: K = selected_real_kind(16) ++ real(K) :: b(2) + end + end interface -+ call c_func(my_t) ++ call c_func(my_x) +end -diff --git a/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/fortran_main024.f90 b/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/fortran_main024.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/fortran_main024.f90 b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/fortran_main024.f90 new file mode 100644 -index 0000000..a5a051a +index 0000000..47bdc29 --- /dev/null -+++ b/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/fortran_main024.f90 -@@ -0,0 +1,21 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is derived type the other component of derived type is -+! scalar type of float _Complex ++++ b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/fortran_main024.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the array type and the array type is ++! float _Complex with bindc +! +program main -+ type, bind(c) :: base -+ complex(4) :: j = (1, 2); -+ end type base -+ type, bind(c) :: t -+ type(base) :: bt -+ end type t -+ type(t) :: my_t ++ complex(4) :: my_x(2) = (-3.14159265358979, 1) + interface -+ subroutine c_func(a) -+ use iso_c_binding -+ import :: t -+ type(t) :: a ++ subroutine c_func(b) bind(c, name = "c_func_") ++ complex(4) :: b(2) + end + end interface -+ call c_func(my_t) ++ call c_func(my_x) +end -diff --git a/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/fortran_main025.f90 b/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/fortran_main025.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/fortran_main025.f90 b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/fortran_main025.f90 new file mode 100644 -index 0000000..be78fcc +index 0000000..9390897 --- /dev/null -+++ b/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/fortran_main025.f90 -@@ -0,0 +1,21 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is derived type the other component of derived type is -+! scalar type of double _Complex ++++ b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/fortran_main025.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the array type and the array type is ++! double _Complex with bindc +! +program main -+ type, bind(c) :: base -+ complex(8) :: j = (1, 2); -+ end type base -+ type, bind(c) :: t -+ type(base) :: bt -+ end type t -+ type(t) :: my_t ++ complex(8) :: my_x(2) = (-3.14159265358979, 1) + interface -+ subroutine c_func(a) -+ use iso_c_binding -+ import :: t -+ type(t) :: a ++ subroutine c_func(b) bind(c, name = "c_func_") ++ complex(8) :: b(2) + end + end interface -+ call c_func(my_t) ++ call c_func(my_x) +end -diff --git a/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/fortran_main026.f90 b/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/fortran_main026.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/fortran_main026.f90 b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/fortran_main026.f90 new file mode 100644 -index 0000000..6d7c710 +index 0000000..e07c0ae --- /dev/null -+++ b/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/fortran_main026.f90 -@@ -0,0 +1,22 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is derived type the other component of derived type is -+! scalar type of long double _Complex ++++ b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/fortran_main026.f90 +@@ -0,0 +1,14 @@ ++! Test fortran call c for the array type and the array type is ++! long double _Complex with bindc +! +program main + integer, parameter :: K = selected_real_kind(16) -+ type, bind(c) :: base -+ complex(K) :: j = (1, 2); -+ end type base -+ type, bind(c) :: t -+ type(base) :: bt -+ end type t -+ type(t) :: my_t ++ complex(K) :: my_x(2) = (-3.14159265358979, 1) + interface -+ subroutine c_func(a) -+ use iso_c_binding -+ import :: t -+ type(t) :: a ++ subroutine c_func(b) bind(c, name = "c_func_") ++ integer, parameter :: K = selected_real_kind(16) ++ complex(K) :: b(2) + end + end interface -+ call c_func(my_t) ++ call c_func(my_x) +end -diff --git a/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/fortran_main027.f90 b/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/fortran_main027.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/fortran_main027.f90 b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/fortran_main027.f90 new file mode 100644 -index 0000000..ed52db7 +index 0000000..7a89da0 --- /dev/null -+++ b/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/fortran_main027.f90 -@@ -0,0 +1,20 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is derived type the other component of derived type is -+! scalar type of _Bool ++++ b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/fortran_main027.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the array type and the array type is _Bool ++! with bindc +! +program main -+ type, bind(c) :: base -+ logical(1) :: j = .TRUE. -+ end type base -+ type, bind(c) :: t -+ type(base) :: bt -+ end type t -+ type(t) :: my_t ++ logical(1) :: my_x(2) = .TRUE. + interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a ++ subroutine c_func(b) bind(c, name = "c_func_") ++ logical(1) :: b(2) + end + end interface -+ call c_func(my_t) ++ call c_func(my_x) +end -diff --git a/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/fortran_main028.f90 b/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/fortran_main028.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/fortran_main028.f90 b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/fortran_main028.f90 new file mode 100644 -index 0000000..7bd346a +index 0000000..b4fd1ba --- /dev/null -+++ b/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/fortran_main028.f90 -@@ -0,0 +1,20 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is derived type the other component of derived type is -+! scalar type of char ++++ b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/fortran_main028.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the array type and the array type is char ++! with bindc +! +program main -+ type, bind(c) :: base -+ character(1) :: j = 'a' -+ end type base -+ type, bind(c) :: t -+ type(base) :: bt -+ end type t -+ type(t) :: my_t ++ character(1) :: my_x(2) = 'a' + interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a ++ subroutine c_func(b) bind(c, name = "c_func_") ++ character(1) :: b(2) + end + end interface -+ call c_func(my_t) ++ call c_func(my_x) +end -diff --git a/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/run.sh b/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/run.sh +diff --git a/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/run.sh b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/run.sh new file mode 100644 -index 0000000..632b582 +index 0000000..b865403 --- /dev/null -+++ b/test/interoperability_with_c/008_fortran-call-C-nested-struct-simple/run.sh -@@ -0,0 +1,17 @@ ++++ b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/run.sh +@@ -0,0 +1,16 @@ +for i in {001..028} +do +echo "------- test $i ------." @@ -7671,450 +6825,194 @@ index 0000000..632b582 +./a.out +rm *.o a.out +done -+ -diff --git a/test/interoperability_with_c/009_fortran-call-C-nested-struct-complicated/c_func001.c b/test/interoperability_with_c/009_fortran-call-C-nested-struct-complicated/c_func001.c +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c/009_fortran_call_c_allocatable/c_func001.c b/test/interoperability_with_c_fortran_call_c/009_fortran_call_c_allocatable/c_func001.c new file mode 100644 -index 0000000..111e43b +index 0000000..6c2e3c9 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/009_fortran_call_c_allocatable/c_func001.c +@@ -0,0 +1,11 @@ ++#include ++#include ++#include ++void c_func_(int *s) ++{ ++ s = (int*) malloc(5 * sizeof(int)); ++ for(int i = 0; i < 5; i++) { ++ s[i] = i; ++ printf("the num is:%d\n", s[i]); ++ } ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c/009_fortran_call_c_allocatable/c_func002.c b/test/interoperability_with_c_fortran_call_c/009_fortran_call_c_allocatable/c_func002.c +new file mode 100644 +index 0000000..366ed68 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/009_fortran_call_c_allocatable/c_func002.c +@@ -0,0 +1,10 @@ ++#include ++#include ++#include ++void c_func_(int *s) ++{ ++ for(int i = 0; i < 5; i++) { ++ s[i] = i; ++ printf("the num is:%d\n", s[i]); ++ } ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c/009_fortran_call_c_allocatable/fortran_main001.f90 b/test/interoperability_with_c_fortran_call_c/009_fortran_call_c_allocatable/fortran_main001.f90 +new file mode 100644 +index 0000000..0832e9c +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/009_fortran_call_c_allocatable/fortran_main001.f90 +@@ -0,0 +1,14 @@ ++! Test fortran call c for the allocatable type and the allocatable type ++! is unallocated ++! ++program main ++ integer, allocatable:: my_x(:) ++ interface ++ subroutine c_func(b) ++ integer, allocatable :: b(:) ++ end ++ end interface ++ print *, my_x ++ call c_func(my_x) ++ print *, my_x ++end +diff --git a/test/interoperability_with_c_fortran_call_c/009_fortran_call_c_allocatable/fortran_main002.f90 b/test/interoperability_with_c_fortran_call_c/009_fortran_call_c_allocatable/fortran_main002.f90 +new file mode 100644 +index 0000000..89e27a6 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/009_fortran_call_c_allocatable/fortran_main002.f90 +@@ -0,0 +1,19 @@ ++! Test fortran call c for the allocatable type and the allocatable type ++! is allocated ++! ++program main ++ integer, allocatable:: my_x(:) ++ interface ++ subroutine c_func(b) ++ integer, dimension(*) :: b ++ end ++ end interface ++ allocate(my_x(5)) ++ do i = 1, 5 ++ my_x(i) = 5 + i ++ end do ++ print *, my_x ++ call c_func(my_x) ++ print *, my_x ++ deallocate(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/009_fortran_call_c_allocatable/run.sh b/test/interoperability_with_c_fortran_call_c/009_fortran_call_c_allocatable/run.sh +new file mode 100644 +index 0000000..bd444eb --- /dev/null -+++ b/test/interoperability_with_c/009_fortran-call-C-nested-struct-complicated/c_func001.c ++++ b/test/interoperability_with_c_fortran_call_c/009_fortran_call_c_allocatable/run.sh @@ -0,0 +1,16 @@ ++for i in {001..002} ++do ++echo "------- test $i ------." ++#echo "----- gfortran result:" ++#gcc c_func$i.c -c -o c-test.o ++#gfortran fortran_main$i.f90 -fno-range-check -c -o fortran-test.o ++#gfortran c-test.o fortran-test.o ++#./a.out ++#rm *.o a.out ++echo "----- flang-new result : " ++clang c_func$i.c -c -o c-test.o ++flang-new fortran_main$i.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o a.out ++done +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/c_func001.c b/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/c_func001.c +new file mode 100644 +index 0000000..89defd9 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/c_func001.c +@@ -0,0 +1,5 @@ +#include -+struct BaseTy { -+ int j; -+}; -+struct Ty { -+ struct BaseTy bt; -+ int n[4]; -+}; -+void c_func_(struct Ty *t) { -+ printf("%d\n", t->bt.j); -+ printf("%d\n", t->n[0]); -+ printf("%d\n", t->n[0]+t->bt.j); -+ printf("%d\n", t->n[1]); -+ printf("%d\n", t->n[2]); -+ printf("%d\n", t->n[3]); ++int* c_func_(int *a) { ++ printf("%5d\n", *a); ++ return a; +} -diff --git a/test/interoperability_with_c/009_fortran-call-C-nested-struct-complicated/c_func002.c b/test/interoperability_with_c/009_fortran-call-C-nested-struct-complicated/c_func002.c +diff --git a/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/c_func002.c b/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/c_func002.c new file mode 100644 -index 0000000..c1df231 +index 0000000..6c172b6 --- /dev/null -+++ b/test/interoperability_with_c/009_fortran-call-C-nested-struct-complicated/c_func002.c -@@ -0,0 +1,22 @@ ++++ b/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/c_func002.c +@@ -0,0 +1,5 @@ +#include -+struct BaseTy { -+ int j; -+}; -+struct Ty { -+ struct BaseTy bt; -+ int n[4]; -+}; -+void c_func_(struct Ty *t) { -+ printf("%d\n", t[0].bt.j); -+ printf("%d\n", t[0].n[0]); -+ printf("%d\n", t[0].n[0]+t->bt.j); -+ printf("%d\n", t[0].n[1]); -+ printf("%d\n", t[0].n[2]); -+ printf("%d\n", t[0].n[3]); -+ printf("%d\n", t[1].bt.j); -+ printf("%d\n", t[1].n[0]); -+ printf("%d\n", t[1].n[0]+t->bt.j); -+ printf("%d\n", t[1].n[1]); -+ printf("%d\n", t[1].n[2]); -+ printf("%d\n", t[1].n[3]); ++short* c_func_(short *a) { ++ printf("%5d\n", *a); ++ return a; +} -diff --git a/test/interoperability_with_c/009_fortran-call-C-nested-struct-complicated/c_func003.c b/test/interoperability_with_c/009_fortran-call-C-nested-struct-complicated/c_func003.c +diff --git a/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/c_func003.c b/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/c_func003.c new file mode 100644 -index 0000000..8d0298b +index 0000000..b1b4838 --- /dev/null -+++ b/test/interoperability_with_c/009_fortran-call-C-nested-struct-complicated/c_func003.c -@@ -0,0 +1,23 @@ ++++ b/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/c_func003.c +@@ -0,0 +1,5 @@ +#include -+struct BaseTy { -+ int j; -+}; -+struct Ty1 { -+ struct BaseTy bt; -+ int k; -+}; -+struct Ty { -+ struct BaseTy bt; -+ struct Ty1 yt; -+ int n[4]; -+}; -+void c_func_(struct Ty *t) { -+ printf("%d\n", t->bt.j); -+ printf("%d\n", t->n[0]); -+ printf("%d\n", t->n[0]+t->bt.j); -+ printf("%d\n", t->n[1]); -+ printf("%d\n", t->n[2]); -+ printf("%d\n", t->n[3]); -+ printf("%d\n", t->yt.k); -+ printf("%d\n", t->yt.bt.j); ++long* c_func_(long *a) { ++ printf("%5ld\n", *a); ++ return a; +} -diff --git a/test/interoperability_with_c/009_fortran-call-C-nested-struct-complicated/c_func004.c b/test/interoperability_with_c/009_fortran-call-C-nested-struct-complicated/c_func004.c +diff --git a/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/c_func004.c b/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/c_func004.c new file mode 100644 -index 0000000..ff232d9 +index 0000000..90896f0 --- /dev/null -+++ b/test/interoperability_with_c/009_fortran-call-C-nested-struct-complicated/c_func004.c -@@ -0,0 +1,30 @@ ++++ b/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/c_func004.c +@@ -0,0 +1,5 @@ +#include -+struct BaseTy { -+ int j; -+}; -+struct Ty1 { -+ struct BaseTy bt; -+ int k1; -+}; -+struct Ty2 { -+ struct Ty1 bty1; -+ int k2; -+}; -+struct Ty3 { -+ struct Ty2 bty2; -+ int k3; -+}; -+struct Ty { -+ struct Ty3 yt; -+ int n[4]; -+}; -+void c_func_(struct Ty *t) { -+ printf("%d\n", t->n[0]); -+ printf("%d\n", t->n[1]); -+ printf("%d\n", t->n[2]); -+ printf("%d\n", t->n[3]); -+ printf("%d\n", t->yt.k3); -+ printf("%d\n", t->yt.bty2.k2); -+ printf("%d\n", t->yt.bty2.bty1.k1); -+ printf("%d\n", t->yt.bty2.bty1.bt.j); ++long long* c_func_(long long *a) { ++ printf("%lld\n", *a); ++ return a; +} -diff --git a/test/interoperability_with_c/009_fortran-call-C-nested-struct-complicated/c_func005.c b/test/interoperability_with_c/009_fortran-call-C-nested-struct-complicated/c_func005.c +diff --git a/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/c_func005.c b/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/c_func005.c new file mode 100644 -index 0000000..9cff8b8 +index 0000000..91e7d0d --- /dev/null -+++ b/test/interoperability_with_c/009_fortran-call-C-nested-struct-complicated/c_func005.c -@@ -0,0 +1,18 @@ ++++ b/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/c_func005.c +@@ -0,0 +1,5 @@ +#include -+struct BaseTy { -+ int j; -+}; -+struct Ty { -+ struct BaseTy bt[3]; -+ int n[4]; -+}; -+void c_func_(struct Ty *t) { -+ printf("%d\n", t->bt[0].j); -+ printf("%d\n", t->bt[1].j); -+ printf("%d\n", t->bt[2].j); -+ printf("%d\n", t->n[0]); -+ printf("%d\n", t->n[0]+t->bt[0].j); -+ printf("%d\n", t->n[1]); -+ printf("%d\n", t->n[2]); -+ printf("%d\n", t->n[3]); ++signed char* c_func_(signed char *a) { ++ printf("%5c\n", *a); ++ return a; +} -diff --git a/test/interoperability_with_c/009_fortran-call-C-nested-struct-complicated/c_func006.c b/test/interoperability_with_c/009_fortran-call-C-nested-struct-complicated/c_func006.c +diff --git a/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/c_func006.c b/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/c_func006.c new file mode 100644 -index 0000000..6bd160d +index 0000000..13ec31a --- /dev/null -+++ b/test/interoperability_with_c/009_fortran-call-C-nested-struct-complicated/c_func006.c -@@ -0,0 +1,19 @@ ++++ b/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/c_func006.c +@@ -0,0 +1,6 @@ +#include -+struct BaseTy { -+ int j; -+}; -+struct Ty { -+ struct BaseTy bt[3]; -+ int n[4]; -+}; -+struct Ty* c_func_(struct Ty *t) { -+ printf("%d\n", t->bt[0].j); -+ printf("%d\n", t->bt[1].j); -+ printf("%d\n", t->bt[2].j); -+ printf("%d\n", t->n[0]); -+ printf("%d\n", t->n[0]+t->bt[0].j); -+ printf("%d\n", t->n[1]); -+ printf("%d\n", t->n[2]); -+ printf("%d\n", t->n[3]); -+ return t; ++#include ++size_t* c_func_(size_t *a) { ++ printf("%5ld\n", *a); ++ return a; +} -diff --git a/test/interoperability_with_c/009_fortran-call-C-nested-struct-complicated/fortran_main001.f90 b/test/interoperability_with_c/009_fortran-call-C-nested-struct-complicated/fortran_main001.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/c_func007.c b/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/c_func007.c new file mode 100644 -index 0000000..2647a97 +index 0000000..e883fd3 --- /dev/null -+++ b/test/interoperability_with_c/009_fortran-call-C-nested-struct-complicated/fortran_main001.f90 -@@ -0,0 +1,20 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is derived type -+! -+program main -+ type, bind(c) :: base -+ integer(4) :: j = -1 -+ end type base -+ type, bind(c) :: t -+ type(base) :: bt -+ integer(4) :: i(4) = 1 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c/009_fortran-call-C-nested-struct-complicated/fortran_main002.f90 b/test/interoperability_with_c/009_fortran-call-C-nested-struct-complicated/fortran_main002.f90 ++++ b/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/c_func007.c +@@ -0,0 +1,6 @@ ++#include ++#include ++int8_t* c_func_(int8_t *a) { ++ printf("%5hhd\n", *a); ++ return a; ++} +diff --git a/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/c_func008.c b/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/c_func008.c new file mode 100644 -index 0000000..edf7112 +index 0000000..a8a3209 --- /dev/null -+++ b/test/interoperability_with_c/009_fortran-call-C-nested-struct-complicated/fortran_main002.f90 -@@ -0,0 +1,20 @@ -+! Test fortran call c for the array of derived type and the component -+! of the derived type is derived type -+! -+program main -+ type, bind(c) :: base -+ integer(4) :: j = -1 -+ end type base -+ type, bind(c) :: t -+ type(base) :: bt -+ integer(4) :: i(4) = 1 -+ end type t -+ type(t) :: my_t(2) -+ interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a(2) -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c/009_fortran-call-C-nested-struct-complicated/fortran_main003.f90 b/test/interoperability_with_c/009_fortran-call-C-nested-struct-complicated/fortran_main003.f90 -new file mode 100644 -index 0000000..e0d5848 ---- /dev/null -+++ b/test/interoperability_with_c/009_fortran-call-C-nested-struct-complicated/fortran_main003.f90 -@@ -0,0 +1,25 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type are derived types -+! -+program main -+ type, bind(c) :: base -+ integer(4) :: j = -1 -+ end type base -+ type, bind(c) :: base2 -+ type(base) :: bt -+ integer(4) :: k = 256 -+ end type base2 -+ type, bind(c) :: t -+ type(base) :: bt -+ type(base2) :: yt -+ integer(4) :: i(4) = 1 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c/009_fortran-call-C-nested-struct-complicated/fortran_main004.f90 b/test/interoperability_with_c/009_fortran-call-C-nested-struct-complicated/fortran_main004.f90 -new file mode 100644 -index 0000000..66e62eb ---- /dev/null -+++ b/test/interoperability_with_c/009_fortran-call-C-nested-struct-complicated/fortran_main004.f90 -@@ -0,0 +1,31 @@ -+! Test fortran call c for the nesting of derived types -+! -+program main -+ type, bind(c) :: base -+ integer(4) :: j = -1 -+ end type base -+ type, bind(c) :: base1 -+ type(base) :: bt1 -+ integer(4) :: k1 = 256 -+ end type base1 -+ type, bind(c) :: base2 -+ type(base1) :: bt2 -+ integer(4) :: k2 = 257 -+ end type base2 -+ type, bind(c) :: base3 -+ type(base2) :: bt3 -+ integer(4) :: k3 = 258 -+ end type base3 -+ type, bind(c) :: t -+ type(base3) :: yt -+ integer(4) :: i(4) = 1 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c/009_fortran-call-C-nested-struct-complicated/fortran_main005.f90 b/test/interoperability_with_c/009_fortran-call-C-nested-struct-complicated/fortran_main005.f90 -new file mode 100644 -index 0000000..60cd8ac ---- /dev/null -+++ b/test/interoperability_with_c/009_fortran-call-C-nested-struct-complicated/fortran_main005.f90 -@@ -0,0 +1,20 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is array of derived type -+! -+program main -+ type, bind(c) :: base -+ integer(4) :: j = -1 -+ end type base -+ type, bind(c) :: t -+ type(base) :: bt(3) -+ integer(4) :: i(4) = 1 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c/009_fortran-call-C-nested-struct-complicated/fortran_main006.f90 b/test/interoperability_with_c/009_fortran-call-C-nested-struct-complicated/fortran_main006.f90 -new file mode 100644 -index 0000000..36ef4a9 ---- /dev/null -+++ b/test/interoperability_with_c/009_fortran-call-C-nested-struct-complicated/fortran_main006.f90 -@@ -0,0 +1,20 @@ -+! Test fortran call c for the return type is derived type -+! -+program main -+ type, bind(c) :: base -+ integer(4) :: j = -1 -+ end type base -+ type, bind(c) :: t -+ type(base) :: bt(3) -+ integer(4) :: i(4) = 1 -+ end type t -+ type(t) :: my_t -+ interface -+ function c_func(a) result(res) bind(c, name = "c_func_") -+ import :: t -+ type(t) :: a -+ type(t), pointer :: res -+ end -+ end interface -+ print *, c_func(my_t) -+end -diff --git a/test/interoperability_with_c/009_fortran-call-C-nested-struct-complicated/run.sh b/test/interoperability_with_c/009_fortran-call-C-nested-struct-complicated/run.sh -new file mode 100644 -index 0000000..5ad075b ---- /dev/null -+++ b/test/interoperability_with_c/009_fortran-call-C-nested-struct-complicated/run.sh -@@ -0,0 +1,17 @@ -+for i in {001..006} -+do -+echo "------- test $i ------." -+#echo "----- gfortran result:" -+#gcc c_func$i.c -c -o c-test.o -+#gfortran fortran_main$i.f90 -fno-range-check -c -o fortran-test.o -+#gfortran c-test.o fortran-test.o -+#./a.out -+#rm *.o a.out -+echo "----- flang-new result : " -+clang c_func$i.c -c -o c-test.o -+flang-new fortran_main$i.f90 -c -o fortran-test.o -+flang-new -flang-experimental-exec c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+done -+ -diff --git a/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/c_func001.c b/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/c_func001.c -new file mode 100644 -index 0000000..89defd9 ---- /dev/null -+++ b/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/c_func001.c -@@ -0,0 +1,5 @@ -+#include -+int* c_func_(int *a) { -+ printf("%5d\n", *a); -+ return a; -+} -diff --git a/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/c_func002.c b/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/c_func002.c -new file mode 100644 -index 0000000..0239f18 ---- /dev/null -+++ b/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/c_func002.c -@@ -0,0 +1,5 @@ -+#include -+short* c_func_(short *a) { -+ printf("%5hd\n", *a); -+ return a; -+} -diff --git a/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/c_func003.c b/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/c_func003.c -new file mode 100644 -index 0000000..b1b4838 ---- /dev/null -+++ b/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/c_func003.c -@@ -0,0 +1,5 @@ -+#include -+long* c_func_(long *a) { -+ printf("%5ld\n", *a); -+ return a; -+} -diff --git a/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/c_func004.c b/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/c_func004.c -new file mode 100644 -index 0000000..90896f0 ---- /dev/null -+++ b/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/c_func004.c -@@ -0,0 +1,5 @@ -+#include -+long long* c_func_(long long *a) { -+ printf("%lld\n", *a); -+ return a; -+} -diff --git a/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/c_func005.c b/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/c_func005.c -new file mode 100644 -index 0000000..91e7d0d ---- /dev/null -+++ b/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/c_func005.c -@@ -0,0 +1,5 @@ -+#include -+signed char* c_func_(signed char *a) { -+ printf("%5c\n", *a); -+ return a; -+} -diff --git a/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/c_func006.c b/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/c_func006.c -new file mode 100644 -index 0000000..13ec31a ---- /dev/null -+++ b/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/c_func006.c -@@ -0,0 +1,6 @@ -+#include -+#include -+size_t* c_func_(size_t *a) { -+ printf("%5ld\n", *a); -+ return a; -+} -diff --git a/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/c_func007.c b/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/c_func007.c -new file mode 100644 -index 0000000..e883fd3 ---- /dev/null -+++ b/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/c_func007.c -@@ -0,0 +1,6 @@ -+#include -+#include -+int8_t* c_func_(int8_t *a) { -+ printf("%5hhd\n", *a); -+ return a; -+} -diff --git a/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/c_func008.c b/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/c_func008.c -new file mode 100644 -index 0000000..a8a3209 ---- /dev/null -+++ b/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/c_func008.c ++++ b/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/c_func008.c @@ -0,0 +1,6 @@ +#include +#include @@ -8122,11 +7020,11 @@ index 0000000..a8a3209 + printf("%5hd\n", *a); + return a; +} -diff --git a/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/c_func009.c b/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/c_func009.c +diff --git a/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/c_func009.c b/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/c_func009.c new file mode 100644 index 0000000..9ad7e76 --- /dev/null -+++ b/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/c_func009.c ++++ b/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/c_func009.c @@ -0,0 +1,6 @@ +#include +#include @@ -8134,11 +7032,11 @@ index 0000000..9ad7e76 + printf("%5d\n", *a); + return a; +} -diff --git a/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/c_func010.c b/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/c_func010.c +diff --git a/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/c_func010.c b/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/c_func010.c new file mode 100644 index 0000000..6bff1b5 --- /dev/null -+++ b/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/c_func010.c ++++ b/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/c_func010.c @@ -0,0 +1,6 @@ +#include +#include @@ -8146,11 +7044,11 @@ index 0000000..6bff1b5 + printf("%5ld\n", *a); + return a; +} -diff --git a/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/c_func011.c b/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/c_func011.c +diff --git a/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/c_func011.c b/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/c_func011.c new file mode 100644 index 0000000..4a5970a --- /dev/null -+++ b/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/c_func011.c ++++ b/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/c_func011.c @@ -0,0 +1,6 @@ +#include +#include @@ -8158,11 +7056,11 @@ index 0000000..4a5970a + printf("%5hhd\n", *a); + return a; +} -diff --git a/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/c_func012.c b/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/c_func012.c +diff --git a/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/c_func012.c b/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/c_func012.c new file mode 100644 index 0000000..72ac1a4 --- /dev/null -+++ b/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/c_func012.c ++++ b/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/c_func012.c @@ -0,0 +1,6 @@ +#include +#include @@ -8170,11 +7068,11 @@ index 0000000..72ac1a4 + printf("%5hd\n", *a); + return a; +} -diff --git a/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/c_func013.c b/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/c_func013.c +diff --git a/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/c_func013.c b/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/c_func013.c new file mode 100644 index 0000000..771e48b --- /dev/null -+++ b/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/c_func013.c ++++ b/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/c_func013.c @@ -0,0 +1,6 @@ +#include +#include @@ -8182,11 +7080,11 @@ index 0000000..771e48b + printf("%d\n", *a); + return a; +} -diff --git a/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/c_func014.c b/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/c_func014.c +diff --git a/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/c_func014.c b/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/c_func014.c new file mode 100644 index 0000000..c782984 --- /dev/null -+++ b/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/c_func014.c ++++ b/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/c_func014.c @@ -0,0 +1,6 @@ +#include +#include @@ -8194,11 +7092,11 @@ index 0000000..c782984 + printf("%5ld\n", *a); + return a; +} -diff --git a/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/c_func015.c b/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/c_func015.c +diff --git a/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/c_func015.c b/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/c_func015.c new file mode 100644 index 0000000..96452b1 --- /dev/null -+++ b/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/c_func015.c ++++ b/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/c_func015.c @@ -0,0 +1,6 @@ +#include +#include @@ -8206,11 +7104,11 @@ index 0000000..96452b1 + printf("%5hhd\n", *a); + return a; +} -diff --git a/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/c_func016.c b/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/c_func016.c +diff --git a/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/c_func016.c b/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/c_func016.c new file mode 100644 index 0000000..27bac38 --- /dev/null -+++ b/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/c_func016.c ++++ b/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/c_func016.c @@ -0,0 +1,6 @@ +#include +#include @@ -8218,11 +7116,11 @@ index 0000000..27bac38 + printf("%5ld\n", *a); + return a; +} -diff --git a/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/c_func017.c b/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/c_func017.c +diff --git a/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/c_func017.c b/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/c_func017.c new file mode 100644 index 0000000..f4e0e76 --- /dev/null -+++ b/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/c_func017.c ++++ b/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/c_func017.c @@ -0,0 +1,6 @@ +#include +#include @@ -8230,11 +7128,11 @@ index 0000000..f4e0e76 + printf("%ld\n", *a); + return a; +} -diff --git a/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/c_func018.c b/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/c_func018.c +diff --git a/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/c_func018.c b/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/c_func018.c new file mode 100644 index 0000000..ee80d9a --- /dev/null -+++ b/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/c_func018.c ++++ b/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/c_func018.c @@ -0,0 +1,6 @@ +#include +#include @@ -8242,11 +7140,11 @@ index 0000000..ee80d9a + printf("%5ld\n", *a); + return a; +} -diff --git a/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/c_func019.c b/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/c_func019.c +diff --git a/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/c_func019.c b/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/c_func019.c new file mode 100644 index 0000000..a6205df --- /dev/null -+++ b/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/c_func019.c ++++ b/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/c_func019.c @@ -0,0 +1,6 @@ +#include +#include @@ -8254,11 +7152,11 @@ index 0000000..a6205df + printf("%5ld\n", *a); + return a; +} -diff --git a/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/c_func020.c b/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/c_func020.c +diff --git a/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/c_func020.c b/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/c_func020.c new file mode 100644 index 0000000..3fc6c40 --- /dev/null -+++ b/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/c_func020.c ++++ b/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/c_func020.c @@ -0,0 +1,6 @@ +#include +#include @@ -8266,44 +7164,44 @@ index 0000000..3fc6c40 + printf("%5ld\n", *a); + return a; +} -diff --git a/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/c_func021.c b/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/c_func021.c +diff --git a/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/c_func021.c b/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/c_func021.c new file mode 100644 index 0000000..4584a17 --- /dev/null -+++ b/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/c_func021.c ++++ b/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/c_func021.c @@ -0,0 +1,5 @@ +#include +float* c_func_(float *a) { + printf("%0.20f\n", *a); + return a; +} -diff --git a/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/c_func022.c b/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/c_func022.c +diff --git a/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/c_func022.c b/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/c_func022.c new file mode 100644 index 0000000..6c20627 --- /dev/null -+++ b/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/c_func022.c ++++ b/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/c_func022.c @@ -0,0 +1,5 @@ +#include +double* c_func_(double *a) { + printf("%0.20lf\n", *a); + return a; +} -diff --git a/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/c_func023.c b/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/c_func023.c +diff --git a/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/c_func023.c b/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/c_func023.c new file mode 100644 index 0000000..4067c00 --- /dev/null -+++ b/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/c_func023.c ++++ b/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/c_func023.c @@ -0,0 +1,5 @@ +#include +long double* c_func_(long double *a) { + printf("%0.20Lf\n", *a); + return a; +} -diff --git a/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/c_func024.c b/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/c_func024.c +diff --git a/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/c_func024.c b/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/c_func024.c new file mode 100644 index 0000000..8d5cbd6 --- /dev/null -+++ b/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/c_func024.c ++++ b/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/c_func024.c @@ -0,0 +1,6 @@ +#include +#include @@ -8311,11 +7209,11 @@ index 0000000..8d5cbd6 + printf("%0.20f + %0.20fi\n", creal(*t), cimag(*t)); + return t; +} -diff --git a/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/c_func025.c b/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/c_func025.c +diff --git a/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/c_func025.c b/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/c_func025.c new file mode 100644 index 0000000..2cc6c66 --- /dev/null -+++ b/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/c_func025.c ++++ b/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/c_func025.c @@ -0,0 +1,6 @@ +#include +#include @@ -8323,11 +7221,11 @@ index 0000000..2cc6c66 + printf("%0.20lf + %0.20lfi\n", creal(*t), cimag(*t)); + return t; +} -diff --git a/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/c_func026.c b/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/c_func026.c +diff --git a/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/c_func026.c b/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/c_func026.c new file mode 100644 index 0000000..4cd06f9 --- /dev/null -+++ b/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/c_func026.c ++++ b/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/c_func026.c @@ -0,0 +1,6 @@ +#include +#include @@ -8335,459 +7233,437 @@ index 0000000..4cd06f9 + printf("%0.20f + %0.20fi\n", creal(*t), cimag(*t)); + return t; +} -diff --git a/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/c_func027.c b/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/c_func027.c +diff --git a/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/c_func027.c b/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/c_func027.c new file mode 100644 index 0000000..d576c9e --- /dev/null -+++ b/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/c_func027.c ++++ b/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/c_func027.c @@ -0,0 +1,5 @@ +#include +_Bool* c_func_(_Bool *a) { + printf("%5d\n", *a); + return a; +} -diff --git a/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/c_func028.c b/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/c_func028.c +diff --git a/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/c_func028.c b/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/c_func028.c new file mode 100644 -index 0000000..d453743 +index 0000000..6024629 --- /dev/null -+++ b/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/c_func028.c -@@ -0,0 +1,6 @@ ++++ b/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/c_func028.c +@@ -0,0 +1,5 @@ +#include -+#include +char* c_func_(char *t) { + printf("%c\n", *t); + return t; +} -diff --git a/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/fortran_main001.f90 b/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/fortran_main001.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/fortran_main001.f90 b/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/fortran_main001.f90 new file mode 100644 -index 0000000..eea8ab6 +index 0000000..0162f22 --- /dev/null -+++ b/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/fortran_main001.f90 ++++ b/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/fortran_main001.f90 @@ -0,0 +1,12 @@ -+! Test fortran call c for the return type is ptr of type int with bindc ++! Test fortran call c for the return type is ptr of type int +! +program main + integer :: my_x = 1 + interface -+ function c_func(b) result(res) bind(c, name = "c_func_") ++ function c_func(b) result(res) + integer :: b + integer, pointer :: res + end + end interface + print '(I5)', c_func(my_x) +end -diff --git a/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/fortran_main002.f90 b/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/fortran_main002.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/fortran_main002.f90 b/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/fortran_main002.f90 new file mode 100644 -index 0000000..75ae05d +index 0000000..9398800 --- /dev/null -+++ b/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/fortran_main002.f90 -@@ -0,0 +1,13 @@ -+! Test fortran call c for the return type is ptr of type short with -+! bindc ++++ b/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/fortran_main002.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the return type is ptr of type short +! +program main + integer(2) :: my_x = 1 + interface -+ function c_func(b) result(res) bind(c, name = "c_func_") ++ function c_func(b) result(res) + integer(2) :: b + integer(2), pointer :: res + end + end interface + print '(I5)', c_func(my_x) +end -diff --git a/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/fortran_main003.f90 b/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/fortran_main003.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/fortran_main003.f90 b/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/fortran_main003.f90 new file mode 100644 -index 0000000..0ddcedf +index 0000000..8905eab --- /dev/null -+++ b/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/fortran_main003.f90 -@@ -0,0 +1,13 @@ -+! Test fortran call c for the return type is ptr of type long with -+! bindc ++++ b/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/fortran_main003.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the return type is ptr of type long +! +program main + integer(8) :: my_x = 1 + interface -+ function c_func(b) result(res) bind(c, name = "c_func_") ++ function c_func(b) result(res) + integer(8) :: b + integer(8), pointer :: res + end + end interface + print '(I5)', c_func(my_x) +end -diff --git a/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/fortran_main004.f90 b/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/fortran_main004.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/fortran_main004.f90 b/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/fortran_main004.f90 new file mode 100644 -index 0000000..7383644 +index 0000000..6ce9768 --- /dev/null -+++ b/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/fortran_main004.f90 -@@ -0,0 +1,13 @@ -+! Test fortran call c for the return type is ptr of type long long with -+! bindc ++++ b/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/fortran_main004.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the return type is ptr of type long long +! +program main + integer(8) :: my_x = 1 + interface -+ function c_func(b) result(res) bind(c, name = "c_func_") ++ function c_func(b) result(res) + integer(8) :: b + integer(8), pointer :: res + end + end interface + print '(I5)', c_func(my_x) +end -diff --git a/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/fortran_main005.f90 b/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/fortran_main005.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/fortran_main005.f90 b/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/fortran_main005.f90 new file mode 100644 -index 0000000..641ec2f +index 0000000..9445938 --- /dev/null -+++ b/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/fortran_main005.f90 -@@ -0,0 +1,13 @@ ++++ b/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/fortran_main005.f90 +@@ -0,0 +1,12 @@ +! Test fortran call c for the return type is ptr of type signed char -+! with bindc +! +program main + integer(1) :: my_x = 65 + interface -+ function c_func(b) result(res) bind(c, name = "c_func_") ++ function c_func(b) result(res) + integer(1) :: b + integer(1), pointer :: res + end + end interface + print '(I5)', c_func(my_x) +end -diff --git a/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/fortran_main006.f90 b/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/fortran_main006.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/fortran_main006.f90 b/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/fortran_main006.f90 new file mode 100644 -index 0000000..f5776ff +index 0000000..7ead44f --- /dev/null -+++ b/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/fortran_main006.f90 -@@ -0,0 +1,13 @@ -+! Test fortran call c for the return type is ptr of type size_t with -+! bindc ++++ b/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/fortran_main006.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the return type is ptr of type size_t +! +program main + integer(8) :: my_x = 1 + interface -+ function c_func(b) result(res) bind(c, name = "c_func_") ++ function c_func(b) result(res) + integer(8) :: b + integer(8), pointer :: res + end + end interface + print '(I5)', c_func(my_x) +end -diff --git a/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/fortran_main007.f90 b/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/fortran_main007.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/fortran_main007.f90 b/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/fortran_main007.f90 new file mode 100644 -index 0000000..9c8f25b +index 0000000..4a80499 --- /dev/null -+++ b/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/fortran_main007.f90 -@@ -0,0 +1,13 @@ -+! Test fortran call c for the return type is ptr of type int8_t with -+! bindc ++++ b/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/fortran_main007.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the return type is ptr of type int8_t +! +program main + integer(1) :: my_x = 1 + interface -+ function c_func(b) result(res) bind(c, name = "c_func_") ++ function c_func(b) result(res) + integer(1) :: b + integer(1), pointer :: res + end + end interface + print '(I5)', c_func(my_x) +end -diff --git a/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/fortran_main008.f90 b/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/fortran_main008.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/fortran_main008.f90 b/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/fortran_main008.f90 new file mode 100644 -index 0000000..e057058 +index 0000000..d85e1bb --- /dev/null -+++ b/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/fortran_main008.f90 -@@ -0,0 +1,13 @@ -+! Test fortran call c for the return type is ptr of type int16_t with -+! bindc ++++ b/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/fortran_main008.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the return type is ptr of type int16_t +! +program main + integer(2) :: my_x = 1 + interface -+ function c_func(b) result(res) bind(c, name = "c_func_") ++ function c_func(b) result(res) + integer(2) :: b + integer(2), pointer :: res + end + end interface + print '(I5)', c_func(my_x) +end -diff --git a/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/fortran_main009.f90 b/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/fortran_main009.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/fortran_main009.f90 b/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/fortran_main009.f90 new file mode 100644 -index 0000000..e9c35c1 +index 0000000..a613e46 --- /dev/null -+++ b/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/fortran_main009.f90 -@@ -0,0 +1,13 @@ -+! Test fortran call c for the return type is ptr of type int32_t with -+! bindc ++++ b/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/fortran_main009.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the return type is ptr of type int32_t +! +program main + integer(4) :: my_x = 1 + interface -+ function c_func(b) result(res) bind(c, name = "c_func_") ++ function c_func(b) result(res) + integer(4) :: b + integer(4), pointer :: res + end + end interface + print '(I5)', c_func(my_x) +end -diff --git a/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/fortran_main010.f90 b/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/fortran_main010.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/fortran_main010.f90 b/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/fortran_main010.f90 new file mode 100644 -index 0000000..d52b3f0 +index 0000000..c300630 --- /dev/null -+++ b/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/fortran_main010.f90 -@@ -0,0 +1,13 @@ -+! Test fortran call c for the return type is ptr of type int64_t with -+! bindc ++++ b/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/fortran_main010.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the return type is ptr of type int64_t +! +program main + integer(8) :: my_x = 1 + interface -+ function c_func(b) result(res) bind(c, name = "c_func_") ++ function c_func(b) result(res) + integer(8) :: b + integer(8), pointer :: res + end + end interface + print '(I5)', c_func(my_x) +end -diff --git a/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/fortran_main011.f90 b/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/fortran_main011.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/fortran_main011.f90 b/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/fortran_main011.f90 new file mode 100644 -index 0000000..8427950 +index 0000000..c5b3ec4 --- /dev/null -+++ b/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/fortran_main011.f90 -@@ -0,0 +1,13 @@ ++++ b/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/fortran_main011.f90 +@@ -0,0 +1,12 @@ +! Test fortran call c for the return type is ptr of type int_least8_t -+! with bindc +! +program main + integer(1) :: my_x = 1 + interface -+ function c_func(b) result(res) bind(c, name = "c_func_") ++ function c_func(b) result(res) + integer(1) :: b + integer(1), pointer :: res + end + end interface + print '(I5)', c_func(my_x) +end -diff --git a/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/fortran_main012.f90 b/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/fortran_main012.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/fortran_main012.f90 b/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/fortran_main012.f90 new file mode 100644 -index 0000000..123a9b1 +index 0000000..50d736a --- /dev/null -+++ b/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/fortran_main012.f90 -@@ -0,0 +1,13 @@ ++++ b/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/fortran_main012.f90 +@@ -0,0 +1,12 @@ +! Test fortran call c for the return type is ptr of type int_least16_t -+! with bindc +! +program main + integer(2) :: my_x = 1 + interface -+ function c_func(b) result(res) bind(c, name = "c_func_") ++ function c_func(b) result(res) + integer(2) :: b + integer(2), pointer :: res + end + end interface + print '(I5)', c_func(my_x) +end -diff --git a/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/fortran_main013.f90 b/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/fortran_main013.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/fortran_main013.f90 b/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/fortran_main013.f90 new file mode 100644 -index 0000000..a8586ed +index 0000000..f1ed742 --- /dev/null -+++ b/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/fortran_main013.f90 -@@ -0,0 +1,13 @@ ++++ b/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/fortran_main013.f90 +@@ -0,0 +1,12 @@ +! Test fortran call c for the return type is ptr of type int_least32_t -+! with bindc +! +program main + integer(4) :: my_x = 1 + interface -+ function c_func(b) result(res) bind(c, name = "c_func_") ++ function c_func(b) result(res) + integer(4) :: b + integer(4), pointer :: res + end + end interface + print '(I5)', c_func(my_x) +end -diff --git a/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/fortran_main014.f90 b/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/fortran_main014.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/fortran_main014.f90 b/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/fortran_main014.f90 new file mode 100644 -index 0000000..6634cd9 +index 0000000..d508d97 --- /dev/null -+++ b/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/fortran_main014.f90 -@@ -0,0 +1,13 @@ ++++ b/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/fortran_main014.f90 +@@ -0,0 +1,12 @@ +! Test fortran call c for the return type is ptr of type int_least64_t -+! with bindc +! +program main + integer(8) :: my_x = 1 + interface -+ function c_func(b) result(res) bind(c, name = "c_func_") ++ function c_func(b) result(res) + integer(8) :: b + integer(8), pointer :: res + end + end interface + print '(I5)', c_func(my_x) +end -diff --git a/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/fortran_main015.f90 b/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/fortran_main015.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/fortran_main015.f90 b/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/fortran_main015.f90 new file mode 100644 -index 0000000..75a9b48 +index 0000000..626f02a --- /dev/null -+++ b/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/fortran_main015.f90 ++++ b/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/fortran_main015.f90 @@ -0,0 +1,12 @@ +! Test fortran call c for the return type is ptr of type int_fast8_t -+! with bindc ++! +program main + integer(1) :: my_x = 1 + interface -+ function c_func(b) result(res) bind(c, name = "c_func_") ++ function c_func(b) result(res) + integer(1) :: b + integer(1), pointer :: res + end + end interface + print '(I5)', c_func(my_x) +end -diff --git a/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/fortran_main016.f90 b/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/fortran_main016.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/fortran_main016.f90 b/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/fortran_main016.f90 new file mode 100644 -index 0000000..58c20b5 +index 0000000..2a41aa9 --- /dev/null -+++ b/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/fortran_main016.f90 -@@ -0,0 +1,13 @@ ++++ b/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/fortran_main016.f90 +@@ -0,0 +1,12 @@ +! Test fortran call c for the return type is ptr of type int_fast16_t -+! with bindc +! +program main + integer(8) :: my_x = 1 + interface -+ function c_func(b) result(res) bind(c, name = "c_func_") ++ function c_func(b) result(res) + integer(8) :: b + integer(8), pointer :: res + end + end interface + print '(I5)', c_func(my_x) +end -diff --git a/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/fortran_main017.f90 b/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/fortran_main017.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/fortran_main017.f90 b/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/fortran_main017.f90 new file mode 100644 -index 0000000..64ed1d0 +index 0000000..1f4ae6a --- /dev/null -+++ b/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/fortran_main017.f90 -@@ -0,0 +1,13 @@ ++++ b/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/fortran_main017.f90 +@@ -0,0 +1,12 @@ +! Test fortran call c for the return type is ptr of type int_fast32_t -+! with bindc +! +program main + integer(8) :: my_x = 1 + interface -+ function c_func(b) result(res) bind(c, name = "c_func_") ++ function c_func(b) result(res) + integer(8) :: b + integer(8), pointer :: res + end + end interface + print '(I5)', c_func(my_x) +end -diff --git a/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/fortran_main018.f90 b/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/fortran_main018.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/fortran_main018.f90 b/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/fortran_main018.f90 new file mode 100644 -index 0000000..b7ad882 +index 0000000..9c99b13 --- /dev/null -+++ b/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/fortran_main018.f90 -@@ -0,0 +1,13 @@ ++++ b/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/fortran_main018.f90 +@@ -0,0 +1,12 @@ +! Test fortran call c for the return type is ptr of type int_fast64_t -+! with bindc +! +program main + integer(8) :: my_x = 1 + interface -+ function c_func(b) result(res) bind(c, name = "c_func_") ++ function c_func(b) result(res) + integer(8) :: b + integer(8), pointer :: res + end + end interface + print '(I5)', c_func(my_x) +end -diff --git a/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/fortran_main019.f90 b/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/fortran_main019.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/fortran_main019.f90 b/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/fortran_main019.f90 new file mode 100644 -index 0000000..1197ccb +index 0000000..4bdcd0c --- /dev/null -+++ b/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/fortran_main019.f90 -@@ -0,0 +1,13 @@ -+! Test fortran call c for the return type is ptr of type intmax_t with -+! bindc ++++ b/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/fortran_main019.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the return type is ptr of type intmax_t +! +program main + integer(8) :: my_x = 1 + interface -+ function c_func(b) result(res) bind(c, name = "c_func_") ++ function c_func(b) result(res) + integer(8) :: b + integer(8), pointer :: res + end + end interface + print *, c_func(my_x) +end -diff --git a/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/fortran_main020.f90 b/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/fortran_main020.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/fortran_main020.f90 b/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/fortran_main020.f90 new file mode 100644 -index 0000000..9bf210b +index 0000000..80b302e --- /dev/null -+++ b/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/fortran_main020.f90 -@@ -0,0 +1,13 @@ -+! Test fortran call c for the return type is ptr of type intptr_t with -+! bindc ++++ b/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/fortran_main020.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the return type is ptr of type intptr_t +! +program main + integer(8) :: my_x = 1 + interface -+ function c_func(b) result(res) bind(c, name = "c_func_") ++ function c_func(b) result(res) + integer(8) :: b + integer(8), pointer :: res + end + end interface + print '(I5)', c_func(my_x) +end -diff --git a/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/fortran_main021.f90 b/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/fortran_main021.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/fortran_main021.f90 b/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/fortran_main021.f90 new file mode 100644 -index 0000000..debcb13 +index 0000000..3760036 --- /dev/null -+++ b/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/fortran_main021.f90 -@@ -0,0 +1,13 @@ -+! Test fortran call c for the return type is ptr of type float with -+! bindc ++++ b/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/fortran_main021.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the return type is ptr of type float +! +program main + real(4) :: my_x = 1.0 + interface -+ function c_func(b) result(res) bind(c, name = "c_func_") ++ function c_func(b) result(res) + real(4) :: b + real(4), pointer :: res + end + end interface + print '(F20.10)', c_func(my_x) +end -diff --git a/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/fortran_main022.f90 b/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/fortran_main022.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/fortran_main022.f90 b/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/fortran_main022.f90 new file mode 100644 -index 0000000..20c50dc +index 0000000..491887f --- /dev/null -+++ b/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/fortran_main022.f90 -@@ -0,0 +1,13 @@ -+! Test fortran call c for the return type is ptr of type double with -+! bindc ++++ b/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/fortran_main022.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the return type is ptr of type double +! +program main + real(8) :: my_x = 3.1415926535 + interface -+ function c_func(b) result(res) bind(c, name = "c_func_") ++ function c_func(b) result(res) + real(8) :: b + real(8), pointer :: res + end + end interface + print '(F20.10)', c_func(my_x) +end -diff --git a/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/fortran_main023.f90 b/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/fortran_main023.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/fortran_main023.f90 b/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/fortran_main023.f90 new file mode 100644 -index 0000000..db15fba +index 0000000..a8861c9 --- /dev/null -+++ b/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/fortran_main023.f90 -@@ -0,0 +1,15 @@ ++++ b/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/fortran_main023.f90 +@@ -0,0 +1,14 @@ +! Test fortran call c for the return type is ptr of type long double -+! with bindc +! +program main + integer, parameter :: K = selected_real_kind(16) + real(K) :: my_x = 3.1415926535 + interface -+ function c_func(b) result(res) bind(c, name = "c_func_") ++ function c_func(b) result(res) + integer, parameter :: K = selected_real_kind(16) + real(K) :: b + real(K), pointer :: res @@ -8795,58 +7671,57 @@ index 0000000..db15fba + end interface + print '(F20.10)', c_func(my_x) +end -diff --git a/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/fortran_main024.f90 b/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/fortran_main024.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/fortran_main024.f90 b/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/fortran_main024.f90 new file mode 100644 -index 0000000..418f3ef +index 0000000..2a49f2a --- /dev/null -+++ b/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/fortran_main024.f90 -@@ -0,0 +1,13 @@ ++++ b/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/fortran_main024.f90 +@@ -0,0 +1,12 @@ +! Test fortran call c for the return type is ptr of type float _Complex -+! with bindc +! +program main + complex(4) :: my_x = (3.1415926535, 1) + interface -+ function c_func(b) result(res) bind(c, name = "c_func_") ++ function c_func(b) result(res) + complex(4) :: b + complex(4), pointer :: res + end + end interface + print '(F20.10)', c_func(my_x) +end -diff --git a/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/fortran_main025.f90 b/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/fortran_main025.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/fortran_main025.f90 b/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/fortran_main025.f90 new file mode 100644 -index 0000000..d895ead +index 0000000..e329c2a --- /dev/null -+++ b/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/fortran_main025.f90 ++++ b/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/fortran_main025.f90 @@ -0,0 +1,13 @@ +! Test fortran call c for the return type is ptr of type double -+! _Complex with bindc ++! _Complex +! +program main + complex(8) :: my_x = (3.1415926535, 1) + interface -+ function c_func(b) result(res) bind(c, name = "c_func_") ++ function c_func(b) result(res) + complex(8) :: b + complex(8), pointer :: res + end + end interface + print '(F20.10)', c_func(my_x) +end -diff --git a/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/fortran_main026.f90 b/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/fortran_main026.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/fortran_main026.f90 b/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/fortran_main026.f90 new file mode 100644 -index 0000000..4a70cfe +index 0000000..6b2b0a2 --- /dev/null -+++ b/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/fortran_main026.f90 ++++ b/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/fortran_main026.f90 @@ -0,0 +1,15 @@ +! Test fortran call c for the return type is ptr of type long double -+! _Complex with bindc ++! _Complex +! +program main + integer, parameter :: K = selected_real_kind(16) + complex(K) :: my_x = (3.1415926535, 1) + interface -+ function c_func(b) result(res) bind(c, name = "c_func_") ++ function c_func(b) result(res) + integer, parameter :: K = selected_real_kind(16) + complex(K) :: b + complex(K), pointer :: res @@ -8854,50 +7729,48 @@ index 0000000..4a70cfe + end interface + print '(F20.10)', c_func(my_x) +end -diff --git a/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/fortran_main027.f90 b/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/fortran_main027.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/fortran_main027.f90 b/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/fortran_main027.f90 new file mode 100644 -index 0000000..7a59b51 +index 0000000..28efc8d --- /dev/null -+++ b/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/fortran_main027.f90 -@@ -0,0 +1,13 @@ -+! Test fortran call c for the return type is ptr of type _Bool with -+! bindc ++++ b/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/fortran_main027.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the return type is ptr of type _Bool +! +program main + logical(1) :: my_x = .FALSE. + interface -+ function c_func(b) result(res) bind(c, name = "c_func_") ++ function c_func(b) result(res) + logical(1) :: b + logical(1), pointer :: res + end + end interface + print *, c_func(my_x) +end -diff --git a/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/fortran_main028.f90 b/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/fortran_main028.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/fortran_main028.f90 b/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/fortran_main028.f90 new file mode 100644 -index 0000000..c76780f +index 0000000..37a0198 --- /dev/null -+++ b/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/fortran_main028.f90 -@@ -0,0 +1,13 @@ -+! Test fortran call c for the return type is ptr of type char with -+! bindc ++++ b/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/fortran_main028.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the return type is ptr of type char +! +program main + character(1) :: my_x = 'a' + interface -+ function c_func(b) result(res) bind(c, name = "c_func_") ++ function c_func(b) result(res) + character(1) :: b + character(1), pointer :: res + end + end interface + print *, c_func(my_x) +end -diff --git a/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/run.sh b/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/run.sh +diff --git a/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/run.sh b/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/run.sh new file mode 100644 -index 0000000..632b582 +index 0000000..b865403 --- /dev/null -+++ b/test/interoperability_with_c/010_fortran_call_c_function_ptr_bindc/run.sh -@@ -0,0 +1,17 @@ ++++ b/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/run.sh +@@ -0,0 +1,16 @@ +for i in {001..028} +do +echo "------- test $i ------." @@ -8914,67 +7787,67 @@ index 0000000..632b582 +./a.out +rm *.o a.out +done -+ -diff --git a/test/interoperability_with_c/011_fortran_call_c_function_ptr/c_func001.c b/test/interoperability_with_c/011_fortran_call_c_function_ptr/c_func001.c +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/c_func001.c b/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/c_func001.c new file mode 100644 index 0000000..89defd9 --- /dev/null -+++ b/test/interoperability_with_c/011_fortran_call_c_function_ptr/c_func001.c ++++ b/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/c_func001.c @@ -0,0 +1,5 @@ +#include +int* c_func_(int *a) { + printf("%5d\n", *a); + return a; +} -diff --git a/test/interoperability_with_c/011_fortran_call_c_function_ptr/c_func002.c b/test/interoperability_with_c/011_fortran_call_c_function_ptr/c_func002.c +diff --git a/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/c_func002.c b/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/c_func002.c new file mode 100644 -index 0000000..0239f18 +index 0000000..6c172b6 --- /dev/null -+++ b/test/interoperability_with_c/011_fortran_call_c_function_ptr/c_func002.c ++++ b/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/c_func002.c @@ -0,0 +1,5 @@ +#include +short* c_func_(short *a) { -+ printf("%5hd\n", *a); ++ printf("%5d\n", *a); + return a; +} -diff --git a/test/interoperability_with_c/011_fortran_call_c_function_ptr/c_func003.c b/test/interoperability_with_c/011_fortran_call_c_function_ptr/c_func003.c +diff --git a/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/c_func003.c b/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/c_func003.c new file mode 100644 index 0000000..b1b4838 --- /dev/null -+++ b/test/interoperability_with_c/011_fortran_call_c_function_ptr/c_func003.c ++++ b/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/c_func003.c @@ -0,0 +1,5 @@ +#include +long* c_func_(long *a) { + printf("%5ld\n", *a); + return a; +} -diff --git a/test/interoperability_with_c/011_fortran_call_c_function_ptr/c_func004.c b/test/interoperability_with_c/011_fortran_call_c_function_ptr/c_func004.c +diff --git a/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/c_func004.c b/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/c_func004.c new file mode 100644 index 0000000..90896f0 --- /dev/null -+++ b/test/interoperability_with_c/011_fortran_call_c_function_ptr/c_func004.c ++++ b/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/c_func004.c @@ -0,0 +1,5 @@ +#include +long long* c_func_(long long *a) { + printf("%lld\n", *a); + return a; +} -diff --git a/test/interoperability_with_c/011_fortran_call_c_function_ptr/c_func005.c b/test/interoperability_with_c/011_fortran_call_c_function_ptr/c_func005.c +diff --git a/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/c_func005.c b/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/c_func005.c new file mode 100644 index 0000000..91e7d0d --- /dev/null -+++ b/test/interoperability_with_c/011_fortran_call_c_function_ptr/c_func005.c ++++ b/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/c_func005.c @@ -0,0 +1,5 @@ +#include +signed char* c_func_(signed char *a) { + printf("%5c\n", *a); + return a; +} -diff --git a/test/interoperability_with_c/011_fortran_call_c_function_ptr/c_func006.c b/test/interoperability_with_c/011_fortran_call_c_function_ptr/c_func006.c +diff --git a/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/c_func006.c b/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/c_func006.c new file mode 100644 index 0000000..13ec31a --- /dev/null -+++ b/test/interoperability_with_c/011_fortran_call_c_function_ptr/c_func006.c ++++ b/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/c_func006.c @@ -0,0 +1,6 @@ +#include +#include @@ -8982,11 +7855,11 @@ index 0000000..13ec31a + printf("%5ld\n", *a); + return a; +} -diff --git a/test/interoperability_with_c/011_fortran_call_c_function_ptr/c_func007.c b/test/interoperability_with_c/011_fortran_call_c_function_ptr/c_func007.c +diff --git a/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/c_func007.c b/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/c_func007.c new file mode 100644 index 0000000..e883fd3 --- /dev/null -+++ b/test/interoperability_with_c/011_fortran_call_c_function_ptr/c_func007.c ++++ b/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/c_func007.c @@ -0,0 +1,6 @@ +#include +#include @@ -8994,11 +7867,11 @@ index 0000000..e883fd3 + printf("%5hhd\n", *a); + return a; +} -diff --git a/test/interoperability_with_c/011_fortran_call_c_function_ptr/c_func008.c b/test/interoperability_with_c/011_fortran_call_c_function_ptr/c_func008.c +diff --git a/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/c_func008.c b/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/c_func008.c new file mode 100644 index 0000000..a8a3209 --- /dev/null -+++ b/test/interoperability_with_c/011_fortran_call_c_function_ptr/c_func008.c ++++ b/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/c_func008.c @@ -0,0 +1,6 @@ +#include +#include @@ -9006,11 +7879,11 @@ index 0000000..a8a3209 + printf("%5hd\n", *a); + return a; +} -diff --git a/test/interoperability_with_c/011_fortran_call_c_function_ptr/c_func009.c b/test/interoperability_with_c/011_fortran_call_c_function_ptr/c_func009.c +diff --git a/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/c_func009.c b/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/c_func009.c new file mode 100644 index 0000000..9ad7e76 --- /dev/null -+++ b/test/interoperability_with_c/011_fortran_call_c_function_ptr/c_func009.c ++++ b/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/c_func009.c @@ -0,0 +1,6 @@ +#include +#include @@ -9018,11 +7891,11 @@ index 0000000..9ad7e76 + printf("%5d\n", *a); + return a; +} -diff --git a/test/interoperability_with_c/011_fortran_call_c_function_ptr/c_func010.c b/test/interoperability_with_c/011_fortran_call_c_function_ptr/c_func010.c +diff --git a/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/c_func010.c b/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/c_func010.c new file mode 100644 index 0000000..6bff1b5 --- /dev/null -+++ b/test/interoperability_with_c/011_fortran_call_c_function_ptr/c_func010.c ++++ b/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/c_func010.c @@ -0,0 +1,6 @@ +#include +#include @@ -9030,11 +7903,11 @@ index 0000000..6bff1b5 + printf("%5ld\n", *a); + return a; +} -diff --git a/test/interoperability_with_c/011_fortran_call_c_function_ptr/c_func011.c b/test/interoperability_with_c/011_fortran_call_c_function_ptr/c_func011.c +diff --git a/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/c_func011.c b/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/c_func011.c new file mode 100644 index 0000000..4a5970a --- /dev/null -+++ b/test/interoperability_with_c/011_fortran_call_c_function_ptr/c_func011.c ++++ b/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/c_func011.c @@ -0,0 +1,6 @@ +#include +#include @@ -9042,11 +7915,11 @@ index 0000000..4a5970a + printf("%5hhd\n", *a); + return a; +} -diff --git a/test/interoperability_with_c/011_fortran_call_c_function_ptr/c_func012.c b/test/interoperability_with_c/011_fortran_call_c_function_ptr/c_func012.c +diff --git a/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/c_func012.c b/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/c_func012.c new file mode 100644 index 0000000..72ac1a4 --- /dev/null -+++ b/test/interoperability_with_c/011_fortran_call_c_function_ptr/c_func012.c ++++ b/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/c_func012.c @@ -0,0 +1,6 @@ +#include +#include @@ -9054,11 +7927,11 @@ index 0000000..72ac1a4 + printf("%5hd\n", *a); + return a; +} -diff --git a/test/interoperability_with_c/011_fortran_call_c_function_ptr/c_func013.c b/test/interoperability_with_c/011_fortran_call_c_function_ptr/c_func013.c +diff --git a/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/c_func013.c b/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/c_func013.c new file mode 100644 index 0000000..771e48b --- /dev/null -+++ b/test/interoperability_with_c/011_fortran_call_c_function_ptr/c_func013.c ++++ b/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/c_func013.c @@ -0,0 +1,6 @@ +#include +#include @@ -9066,11 +7939,11 @@ index 0000000..771e48b + printf("%d\n", *a); + return a; +} -diff --git a/test/interoperability_with_c/011_fortran_call_c_function_ptr/c_func014.c b/test/interoperability_with_c/011_fortran_call_c_function_ptr/c_func014.c +diff --git a/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/c_func014.c b/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/c_func014.c new file mode 100644 index 0000000..c782984 --- /dev/null -+++ b/test/interoperability_with_c/011_fortran_call_c_function_ptr/c_func014.c ++++ b/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/c_func014.c @@ -0,0 +1,6 @@ +#include +#include @@ -9078,11 +7951,11 @@ index 0000000..c782984 + printf("%5ld\n", *a); + return a; +} -diff --git a/test/interoperability_with_c/011_fortran_call_c_function_ptr/c_func015.c b/test/interoperability_with_c/011_fortran_call_c_function_ptr/c_func015.c +diff --git a/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/c_func015.c b/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/c_func015.c new file mode 100644 index 0000000..96452b1 --- /dev/null -+++ b/test/interoperability_with_c/011_fortran_call_c_function_ptr/c_func015.c ++++ b/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/c_func015.c @@ -0,0 +1,6 @@ +#include +#include @@ -9090,11 +7963,11 @@ index 0000000..96452b1 + printf("%5hhd\n", *a); + return a; +} -diff --git a/test/interoperability_with_c/011_fortran_call_c_function_ptr/c_func016.c b/test/interoperability_with_c/011_fortran_call_c_function_ptr/c_func016.c +diff --git a/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/c_func016.c b/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/c_func016.c new file mode 100644 index 0000000..27bac38 --- /dev/null -+++ b/test/interoperability_with_c/011_fortran_call_c_function_ptr/c_func016.c ++++ b/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/c_func016.c @@ -0,0 +1,6 @@ +#include +#include @@ -9102,11 +7975,11 @@ index 0000000..27bac38 + printf("%5ld\n", *a); + return a; +} -diff --git a/test/interoperability_with_c/011_fortran_call_c_function_ptr/c_func017.c b/test/interoperability_with_c/011_fortran_call_c_function_ptr/c_func017.c +diff --git a/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/c_func017.c b/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/c_func017.c new file mode 100644 index 0000000..f4e0e76 --- /dev/null -+++ b/test/interoperability_with_c/011_fortran_call_c_function_ptr/c_func017.c ++++ b/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/c_func017.c @@ -0,0 +1,6 @@ +#include +#include @@ -9114,11 +7987,11 @@ index 0000000..f4e0e76 + printf("%ld\n", *a); + return a; +} -diff --git a/test/interoperability_with_c/011_fortran_call_c_function_ptr/c_func018.c b/test/interoperability_with_c/011_fortran_call_c_function_ptr/c_func018.c +diff --git a/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/c_func018.c b/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/c_func018.c new file mode 100644 index 0000000..ee80d9a --- /dev/null -+++ b/test/interoperability_with_c/011_fortran_call_c_function_ptr/c_func018.c ++++ b/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/c_func018.c @@ -0,0 +1,6 @@ +#include +#include @@ -9126,11 +7999,11 @@ index 0000000..ee80d9a + printf("%5ld\n", *a); + return a; +} -diff --git a/test/interoperability_with_c/011_fortran_call_c_function_ptr/c_func019.c b/test/interoperability_with_c/011_fortran_call_c_function_ptr/c_func019.c +diff --git a/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/c_func019.c b/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/c_func019.c new file mode 100644 index 0000000..a6205df --- /dev/null -+++ b/test/interoperability_with_c/011_fortran_call_c_function_ptr/c_func019.c ++++ b/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/c_func019.c @@ -0,0 +1,6 @@ +#include +#include @@ -9138,11 +8011,11 @@ index 0000000..a6205df + printf("%5ld\n", *a); + return a; +} -diff --git a/test/interoperability_with_c/011_fortran_call_c_function_ptr/c_func020.c b/test/interoperability_with_c/011_fortran_call_c_function_ptr/c_func020.c +diff --git a/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/c_func020.c b/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/c_func020.c new file mode 100644 index 0000000..3fc6c40 --- /dev/null -+++ b/test/interoperability_with_c/011_fortran_call_c_function_ptr/c_func020.c ++++ b/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/c_func020.c @@ -0,0 +1,6 @@ +#include +#include @@ -9150,44 +8023,44 @@ index 0000000..3fc6c40 + printf("%5ld\n", *a); + return a; +} -diff --git a/test/interoperability_with_c/011_fortran_call_c_function_ptr/c_func021.c b/test/interoperability_with_c/011_fortran_call_c_function_ptr/c_func021.c +diff --git a/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/c_func021.c b/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/c_func021.c new file mode 100644 index 0000000..4584a17 --- /dev/null -+++ b/test/interoperability_with_c/011_fortran_call_c_function_ptr/c_func021.c ++++ b/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/c_func021.c @@ -0,0 +1,5 @@ +#include +float* c_func_(float *a) { + printf("%0.20f\n", *a); + return a; +} -diff --git a/test/interoperability_with_c/011_fortran_call_c_function_ptr/c_func022.c b/test/interoperability_with_c/011_fortran_call_c_function_ptr/c_func022.c +diff --git a/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/c_func022.c b/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/c_func022.c new file mode 100644 index 0000000..6c20627 --- /dev/null -+++ b/test/interoperability_with_c/011_fortran_call_c_function_ptr/c_func022.c ++++ b/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/c_func022.c @@ -0,0 +1,5 @@ +#include +double* c_func_(double *a) { + printf("%0.20lf\n", *a); + return a; +} -diff --git a/test/interoperability_with_c/011_fortran_call_c_function_ptr/c_func023.c b/test/interoperability_with_c/011_fortran_call_c_function_ptr/c_func023.c +diff --git a/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/c_func023.c b/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/c_func023.c new file mode 100644 index 0000000..4067c00 --- /dev/null -+++ b/test/interoperability_with_c/011_fortran_call_c_function_ptr/c_func023.c ++++ b/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/c_func023.c @@ -0,0 +1,5 @@ +#include +long double* c_func_(long double *a) { + printf("%0.20Lf\n", *a); + return a; +} -diff --git a/test/interoperability_with_c/011_fortran_call_c_function_ptr/c_func024.c b/test/interoperability_with_c/011_fortran_call_c_function_ptr/c_func024.c +diff --git a/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/c_func024.c b/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/c_func024.c new file mode 100644 index 0000000..8d5cbd6 --- /dev/null -+++ b/test/interoperability_with_c/011_fortran_call_c_function_ptr/c_func024.c ++++ b/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/c_func024.c @@ -0,0 +1,6 @@ +#include +#include @@ -9195,11 +8068,11 @@ index 0000000..8d5cbd6 + printf("%0.20f + %0.20fi\n", creal(*t), cimag(*t)); + return t; +} -diff --git a/test/interoperability_with_c/011_fortran_call_c_function_ptr/c_func025.c b/test/interoperability_with_c/011_fortran_call_c_function_ptr/c_func025.c +diff --git a/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/c_func025.c b/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/c_func025.c new file mode 100644 index 0000000..2cc6c66 --- /dev/null -+++ b/test/interoperability_with_c/011_fortran_call_c_function_ptr/c_func025.c ++++ b/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/c_func025.c @@ -0,0 +1,6 @@ +#include +#include @@ -9207,11 +8080,11 @@ index 0000000..2cc6c66 + printf("%0.20lf + %0.20lfi\n", creal(*t), cimag(*t)); + return t; +} -diff --git a/test/interoperability_with_c/011_fortran_call_c_function_ptr/c_func026.c b/test/interoperability_with_c/011_fortran_call_c_function_ptr/c_func026.c +diff --git a/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/c_func026.c b/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/c_func026.c new file mode 100644 index 0000000..4cd06f9 --- /dev/null -+++ b/test/interoperability_with_c/011_fortran_call_c_function_ptr/c_func026.c ++++ b/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/c_func026.c @@ -0,0 +1,6 @@ +#include +#include @@ -9219,438 +8092,459 @@ index 0000000..4cd06f9 + printf("%0.20f + %0.20fi\n", creal(*t), cimag(*t)); + return t; +} -diff --git a/test/interoperability_with_c/011_fortran_call_c_function_ptr/c_func027.c b/test/interoperability_with_c/011_fortran_call_c_function_ptr/c_func027.c +diff --git a/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/c_func027.c b/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/c_func027.c new file mode 100644 index 0000000..d576c9e --- /dev/null -+++ b/test/interoperability_with_c/011_fortran_call_c_function_ptr/c_func027.c ++++ b/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/c_func027.c @@ -0,0 +1,5 @@ +#include +_Bool* c_func_(_Bool *a) { + printf("%5d\n", *a); + return a; +} -diff --git a/test/interoperability_with_c/011_fortran_call_c_function_ptr/c_func028.c b/test/interoperability_with_c/011_fortran_call_c_function_ptr/c_func028.c +diff --git a/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/c_func028.c b/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/c_func028.c new file mode 100644 -index 0000000..d453743 +index 0000000..6024629 --- /dev/null -+++ b/test/interoperability_with_c/011_fortran_call_c_function_ptr/c_func028.c -@@ -0,0 +1,6 @@ ++++ b/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/c_func028.c +@@ -0,0 +1,5 @@ +#include -+#include +char* c_func_(char *t) { + printf("%c\n", *t); + return t; +} -diff --git a/test/interoperability_with_c/011_fortran_call_c_function_ptr/fortran_main001.f90 b/test/interoperability_with_c/011_fortran_call_c_function_ptr/fortran_main001.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/fortran_main001.f90 b/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/fortran_main001.f90 new file mode 100644 -index 0000000..0162f22 +index 0000000..eea8ab6 --- /dev/null -+++ b/test/interoperability_with_c/011_fortran_call_c_function_ptr/fortran_main001.f90 ++++ b/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/fortran_main001.f90 @@ -0,0 +1,12 @@ -+! Test fortran call c for the return type is ptr of type int ++! Test fortran call c for the return type is ptr of type int with bindc +! +program main + integer :: my_x = 1 + interface -+ function c_func(b) result(res) ++ function c_func(b) result(res) bind(c, name = "c_func_") + integer :: b + integer, pointer :: res + end + end interface + print '(I5)', c_func(my_x) +end -diff --git a/test/interoperability_with_c/011_fortran_call_c_function_ptr/fortran_main002.f90 b/test/interoperability_with_c/011_fortran_call_c_function_ptr/fortran_main002.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/fortran_main002.f90 b/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/fortran_main002.f90 new file mode 100644 -index 0000000..9398800 +index 0000000..75ae05d --- /dev/null -+++ b/test/interoperability_with_c/011_fortran_call_c_function_ptr/fortran_main002.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the return type is ptr of type short ++++ b/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/fortran_main002.f90 +@@ -0,0 +1,13 @@ ++! Test fortran call c for the return type is ptr of type short with ++! bindc +! +program main + integer(2) :: my_x = 1 + interface -+ function c_func(b) result(res) ++ function c_func(b) result(res) bind(c, name = "c_func_") + integer(2) :: b + integer(2), pointer :: res + end + end interface + print '(I5)', c_func(my_x) +end -diff --git a/test/interoperability_with_c/011_fortran_call_c_function_ptr/fortran_main003.f90 b/test/interoperability_with_c/011_fortran_call_c_function_ptr/fortran_main003.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/fortran_main003.f90 b/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/fortran_main003.f90 new file mode 100644 -index 0000000..8905eab +index 0000000..0ddcedf --- /dev/null -+++ b/test/interoperability_with_c/011_fortran_call_c_function_ptr/fortran_main003.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the return type is ptr of type long ++++ b/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/fortran_main003.f90 +@@ -0,0 +1,13 @@ ++! Test fortran call c for the return type is ptr of type long with ++! bindc +! +program main + integer(8) :: my_x = 1 + interface -+ function c_func(b) result(res) ++ function c_func(b) result(res) bind(c, name = "c_func_") + integer(8) :: b + integer(8), pointer :: res + end + end interface + print '(I5)', c_func(my_x) +end -diff --git a/test/interoperability_with_c/011_fortran_call_c_function_ptr/fortran_main004.f90 b/test/interoperability_with_c/011_fortran_call_c_function_ptr/fortran_main004.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/fortran_main004.f90 b/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/fortran_main004.f90 new file mode 100644 -index 0000000..6ce9768 +index 0000000..7383644 --- /dev/null -+++ b/test/interoperability_with_c/011_fortran_call_c_function_ptr/fortran_main004.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the return type is ptr of type long long ++++ b/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/fortran_main004.f90 +@@ -0,0 +1,13 @@ ++! Test fortran call c for the return type is ptr of type long long with ++! bindc +! +program main + integer(8) :: my_x = 1 + interface -+ function c_func(b) result(res) ++ function c_func(b) result(res) bind(c, name = "c_func_") + integer(8) :: b + integer(8), pointer :: res + end + end interface + print '(I5)', c_func(my_x) +end -diff --git a/test/interoperability_with_c/011_fortran_call_c_function_ptr/fortran_main005.f90 b/test/interoperability_with_c/011_fortran_call_c_function_ptr/fortran_main005.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/fortran_main005.f90 b/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/fortran_main005.f90 new file mode 100644 -index 0000000..9445938 +index 0000000..641ec2f --- /dev/null -+++ b/test/interoperability_with_c/011_fortran_call_c_function_ptr/fortran_main005.f90 -@@ -0,0 +1,12 @@ ++++ b/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/fortran_main005.f90 +@@ -0,0 +1,13 @@ +! Test fortran call c for the return type is ptr of type signed char ++! with bindc +! +program main + integer(1) :: my_x = 65 + interface -+ function c_func(b) result(res) ++ function c_func(b) result(res) bind(c, name = "c_func_") + integer(1) :: b + integer(1), pointer :: res + end + end interface + print '(I5)', c_func(my_x) +end -diff --git a/test/interoperability_with_c/011_fortran_call_c_function_ptr/fortran_main006.f90 b/test/interoperability_with_c/011_fortran_call_c_function_ptr/fortran_main006.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/fortran_main006.f90 b/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/fortran_main006.f90 new file mode 100644 -index 0000000..7ead44f +index 0000000..f5776ff --- /dev/null -+++ b/test/interoperability_with_c/011_fortran_call_c_function_ptr/fortran_main006.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the return type is ptr of type size_t ++++ b/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/fortran_main006.f90 +@@ -0,0 +1,13 @@ ++! Test fortran call c for the return type is ptr of type size_t with ++! bindc +! +program main + integer(8) :: my_x = 1 + interface -+ function c_func(b) result(res) ++ function c_func(b) result(res) bind(c, name = "c_func_") + integer(8) :: b + integer(8), pointer :: res + end + end interface + print '(I5)', c_func(my_x) +end -diff --git a/test/interoperability_with_c/011_fortran_call_c_function_ptr/fortran_main007.f90 b/test/interoperability_with_c/011_fortran_call_c_function_ptr/fortran_main007.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/fortran_main007.f90 b/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/fortran_main007.f90 new file mode 100644 -index 0000000..4a80499 +index 0000000..9c8f25b --- /dev/null -+++ b/test/interoperability_with_c/011_fortran_call_c_function_ptr/fortran_main007.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the return type is ptr of type int8_t ++++ b/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/fortran_main007.f90 +@@ -0,0 +1,13 @@ ++! Test fortran call c for the return type is ptr of type int8_t with ++! bindc +! +program main + integer(1) :: my_x = 1 + interface -+ function c_func(b) result(res) ++ function c_func(b) result(res) bind(c, name = "c_func_") + integer(1) :: b + integer(1), pointer :: res + end + end interface + print '(I5)', c_func(my_x) +end -diff --git a/test/interoperability_with_c/011_fortran_call_c_function_ptr/fortran_main008.f90 b/test/interoperability_with_c/011_fortran_call_c_function_ptr/fortran_main008.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/fortran_main008.f90 b/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/fortran_main008.f90 new file mode 100644 -index 0000000..d85e1bb +index 0000000..e057058 --- /dev/null -+++ b/test/interoperability_with_c/011_fortran_call_c_function_ptr/fortran_main008.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the return type is ptr of type int16_t ++++ b/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/fortran_main008.f90 +@@ -0,0 +1,13 @@ ++! Test fortran call c for the return type is ptr of type int16_t with ++! bindc +! +program main + integer(2) :: my_x = 1 + interface -+ function c_func(b) result(res) ++ function c_func(b) result(res) bind(c, name = "c_func_") + integer(2) :: b + integer(2), pointer :: res + end + end interface + print '(I5)', c_func(my_x) +end -diff --git a/test/interoperability_with_c/011_fortran_call_c_function_ptr/fortran_main009.f90 b/test/interoperability_with_c/011_fortran_call_c_function_ptr/fortran_main009.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/fortran_main009.f90 b/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/fortran_main009.f90 new file mode 100644 -index 0000000..a613e46 +index 0000000..e9c35c1 --- /dev/null -+++ b/test/interoperability_with_c/011_fortran_call_c_function_ptr/fortran_main009.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the return type is ptr of type int32_t ++++ b/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/fortran_main009.f90 +@@ -0,0 +1,13 @@ ++! Test fortran call c for the return type is ptr of type int32_t with ++! bindc +! +program main + integer(4) :: my_x = 1 + interface -+ function c_func(b) result(res) ++ function c_func(b) result(res) bind(c, name = "c_func_") + integer(4) :: b + integer(4), pointer :: res + end + end interface + print '(I5)', c_func(my_x) +end -diff --git a/test/interoperability_with_c/011_fortran_call_c_function_ptr/fortran_main010.f90 b/test/interoperability_with_c/011_fortran_call_c_function_ptr/fortran_main010.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/fortran_main010.f90 b/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/fortran_main010.f90 new file mode 100644 -index 0000000..c300630 +index 0000000..d52b3f0 --- /dev/null -+++ b/test/interoperability_with_c/011_fortran_call_c_function_ptr/fortran_main010.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the return type is ptr of type int64_t ++++ b/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/fortran_main010.f90 +@@ -0,0 +1,13 @@ ++! Test fortran call c for the return type is ptr of type int64_t with ++! bindc +! +program main + integer(8) :: my_x = 1 + interface -+ function c_func(b) result(res) ++ function c_func(b) result(res) bind(c, name = "c_func_") + integer(8) :: b + integer(8), pointer :: res + end + end interface + print '(I5)', c_func(my_x) +end -diff --git a/test/interoperability_with_c/011_fortran_call_c_function_ptr/fortran_main011.f90 b/test/interoperability_with_c/011_fortran_call_c_function_ptr/fortran_main011.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/fortran_main011.f90 b/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/fortran_main011.f90 new file mode 100644 -index 0000000..c5b3ec4 +index 0000000..8427950 --- /dev/null -+++ b/test/interoperability_with_c/011_fortran_call_c_function_ptr/fortran_main011.f90 -@@ -0,0 +1,12 @@ ++++ b/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/fortran_main011.f90 +@@ -0,0 +1,13 @@ +! Test fortran call c for the return type is ptr of type int_least8_t ++! with bindc +! +program main + integer(1) :: my_x = 1 + interface -+ function c_func(b) result(res) ++ function c_func(b) result(res) bind(c, name = "c_func_") + integer(1) :: b + integer(1), pointer :: res + end + end interface + print '(I5)', c_func(my_x) +end -diff --git a/test/interoperability_with_c/011_fortran_call_c_function_ptr/fortran_main012.f90 b/test/interoperability_with_c/011_fortran_call_c_function_ptr/fortran_main012.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/fortran_main012.f90 b/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/fortran_main012.f90 new file mode 100644 -index 0000000..50d736a +index 0000000..123a9b1 --- /dev/null -+++ b/test/interoperability_with_c/011_fortran_call_c_function_ptr/fortran_main012.f90 -@@ -0,0 +1,12 @@ ++++ b/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/fortran_main012.f90 +@@ -0,0 +1,13 @@ +! Test fortran call c for the return type is ptr of type int_least16_t ++! with bindc +! +program main + integer(2) :: my_x = 1 + interface -+ function c_func(b) result(res) ++ function c_func(b) result(res) bind(c, name = "c_func_") + integer(2) :: b + integer(2), pointer :: res + end + end interface + print '(I5)', c_func(my_x) +end -diff --git a/test/interoperability_with_c/011_fortran_call_c_function_ptr/fortran_main013.f90 b/test/interoperability_with_c/011_fortran_call_c_function_ptr/fortran_main013.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/fortran_main013.f90 b/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/fortran_main013.f90 new file mode 100644 -index 0000000..f1ed742 +index 0000000..a8586ed --- /dev/null -+++ b/test/interoperability_with_c/011_fortran_call_c_function_ptr/fortran_main013.f90 -@@ -0,0 +1,12 @@ ++++ b/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/fortran_main013.f90 +@@ -0,0 +1,13 @@ +! Test fortran call c for the return type is ptr of type int_least32_t ++! with bindc +! +program main + integer(4) :: my_x = 1 + interface -+ function c_func(b) result(res) ++ function c_func(b) result(res) bind(c, name = "c_func_") + integer(4) :: b + integer(4), pointer :: res + end + end interface + print '(I5)', c_func(my_x) +end -diff --git a/test/interoperability_with_c/011_fortran_call_c_function_ptr/fortran_main014.f90 b/test/interoperability_with_c/011_fortran_call_c_function_ptr/fortran_main014.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/fortran_main014.f90 b/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/fortran_main014.f90 new file mode 100644 -index 0000000..2cb4795 +index 0000000..6634cd9 --- /dev/null -+++ b/test/interoperability_with_c/011_fortran_call_c_function_ptr/fortran_main014.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the return type is ptr of type int_least8_t ++++ b/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/fortran_main014.f90 +@@ -0,0 +1,13 @@ ++! Test fortran call c for the return type is ptr of type int_least64_t ++! with bindc +! +program main + integer(8) :: my_x = 1 + interface -+ function c_func(b) result(res) ++ function c_func(b) result(res) bind(c, name = "c_func_") + integer(8) :: b + integer(8), pointer :: res + end + end interface + print '(I5)', c_func(my_x) +end -diff --git a/test/interoperability_with_c/011_fortran_call_c_function_ptr/fortran_main015.f90 b/test/interoperability_with_c/011_fortran_call_c_function_ptr/fortran_main015.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/fortran_main015.f90 b/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/fortran_main015.f90 new file mode 100644 -index 0000000..626f02a +index 0000000..007d56d --- /dev/null -+++ b/test/interoperability_with_c/011_fortran_call_c_function_ptr/fortran_main015.f90 -@@ -0,0 +1,12 @@ ++++ b/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/fortran_main015.f90 +@@ -0,0 +1,13 @@ +! Test fortran call c for the return type is ptr of type int_fast8_t ++! with bindc +! +program main + integer(1) :: my_x = 1 + interface -+ function c_func(b) result(res) ++ function c_func(b) result(res) bind(c, name = "c_func_") + integer(1) :: b + integer(1), pointer :: res + end + end interface + print '(I5)', c_func(my_x) +end -diff --git a/test/interoperability_with_c/011_fortran_call_c_function_ptr/fortran_main016.f90 b/test/interoperability_with_c/011_fortran_call_c_function_ptr/fortran_main016.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/fortran_main016.f90 b/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/fortran_main016.f90 new file mode 100644 -index 0000000..2a41aa9 +index 0000000..58c20b5 --- /dev/null -+++ b/test/interoperability_with_c/011_fortran_call_c_function_ptr/fortran_main016.f90 -@@ -0,0 +1,12 @@ ++++ b/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/fortran_main016.f90 +@@ -0,0 +1,13 @@ +! Test fortran call c for the return type is ptr of type int_fast16_t ++! with bindc +! +program main + integer(8) :: my_x = 1 + interface -+ function c_func(b) result(res) ++ function c_func(b) result(res) bind(c, name = "c_func_") + integer(8) :: b + integer(8), pointer :: res + end + end interface + print '(I5)', c_func(my_x) +end -diff --git a/test/interoperability_with_c/011_fortran_call_c_function_ptr/fortran_main017.f90 b/test/interoperability_with_c/011_fortran_call_c_function_ptr/fortran_main017.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/fortran_main017.f90 b/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/fortran_main017.f90 new file mode 100644 -index 0000000..1f4ae6a +index 0000000..64ed1d0 --- /dev/null -+++ b/test/interoperability_with_c/011_fortran_call_c_function_ptr/fortran_main017.f90 -@@ -0,0 +1,12 @@ ++++ b/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/fortran_main017.f90 +@@ -0,0 +1,13 @@ +! Test fortran call c for the return type is ptr of type int_fast32_t ++! with bindc +! +program main + integer(8) :: my_x = 1 + interface -+ function c_func(b) result(res) ++ function c_func(b) result(res) bind(c, name = "c_func_") + integer(8) :: b + integer(8), pointer :: res + end + end interface + print '(I5)', c_func(my_x) +end -diff --git a/test/interoperability_with_c/011_fortran_call_c_function_ptr/fortran_main018.f90 b/test/interoperability_with_c/011_fortran_call_c_function_ptr/fortran_main018.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/fortran_main018.f90 b/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/fortran_main018.f90 new file mode 100644 -index 0000000..9c99b13 +index 0000000..b7ad882 --- /dev/null -+++ b/test/interoperability_with_c/011_fortran_call_c_function_ptr/fortran_main018.f90 -@@ -0,0 +1,12 @@ ++++ b/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/fortran_main018.f90 +@@ -0,0 +1,13 @@ +! Test fortran call c for the return type is ptr of type int_fast64_t ++! with bindc +! +program main + integer(8) :: my_x = 1 + interface -+ function c_func(b) result(res) ++ function c_func(b) result(res) bind(c, name = "c_func_") + integer(8) :: b + integer(8), pointer :: res + end + end interface + print '(I5)', c_func(my_x) +end -diff --git a/test/interoperability_with_c/011_fortran_call_c_function_ptr/fortran_main019.f90 b/test/interoperability_with_c/011_fortran_call_c_function_ptr/fortran_main019.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/fortran_main019.f90 b/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/fortran_main019.f90 new file mode 100644 -index 0000000..4bdcd0c +index 0000000..1197ccb --- /dev/null -+++ b/test/interoperability_with_c/011_fortran_call_c_function_ptr/fortran_main019.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the return type is ptr of type intmax_t ++++ b/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/fortran_main019.f90 +@@ -0,0 +1,13 @@ ++! Test fortran call c for the return type is ptr of type intmax_t with ++! bindc +! +program main + integer(8) :: my_x = 1 + interface -+ function c_func(b) result(res) ++ function c_func(b) result(res) bind(c, name = "c_func_") + integer(8) :: b + integer(8), pointer :: res + end + end interface + print *, c_func(my_x) +end -diff --git a/test/interoperability_with_c/011_fortran_call_c_function_ptr/fortran_main020.f90 b/test/interoperability_with_c/011_fortran_call_c_function_ptr/fortran_main020.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/fortran_main020.f90 b/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/fortran_main020.f90 new file mode 100644 -index 0000000..80b302e +index 0000000..9bf210b --- /dev/null -+++ b/test/interoperability_with_c/011_fortran_call_c_function_ptr/fortran_main020.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the return type is ptr of type intptr_t ++++ b/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/fortran_main020.f90 +@@ -0,0 +1,13 @@ ++! Test fortran call c for the return type is ptr of type intptr_t with ++! bindc +! +program main + integer(8) :: my_x = 1 + interface -+ function c_func(b) result(res) ++ function c_func(b) result(res) bind(c, name = "c_func_") + integer(8) :: b + integer(8), pointer :: res + end + end interface + print '(I5)', c_func(my_x) +end -diff --git a/test/interoperability_with_c/011_fortran_call_c_function_ptr/fortran_main021.f90 b/test/interoperability_with_c/011_fortran_call_c_function_ptr/fortran_main021.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/fortran_main021.f90 b/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/fortran_main021.f90 new file mode 100644 -index 0000000..3760036 +index 0000000..debcb13 --- /dev/null -+++ b/test/interoperability_with_c/011_fortran_call_c_function_ptr/fortran_main021.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the return type is ptr of type float ++++ b/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/fortran_main021.f90 +@@ -0,0 +1,13 @@ ++! Test fortran call c for the return type is ptr of type float with ++! bindc +! +program main + real(4) :: my_x = 1.0 + interface -+ function c_func(b) result(res) ++ function c_func(b) result(res) bind(c, name = "c_func_") + real(4) :: b + real(4), pointer :: res + end + end interface + print '(F20.10)', c_func(my_x) +end -diff --git a/test/interoperability_with_c/011_fortran_call_c_function_ptr/fortran_main022.f90 b/test/interoperability_with_c/011_fortran_call_c_function_ptr/fortran_main022.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/fortran_main022.f90 b/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/fortran_main022.f90 new file mode 100644 -index 0000000..491887f +index 0000000..20c50dc --- /dev/null -+++ b/test/interoperability_with_c/011_fortran_call_c_function_ptr/fortran_main022.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the return type is ptr of type double ++++ b/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/fortran_main022.f90 +@@ -0,0 +1,13 @@ ++! Test fortran call c for the return type is ptr of type double with ++! bindc +! +program main + real(8) :: my_x = 3.1415926535 + interface -+ function c_func(b) result(res) ++ function c_func(b) result(res) bind(c, name = "c_func_") + real(8) :: b + real(8), pointer :: res + end + end interface + print '(F20.10)', c_func(my_x) +end -diff --git a/test/interoperability_with_c/011_fortran_call_c_function_ptr/fortran_main023.f90 b/test/interoperability_with_c/011_fortran_call_c_function_ptr/fortran_main023.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/fortran_main023.f90 b/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/fortran_main023.f90 new file mode 100644 -index 0000000..a8861c9 +index 0000000..db15fba --- /dev/null -+++ b/test/interoperability_with_c/011_fortran_call_c_function_ptr/fortran_main023.f90 -@@ -0,0 +1,14 @@ ++++ b/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/fortran_main023.f90 +@@ -0,0 +1,15 @@ +! Test fortran call c for the return type is ptr of type long double ++! with bindc +! +program main + integer, parameter :: K = selected_real_kind(16) + real(K) :: my_x = 3.1415926535 + interface -+ function c_func(b) result(res) ++ function c_func(b) result(res) bind(c, name = "c_func_") + integer, parameter :: K = selected_real_kind(16) + real(K) :: b + real(K), pointer :: res @@ -9658,57 +8552,58 @@ index 0000000..a8861c9 + end interface + print '(F20.10)', c_func(my_x) +end -diff --git a/test/interoperability_with_c/011_fortran_call_c_function_ptr/fortran_main024.f90 b/test/interoperability_with_c/011_fortran_call_c_function_ptr/fortran_main024.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/fortran_main024.f90 b/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/fortran_main024.f90 new file mode 100644 -index 0000000..2a49f2a +index 0000000..418f3ef --- /dev/null -+++ b/test/interoperability_with_c/011_fortran_call_c_function_ptr/fortran_main024.f90 -@@ -0,0 +1,12 @@ ++++ b/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/fortran_main024.f90 +@@ -0,0 +1,13 @@ +! Test fortran call c for the return type is ptr of type float _Complex ++! with bindc +! +program main + complex(4) :: my_x = (3.1415926535, 1) + interface -+ function c_func(b) result(res) ++ function c_func(b) result(res) bind(c, name = "c_func_") + complex(4) :: b + complex(4), pointer :: res + end + end interface + print '(F20.10)', c_func(my_x) +end -diff --git a/test/interoperability_with_c/011_fortran_call_c_function_ptr/fortran_main025.f90 b/test/interoperability_with_c/011_fortran_call_c_function_ptr/fortran_main025.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/fortran_main025.f90 b/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/fortran_main025.f90 new file mode 100644 -index 0000000..e329c2a +index 0000000..d895ead --- /dev/null -+++ b/test/interoperability_with_c/011_fortran_call_c_function_ptr/fortran_main025.f90 ++++ b/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/fortran_main025.f90 @@ -0,0 +1,13 @@ +! Test fortran call c for the return type is ptr of type double -+! _Complex ++! _Complex with bindc +! +program main + complex(8) :: my_x = (3.1415926535, 1) + interface -+ function c_func(b) result(res) ++ function c_func(b) result(res) bind(c, name = "c_func_") + complex(8) :: b + complex(8), pointer :: res + end + end interface + print '(F20.10)', c_func(my_x) +end -diff --git a/test/interoperability_with_c/011_fortran_call_c_function_ptr/fortran_main026.f90 b/test/interoperability_with_c/011_fortran_call_c_function_ptr/fortran_main026.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/fortran_main026.f90 b/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/fortran_main026.f90 new file mode 100644 -index 0000000..6b2b0a2 +index 0000000..4a70cfe --- /dev/null -+++ b/test/interoperability_with_c/011_fortran_call_c_function_ptr/fortran_main026.f90 ++++ b/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/fortran_main026.f90 @@ -0,0 +1,15 @@ +! Test fortran call c for the return type is ptr of type long double -+! _Complex ++! _Complex with bindc +! +program main + integer, parameter :: K = selected_real_kind(16) + complex(K) :: my_x = (3.1415926535, 1) + interface -+ function c_func(b) result(res) ++ function c_func(b) result(res) bind(c, name = "c_func_") + integer, parameter :: K = selected_real_kind(16) + complex(K) :: b + complex(K), pointer :: res @@ -9716,48 +8611,50 @@ index 0000000..6b2b0a2 + end interface + print '(F20.10)', c_func(my_x) +end -diff --git a/test/interoperability_with_c/011_fortran_call_c_function_ptr/fortran_main027.f90 b/test/interoperability_with_c/011_fortran_call_c_function_ptr/fortran_main027.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/fortran_main027.f90 b/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/fortran_main027.f90 new file mode 100644 -index 0000000..28efc8d +index 0000000..7a59b51 --- /dev/null -+++ b/test/interoperability_with_c/011_fortran_call_c_function_ptr/fortran_main027.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the return type is ptr of type _Bool ++++ b/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/fortran_main027.f90 +@@ -0,0 +1,13 @@ ++! Test fortran call c for the return type is ptr of type _Bool with ++! bindc +! +program main + logical(1) :: my_x = .FALSE. + interface -+ function c_func(b) result(res) ++ function c_func(b) result(res) bind(c, name = "c_func_") + logical(1) :: b + logical(1), pointer :: res + end + end interface + print *, c_func(my_x) +end -diff --git a/test/interoperability_with_c/011_fortran_call_c_function_ptr/fortran_main028.f90 b/test/interoperability_with_c/011_fortran_call_c_function_ptr/fortran_main028.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/fortran_main028.f90 b/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/fortran_main028.f90 new file mode 100644 -index 0000000..37a0198 +index 0000000..c76780f --- /dev/null -+++ b/test/interoperability_with_c/011_fortran_call_c_function_ptr/fortran_main028.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the return type is ptr of type char ++++ b/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/fortran_main028.f90 +@@ -0,0 +1,13 @@ ++! Test fortran call c for the return type is ptr of type char with ++! bindc +! +program main + character(1) :: my_x = 'a' + interface -+ function c_func(b) result(res) ++ function c_func(b) result(res) bind(c, name = "c_func_") + character(1) :: b + character(1), pointer :: res + end + end interface + print *, c_func(my_x) +end -diff --git a/test/interoperability_with_c/011_fortran_call_c_function_ptr/run.sh b/test/interoperability_with_c/011_fortran_call_c_function_ptr/run.sh +diff --git a/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/run.sh b/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/run.sh new file mode 100644 -index 0000000..632b582 +index 0000000..b865403 --- /dev/null -+++ b/test/interoperability_with_c/011_fortran_call_c_function_ptr/run.sh -@@ -0,0 +1,17 @@ ++++ b/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/run.sh +@@ -0,0 +1,16 @@ +for i in {001..028} +do +echo "------- test $i ------." @@ -9774,280 +8671,280 @@ index 0000000..632b582 +./a.out +rm *.o a.out +done -+ -diff --git a/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/c_func001.c b/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/c_func001.c +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/c_func001.c b/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/c_func001.c new file mode 100644 -index 0000000..5eabe70 +index 0000000..92427a4 --- /dev/null -+++ b/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/c_func001.c ++++ b/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/c_func001.c @@ -0,0 +1,5 @@ +#include +int c_func_(int *a) { + printf("%5d\n", *a); -+ return *a + 1; ++ return *a; +} -diff --git a/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/c_func002.c b/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/c_func002.c +diff --git a/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/c_func002.c b/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/c_func002.c new file mode 100644 -index 0000000..87a9609 +index 0000000..54747f2 --- /dev/null -+++ b/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/c_func002.c ++++ b/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/c_func002.c @@ -0,0 +1,5 @@ +#include +short c_func_(short *a) { + printf("%5hd\n", *a); -+ return *a + 1; ++ return *a; +} -diff --git a/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/c_func003.c b/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/c_func003.c +diff --git a/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/c_func003.c b/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/c_func003.c new file mode 100644 -index 0000000..5ba1d95 +index 0000000..a9fde92 --- /dev/null -+++ b/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/c_func003.c ++++ b/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/c_func003.c @@ -0,0 +1,5 @@ +#include +long c_func_(long *a) { + printf("%5ld\n", *a); -+ return *a + 1; ++ return *a; +} -diff --git a/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/c_func004.c b/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/c_func004.c +diff --git a/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/c_func004.c b/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/c_func004.c new file mode 100644 -index 0000000..f3914cb +index 0000000..2131b04 --- /dev/null -+++ b/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/c_func004.c ++++ b/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/c_func004.c @@ -0,0 +1,5 @@ +#include +long long c_func_(long long *a) { + printf("%lld\n", *a); -+ return *a + 1; ++ return *a; +} -diff --git a/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/c_func005.c b/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/c_func005.c +diff --git a/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/c_func005.c b/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/c_func005.c new file mode 100644 -index 0000000..1ea4f3e +index 0000000..309b9d0 --- /dev/null -+++ b/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/c_func005.c ++++ b/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/c_func005.c @@ -0,0 +1,5 @@ +#include +signed char c_func_(signed char *a) { + printf("%5c\n", *a); -+ return *a + 1; ++ return *a; +} -diff --git a/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/c_func006.c b/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/c_func006.c +diff --git a/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/c_func006.c b/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/c_func006.c new file mode 100644 -index 0000000..f5a2dcc +index 0000000..73982d0 --- /dev/null -+++ b/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/c_func006.c ++++ b/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/c_func006.c @@ -0,0 +1,6 @@ +#include +#include +size_t c_func_(size_t *a) { + printf("%5ld\n", *a); -+ return *a + 1; ++ return *a; +} -diff --git a/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/c_func007.c b/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/c_func007.c +diff --git a/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/c_func007.c b/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/c_func007.c new file mode 100644 -index 0000000..231e071 +index 0000000..efaee56 --- /dev/null -+++ b/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/c_func007.c ++++ b/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/c_func007.c @@ -0,0 +1,6 @@ +#include +#include +int8_t c_func_(int8_t *a) { + printf("%5hhd\n", *a); -+ return *a + 1; ++ return *a; +} -diff --git a/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/c_func008.c b/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/c_func008.c +diff --git a/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/c_func008.c b/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/c_func008.c new file mode 100644 -index 0000000..c243d9c +index 0000000..5a57718 --- /dev/null -+++ b/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/c_func008.c ++++ b/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/c_func008.c @@ -0,0 +1,6 @@ +#include +#include +int16_t c_func_(int16_t *a) { + printf("%5hd\n", *a); -+ return *a + 1; ++ return *a; +} -diff --git a/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/c_func009.c b/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/c_func009.c +diff --git a/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/c_func009.c b/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/c_func009.c new file mode 100644 -index 0000000..ff5050c +index 0000000..e076c57 --- /dev/null -+++ b/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/c_func009.c ++++ b/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/c_func009.c @@ -0,0 +1,6 @@ +#include +#include +int32_t c_func_(int32_t *a) { + printf("%5d\n", *a); -+ return *a + 1; ++ return *a; +} -diff --git a/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/c_func010.c b/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/c_func010.c +diff --git a/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/c_func010.c b/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/c_func010.c new file mode 100644 -index 0000000..2249b6a +index 0000000..197e12b --- /dev/null -+++ b/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/c_func010.c ++++ b/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/c_func010.c @@ -0,0 +1,6 @@ +#include +#include +int64_t c_func_(int64_t *a) { + printf("%5ld\n", *a); -+ return *a + 1; ++ return *a; +} -diff --git a/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/c_func011.c b/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/c_func011.c +diff --git a/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/c_func011.c b/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/c_func011.c new file mode 100644 -index 0000000..0eb9353 +index 0000000..cc67a34 --- /dev/null -+++ b/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/c_func011.c ++++ b/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/c_func011.c @@ -0,0 +1,6 @@ +#include +#include +int_least8_t c_func_(int_least8_t *a) { + printf("%5hhd\n", *a); -+ return *a + 1; ++ return *a; +} -diff --git a/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/c_func012.c b/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/c_func012.c +diff --git a/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/c_func012.c b/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/c_func012.c new file mode 100644 -index 0000000..3a591b2 +index 0000000..484de62 --- /dev/null -+++ b/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/c_func012.c ++++ b/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/c_func012.c @@ -0,0 +1,6 @@ +#include +#include +int_least16_t c_func_(int_least16_t *a) { + printf("%5hd\n", *a); -+ return *a + 1; ++ return *a; +} -diff --git a/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/c_func013.c b/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/c_func013.c +diff --git a/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/c_func013.c b/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/c_func013.c new file mode 100644 -index 0000000..cfbacdb +index 0000000..7a1973e --- /dev/null -+++ b/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/c_func013.c ++++ b/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/c_func013.c @@ -0,0 +1,6 @@ +#include +#include +int_least32_t c_func_(int_least32_t *a) { + printf("%d\n", *a); -+ return *a + 1; ++ return *a; +} -diff --git a/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/c_func014.c b/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/c_func014.c +diff --git a/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/c_func014.c b/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/c_func014.c new file mode 100644 -index 0000000..c922aa7 +index 0000000..d535c60 --- /dev/null -+++ b/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/c_func014.c ++++ b/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/c_func014.c @@ -0,0 +1,6 @@ +#include +#include +int_least64_t c_func_(int_least64_t *a) { + printf("%5ld\n", *a); -+ return *a + 1; ++ return *a; +} -diff --git a/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/c_func015.c b/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/c_func015.c +diff --git a/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/c_func015.c b/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/c_func015.c new file mode 100644 -index 0000000..75b0963 +index 0000000..cb1989f --- /dev/null -+++ b/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/c_func015.c ++++ b/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/c_func015.c @@ -0,0 +1,6 @@ +#include +#include +int_fast8_t c_func_(int_fast8_t *a) { + printf("%5hhd\n", *a); -+ return *a + 1; ++ return *a; +} -diff --git a/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/c_func016.c b/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/c_func016.c +diff --git a/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/c_func016.c b/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/c_func016.c new file mode 100644 -index 0000000..db5dce0 +index 0000000..df1b16b --- /dev/null -+++ b/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/c_func016.c ++++ b/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/c_func016.c @@ -0,0 +1,6 @@ +#include +#include +int_fast16_t c_func_(int_fast16_t *a) { + printf("%5ld\n", *a); -+ return *a + 1; ++ return *a; +} -diff --git a/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/c_func017.c b/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/c_func017.c +diff --git a/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/c_func017.c b/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/c_func017.c new file mode 100644 -index 0000000..fe66b2b +index 0000000..6070d3e --- /dev/null -+++ b/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/c_func017.c ++++ b/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/c_func017.c @@ -0,0 +1,6 @@ +#include +#include +int_fast32_t c_func_(int_fast32_t *a) { + printf("%ld\n", *a); -+ return *a + 1; ++ return *a; +} -diff --git a/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/c_func018.c b/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/c_func018.c +diff --git a/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/c_func018.c b/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/c_func018.c new file mode 100644 -index 0000000..218f4bc +index 0000000..18b6494 --- /dev/null -+++ b/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/c_func018.c ++++ b/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/c_func018.c @@ -0,0 +1,6 @@ +#include +#include +int_fast64_t c_func_(int_fast64_t *a) { + printf("%5ld\n", *a); -+ return *a + 1; ++ return *a; +} -diff --git a/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/c_func019.c b/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/c_func019.c +diff --git a/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/c_func019.c b/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/c_func019.c new file mode 100644 -index 0000000..60ef3e3 +index 0000000..b0a0b6f --- /dev/null -+++ b/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/c_func019.c ++++ b/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/c_func019.c @@ -0,0 +1,6 @@ +#include +#include +intmax_t c_func_(intmax_t *a) { + printf("%5ld\n", *a); -+ return *a + 1; ++ return *a; +} -diff --git a/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/c_func020.c b/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/c_func020.c +diff --git a/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/c_func020.c b/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/c_func020.c new file mode 100644 -index 0000000..c1422b1 +index 0000000..071f5c5 --- /dev/null -+++ b/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/c_func020.c ++++ b/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/c_func020.c @@ -0,0 +1,6 @@ +#include +#include +intptr_t c_func_(intptr_t *a) { + printf("%5ld\n", *a); -+ return *a + 1; ++ return *a; +} -diff --git a/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/c_func021.c b/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/c_func021.c +diff --git a/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/c_func021.c b/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/c_func021.c new file mode 100644 -index 0000000..d922b72 +index 0000000..2dee5f2 --- /dev/null -+++ b/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/c_func021.c ++++ b/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/c_func021.c @@ -0,0 +1,5 @@ +#include +float c_func_(float *a) { + printf("%0.20f\n", *a); -+ return *a + 0.5; ++ return *a; +} -diff --git a/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/c_func022.c b/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/c_func022.c +diff --git a/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/c_func022.c b/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/c_func022.c new file mode 100644 -index 0000000..d86716c +index 0000000..a2a9843 --- /dev/null -+++ b/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/c_func022.c ++++ b/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/c_func022.c @@ -0,0 +1,5 @@ +#include +double c_func_(double *a) { + printf("%0.20lf\n", *a); -+ return *a + 0.5; ++ return *a; +} -diff --git a/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/c_func023.c b/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/c_func023.c +diff --git a/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/c_func023.c b/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/c_func023.c new file mode 100644 -index 0000000..67b260e +index 0000000..c762a0a --- /dev/null -+++ b/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/c_func023.c ++++ b/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/c_func023.c @@ -0,0 +1,5 @@ +#include +long double c_func_(long double *a) { + printf("%0.20Lf\n", *a); -+ return *a + 0.5; ++ return *a; +} -diff --git a/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/c_func024.c b/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/c_func024.c +diff --git a/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/c_func024.c b/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/c_func024.c new file mode 100644 index 0000000..87b3e4c --- /dev/null -+++ b/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/c_func024.c ++++ b/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/c_func024.c @@ -0,0 +1,6 @@ +#include +#include @@ -10055,11 +8952,11 @@ index 0000000..87b3e4c + printf("%0.20f + %0.20fi\n", creal(*t), cimag(*t)); + return *t; +} -diff --git a/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/c_func025.c b/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/c_func025.c +diff --git a/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/c_func025.c b/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/c_func025.c new file mode 100644 index 0000000..2d7b33f --- /dev/null -+++ b/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/c_func025.c ++++ b/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/c_func025.c @@ -0,0 +1,6 @@ +#include +#include @@ -10067,11 +8964,11 @@ index 0000000..2d7b33f + printf("%0.20lf + %0.20lfi\n", creal(*t), cimag(*t)); + return *t; +} -diff --git a/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/c_func026.c b/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/c_func026.c +diff --git a/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/c_func026.c b/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/c_func026.c new file mode 100644 index 0000000..78f93c9 --- /dev/null -+++ b/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/c_func026.c ++++ b/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/c_func026.c @@ -0,0 +1,6 @@ +#include +#include @@ -10079,571 +8976,548 @@ index 0000000..78f93c9 + printf("%0.20f + %0.20fi\n", creal(*t), cimag(*t)); + return *t; +} -diff --git a/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/c_func027.c b/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/c_func027.c +diff --git a/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/c_func027.c b/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/c_func027.c new file mode 100644 index 0000000..2bf5cce --- /dev/null -+++ b/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/c_func027.c ++++ b/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/c_func027.c @@ -0,0 +1,5 @@ +#include +_Bool c_func_(_Bool *a) { + printf("%5d\n", *a); + return *a; +} -diff --git a/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/c_func028.c b/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/c_func028.c +diff --git a/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/c_func028.c b/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/c_func028.c new file mode 100644 -index 0000000..0cf496b +index 0000000..197c9b6 --- /dev/null -+++ b/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/c_func028.c ++++ b/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/c_func028.c @@ -0,0 +1,6 @@ +#include +#include +char c_func_(char *t) { -+ printf("%s\n", t); ++ printf("%c\n", *t); + return *t; +} -diff --git a/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/fortran_main001.f90 b/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/fortran_main001.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/fortran_main001.f90 b/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/fortran_main001.f90 new file mode 100644 -index 0000000..e5c3136 +index 0000000..833d15b --- /dev/null -+++ b/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/fortran_main001.f90 -@@ -0,0 +1,13 @@ -+! Test fortran call c for the return type is scalar of type int with -+! bindc ++++ b/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/fortran_main001.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the return type is value of type int +! +program main + integer :: my_x = 1 + interface -+ function c_func(b) bind(c, name = "c_func_") ++ function c_func(b) result(res) + integer :: b -+ integer :: c_func ++ integer :: res + end + end interface + print '(I5)', c_func(my_x) +end -diff --git a/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/fortran_main002.f90 b/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/fortran_main002.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/fortran_main002.f90 b/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/fortran_main002.f90 new file mode 100644 -index 0000000..2ee063d +index 0000000..f3bf45c --- /dev/null -+++ b/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/fortran_main002.f90 -@@ -0,0 +1,13 @@ -+! Test fortran call c for the return type is scalar of type short with -+! bindc ++++ b/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/fortran_main002.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the return type is value of type short +! +program main + integer(2) :: my_x = 1 + interface -+ function c_func(b) bind(c, name = "c_func_") ++ function c_func(b) result(res) + integer(2) :: b -+ integer(2) :: c_func ++ integer(2) :: res + end + end interface + print '(I5)', c_func(my_x) +end -diff --git a/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/fortran_main003.f90 b/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/fortran_main003.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/fortran_main003.f90 b/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/fortran_main003.f90 new file mode 100644 -index 0000000..188fee6 +index 0000000..be25937 --- /dev/null -+++ b/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/fortran_main003.f90 -@@ -0,0 +1,13 @@ -+! Test fortran call c for the return type is scalar of type long with -+! bindc ++++ b/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/fortran_main003.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the return type is value of type long +! +program main + integer(8) :: my_x = 1 + interface -+ function c_func(b) bind(c, name = "c_func_") ++ function c_func(b) result(res) + integer(8) :: b -+ integer(8) :: c_func ++ integer(8) :: res + end + end interface + print '(I5)', c_func(my_x) +end -diff --git a/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/fortran_main004.f90 b/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/fortran_main004.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/fortran_main004.f90 b/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/fortran_main004.f90 new file mode 100644 -index 0000000..4853b2c +index 0000000..f5a5c25 --- /dev/null -+++ b/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/fortran_main004.f90 -@@ -0,0 +1,13 @@ -+! Test fortran call c for the return type is scalar of type long long -+! with bindc ++++ b/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/fortran_main004.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the return type is value of type long long +! +program main + integer(8) :: my_x = 1 + interface -+ function c_func(b) bind(c, name = "c_func_") ++ function c_func(b) result(res) + integer(8) :: b -+ integer(8) :: c_func ++ integer(8) :: res + end + end interface + print '(I5)', c_func(my_x) +end -diff --git a/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/fortran_main005.f90 b/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/fortran_main005.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/fortran_main005.f90 b/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/fortran_main005.f90 new file mode 100644 -index 0000000..102b537 +index 0000000..ce67996 --- /dev/null -+++ b/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/fortran_main005.f90 -@@ -0,0 +1,13 @@ -+! Test fortran call c for the return type is scalar of type signed char -+! with bindc ++++ b/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/fortran_main005.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the return type is value of type signed char +! +program main + integer(1) :: my_x = 65 + interface -+ function c_func(b) bind(c, name = "c_func_") ++ function c_func(b) result(res) + integer(1) :: b -+ integer(1) :: c_func ++ integer(1) :: res + end + end interface + print '(I5)', c_func(my_x) +end -diff --git a/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/fortran_main006.f90 b/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/fortran_main006.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/fortran_main006.f90 b/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/fortran_main006.f90 new file mode 100644 -index 0000000..3baa816 +index 0000000..a334489 --- /dev/null -+++ b/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/fortran_main006.f90 -@@ -0,0 +1,13 @@ -+! Test fortran call c for the return type is scalar of type size_t with -+! bindc ++++ b/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/fortran_main006.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the return type is value of type size_t +! +program main + integer(8) :: my_x = 1 + interface -+ function c_func(b) bind(c, name = "c_func_") ++ function c_func(b) result(res) + integer(8) :: b -+ integer(8) :: c_func ++ integer(8) :: res + end + end interface + print '(I5)', c_func(my_x) +end -diff --git a/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/fortran_main007.f90 b/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/fortran_main007.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/fortran_main007.f90 b/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/fortran_main007.f90 new file mode 100644 -index 0000000..077dc37 +index 0000000..11b1e27 --- /dev/null -+++ b/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/fortran_main007.f90 -@@ -0,0 +1,13 @@ -+! Test fortran call c for the return type is scalar of type int8_t with -+! bindc ++++ b/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/fortran_main007.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the return type is value of type int8_t +! +program main + integer(1) :: my_x = 1 + interface -+ function c_func(b) bind(c, name = "c_func_") ++ function c_func(b) result(res) + integer(1) :: b -+ integer(1) :: c_func ++ integer(1) :: res + end + end interface + print '(I5)', c_func(my_x) +end -diff --git a/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/fortran_main008.f90 b/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/fortran_main008.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/fortran_main008.f90 b/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/fortran_main008.f90 new file mode 100644 -index 0000000..20b0b65 +index 0000000..6addc84 --- /dev/null -+++ b/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/fortran_main008.f90 -@@ -0,0 +1,13 @@ -+! Test fortran call c for the return type is scalar of type int16_t -+! with bindc ++++ b/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/fortran_main008.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the return type is value of type int16_t +! +program main + integer(2) :: my_x = 1 + interface -+ function c_func(b) bind(c, name = "c_func_") ++ function c_func(b) result(res) + integer(2) :: b -+ integer(2) :: c_func ++ integer(2) :: res + end + end interface + print '(I5)', c_func(my_x) +end -diff --git a/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/fortran_main009.f90 b/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/fortran_main009.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/fortran_main009.f90 b/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/fortran_main009.f90 new file mode 100644 -index 0000000..29a0690 +index 0000000..20d49b4 --- /dev/null -+++ b/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/fortran_main009.f90 -@@ -0,0 +1,13 @@ -+! Test fortran call c for the return type is scalar of type int32_t -+! with bindc ++++ b/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/fortran_main009.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the return type is value of type int32_t +! +program main + integer(4) :: my_x = 1 + interface -+ function c_func(b) bind(c, name = "c_func_") ++ function c_func(b) result(res) + integer(4) :: b -+ integer(4) :: c_func ++ integer(4) :: res + end + end interface + print '(I5)', c_func(my_x) +end -diff --git a/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/fortran_main010.f90 b/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/fortran_main010.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/fortran_main010.f90 b/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/fortran_main010.f90 new file mode 100644 -index 0000000..7a96c7d +index 0000000..363fa19 --- /dev/null -+++ b/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/fortran_main010.f90 -@@ -0,0 +1,13 @@ -+! Test fortran call c for the return type is scalar of type int64_t -+! with bindc ++++ b/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/fortran_main010.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the return type is value of type int64_t +! +program main + integer(8) :: my_x = 1 + interface -+ function c_func(b) bind(c, name = "c_func_") ++ function c_func(b) result(res) + integer(8) :: b -+ integer(8) :: c_func ++ integer(8) :: res + end + end interface + print '(I5)', c_func(my_x) +end -diff --git a/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/fortran_main011.f90 b/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/fortran_main011.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/fortran_main011.f90 b/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/fortran_main011.f90 new file mode 100644 -index 0000000..7cf5dbe +index 0000000..6e95d17 --- /dev/null -+++ b/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/fortran_main011.f90 -@@ -0,0 +1,13 @@ -+! Test fortran call c for the return type is scalar of type -+! int_least8_t with bindc ++++ b/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/fortran_main011.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the return type is value of type int_least8_t +! +program main + integer(1) :: my_x = 1 + interface -+ function c_func(b) bind(c, name = "c_func_") ++ function c_func(b) result(res) + integer(1) :: b -+ integer(1) :: c_func ++ integer(1) :: res + end + end interface + print '(I5)', c_func(my_x) +end -diff --git a/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/fortran_main012.f90 b/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/fortran_main012.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/fortran_main012.f90 b/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/fortran_main012.f90 new file mode 100644 -index 0000000..e30fa5b +index 0000000..b8b3c12 --- /dev/null -+++ b/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/fortran_main012.f90 -@@ -0,0 +1,13 @@ -+! Test fortran call c for the return type is scalar of type -+! int_least16_t with bindc ++++ b/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/fortran_main012.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the return type is value of int_least16_t +! +program main + integer(2) :: my_x = 1 + interface -+ function c_func(b) bind(c, name = "c_func_") ++ function c_func(b) result(res) + integer(2) :: b -+ integer(2) :: c_func ++ integer(2) :: res + end + end interface + print '(I5)', c_func(my_x) +end -diff --git a/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/fortran_main013.f90 b/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/fortran_main013.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/fortran_main013.f90 b/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/fortran_main013.f90 new file mode 100644 -index 0000000..0da6955 +index 0000000..1eb9429 --- /dev/null -+++ b/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/fortran_main013.f90 ++++ b/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/fortran_main013.f90 @@ -0,0 +1,13 @@ -+! Test fortran call c for the return type is scalar of type -+! int_least32_t with bindc ++! Test fortran call c for the return type is value of type ++! int_least32_t +! +program main + integer(4) :: my_x = 1 + interface -+ function c_func(b) bind(c, name = "c_func_") ++ function c_func(b) result(res) + integer(4) :: b -+ integer(4) :: c_func ++ integer(4) :: res + end + end interface + print '(I5)', c_func(my_x) +end -diff --git a/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/fortran_main014.f90 b/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/fortran_main014.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/fortran_main014.f90 b/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/fortran_main014.f90 new file mode 100644 -index 0000000..f8b072f +index 0000000..0d6fba6 --- /dev/null -+++ b/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/fortran_main014.f90 ++++ b/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/fortran_main014.f90 @@ -0,0 +1,13 @@ -+! Test fortran call c for the return type is scalar of type -+! int_least8_t with bindc ++! Test fortran call c for the return type is value of type ++! int_least64_t +! +program main + integer(8) :: my_x = 1 + interface -+ function c_func(b) bind(c, name = "c_func_") ++ function c_func(b) result(res) + integer(8) :: b -+ integer(8) :: c_func ++ integer(8) :: res + end + end interface + print '(I5)', c_func(my_x) +end -diff --git a/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/fortran_main015.f90 b/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/fortran_main015.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/fortran_main015.f90 b/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/fortran_main015.f90 new file mode 100644 -index 0000000..87036fe +index 0000000..78dd147 --- /dev/null -+++ b/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/fortran_main015.f90 -@@ -0,0 +1,13 @@ -+! Test fortran call c for the return type is scalar of type int_fast8_t -+! with bindc ++++ b/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/fortran_main015.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the return type is value of type int_fast8_t +! +program main + integer(1) :: my_x = 1 + interface -+ function c_func(b) bind(c, name = "c_func_") ++ function c_func(b) result(res) + integer(1) :: b -+ integer(1) :: c_func ++ integer(1) :: res + end + end interface + print '(I5)', c_func(my_x) +end -diff --git a/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/fortran_main016.f90 b/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/fortran_main016.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/fortran_main016.f90 b/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/fortran_main016.f90 new file mode 100644 -index 0000000..37e5808 +index 0000000..a12f03e --- /dev/null -+++ b/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/fortran_main016.f90 -@@ -0,0 +1,13 @@ -+! Test fortran call c for the return type is scalar of type -+! int_fast16_t with bindc ++++ b/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/fortran_main016.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the return type is value of type int_fast16_t +! +program main + integer(8) :: my_x = 1 + interface -+ function c_func(b) bind(c, name = "c_func_") ++ function c_func(b) result(res) + integer(8) :: b -+ integer(8) :: c_func ++ integer(8) :: res + end + end interface + print '(I5)', c_func(my_x) +end -diff --git a/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/fortran_main017.f90 b/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/fortran_main017.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/fortran_main017.f90 b/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/fortran_main017.f90 new file mode 100644 -index 0000000..74208cd +index 0000000..392a401 --- /dev/null -+++ b/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/fortran_main017.f90 -@@ -0,0 +1,13 @@ -+! Test fortran call c for the return type is scalar of type -+! int_fast32_t with bindc ++++ b/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/fortran_main017.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the return type is value of type int_fast32_t +! +program main + integer(8) :: my_x = 1 + interface -+ function c_func(b) bind(c, name = "c_func_") ++ function c_func(b) result(res) + integer(8) :: b -+ integer(8) :: c_func ++ integer(8) :: res + end + end interface + print '(I5)', c_func(my_x) +end -diff --git a/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/fortran_main018.f90 b/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/fortran_main018.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/fortran_main018.f90 b/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/fortran_main018.f90 new file mode 100644 -index 0000000..b9443d6 +index 0000000..c24ad39 --- /dev/null -+++ b/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/fortran_main018.f90 -@@ -0,0 +1,13 @@ -+! Test fortran call c for the return type is scalar of type -+! int_fast64_t with bindc ++++ b/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/fortran_main018.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the return type is value of type int_fast64_t +! +program main + integer(8) :: my_x = 1 + interface -+ function c_func(b) bind(c, name = "c_func_") ++ function c_func(b) result(res) + integer(8) :: b -+ integer(8) :: c_func ++ integer(8) :: res + end + end interface + print '(I5)', c_func(my_x) +end -diff --git a/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/fortran_main019.f90 b/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/fortran_main019.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/fortran_main019.f90 b/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/fortran_main019.f90 new file mode 100644 -index 0000000..0b99dc4 +index 0000000..db38e53 --- /dev/null -+++ b/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/fortran_main019.f90 -@@ -0,0 +1,13 @@ -+! Test fortran call c for the return type is scalar of type intmax_t -+! with bindc ++++ b/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/fortran_main019.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the return type is value of type intmax_t +! +program main + integer(8) :: my_x = 1 + interface -+ function c_func(b) bind(c, name = "c_func_") ++ function c_func(b) result(res) + integer(8) :: b -+ integer(8) :: c_func ++ integer(8) :: res + end + end interface -+ print '(I5)', c_func(my_x) ++ print *, c_func(my_x) +end -diff --git a/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/fortran_main020.f90 b/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/fortran_main020.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/fortran_main020.f90 b/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/fortran_main020.f90 new file mode 100644 -index 0000000..a9af5b9 +index 0000000..d99e3d0 --- /dev/null -+++ b/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/fortran_main020.f90 -@@ -0,0 +1,13 @@ -+! Test fortran call c for the return type is scalar of type intptr_t -+! with bindc ++++ b/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/fortran_main020.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the return type is value of type intptr_t +! +program main + integer(8) :: my_x = 1 + interface -+ function c_func(b) bind(c, name = "c_func_") ++ function c_func(b) result(res) + integer(8) :: b -+ integer(8) :: c_func ++ integer(8) :: res + end + end interface + print '(I5)', c_func(my_x) +end -diff --git a/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/fortran_main021.f90 b/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/fortran_main021.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/fortran_main021.f90 b/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/fortran_main021.f90 new file mode 100644 -index 0000000..0e946c9 +index 0000000..c61c8f1 --- /dev/null -+++ b/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/fortran_main021.f90 -@@ -0,0 +1,13 @@ -+! Test fortran call c for the return type is scalar of type float with -+! bindc ++++ b/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/fortran_main021.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the return type is value of type float +! +program main + real(4) :: my_x = 1.0 + interface -+ function c_func(b) bind(c, name = "c_func_") ++ function c_func(b) result(res) + real(4) :: b -+ real(4) :: c_func ++ real(4) :: res + end + end interface + print '(F20.10)', c_func(my_x) +end -diff --git a/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/fortran_main022.f90 b/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/fortran_main022.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/fortran_main022.f90 b/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/fortran_main022.f90 new file mode 100644 -index 0000000..72ab9f7 +index 0000000..b5f5dd9 --- /dev/null -+++ b/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/fortran_main022.f90 -@@ -0,0 +1,13 @@ -+! Test fortran call c for the return type is scalar of type double with -+! bindc ++++ b/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/fortran_main022.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the return type is value of type double +! +program main + real(8) :: my_x = 3.1415926535 + interface -+ function c_func(b) bind(c, name = "c_func_") ++ function c_func(b) result(res) + real(8) :: b -+ real(8) :: c_func ++ real(8) :: res + end + end interface + print '(F20.10)', c_func(my_x) +end -diff --git a/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/fortran_main023.f90 b/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/fortran_main023.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/fortran_main023.f90 b/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/fortran_main023.f90 new file mode 100644 -index 0000000..d216a97 +index 0000000..0dd6d35 --- /dev/null -+++ b/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/fortran_main023.f90 -@@ -0,0 +1,15 @@ -+! Test fortran call c for the return type is scalar of type long double -+! with bindc ++++ b/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/fortran_main023.f90 +@@ -0,0 +1,14 @@ ++! Test fortran call c for the return type is value of type long double +! +program main + integer, parameter :: K = selected_real_kind(16) + real(K) :: my_x = 3.1415926535 + interface -+ function c_func(b) bind(c, name = "c_func_") ++ function c_func(b) result(res) + integer, parameter :: K = selected_real_kind(16) + real(K) :: b -+ real(K) :: c_func ++ real(K) :: res + end + end interface + print '(F20.10)', c_func(my_x) +end -diff --git a/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/fortran_main024.f90 b/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/fortran_main024.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/fortran_main024.f90 b/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/fortran_main024.f90 new file mode 100644 -index 0000000..cbf38c5 +index 0000000..6af3f75 --- /dev/null -+++ b/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/fortran_main024.f90 ++++ b/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/fortran_main024.f90 @@ -0,0 +1,13 @@ -+! Test fortran call c for the return type is scalar of type float -+! _Complex with bindc ++! Test fortran call c for the return type is value of type float ++! _Complex +! +program main + complex(4) :: my_x = (3.1415926535, 1) + interface -+ function c_func(b) bind(c, name = "c_func_") ++ function c_func(b) result(res) + complex(4) :: b -+ complex(4) :: c_func ++ complex(4) :: res + end + end interface + print '(F20.10)', c_func(my_x) +end -diff --git a/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/fortran_main025.f90 b/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/fortran_main025.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/fortran_main025.f90 b/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/fortran_main025.f90 new file mode 100644 -index 0000000..50a3c27 +index 0000000..5c7a953 --- /dev/null -+++ b/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/fortran_main025.f90 ++++ b/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/fortran_main025.f90 @@ -0,0 +1,13 @@ -+! Test fortran call c for the return type is scalar of type double -+! _Complex with bindc ++! Test fortran call c for the return type is value of type double ++! _Complex +! +program main + complex(8) :: my_x = (3.1415926535, 1) + interface -+ function c_func(b) bind(c, name = "c_func_") ++ function c_func(b) result(res) + complex(8) :: b -+ complex(8) :: c_func ++ complex(8) :: res + end + end interface + print '(F20.10)', c_func(my_x) +end -diff --git a/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/fortran_main026.f90 b/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/fortran_main026.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/fortran_main026.f90 b/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/fortran_main026.f90 new file mode 100644 -index 0000000..e0ba7c3 +index 0000000..14ec793 --- /dev/null -+++ b/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/fortran_main026.f90 ++++ b/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/fortran_main026.f90 @@ -0,0 +1,15 @@ -+! Test fortran call c for the return type is scalar of type long double -+! _Complex with bindc ++! Test fortran call c for the return type is value of type long double ++! _Complex +! +program main + integer, parameter :: K = selected_real_kind(16) + complex(K) :: my_x = (3.1415926535, 1) + interface -+ function c_func(b) bind(c, name = "c_func_") ++ function c_func(b) result(res) + integer, parameter :: K = selected_real_kind(16) + complex(K) :: b -+ complex(K) :: c_func ++ complex(K) :: res + end + end interface + print '(F20.10)', c_func(my_x) +end -diff --git a/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/fortran_main027.f90 b/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/fortran_main027.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/fortran_main027.f90 b/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/fortran_main027.f90 new file mode 100644 -index 0000000..042cafc +index 0000000..203901c --- /dev/null -+++ b/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/fortran_main027.f90 -@@ -0,0 +1,13 @@ -+! Test fortran call c for the return type is scalar of type _Bool with -+! bindc ++++ b/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/fortran_main027.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the return type is value of type _Bool +! +program main + logical(1) :: my_x = .FALSE. + interface -+ function c_func(b) bind(c, name = "c_func_") ++ function c_func(b) result(res) + logical(1) :: b -+ logical(1) :: c_func ++ logical(1) :: res + end + end interface + print *, c_func(my_x) +end -diff --git a/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/fortran_main028.f90 b/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/fortran_main028.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/fortran_main028.f90 b/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/fortran_main028.f90 new file mode 100644 -index 0000000..c1bd3cd +index 0000000..537c6cb --- /dev/null -+++ b/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/fortran_main028.f90 -@@ -0,0 +1,13 @@ -+! Test fortran call c for the return type is scalar of type char with -+! bindc ++++ b/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/fortran_main028.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the return type is value of type char +! +program main + character(1) :: my_x = 'a' + interface -+ function c_func(b) bind(c, name = "c_func_") ++ function c_func(b) result(res) + character(1) :: b -+ character(1) :: c_func ++ character(1) :: res + end + end interface + print *, c_func(my_x) +end -diff --git a/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/run.sh b/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/run.sh +diff --git a/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/run.sh b/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/run.sh new file mode 100644 -index 0000000..632b582 +index 0000000..b865403 --- /dev/null -+++ b/test/interoperability_with_c/012_fortran_call_c_function_value_bindc/run.sh -@@ -0,0 +1,17 @@ ++++ b/test/interoperability_with_c_fortran_call_c/012_fortran_call_c_function_value/run.sh +@@ -0,0 +1,16 @@ +for i in {001..028} +do +echo "------- test $i ------." @@ -10660,280 +9534,280 @@ index 0000000..632b582 +./a.out +rm *.o a.out +done -+ -diff --git a/test/interoperability_with_c/013_fortran_call_c_function_value/c_func001.c b/test/interoperability_with_c/013_fortran_call_c_function_value/c_func001.c +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/c_func001.c b/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/c_func001.c new file mode 100644 -index 0000000..5eabe70 +index 0000000..92427a4 --- /dev/null -+++ b/test/interoperability_with_c/013_fortran_call_c_function_value/c_func001.c ++++ b/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/c_func001.c @@ -0,0 +1,5 @@ +#include +int c_func_(int *a) { + printf("%5d\n", *a); -+ return *a + 1; ++ return *a; +} -diff --git a/test/interoperability_with_c/013_fortran_call_c_function_value/c_func002.c b/test/interoperability_with_c/013_fortran_call_c_function_value/c_func002.c +diff --git a/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/c_func002.c b/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/c_func002.c new file mode 100644 -index 0000000..87a9609 +index 0000000..54747f2 --- /dev/null -+++ b/test/interoperability_with_c/013_fortran_call_c_function_value/c_func002.c ++++ b/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/c_func002.c @@ -0,0 +1,5 @@ +#include +short c_func_(short *a) { + printf("%5hd\n", *a); -+ return *a + 1; ++ return *a; +} -diff --git a/test/interoperability_with_c/013_fortran_call_c_function_value/c_func003.c b/test/interoperability_with_c/013_fortran_call_c_function_value/c_func003.c +diff --git a/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/c_func003.c b/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/c_func003.c new file mode 100644 -index 0000000..5ba1d95 +index 0000000..a9fde92 --- /dev/null -+++ b/test/interoperability_with_c/013_fortran_call_c_function_value/c_func003.c ++++ b/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/c_func003.c @@ -0,0 +1,5 @@ +#include +long c_func_(long *a) { + printf("%5ld\n", *a); -+ return *a + 1; ++ return *a; +} -diff --git a/test/interoperability_with_c/013_fortran_call_c_function_value/c_func004.c b/test/interoperability_with_c/013_fortran_call_c_function_value/c_func004.c +diff --git a/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/c_func004.c b/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/c_func004.c new file mode 100644 -index 0000000..f3914cb +index 0000000..2131b04 --- /dev/null -+++ b/test/interoperability_with_c/013_fortran_call_c_function_value/c_func004.c ++++ b/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/c_func004.c @@ -0,0 +1,5 @@ +#include +long long c_func_(long long *a) { + printf("%lld\n", *a); -+ return *a + 1; ++ return *a; +} -diff --git a/test/interoperability_with_c/013_fortran_call_c_function_value/c_func005.c b/test/interoperability_with_c/013_fortran_call_c_function_value/c_func005.c +diff --git a/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/c_func005.c b/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/c_func005.c new file mode 100644 -index 0000000..1ea4f3e +index 0000000..309b9d0 --- /dev/null -+++ b/test/interoperability_with_c/013_fortran_call_c_function_value/c_func005.c ++++ b/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/c_func005.c @@ -0,0 +1,5 @@ +#include +signed char c_func_(signed char *a) { + printf("%5c\n", *a); -+ return *a + 1; ++ return *a; +} -diff --git a/test/interoperability_with_c/013_fortran_call_c_function_value/c_func006.c b/test/interoperability_with_c/013_fortran_call_c_function_value/c_func006.c +diff --git a/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/c_func006.c b/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/c_func006.c new file mode 100644 -index 0000000..f5a2dcc +index 0000000..73982d0 --- /dev/null -+++ b/test/interoperability_with_c/013_fortran_call_c_function_value/c_func006.c ++++ b/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/c_func006.c @@ -0,0 +1,6 @@ +#include +#include +size_t c_func_(size_t *a) { + printf("%5ld\n", *a); -+ return *a + 1; ++ return *a; +} -diff --git a/test/interoperability_with_c/013_fortran_call_c_function_value/c_func007.c b/test/interoperability_with_c/013_fortran_call_c_function_value/c_func007.c +diff --git a/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/c_func007.c b/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/c_func007.c new file mode 100644 -index 0000000..231e071 +index 0000000..efaee56 --- /dev/null -+++ b/test/interoperability_with_c/013_fortran_call_c_function_value/c_func007.c ++++ b/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/c_func007.c @@ -0,0 +1,6 @@ +#include +#include +int8_t c_func_(int8_t *a) { + printf("%5hhd\n", *a); -+ return *a + 1; ++ return *a; +} -diff --git a/test/interoperability_with_c/013_fortran_call_c_function_value/c_func008.c b/test/interoperability_with_c/013_fortran_call_c_function_value/c_func008.c +diff --git a/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/c_func008.c b/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/c_func008.c new file mode 100644 -index 0000000..c243d9c +index 0000000..5a57718 --- /dev/null -+++ b/test/interoperability_with_c/013_fortran_call_c_function_value/c_func008.c ++++ b/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/c_func008.c @@ -0,0 +1,6 @@ +#include +#include +int16_t c_func_(int16_t *a) { + printf("%5hd\n", *a); -+ return *a + 1; ++ return *a; +} -diff --git a/test/interoperability_with_c/013_fortran_call_c_function_value/c_func009.c b/test/interoperability_with_c/013_fortran_call_c_function_value/c_func009.c +diff --git a/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/c_func009.c b/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/c_func009.c new file mode 100644 -index 0000000..ff5050c +index 0000000..e076c57 --- /dev/null -+++ b/test/interoperability_with_c/013_fortran_call_c_function_value/c_func009.c ++++ b/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/c_func009.c @@ -0,0 +1,6 @@ +#include +#include +int32_t c_func_(int32_t *a) { + printf("%5d\n", *a); -+ return *a + 1; ++ return *a; +} -diff --git a/test/interoperability_with_c/013_fortran_call_c_function_value/c_func010.c b/test/interoperability_with_c/013_fortran_call_c_function_value/c_func010.c +diff --git a/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/c_func010.c b/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/c_func010.c new file mode 100644 -index 0000000..2249b6a +index 0000000..197e12b --- /dev/null -+++ b/test/interoperability_with_c/013_fortran_call_c_function_value/c_func010.c ++++ b/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/c_func010.c @@ -0,0 +1,6 @@ +#include +#include +int64_t c_func_(int64_t *a) { + printf("%5ld\n", *a); -+ return *a + 1; ++ return *a; +} -diff --git a/test/interoperability_with_c/013_fortran_call_c_function_value/c_func011.c b/test/interoperability_with_c/013_fortran_call_c_function_value/c_func011.c +diff --git a/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/c_func011.c b/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/c_func011.c new file mode 100644 -index 0000000..0eb9353 +index 0000000..cc67a34 --- /dev/null -+++ b/test/interoperability_with_c/013_fortran_call_c_function_value/c_func011.c ++++ b/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/c_func011.c @@ -0,0 +1,6 @@ +#include +#include +int_least8_t c_func_(int_least8_t *a) { + printf("%5hhd\n", *a); -+ return *a + 1; ++ return *a; +} -diff --git a/test/interoperability_with_c/013_fortran_call_c_function_value/c_func012.c b/test/interoperability_with_c/013_fortran_call_c_function_value/c_func012.c +diff --git a/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/c_func012.c b/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/c_func012.c new file mode 100644 -index 0000000..3a591b2 +index 0000000..484de62 --- /dev/null -+++ b/test/interoperability_with_c/013_fortran_call_c_function_value/c_func012.c ++++ b/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/c_func012.c @@ -0,0 +1,6 @@ +#include +#include +int_least16_t c_func_(int_least16_t *a) { + printf("%5hd\n", *a); -+ return *a + 1; ++ return *a; +} -diff --git a/test/interoperability_with_c/013_fortran_call_c_function_value/c_func013.c b/test/interoperability_with_c/013_fortran_call_c_function_value/c_func013.c +diff --git a/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/c_func013.c b/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/c_func013.c new file mode 100644 -index 0000000..cfbacdb +index 0000000..7a1973e --- /dev/null -+++ b/test/interoperability_with_c/013_fortran_call_c_function_value/c_func013.c ++++ b/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/c_func013.c @@ -0,0 +1,6 @@ +#include +#include +int_least32_t c_func_(int_least32_t *a) { + printf("%d\n", *a); -+ return *a + 1; ++ return *a; +} -diff --git a/test/interoperability_with_c/013_fortran_call_c_function_value/c_func014.c b/test/interoperability_with_c/013_fortran_call_c_function_value/c_func014.c +diff --git a/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/c_func014.c b/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/c_func014.c new file mode 100644 -index 0000000..c922aa7 +index 0000000..d535c60 --- /dev/null -+++ b/test/interoperability_with_c/013_fortran_call_c_function_value/c_func014.c ++++ b/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/c_func014.c @@ -0,0 +1,6 @@ +#include +#include +int_least64_t c_func_(int_least64_t *a) { + printf("%5ld\n", *a); -+ return *a + 1; ++ return *a; +} -diff --git a/test/interoperability_with_c/013_fortran_call_c_function_value/c_func015.c b/test/interoperability_with_c/013_fortran_call_c_function_value/c_func015.c +diff --git a/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/c_func015.c b/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/c_func015.c new file mode 100644 -index 0000000..75b0963 +index 0000000..cb1989f --- /dev/null -+++ b/test/interoperability_with_c/013_fortran_call_c_function_value/c_func015.c ++++ b/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/c_func015.c @@ -0,0 +1,6 @@ +#include +#include +int_fast8_t c_func_(int_fast8_t *a) { + printf("%5hhd\n", *a); -+ return *a + 1; ++ return *a; +} -diff --git a/test/interoperability_with_c/013_fortran_call_c_function_value/c_func016.c b/test/interoperability_with_c/013_fortran_call_c_function_value/c_func016.c +diff --git a/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/c_func016.c b/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/c_func016.c new file mode 100644 -index 0000000..db5dce0 +index 0000000..df1b16b --- /dev/null -+++ b/test/interoperability_with_c/013_fortran_call_c_function_value/c_func016.c ++++ b/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/c_func016.c @@ -0,0 +1,6 @@ +#include +#include +int_fast16_t c_func_(int_fast16_t *a) { + printf("%5ld\n", *a); -+ return *a + 1; ++ return *a; +} -diff --git a/test/interoperability_with_c/013_fortran_call_c_function_value/c_func017.c b/test/interoperability_with_c/013_fortran_call_c_function_value/c_func017.c +diff --git a/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/c_func017.c b/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/c_func017.c new file mode 100644 -index 0000000..fe66b2b +index 0000000..6070d3e --- /dev/null -+++ b/test/interoperability_with_c/013_fortran_call_c_function_value/c_func017.c ++++ b/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/c_func017.c @@ -0,0 +1,6 @@ +#include +#include +int_fast32_t c_func_(int_fast32_t *a) { + printf("%ld\n", *a); -+ return *a + 1; ++ return *a; +} -diff --git a/test/interoperability_with_c/013_fortran_call_c_function_value/c_func018.c b/test/interoperability_with_c/013_fortran_call_c_function_value/c_func018.c +diff --git a/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/c_func018.c b/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/c_func018.c new file mode 100644 -index 0000000..218f4bc +index 0000000..18b6494 --- /dev/null -+++ b/test/interoperability_with_c/013_fortran_call_c_function_value/c_func018.c ++++ b/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/c_func018.c @@ -0,0 +1,6 @@ +#include +#include +int_fast64_t c_func_(int_fast64_t *a) { + printf("%5ld\n", *a); -+ return *a + 1; ++ return *a; +} -diff --git a/test/interoperability_with_c/013_fortran_call_c_function_value/c_func019.c b/test/interoperability_with_c/013_fortran_call_c_function_value/c_func019.c +diff --git a/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/c_func019.c b/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/c_func019.c new file mode 100644 -index 0000000..60ef3e3 +index 0000000..b0a0b6f --- /dev/null -+++ b/test/interoperability_with_c/013_fortran_call_c_function_value/c_func019.c ++++ b/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/c_func019.c @@ -0,0 +1,6 @@ +#include +#include +intmax_t c_func_(intmax_t *a) { + printf("%5ld\n", *a); -+ return *a + 1; ++ return *a; +} -diff --git a/test/interoperability_with_c/013_fortran_call_c_function_value/c_func020.c b/test/interoperability_with_c/013_fortran_call_c_function_value/c_func020.c +diff --git a/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/c_func020.c b/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/c_func020.c new file mode 100644 -index 0000000..c1422b1 +index 0000000..071f5c5 --- /dev/null -+++ b/test/interoperability_with_c/013_fortran_call_c_function_value/c_func020.c ++++ b/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/c_func020.c @@ -0,0 +1,6 @@ +#include +#include +intptr_t c_func_(intptr_t *a) { + printf("%5ld\n", *a); -+ return *a + 1; ++ return *a; +} -diff --git a/test/interoperability_with_c/013_fortran_call_c_function_value/c_func021.c b/test/interoperability_with_c/013_fortran_call_c_function_value/c_func021.c +diff --git a/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/c_func021.c b/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/c_func021.c new file mode 100644 -index 0000000..d922b72 +index 0000000..2dee5f2 --- /dev/null -+++ b/test/interoperability_with_c/013_fortran_call_c_function_value/c_func021.c ++++ b/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/c_func021.c @@ -0,0 +1,5 @@ +#include +float c_func_(float *a) { + printf("%0.20f\n", *a); -+ return *a + 0.5; ++ return *a; +} -diff --git a/test/interoperability_with_c/013_fortran_call_c_function_value/c_func022.c b/test/interoperability_with_c/013_fortran_call_c_function_value/c_func022.c +diff --git a/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/c_func022.c b/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/c_func022.c new file mode 100644 -index 0000000..d86716c +index 0000000..a2a9843 --- /dev/null -+++ b/test/interoperability_with_c/013_fortran_call_c_function_value/c_func022.c ++++ b/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/c_func022.c @@ -0,0 +1,5 @@ +#include +double c_func_(double *a) { + printf("%0.20lf\n", *a); -+ return *a + 0.5; ++ return *a; +} -diff --git a/test/interoperability_with_c/013_fortran_call_c_function_value/c_func023.c b/test/interoperability_with_c/013_fortran_call_c_function_value/c_func023.c +diff --git a/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/c_func023.c b/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/c_func023.c new file mode 100644 -index 0000000..67b260e +index 0000000..c762a0a --- /dev/null -+++ b/test/interoperability_with_c/013_fortran_call_c_function_value/c_func023.c ++++ b/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/c_func023.c @@ -0,0 +1,5 @@ +#include +long double c_func_(long double *a) { + printf("%0.20Lf\n", *a); -+ return *a + 0.5; ++ return *a; +} -diff --git a/test/interoperability_with_c/013_fortran_call_c_function_value/c_func024.c b/test/interoperability_with_c/013_fortran_call_c_function_value/c_func024.c +diff --git a/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/c_func024.c b/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/c_func024.c new file mode 100644 index 0000000..87b3e4c --- /dev/null -+++ b/test/interoperability_with_c/013_fortran_call_c_function_value/c_func024.c ++++ b/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/c_func024.c @@ -0,0 +1,6 @@ +#include +#include @@ -10941,11 +9815,11 @@ index 0000000..87b3e4c + printf("%0.20f + %0.20fi\n", creal(*t), cimag(*t)); + return *t; +} -diff --git a/test/interoperability_with_c/013_fortran_call_c_function_value/c_func025.c b/test/interoperability_with_c/013_fortran_call_c_function_value/c_func025.c +diff --git a/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/c_func025.c b/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/c_func025.c new file mode 100644 index 0000000..2d7b33f --- /dev/null -+++ b/test/interoperability_with_c/013_fortran_call_c_function_value/c_func025.c ++++ b/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/c_func025.c @@ -0,0 +1,6 @@ +#include +#include @@ -10953,11 +9827,11 @@ index 0000000..2d7b33f + printf("%0.20lf + %0.20lfi\n", creal(*t), cimag(*t)); + return *t; +} -diff --git a/test/interoperability_with_c/013_fortran_call_c_function_value/c_func026.c b/test/interoperability_with_c/013_fortran_call_c_function_value/c_func026.c +diff --git a/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/c_func026.c b/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/c_func026.c new file mode 100644 index 0000000..78f93c9 --- /dev/null -+++ b/test/interoperability_with_c/013_fortran_call_c_function_value/c_func026.c ++++ b/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/c_func026.c @@ -0,0 +1,6 @@ +#include +#include @@ -10965,553 +9839,570 @@ index 0000000..78f93c9 + printf("%0.20f + %0.20fi\n", creal(*t), cimag(*t)); + return *t; +} -diff --git a/test/interoperability_with_c/013_fortran_call_c_function_value/c_func027.c b/test/interoperability_with_c/013_fortran_call_c_function_value/c_func027.c +diff --git a/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/c_func027.c b/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/c_func027.c new file mode 100644 index 0000000..2bf5cce --- /dev/null -+++ b/test/interoperability_with_c/013_fortran_call_c_function_value/c_func027.c ++++ b/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/c_func027.c @@ -0,0 +1,5 @@ +#include +_Bool c_func_(_Bool *a) { + printf("%5d\n", *a); + return *a; +} -diff --git a/test/interoperability_with_c/013_fortran_call_c_function_value/c_func028.c b/test/interoperability_with_c/013_fortran_call_c_function_value/c_func028.c +diff --git a/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/c_func028.c b/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/c_func028.c new file mode 100644 -index 0000000..0cf496b +index 0000000..197c9b6 --- /dev/null -+++ b/test/interoperability_with_c/013_fortran_call_c_function_value/c_func028.c ++++ b/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/c_func028.c @@ -0,0 +1,6 @@ +#include +#include +char c_func_(char *t) { -+ printf("%s\n", t); ++ printf("%c\n", *t); + return *t; +} -diff --git a/test/interoperability_with_c/013_fortran_call_c_function_value/fortran_main001.f90 b/test/interoperability_with_c/013_fortran_call_c_function_value/fortran_main001.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/fortran_main001.f90 b/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/fortran_main001.f90 new file mode 100644 -index 0000000..229ca82 +index 0000000..f7e19f7 --- /dev/null -+++ b/test/interoperability_with_c/013_fortran_call_c_function_value/fortran_main001.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the return type is scalar of type int ++++ b/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/fortran_main001.f90 +@@ -0,0 +1,13 @@ ++! Test fortran call c for the return type is value of type int with ++! bindc +! +program main + integer :: my_x = 1 + interface -+ function c_func(b) ++ function c_func(b) result(res) bind(c, name = "c_func_") + integer :: b -+ integer :: c_func ++ integer :: res + end + end interface + print '(I5)', c_func(my_x) +end -diff --git a/test/interoperability_with_c/013_fortran_call_c_function_value/fortran_main002.f90 b/test/interoperability_with_c/013_fortran_call_c_function_value/fortran_main002.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/fortran_main002.f90 b/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/fortran_main002.f90 new file mode 100644 -index 0000000..d31e0f8 +index 0000000..b7b2ab4 --- /dev/null -+++ b/test/interoperability_with_c/013_fortran_call_c_function_value/fortran_main002.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the return type is scalar of type short ++++ b/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/fortran_main002.f90 +@@ -0,0 +1,13 @@ ++! Test fortran call c for the return type is value of type short with ++! bindc +! +program main + integer(2) :: my_x = 1 + interface -+ function c_func(b) ++ function c_func(b) result(res) bind(c, name = "c_func_") + integer(2) :: b -+ integer(2) :: c_func ++ integer(2) :: res + end + end interface + print '(I5)', c_func(my_x) +end -diff --git a/test/interoperability_with_c/013_fortran_call_c_function_value/fortran_main003.f90 b/test/interoperability_with_c/013_fortran_call_c_function_value/fortran_main003.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/fortran_main003.f90 b/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/fortran_main003.f90 new file mode 100644 -index 0000000..638ea88 +index 0000000..7fea817 --- /dev/null -+++ b/test/interoperability_with_c/013_fortran_call_c_function_value/fortran_main003.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the return type is scalar of type long ++++ b/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/fortran_main003.f90 +@@ -0,0 +1,13 @@ ++! Test fortran call c for the return type is value of type long with ++! bindc +! +program main + integer(8) :: my_x = 1 + interface -+ function c_func(b) ++ function c_func(b) result(res) bind(c, name = "c_func_") + integer(8) :: b -+ integer(8) :: c_func ++ integer(8) :: res + end + end interface + print '(I5)', c_func(my_x) +end -diff --git a/test/interoperability_with_c/013_fortran_call_c_function_value/fortran_main004.f90 b/test/interoperability_with_c/013_fortran_call_c_function_value/fortran_main004.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/fortran_main004.f90 b/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/fortran_main004.f90 new file mode 100644 -index 0000000..c905670 +index 0000000..c62ea01 --- /dev/null -+++ b/test/interoperability_with_c/013_fortran_call_c_function_value/fortran_main004.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the return type is scalar of type long long ++++ b/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/fortran_main004.f90 +@@ -0,0 +1,13 @@ ++! Test fortran call c for the return type is value of type long long ++! with bindc +! +program main + integer(8) :: my_x = 1 + interface -+ function c_func(b) ++ function c_func(b) result(res) bind(c, name = "c_func_") + integer(8) :: b -+ integer(8) :: c_func ++ integer(8) :: res + end + end interface + print '(I5)', c_func(my_x) +end -diff --git a/test/interoperability_with_c/013_fortran_call_c_function_value/fortran_main005.f90 b/test/interoperability_with_c/013_fortran_call_c_function_value/fortran_main005.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/fortran_main005.f90 b/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/fortran_main005.f90 new file mode 100644 -index 0000000..be8aaf8 +index 0000000..6c3185c --- /dev/null -+++ b/test/interoperability_with_c/013_fortran_call_c_function_value/fortran_main005.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the return type is scalar of type signed char ++++ b/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/fortran_main005.f90 +@@ -0,0 +1,13 @@ ++! Test fortran call c for the return type is value of type signed char ++! with bindc +! +program main + integer(1) :: my_x = 65 + interface -+ function c_func(b) ++ function c_func(b) result(res) bind(c, name = "c_func_") + integer(1) :: b -+ integer(1) :: c_func ++ integer(1) :: res + end + end interface + print '(I5)', c_func(my_x) +end -diff --git a/test/interoperability_with_c/013_fortran_call_c_function_value/fortran_main006.f90 b/test/interoperability_with_c/013_fortran_call_c_function_value/fortran_main006.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/fortran_main006.f90 b/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/fortran_main006.f90 new file mode 100644 -index 0000000..b9afa1a +index 0000000..8be1fe5 --- /dev/null -+++ b/test/interoperability_with_c/013_fortran_call_c_function_value/fortran_main006.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the return type is scalar of type size_t ++++ b/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/fortran_main006.f90 +@@ -0,0 +1,13 @@ ++! Test fortran call c for the return type is value of type size_t with ++! bindc +! +program main + integer(8) :: my_x = 1 + interface -+ function c_func(b) ++ function c_func(b) result(res) bind(c, name = "c_func_") + integer(8) :: b -+ integer(8) :: c_func ++ integer(8) :: res + end + end interface + print '(I5)', c_func(my_x) +end -diff --git a/test/interoperability_with_c/013_fortran_call_c_function_value/fortran_main007.f90 b/test/interoperability_with_c/013_fortran_call_c_function_value/fortran_main007.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/fortran_main007.f90 b/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/fortran_main007.f90 new file mode 100644 -index 0000000..b8548c3 +index 0000000..5d909b1 --- /dev/null -+++ b/test/interoperability_with_c/013_fortran_call_c_function_value/fortran_main007.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the return type is scalar of type int8_t ++++ b/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/fortran_main007.f90 +@@ -0,0 +1,13 @@ ++! Test fortran call c for the return type is value of type int8_t with ++! bindc +! +program main + integer(1) :: my_x = 1 + interface -+ function c_func(b) ++ function c_func(b) result(res) bind(c, name = "c_func_") + integer(1) :: b -+ integer(1) :: c_func ++ integer(1) :: res + end + end interface + print '(I5)', c_func(my_x) +end -diff --git a/test/interoperability_with_c/013_fortran_call_c_function_value/fortran_main008.f90 b/test/interoperability_with_c/013_fortran_call_c_function_value/fortran_main008.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/fortran_main008.f90 b/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/fortran_main008.f90 new file mode 100644 -index 0000000..89f3809 +index 0000000..fbbfc82 --- /dev/null -+++ b/test/interoperability_with_c/013_fortran_call_c_function_value/fortran_main008.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the return type is scalar of type int16_t ++++ b/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/fortran_main008.f90 +@@ -0,0 +1,13 @@ ++! Test fortran call c for the return type is value of type int16_t with ++! bindc +! +program main + integer(2) :: my_x = 1 + interface -+ function c_func(b) ++ function c_func(b) result(res) bind(c, name = "c_func_") + integer(2) :: b -+ integer(2) :: c_func ++ integer(2) :: res + end + end interface + print '(I5)', c_func(my_x) +end -diff --git a/test/interoperability_with_c/013_fortran_call_c_function_value/fortran_main009.f90 b/test/interoperability_with_c/013_fortran_call_c_function_value/fortran_main009.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/fortran_main009.f90 b/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/fortran_main009.f90 new file mode 100644 -index 0000000..8162ab0 +index 0000000..9cd04c3 --- /dev/null -+++ b/test/interoperability_with_c/013_fortran_call_c_function_value/fortran_main009.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the return type is scalar of type int32_t ++++ b/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/fortran_main009.f90 +@@ -0,0 +1,13 @@ ++! Test fortran call c for the return type is value of type int32_t with ++! bindc +! +program main + integer(4) :: my_x = 1 + interface -+ function c_func(b) ++ function c_func(b) result(res) bind(c, name = "c_func_") + integer(4) :: b -+ integer(4) :: c_func ++ integer(4) :: res + end + end interface + print '(I5)', c_func(my_x) +end -diff --git a/test/interoperability_with_c/013_fortran_call_c_function_value/fortran_main010.f90 b/test/interoperability_with_c/013_fortran_call_c_function_value/fortran_main010.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/fortran_main010.f90 b/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/fortran_main010.f90 new file mode 100644 -index 0000000..83616f8 +index 0000000..620d195 --- /dev/null -+++ b/test/interoperability_with_c/013_fortran_call_c_function_value/fortran_main010.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the return type is scalar of type int64_t ++++ b/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/fortran_main010.f90 +@@ -0,0 +1,13 @@ ++! Test fortran call c for the return type is value of type int64_t with ++! bindc +! +program main + integer(8) :: my_x = 1 + interface -+ function c_func(b) ++ function c_func(b) result(res) bind(c, name = "c_func_") + integer(8) :: b -+ integer(8) :: c_func ++ integer(8) :: res + end + end interface + print '(I5)', c_func(my_x) +end -diff --git a/test/interoperability_with_c/013_fortran_call_c_function_value/fortran_main011.f90 b/test/interoperability_with_c/013_fortran_call_c_function_value/fortran_main011.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/fortran_main011.f90 b/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/fortran_main011.f90 new file mode 100644 -index 0000000..6fb5a66 +index 0000000..c933b43 --- /dev/null -+++ b/test/interoperability_with_c/013_fortran_call_c_function_value/fortran_main011.f90 ++++ b/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/fortran_main011.f90 @@ -0,0 +1,13 @@ -+! Test fortran call c for the return type is scalar of type -+! int_least8_t ++! Test fortran call c for the return type is value of type int_least8_t ++! with bindc +! +program main + integer(1) :: my_x = 1 + interface -+ function c_func(b) ++ function c_func(b) result(res) bind(c, name = "c_func_") + integer(1) :: b -+ integer(1) :: c_func ++ integer(1) :: res + end + end interface + print '(I5)', c_func(my_x) +end -diff --git a/test/interoperability_with_c/013_fortran_call_c_function_value/fortran_main012.f90 b/test/interoperability_with_c/013_fortran_call_c_function_value/fortran_main012.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/fortran_main012.f90 b/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/fortran_main012.f90 new file mode 100644 -index 0000000..ef04a7a +index 0000000..35da307 --- /dev/null -+++ b/test/interoperability_with_c/013_fortran_call_c_function_value/fortran_main012.f90 ++++ b/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/fortran_main012.f90 @@ -0,0 +1,13 @@ -+! Test fortran call c for the return type is scalar of type -+! int_least16_t ++! Test fortran call c for the return type is value of type ++! int_least16_t with bindc +! +program main + integer(2) :: my_x = 1 + interface -+ function c_func(b) ++ function c_func(b) result(res) bind(c, name = "c_func_") + integer(2) :: b -+ integer(2) :: c_func ++ integer(2) :: res + end + end interface + print '(I5)', c_func(my_x) +end -diff --git a/test/interoperability_with_c/013_fortran_call_c_function_value/fortran_main013.f90 b/test/interoperability_with_c/013_fortran_call_c_function_value/fortran_main013.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/fortran_main013.f90 b/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/fortran_main013.f90 new file mode 100644 -index 0000000..f4f8893 +index 0000000..38eb044 --- /dev/null -+++ b/test/interoperability_with_c/013_fortran_call_c_function_value/fortran_main013.f90 ++++ b/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/fortran_main013.f90 @@ -0,0 +1,13 @@ -+! Test fortran call c for the return type is scalar of type -+! int_least32_t ++! Test fortran call c for the return type is value of type ++! int_least32_t with bindc +! +program main + integer(4) :: my_x = 1 + interface -+ function c_func(b) ++ function c_func(b) result(res) bind(c, name = "c_func_") + integer(4) :: b -+ integer(4) :: c_func ++ integer(4) :: res + end + end interface + print '(I5)', c_func(my_x) +end -diff --git a/test/interoperability_with_c/013_fortran_call_c_function_value/fortran_main014.f90 b/test/interoperability_with_c/013_fortran_call_c_function_value/fortran_main014.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/fortran_main014.f90 b/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/fortran_main014.f90 new file mode 100644 -index 0000000..faa3acf +index 0000000..e7a3281 --- /dev/null -+++ b/test/interoperability_with_c/013_fortran_call_c_function_value/fortran_main014.f90 ++++ b/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/fortran_main014.f90 @@ -0,0 +1,13 @@ -+! Test fortran call c for the return type is scalar of type -+! int_least8_t ++! Test fortran call c for the return type is value of type ++! int_least64_t with bindc +! +program main + integer(8) :: my_x = 1 + interface -+ function c_func(b) ++ function c_func(b) result(res) bind(c, name = "c_func_") + integer(8) :: b -+ integer(8) :: c_func ++ integer(8) :: res + end + end interface + print '(I5)', c_func(my_x) +end -diff --git a/test/interoperability_with_c/013_fortran_call_c_function_value/fortran_main015.f90 b/test/interoperability_with_c/013_fortran_call_c_function_value/fortran_main015.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/fortran_main015.f90 b/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/fortran_main015.f90 new file mode 100644 -index 0000000..03f3b8f +index 0000000..6f41989 --- /dev/null -+++ b/test/interoperability_with_c/013_fortran_call_c_function_value/fortran_main015.f90 ++++ b/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/fortran_main015.f90 @@ -0,0 +1,12 @@ -+! Test fortran call c for the return type is scalar of type int_fast8_t -+! ++! Test fortran call c for the return type is value of type int_fast8_t ++! with bindc +program main + integer(1) :: my_x = 1 + interface -+ function c_func(b) ++ function c_func(b) result(res) bind(c, name = "c_func_") + integer(1) :: b -+ integer(1) :: c_func ++ integer(1) :: res + end + end interface + print '(I5)', c_func(my_x) +end -diff --git a/test/interoperability_with_c/013_fortran_call_c_function_value/fortran_main016.f90 b/test/interoperability_with_c/013_fortran_call_c_function_value/fortran_main016.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/fortran_main016.f90 b/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/fortran_main016.f90 new file mode 100644 -index 0000000..4c80fe3 +index 0000000..8776c5f --- /dev/null -+++ b/test/interoperability_with_c/013_fortran_call_c_function_value/fortran_main016.f90 ++++ b/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/fortran_main016.f90 @@ -0,0 +1,13 @@ -+! Test fortran call c for the return type is scalar of type -+! int_fast16_t ++! Test fortran call c for the return type is value of type int_fast16_t ++! with bindc +! +program main + integer(8) :: my_x = 1 + interface -+ function c_func(b) ++ function c_func(b) result(res) bind(c, name = "c_func_") + integer(8) :: b -+ integer(8) :: c_func ++ integer(8) :: res + end + end interface + print '(I5)', c_func(my_x) +end -diff --git a/test/interoperability_with_c/013_fortran_call_c_function_value/fortran_main017.f90 b/test/interoperability_with_c/013_fortran_call_c_function_value/fortran_main017.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/fortran_main017.f90 b/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/fortran_main017.f90 new file mode 100644 -index 0000000..95caef9 +index 0000000..1e153ae --- /dev/null -+++ b/test/interoperability_with_c/013_fortran_call_c_function_value/fortran_main017.f90 ++++ b/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/fortran_main017.f90 @@ -0,0 +1,13 @@ -+! Test fortran call c for the return type is scalar of type -+! int_fast32_t ++! Test fortran call c for the return type is value of type int_fast32_t ++! with bindc +! +program main + integer(8) :: my_x = 1 + interface -+ function c_func(b) ++ function c_func(b) result(res) bind(c, name = "c_func_") + integer(8) :: b -+ integer(8) :: c_func ++ integer(8) :: res + end + end interface + print '(I5)', c_func(my_x) +end -diff --git a/test/interoperability_with_c/013_fortran_call_c_function_value/fortran_main018.f90 b/test/interoperability_with_c/013_fortran_call_c_function_value/fortran_main018.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/fortran_main018.f90 b/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/fortran_main018.f90 new file mode 100644 -index 0000000..acd5b25 +index 0000000..210678d --- /dev/null -+++ b/test/interoperability_with_c/013_fortran_call_c_function_value/fortran_main018.f90 ++++ b/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/fortran_main018.f90 @@ -0,0 +1,13 @@ -+! Test fortran call c for the return type is scalar of type -+! int_fast64_t ++! Test fortran call c for the return type is value of type int_fast64_t ++! with bindc +! +program main + integer(8) :: my_x = 1 + interface -+ function c_func(b) ++ function c_func(b) result(res) bind(c, name = "c_func_") + integer(8) :: b -+ integer(8) :: c_func ++ integer(8) :: res + end + end interface + print '(I5)', c_func(my_x) +end -diff --git a/test/interoperability_with_c/013_fortran_call_c_function_value/fortran_main019.f90 b/test/interoperability_with_c/013_fortran_call_c_function_value/fortran_main019.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/fortran_main019.f90 b/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/fortran_main019.f90 new file mode 100644 -index 0000000..e4ee87f +index 0000000..46677d3 --- /dev/null -+++ b/test/interoperability_with_c/013_fortran_call_c_function_value/fortran_main019.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the return type is scalar of type intmax_t ++++ b/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/fortran_main019.f90 +@@ -0,0 +1,13 @@ ++! Test fortran call c for the return type is value of type intmax_t ++! with bindc +! +program main + integer(8) :: my_x = 1 + interface -+ function c_func(b) ++ function c_func(b) result(res) bind(c, name = "c_func_") + integer(8) :: b -+ integer(8) :: c_func ++ integer(8) :: res + end + end interface + print *, c_func(my_x) +end -diff --git a/test/interoperability_with_c/013_fortran_call_c_function_value/fortran_main020.f90 b/test/interoperability_with_c/013_fortran_call_c_function_value/fortran_main020.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/fortran_main020.f90 b/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/fortran_main020.f90 new file mode 100644 -index 0000000..b93dec1 +index 0000000..e5044e4 --- /dev/null -+++ b/test/interoperability_with_c/013_fortran_call_c_function_value/fortran_main020.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the return type is scalar of type intptr_t ++++ b/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/fortran_main020.f90 +@@ -0,0 +1,13 @@ ++! Test fortran call c for the return type is value of type intptr_t ++! with bindc +! +program main + integer(8) :: my_x = 1 + interface -+ function c_func(b) ++ function c_func(b) result(res) bind(c, name = "c_func_") + integer(8) :: b -+ integer(8) :: c_func ++ integer(8) :: res + end + end interface + print '(I5)', c_func(my_x) +end -diff --git a/test/interoperability_with_c/013_fortran_call_c_function_value/fortran_main021.f90 b/test/interoperability_with_c/013_fortran_call_c_function_value/fortran_main021.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/fortran_main021.f90 b/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/fortran_main021.f90 new file mode 100644 -index 0000000..689a134 +index 0000000..0e2a2c5 --- /dev/null -+++ b/test/interoperability_with_c/013_fortran_call_c_function_value/fortran_main021.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the return type is scalar of type float ++++ b/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/fortran_main021.f90 +@@ -0,0 +1,13 @@ ++! Test fortran call c for the return type is value of type float with ++! bindc +! +program main + real(4) :: my_x = 1.0 + interface -+ function c_func(b) ++ function c_func(b) result(res) bind(c, name = "c_func_") + real(4) :: b -+ real(4) :: c_func ++ real(4) :: res + end + end interface + print '(F20.10)', c_func(my_x) +end -diff --git a/test/interoperability_with_c/013_fortran_call_c_function_value/fortran_main022.f90 b/test/interoperability_with_c/013_fortran_call_c_function_value/fortran_main022.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/fortran_main022.f90 b/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/fortran_main022.f90 new file mode 100644 -index 0000000..05582ae +index 0000000..5ba9920 --- /dev/null -+++ b/test/interoperability_with_c/013_fortran_call_c_function_value/fortran_main022.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the return type is scalar of type double ++++ b/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/fortran_main022.f90 +@@ -0,0 +1,13 @@ ++! Test fortran call c for the return type is value of type double with ++! bindc +! +program main + real(8) :: my_x = 3.1415926535 + interface -+ function c_func(b) ++ function c_func(b) result(res) bind(c, name = "c_func_") + real(8) :: b -+ real(8) :: c_func ++ real(8) :: res + end + end interface + print '(F20.10)', c_func(my_x) +end -diff --git a/test/interoperability_with_c/013_fortran_call_c_function_value/fortran_main023.f90 b/test/interoperability_with_c/013_fortran_call_c_function_value/fortran_main023.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/fortran_main023.f90 b/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/fortran_main023.f90 new file mode 100644 -index 0000000..388a97a +index 0000000..cd87fb6 --- /dev/null -+++ b/test/interoperability_with_c/013_fortran_call_c_function_value/fortran_main023.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the return type is scalar of type long double ++++ b/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/fortran_main023.f90 +@@ -0,0 +1,15 @@ ++! Test fortran call c for the return type is value of type long double ++! with bindc +! +program main + integer, parameter :: K = selected_real_kind(16) + real(K) :: my_x = 3.1415926535 + interface -+ function c_func(b) ++ function c_func(b) result(res) bind(c, name = "c_func_") + integer, parameter :: K = selected_real_kind(16) + real(K) :: b -+ real(K) :: c_func ++ real(K) :: res + end + end interface + print '(F20.10)', c_func(my_x) +end -diff --git a/test/interoperability_with_c/013_fortran_call_c_function_value/fortran_main024.f90 b/test/interoperability_with_c/013_fortran_call_c_function_value/fortran_main024.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/fortran_main024.f90 b/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/fortran_main024.f90 new file mode 100644 -index 0000000..d107e95 +index 0000000..890bd95 --- /dev/null -+++ b/test/interoperability_with_c/013_fortran_call_c_function_value/fortran_main024.f90 ++++ b/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/fortran_main024.f90 @@ -0,0 +1,13 @@ -+! Test fortran call c for the return type is scalar of type -+! float _Complex ++! Test fortran call c for the return type is value of type float ++! _Complex with bindc +! +program main + complex(4) :: my_x = (3.1415926535, 1) + interface -+ function c_func(b) ++ function c_func(b) result(res) bind(c, name = "c_func_") + complex(4) :: b -+ complex(4) :: c_func ++ complex(4) :: res + end + end interface + print '(F20.10)', c_func(my_x) +end -diff --git a/test/interoperability_with_c/013_fortran_call_c_function_value/fortran_main025.f90 b/test/interoperability_with_c/013_fortran_call_c_function_value/fortran_main025.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/fortran_main025.f90 b/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/fortran_main025.f90 new file mode 100644 -index 0000000..d08ea5f +index 0000000..39ba319 --- /dev/null -+++ b/test/interoperability_with_c/013_fortran_call_c_function_value/fortran_main025.f90 ++++ b/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/fortran_main025.f90 @@ -0,0 +1,13 @@ -+! Test fortran call c for the return type is scalar of type -+! double _Complex ++! Test fortran call c for the return type is value of type double ++! _Complex with bindc +! +program main + complex(8) :: my_x = (3.1415926535, 1) + interface -+ function c_func(b) ++ function c_func(b) result(res) bind(c, name = "c_func_") + complex(8) :: b -+ complex(8) :: c_func ++ complex(8) :: res + end + end interface + print '(F20.10)', c_func(my_x) +end -diff --git a/test/interoperability_with_c/013_fortran_call_c_function_value/fortran_main026.f90 b/test/interoperability_with_c/013_fortran_call_c_function_value/fortran_main026.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/fortran_main026.f90 b/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/fortran_main026.f90 new file mode 100644 -index 0000000..e0134df +index 0000000..5e7b4c5 --- /dev/null -+++ b/test/interoperability_with_c/013_fortran_call_c_function_value/fortran_main026.f90 ++++ b/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/fortran_main026.f90 @@ -0,0 +1,15 @@ -+! Test fortran call c for the return type is scalar of type -+! long double _Complex ++! Test fortran call c for the return type is value of type long double ++! _Complex with bindc +! +program main + integer, parameter :: K = selected_real_kind(16) + complex(K) :: my_x = (3.1415926535, 1) + interface -+ function c_func(b) ++ function c_func(b) result(res) bind(c, name = "c_func_") + integer, parameter :: K = selected_real_kind(16) + complex(K) :: b -+ complex(K) :: c_func ++ complex(K) :: res + end + end interface + print '(F20.10)', c_func(my_x) +end -diff --git a/test/interoperability_with_c/013_fortran_call_c_function_value/fortran_main027.f90 b/test/interoperability_with_c/013_fortran_call_c_function_value/fortran_main027.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/fortran_main027.f90 b/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/fortran_main027.f90 new file mode 100644 -index 0000000..aef8c72 +index 0000000..08b2d11 --- /dev/null -+++ b/test/interoperability_with_c/013_fortran_call_c_function_value/fortran_main027.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the return type is scalar of type _Bool ++++ b/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/fortran_main027.f90 +@@ -0,0 +1,13 @@ ++! Test fortran call c for the return type is value of type _Bool with ++! bindc +! +program main + logical(1) :: my_x = .FALSE. + interface -+ function c_func(b) ++ function c_func(b) result(res) bind(c, name = "c_func_") + logical(1) :: b -+ logical(1) :: c_func ++ logical(1) :: res + end + end interface + print *, c_func(my_x) +end -diff --git a/test/interoperability_with_c/013_fortran_call_c_function_value/fortran_main028.f90 b/test/interoperability_with_c/013_fortran_call_c_function_value/fortran_main028.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/fortran_main028.f90 b/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/fortran_main028.f90 new file mode 100644 -index 0000000..5290620 +index 0000000..8174ac5 --- /dev/null -+++ b/test/interoperability_with_c/013_fortran_call_c_function_value/fortran_main028.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the return type is scalar of type char ++++ b/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/fortran_main028.f90 +@@ -0,0 +1,13 @@ ++! Test fortran call c for the return type is value of type char with ++! bindc +! +program main + character(1) :: my_x = 'a' + interface -+ function c_func(b) ++ function c_func(b) result(res) bind(c, name = "c_func_") + character(1) :: b -+ character(1) :: c_func ++ character(1) :: res + end + end interface + print *, c_func(my_x) +end -diff --git a/test/interoperability_with_c/013_fortran_call_c_function_value/run.sh b/test/interoperability_with_c/013_fortran_call_c_function_value/run.sh +diff --git a/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/run.sh b/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/run.sh new file mode 100644 -index 0000000..632b582 +index 0000000..b865403 --- /dev/null -+++ b/test/interoperability_with_c/013_fortran_call_c_function_value/run.sh -@@ -0,0 +1,17 @@ ++++ b/test/interoperability_with_c_fortran_call_c/013_fortran_call_c_function_value_bindc/run.sh +@@ -0,0 +1,16 @@ +for i in {001..028} +do +echo "------- test $i ------." @@ -11528,12 +10419,12 @@ index 0000000..632b582 +./a.out +rm *.o a.out +done -+ -diff --git a/test/interoperability_with_c/014_fortran_call_c_mix/c_func001.c b/test/interoperability_with_c/014_fortran_call_c_mix/c_func001.c +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/c_func001.c b/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/c_func001.c new file mode 100755 index 0000000..0da9335 --- /dev/null -+++ b/test/interoperability_with_c/014_fortran_call_c_mix/c_func001.c ++++ b/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/c_func001.c @@ -0,0 +1,15 @@ +#include +struct BaseTy { @@ -11550,11 +10441,11 @@ index 0000000..0da9335 + printf("%d\t", t->y); + printf("%d\n", *a); +} -diff --git a/test/interoperability_with_c/014_fortran_call_c_mix/c_func002.c b/test/interoperability_with_c/014_fortran_call_c_mix/c_func002.c +diff --git a/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/c_func002.c b/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/c_func002.c new file mode 100755 index 0000000..d43d87c --- /dev/null -+++ b/test/interoperability_with_c/014_fortran_call_c_mix/c_func002.c ++++ b/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/c_func002.c @@ -0,0 +1,15 @@ +#include +struct BaseTy { @@ -11571,11 +10462,11 @@ index 0000000..d43d87c + printf("%hd\t", t->y); + printf("%hd\n", *a); +} -diff --git a/test/interoperability_with_c/014_fortran_call_c_mix/c_func003.c b/test/interoperability_with_c/014_fortran_call_c_mix/c_func003.c +diff --git a/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/c_func003.c b/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/c_func003.c new file mode 100755 index 0000000..7901c06 --- /dev/null -+++ b/test/interoperability_with_c/014_fortran_call_c_mix/c_func003.c ++++ b/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/c_func003.c @@ -0,0 +1,15 @@ +#include +struct BaseTy { @@ -11592,11 +10483,11 @@ index 0000000..7901c06 + printf("%ld\t", t->y); + printf("%ld\n", *a); +} -diff --git a/test/interoperability_with_c/014_fortran_call_c_mix/c_func004.c b/test/interoperability_with_c/014_fortran_call_c_mix/c_func004.c +diff --git a/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/c_func004.c b/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/c_func004.c new file mode 100755 index 0000000..061fcfa --- /dev/null -+++ b/test/interoperability_with_c/014_fortran_call_c_mix/c_func004.c ++++ b/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/c_func004.c @@ -0,0 +1,15 @@ +#include +struct BaseTy { @@ -11613,11 +10504,11 @@ index 0000000..061fcfa + printf("%lld\t", t->y); + printf("%lld\n", *a); +} -diff --git a/test/interoperability_with_c/014_fortran_call_c_mix/c_func005.c b/test/interoperability_with_c/014_fortran_call_c_mix/c_func005.c +diff --git a/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/c_func005.c b/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/c_func005.c new file mode 100755 index 0000000..ca651e3 --- /dev/null -+++ b/test/interoperability_with_c/014_fortran_call_c_mix/c_func005.c ++++ b/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/c_func005.c @@ -0,0 +1,15 @@ +#include +struct BaseTy { @@ -11634,11 +10525,11 @@ index 0000000..ca651e3 + printf("%c\t", t->y); + printf("%c\n", *a); +} -diff --git a/test/interoperability_with_c/014_fortran_call_c_mix/c_func006.c b/test/interoperability_with_c/014_fortran_call_c_mix/c_func006.c +diff --git a/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/c_func006.c b/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/c_func006.c new file mode 100755 index 0000000..56c7f41 --- /dev/null -+++ b/test/interoperability_with_c/014_fortran_call_c_mix/c_func006.c ++++ b/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/c_func006.c @@ -0,0 +1,15 @@ +#include +struct BaseTy { @@ -11655,11 +10546,11 @@ index 0000000..56c7f41 + printf("%lu\t", t->y); + printf("%lu\n", *a); +} -diff --git a/test/interoperability_with_c/014_fortran_call_c_mix/c_func007.c b/test/interoperability_with_c/014_fortran_call_c_mix/c_func007.c +diff --git a/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/c_func007.c b/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/c_func007.c new file mode 100755 index 0000000..2a8eaa8 --- /dev/null -+++ b/test/interoperability_with_c/014_fortran_call_c_mix/c_func007.c ++++ b/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/c_func007.c @@ -0,0 +1,16 @@ +#include +#include @@ -11677,11 +10568,11 @@ index 0000000..2a8eaa8 + printf("%hhd\t", t->y); + printf("%hhd\n", *a); +} -diff --git a/test/interoperability_with_c/014_fortran_call_c_mix/c_func008.c b/test/interoperability_with_c/014_fortran_call_c_mix/c_func008.c +diff --git a/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/c_func008.c b/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/c_func008.c new file mode 100755 index 0000000..f45f58e --- /dev/null -+++ b/test/interoperability_with_c/014_fortran_call_c_mix/c_func008.c ++++ b/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/c_func008.c @@ -0,0 +1,16 @@ +#include +#include @@ -11699,11 +10590,11 @@ index 0000000..f45f58e + printf("%hd\t", t->y); + printf("%hd\n", *a); +} -diff --git a/test/interoperability_with_c/014_fortran_call_c_mix/c_func009.c b/test/interoperability_with_c/014_fortran_call_c_mix/c_func009.c +diff --git a/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/c_func009.c b/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/c_func009.c new file mode 100755 index 0000000..01ad489 --- /dev/null -+++ b/test/interoperability_with_c/014_fortran_call_c_mix/c_func009.c ++++ b/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/c_func009.c @@ -0,0 +1,16 @@ +#include +#include @@ -11721,11 +10612,11 @@ index 0000000..01ad489 + printf("%d\t", t->y); + printf("%d\n", *a); +} -diff --git a/test/interoperability_with_c/014_fortran_call_c_mix/c_func010.c b/test/interoperability_with_c/014_fortran_call_c_mix/c_func010.c +diff --git a/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/c_func010.c b/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/c_func010.c new file mode 100755 index 0000000..105ad9a --- /dev/null -+++ b/test/interoperability_with_c/014_fortran_call_c_mix/c_func010.c ++++ b/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/c_func010.c @@ -0,0 +1,16 @@ +#include +#include @@ -11743,11 +10634,11 @@ index 0000000..105ad9a + printf("%ld\t", t->y); + printf("%ld\n", *a); +} -diff --git a/test/interoperability_with_c/014_fortran_call_c_mix/c_func011.c b/test/interoperability_with_c/014_fortran_call_c_mix/c_func011.c +diff --git a/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/c_func011.c b/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/c_func011.c new file mode 100755 index 0000000..e19a9f0 --- /dev/null -+++ b/test/interoperability_with_c/014_fortran_call_c_mix/c_func011.c ++++ b/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/c_func011.c @@ -0,0 +1,16 @@ +#include +#include @@ -11765,11 +10656,11 @@ index 0000000..e19a9f0 + printf("%hhd\t", t->y); + printf("%hhd\n", *a); +} -diff --git a/test/interoperability_with_c/014_fortran_call_c_mix/c_func012.c b/test/interoperability_with_c/014_fortran_call_c_mix/c_func012.c +diff --git a/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/c_func012.c b/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/c_func012.c new file mode 100755 index 0000000..1b9064b --- /dev/null -+++ b/test/interoperability_with_c/014_fortran_call_c_mix/c_func012.c ++++ b/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/c_func012.c @@ -0,0 +1,16 @@ +#include +#include @@ -11787,11 +10678,11 @@ index 0000000..1b9064b + printf("%hd\t", t->y); + printf("%hd\n", *a); +} -diff --git a/test/interoperability_with_c/014_fortran_call_c_mix/c_func013.c b/test/interoperability_with_c/014_fortran_call_c_mix/c_func013.c +diff --git a/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/c_func013.c b/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/c_func013.c new file mode 100755 index 0000000..9ab4390 --- /dev/null -+++ b/test/interoperability_with_c/014_fortran_call_c_mix/c_func013.c ++++ b/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/c_func013.c @@ -0,0 +1,16 @@ +#include +#include @@ -11809,11 +10700,11 @@ index 0000000..9ab4390 + printf("%d\t", t->y); + printf("%d\n", *a); +} -diff --git a/test/interoperability_with_c/014_fortran_call_c_mix/c_func014.c b/test/interoperability_with_c/014_fortran_call_c_mix/c_func014.c +diff --git a/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/c_func014.c b/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/c_func014.c new file mode 100755 index 0000000..82bd2a2 --- /dev/null -+++ b/test/interoperability_with_c/014_fortran_call_c_mix/c_func014.c ++++ b/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/c_func014.c @@ -0,0 +1,16 @@ +#include +#include @@ -11831,11 +10722,11 @@ index 0000000..82bd2a2 + printf("%ld\t", t->y); + printf("%ld\n", *a); +} -diff --git a/test/interoperability_with_c/014_fortran_call_c_mix/c_func015.c b/test/interoperability_with_c/014_fortran_call_c_mix/c_func015.c +diff --git a/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/c_func015.c b/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/c_func015.c new file mode 100755 index 0000000..b2a9da9 --- /dev/null -+++ b/test/interoperability_with_c/014_fortran_call_c_mix/c_func015.c ++++ b/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/c_func015.c @@ -0,0 +1,16 @@ +#include +#include @@ -11853,11 +10744,11 @@ index 0000000..b2a9da9 + printf("%hhd\t", t->y); + printf("%hhd\n", *a); +} -diff --git a/test/interoperability_with_c/014_fortran_call_c_mix/c_func016.c b/test/interoperability_with_c/014_fortran_call_c_mix/c_func016.c +diff --git a/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/c_func016.c b/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/c_func016.c new file mode 100755 index 0000000..f35b45c --- /dev/null -+++ b/test/interoperability_with_c/014_fortran_call_c_mix/c_func016.c ++++ b/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/c_func016.c @@ -0,0 +1,16 @@ +#include +#include @@ -11875,11 +10766,11 @@ index 0000000..f35b45c + printf("%ld\t", t->y); + printf("%ld\n", *a); +} -diff --git a/test/interoperability_with_c/014_fortran_call_c_mix/c_func017.c b/test/interoperability_with_c/014_fortran_call_c_mix/c_func017.c +diff --git a/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/c_func017.c b/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/c_func017.c new file mode 100755 index 0000000..4d6e335 --- /dev/null -+++ b/test/interoperability_with_c/014_fortran_call_c_mix/c_func017.c ++++ b/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/c_func017.c @@ -0,0 +1,16 @@ +#include +#include @@ -11897,11 +10788,11 @@ index 0000000..4d6e335 + printf("%ld\t", t->y); + printf("%ld\n", *a); +} -diff --git a/test/interoperability_with_c/014_fortran_call_c_mix/c_func018.c b/test/interoperability_with_c/014_fortran_call_c_mix/c_func018.c +diff --git a/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/c_func018.c b/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/c_func018.c new file mode 100755 index 0000000..86d6afa --- /dev/null -+++ b/test/interoperability_with_c/014_fortran_call_c_mix/c_func018.c ++++ b/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/c_func018.c @@ -0,0 +1,16 @@ +#include +#include @@ -11919,11 +10810,11 @@ index 0000000..86d6afa + printf("%ld\t", t->y); + printf("%ld\n", *a); +} -diff --git a/test/interoperability_with_c/014_fortran_call_c_mix/c_func019.c b/test/interoperability_with_c/014_fortran_call_c_mix/c_func019.c +diff --git a/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/c_func019.c b/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/c_func019.c new file mode 100755 index 0000000..48600a8 --- /dev/null -+++ b/test/interoperability_with_c/014_fortran_call_c_mix/c_func019.c ++++ b/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/c_func019.c @@ -0,0 +1,16 @@ +#include +#include @@ -11941,11 +10832,11 @@ index 0000000..48600a8 + printf("%ld\t", t->y); + printf("%ld\n", *a); +} -diff --git a/test/interoperability_with_c/014_fortran_call_c_mix/c_func020.c b/test/interoperability_with_c/014_fortran_call_c_mix/c_func020.c +diff --git a/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/c_func020.c b/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/c_func020.c new file mode 100755 index 0000000..88cb6d9 --- /dev/null -+++ b/test/interoperability_with_c/014_fortran_call_c_mix/c_func020.c ++++ b/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/c_func020.c @@ -0,0 +1,16 @@ +#include +#include @@ -11963,11 +10854,11 @@ index 0000000..88cb6d9 + printf("%ld\t", t->y); + printf("%ld\n", *a); +} -diff --git a/test/interoperability_with_c/014_fortran_call_c_mix/c_func021.c b/test/interoperability_with_c/014_fortran_call_c_mix/c_func021.c +diff --git a/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/c_func021.c b/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/c_func021.c new file mode 100755 index 0000000..4ef4c87 --- /dev/null -+++ b/test/interoperability_with_c/014_fortran_call_c_mix/c_func021.c ++++ b/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/c_func021.c @@ -0,0 +1,15 @@ +#include +#include @@ -11984,11 +10875,11 @@ index 0000000..4ef4c87 + printf("%.2f\t", t->x); + printf("%.2f\n", t->y); +} -diff --git a/test/interoperability_with_c/014_fortran_call_c_mix/c_func022.c b/test/interoperability_with_c/014_fortran_call_c_mix/c_func022.c +diff --git a/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/c_func022.c b/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/c_func022.c new file mode 100755 index 0000000..6a17869 --- /dev/null -+++ b/test/interoperability_with_c/014_fortran_call_c_mix/c_func022.c ++++ b/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/c_func022.c @@ -0,0 +1,15 @@ +#include +#include @@ -12005,11 +10896,11 @@ index 0000000..6a17869 + printf("%.6lf\t", t->x); + printf("%.6lf\n", t->y); +} -diff --git a/test/interoperability_with_c/014_fortran_call_c_mix/c_func023.c b/test/interoperability_with_c/014_fortran_call_c_mix/c_func023.c +diff --git a/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/c_func023.c b/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/c_func023.c new file mode 100755 index 0000000..ce676c0 --- /dev/null -+++ b/test/interoperability_with_c/014_fortran_call_c_mix/c_func023.c ++++ b/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/c_func023.c @@ -0,0 +1,15 @@ +#include +#include @@ -12026,11 +10917,11 @@ index 0000000..ce676c0 + printf("%.6Lf\t", t->x); + printf("%.6Lf\n", t->y); +} -diff --git a/test/interoperability_with_c/014_fortran_call_c_mix/c_func024.c b/test/interoperability_with_c/014_fortran_call_c_mix/c_func024.c +diff --git a/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/c_func024.c b/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/c_func024.c new file mode 100755 index 0000000..65f9cd3 --- /dev/null -+++ b/test/interoperability_with_c/014_fortran_call_c_mix/c_func024.c ++++ b/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/c_func024.c @@ -0,0 +1,15 @@ +#include +#include @@ -12047,11 +10938,11 @@ index 0000000..65f9cd3 + printf("%f + %fi\n", creal(t->x), cimag(t->x)); + printf("%f + %fi\n", creal(t->y), cimag(t->y)); +} -diff --git a/test/interoperability_with_c/014_fortran_call_c_mix/c_func025.c b/test/interoperability_with_c/014_fortran_call_c_mix/c_func025.c +diff --git a/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/c_func025.c b/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/c_func025.c new file mode 100755 index 0000000..5a508d3 --- /dev/null -+++ b/test/interoperability_with_c/014_fortran_call_c_mix/c_func025.c ++++ b/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/c_func025.c @@ -0,0 +1,15 @@ +#include +#include @@ -12068,11 +10959,11 @@ index 0000000..5a508d3 + printf("%lf + %lfi\n", creal(t->x), cimag(t->x)); + printf("%lf + %lfi\n", creal(t->y), cimag(t->y)); +} -diff --git a/test/interoperability_with_c/014_fortran_call_c_mix/c_func026.c b/test/interoperability_with_c/014_fortran_call_c_mix/c_func026.c +diff --git a/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/c_func026.c b/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/c_func026.c new file mode 100755 index 0000000..3969809 --- /dev/null -+++ b/test/interoperability_with_c/014_fortran_call_c_mix/c_func026.c ++++ b/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/c_func026.c @@ -0,0 +1,15 @@ +#include +#include @@ -12089,11 +10980,11 @@ index 0000000..3969809 + printf("%f + %fi\n", creal(t->x), cimag(t->x)); + printf("%f + %fi\n", creal(t->y), cimag(t->y)); +} -diff --git a/test/interoperability_with_c/014_fortran_call_c_mix/c_func027.c b/test/interoperability_with_c/014_fortran_call_c_mix/c_func027.c +diff --git a/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/c_func027.c b/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/c_func027.c new file mode 100755 index 0000000..8847072 --- /dev/null -+++ b/test/interoperability_with_c/014_fortran_call_c_mix/c_func027.c ++++ b/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/c_func027.c @@ -0,0 +1,15 @@ +#include +struct BaseTy { @@ -12110,11 +11001,11 @@ index 0000000..8847072 + printf("%d\t", t->y); + printf("%d\n", *a); +} -diff --git a/test/interoperability_with_c/014_fortran_call_c_mix/c_func028.c b/test/interoperability_with_c/014_fortran_call_c_mix/c_func028.c +diff --git a/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/c_func028.c b/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/c_func028.c new file mode 100755 index 0000000..988b739 --- /dev/null -+++ b/test/interoperability_with_c/014_fortran_call_c_mix/c_func028.c ++++ b/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/c_func028.c @@ -0,0 +1,15 @@ +#include +struct BaseTy { @@ -12131,11 +11022,11 @@ index 0000000..988b739 + printf("%c\t", t->y); + printf("%c\n", *a); +} -diff --git a/test/interoperability_with_c/014_fortran_call_c_mix/fortran_main001.f90 b/test/interoperability_with_c/014_fortran_call_c_mix/fortran_main001.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/fortran_main001.f90 b/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/fortran_main001.f90 new file mode 100755 index 0000000..37bfd33 --- /dev/null -+++ b/test/interoperability_with_c/014_fortran_call_c_mix/fortran_main001.f90 ++++ b/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/fortran_main001.f90 @@ -0,0 +1,26 @@ +! Test fortran call c for the derived type and the derived type has +! multiple components and one component is the derived type. remaining @@ -12163,11 +11054,11 @@ index 0000000..37bfd33 + end interface + call c_func(my_t, my_x) +end -diff --git a/test/interoperability_with_c/014_fortran_call_c_mix/fortran_main002.f90 b/test/interoperability_with_c/014_fortran_call_c_mix/fortran_main002.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/fortran_main002.f90 b/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/fortran_main002.f90 new file mode 100755 index 0000000..ad07ec8 --- /dev/null -+++ b/test/interoperability_with_c/014_fortran_call_c_mix/fortran_main002.f90 ++++ b/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/fortran_main002.f90 @@ -0,0 +1,26 @@ +! Test fortran call c for the derived type and the derived type has +! multiple components and one component is the derived type. remaining @@ -12195,11 +11086,11 @@ index 0000000..ad07ec8 + end interface + call c_func(my_t, my_x) +end -diff --git a/test/interoperability_with_c/014_fortran_call_c_mix/fortran_main003.f90 b/test/interoperability_with_c/014_fortran_call_c_mix/fortran_main003.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/fortran_main003.f90 b/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/fortran_main003.f90 new file mode 100755 index 0000000..4b182aa --- /dev/null -+++ b/test/interoperability_with_c/014_fortran_call_c_mix/fortran_main003.f90 ++++ b/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/fortran_main003.f90 @@ -0,0 +1,26 @@ +! Test fortran call c for the derived type and the derived type has +! multiple components and one component is the derived type. remaining @@ -12227,11 +11118,11 @@ index 0000000..4b182aa + end interface + call c_func(my_t, my_x) +end -diff --git a/test/interoperability_with_c/014_fortran_call_c_mix/fortran_main004.f90 b/test/interoperability_with_c/014_fortran_call_c_mix/fortran_main004.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/fortran_main004.f90 b/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/fortran_main004.f90 new file mode 100755 index 0000000..7a1d67a --- /dev/null -+++ b/test/interoperability_with_c/014_fortran_call_c_mix/fortran_main004.f90 ++++ b/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/fortran_main004.f90 @@ -0,0 +1,26 @@ +! Test fortran call c for the derived type and the derived type has +! multiple components and one component is the derived type. remaining @@ -12259,11 +11150,11 @@ index 0000000..7a1d67a + end interface + call c_func(my_t, my_x) +end -diff --git a/test/interoperability_with_c/014_fortran_call_c_mix/fortran_main005.f90 b/test/interoperability_with_c/014_fortran_call_c_mix/fortran_main005.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/fortran_main005.f90 b/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/fortran_main005.f90 new file mode 100755 index 0000000..5fa4d83 --- /dev/null -+++ b/test/interoperability_with_c/014_fortran_call_c_mix/fortran_main005.f90 ++++ b/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/fortran_main005.f90 @@ -0,0 +1,26 @@ +! Test fortran call c for the derived type and the derived type has +! multiple components and one component is the derived type. remaining @@ -12291,11 +11182,11 @@ index 0000000..5fa4d83 + end interface + call c_func(my_t, my_x) +end -diff --git a/test/interoperability_with_c/014_fortran_call_c_mix/fortran_main006.f90 b/test/interoperability_with_c/014_fortran_call_c_mix/fortran_main006.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/fortran_main006.f90 b/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/fortran_main006.f90 new file mode 100755 index 0000000..1ef89d9 --- /dev/null -+++ b/test/interoperability_with_c/014_fortran_call_c_mix/fortran_main006.f90 ++++ b/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/fortran_main006.f90 @@ -0,0 +1,26 @@ +! Test fortran call c for the derived type and the derived type has +! multiple components and one component is the derived type. remaining @@ -12323,859 +11214,8294 @@ index 0000000..1ef89d9 + end interface + call c_func(my_t, my_x) +end -diff --git a/test/interoperability_with_c/014_fortran_call_c_mix/fortran_main007.f90 b/test/interoperability_with_c/014_fortran_call_c_mix/fortran_main007.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/fortran_main007.f90 b/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/fortran_main007.f90 new file mode 100755 index 0000000..56e5341 --- /dev/null -+++ b/test/interoperability_with_c/014_fortran_call_c_mix/fortran_main007.f90 ++++ b/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/fortran_main007.f90 @@ -0,0 +1,26 @@ +! Test fortran call c for the derived type and the derived type has +! multiple components and one component is the derived type. remaining +! components are mixed type int8_t +! +program main -+ use iso_c_binding -+ type, bind(c) :: base -+ integer(C_INT8_T) :: j(2) = -2 -+ end type base ++ use iso_c_binding ++ type, bind(c) :: base ++ integer(C_INT8_T) :: j(2) = -2 ++ end type base ++ type, bind(c) :: t ++ type(base) :: bt ++ integer(C_INT8_T) :: x = -128 ++ integer(1) :: y = 127 ++ end type t ++ type(t) :: my_t ++ integer(C_INT8_T) :: my_x = 3 ++ interface ++ subroutine c_func(a, b) ++ use iso_c_binding ++ import :: t ++ type(t) :: a ++ integer(C_INT8_T) :: b ++ end ++ end interface ++ call c_func(my_t, my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/fortran_main008.f90 b/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/fortran_main008.f90 +new file mode 100755 +index 0000000..8b5a4ce +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/fortran_main008.f90 +@@ -0,0 +1,26 @@ ++! Test fortran call c for the derived type and the derived type has ++! multiple components and one component is the derived type. remaining ++! components are mixed type int16_t ++! ++program main ++ use iso_c_binding ++ type, bind(c) :: base ++ integer(C_INT16_T) :: j(2) = -2 ++ end type base ++ type, bind(c) :: t ++ type(base) :: bt ++ integer(C_INT16_T) :: x = -32768 ++ integer(2) :: y = 32767 ++ end type t ++ type(t) :: my_t ++ integer(C_INT16_T) :: my_x = 3 ++ interface ++ subroutine c_func(a, b) ++ use iso_c_binding ++ import :: t ++ type(t) :: a ++ integer(C_INT16_T) :: b ++ end ++ end interface ++ call c_func(my_t, my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/fortran_main009.f90 b/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/fortran_main009.f90 +new file mode 100755 +index 0000000..2674ede +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/fortran_main009.f90 +@@ -0,0 +1,26 @@ ++! Test fortran call c for the derived type and the derived type has ++! multiple components and one component is the derived type. remaining ++! components are mixed type int32_t ++! ++program main ++ use iso_c_binding ++ type, bind(c) :: base ++ integer(C_INT32_T) :: j(2) = -2 ++ end type base ++ type, bind(c) :: t ++ type(base) :: bt ++ integer(C_INT32_T) :: x = -2147483647 ++ integer(4) :: y = 2147483647 ++ end type t ++ type(t) :: my_t ++ integer(C_INT32_T) :: my_x = 3 ++ interface ++ subroutine c_func(a, b) ++ use iso_c_binding ++ import :: t ++ type(t) :: a ++ integer(C_INT32_T) :: b ++ end ++ end interface ++ call c_func(my_t, my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/fortran_main010.f90 b/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/fortran_main010.f90 +new file mode 100755 +index 0000000..9d50708 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/fortran_main010.f90 +@@ -0,0 +1,26 @@ ++! Test fortran call c for the derived type and the derived type has ++! multiple components and one component is the derived type. remaining ++! components are mixed type int64_t ++! ++program main ++ use iso_c_binding ++ type, bind(c) :: base ++ integer(C_INT64_T) :: j(2) = -2 ++ end type base ++ type, bind(c) :: t ++ type(base) :: bt ++ integer(C_INT64_T) :: x = -9223372036854775807 ++ integer(8) :: y = 9223372036854775807 ++ end type t ++ type(t) :: my_t ++ integer(C_INT64_T) :: my_x = 3 ++ interface ++ subroutine c_func(a, b) ++ use iso_c_binding ++ import :: t ++ type(t) :: a ++ integer(C_INT64_T) :: b ++ end ++ end interface ++ call c_func(my_t, my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/fortran_main011.f90 b/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/fortran_main011.f90 +new file mode 100755 +index 0000000..3e895fc +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/fortran_main011.f90 +@@ -0,0 +1,26 @@ ++! Test fortran call c for the derived type and the derived type has ++! multiple components and one component is the derived type. remaining ++! components are mixed type int_least8_t ++! ++program main ++ use iso_c_binding ++ type, bind(c) :: base ++ integer(C_INT_LEAST8_T) :: j(2) = -2 ++ end type base ++ type, bind(c) :: t ++ type(base) :: bt ++ integer(C_INT_LEAST8_T) :: x = -128 ++ integer(1) :: y = 127 ++ end type t ++ type(t) :: my_t ++ integer(C_INT_LEAST8_T) :: my_x = 3 ++ interface ++ subroutine c_func(a, b) ++ use iso_c_binding ++ import :: t ++ type(t) :: a ++ integer(C_INT_LEAST8_T) :: b ++ end ++ end interface ++ call c_func(my_t, my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/fortran_main012.f90 b/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/fortran_main012.f90 +new file mode 100755 +index 0000000..a8b0ef5 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/fortran_main012.f90 +@@ -0,0 +1,26 @@ ++! Test fortran call c for the derived type and the derived type has ++! multiple components and one component is the derived type. remaining ++! components are mixed type int_least16_t ++! ++program main ++ use iso_c_binding ++ type, bind(c) :: base ++ integer(C_INT_LEAST16_T) :: j(2) = -2 ++ end type base ++ type, bind(c) :: t ++ type(base) :: bt ++ integer(C_INT_LEAST16_T) :: x = -32768 ++ integer(2) :: y = 32767 ++ end type t ++ type(t) :: my_t ++ integer(C_INT_LEAST16_T) :: my_x = 3 ++ interface ++ subroutine c_func(a, b) ++ use iso_c_binding ++ import :: t ++ type(t) :: a ++ integer(C_INT_LEAST16_T) :: b ++ end ++ end interface ++ call c_func(my_t, my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/fortran_main013.f90 b/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/fortran_main013.f90 +new file mode 100755 +index 0000000..62e8b11 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/fortran_main013.f90 +@@ -0,0 +1,26 @@ ++! Test fortran call c for the derived type and the derived type has ++! multiple components and one component is the derived type. remaining ++! components are mixed type int_least32_t ++! ++program main ++ use iso_c_binding ++ type, bind(c) :: base ++ integer(C_INT_LEAST32_T) :: j(2) = -2 ++ end type base ++ type, bind(c) :: t ++ type(base) :: bt ++ integer(C_INT_LEAST32_T) :: x = -2147483647 ++ integer(4) :: y = 2147483647 ++ end type t ++ type(t) :: my_t ++ integer(C_INT_LEAST32_T) :: my_x = 3 ++ interface ++ subroutine c_func(a, b) ++ use iso_c_binding ++ import :: t ++ type(t) :: a ++ integer(C_INT_LEAST32_T) :: b ++ end ++ end interface ++ call c_func(my_t, my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/fortran_main014.f90 b/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/fortran_main014.f90 +new file mode 100755 +index 0000000..1b0aa8e +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/fortran_main014.f90 +@@ -0,0 +1,26 @@ ++! Test fortran call ! Test fortran call c for the derived type and the derived type has ++! multiple components and one component is the derived type. remaining ++! components are mixed type int_least64_t ++! ++program main ++ use iso_c_binding ++ type, bind(c) :: base ++ integer(C_INT_LEAST64_T) :: j(2) = -2 ++ end type base ++ type, bind(c) :: t ++ type(base) :: bt ++ integer(C_INT_LEAST64_T) :: x = -9223372036854775807 ++ integer(8) :: y = 9223372036854775807 ++ end type t ++ type(t) :: my_t ++ integer(C_INT_LEAST64_T) :: my_x = 3 ++ interface ++ subroutine c_func(a, b) ++ use iso_c_binding ++ import :: t ++ type(t) :: a ++ integer(C_INT_LEAST64_T) :: b ++ end ++ end interface ++ call c_func(my_t, my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/fortran_main015.f90 b/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/fortran_main015.f90 +new file mode 100755 +index 0000000..52d7e1d +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/fortran_main015.f90 +@@ -0,0 +1,26 @@ ++! Test fortran call c for the derived type and the derived type has ++! multiple components and one component is the derived type. remaining ++! components are mixed type int_fast8_t ++! ++program main ++ use iso_c_binding ++ type, bind(c) :: base ++ integer(C_INT_FAST8_T) :: j(2) = -2 ++ end type base ++ type, bind(c) :: t ++ type(base) :: bt ++ integer(C_INT_FAST8_T) :: x = -128 ++ integer(1) :: y = 127 ++ end type t ++ type(t) :: my_t ++ integer(C_INT_FAST8_T) :: my_x = 3 ++ interface ++ subroutine c_func(a, b) ++ use iso_c_binding ++ import :: t ++ type(t) :: a ++ integer(C_INT_FAST8_T) :: b ++ end ++ end interface ++ call c_func(my_t, my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/fortran_main016.f90 b/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/fortran_main016.f90 +new file mode 100755 +index 0000000..05bd335 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/fortran_main016.f90 +@@ -0,0 +1,26 @@ ++! Test fortran call c for the derived type and the derived type has ++! multiple components and one component is the derived type. remaining ++! components are mixed type int_fast16_t ++! ++program main ++ use iso_c_binding ++ type, bind(c) :: base ++ integer(C_INT_FAST16_T) :: j(2) = -2 ++ end type base ++ type, bind(c) :: t ++ type(base) :: bt ++ integer(C_INT_FAST16_T) :: x = -32768 ++ integer(8) :: y = 32767 ++ end type t ++ type(t) :: my_t ++ integer(C_INT_FAST16_T) :: my_x = 3 ++ interface ++ subroutine c_func(a, b) ++ use iso_c_binding ++ import :: t ++ type(t) :: a ++ integer(C_INT_FAST16_T) :: b ++ end ++ end interface ++ call c_func(my_t, my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/fortran_main017.f90 b/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/fortran_main017.f90 +new file mode 100755 +index 0000000..0a648b4 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/fortran_main017.f90 +@@ -0,0 +1,26 @@ ++! Test fortran call c for the derived type and the derived type has ++! multiple components and one component is the derived type. remaining ++! components are mixed type int_fast32_t ++! ++program main ++ use iso_c_binding ++ type, bind(c) :: base ++ integer(C_INT_FAST32_T) :: j(2) = -2 ++ end type base ++ type, bind(c) :: t ++ type(base) :: bt ++ integer(C_INT_FAST32_T) :: x = -2147483647 ++ integer(8) :: y = 2147483647 ++ end type t ++ type(t) :: my_t ++ integer(C_INT_FAST32_T) :: my_x = 3 ++ interface ++ subroutine c_func(a, b) ++ use iso_c_binding ++ import :: t ++ type(t) :: a ++ integer(C_INT_FAST32_T) :: b ++ end ++ end interface ++ call c_func(my_t, my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/fortran_main018.f90 b/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/fortran_main018.f90 +new file mode 100755 +index 0000000..34fd6b2 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/fortran_main018.f90 +@@ -0,0 +1,26 @@ ++! Test fortran call c for the derived type and the derived type has ++! multiple components and one component is the derived type. remaining ++! components are mixed type int_fast64_t ++! ++program main ++ use iso_c_binding ++ type, bind(c) :: base ++ integer(C_INT_FAST64_T) :: j(2) = -2 ++ end type base ++ type, bind(c) :: t ++ type(base) :: bt ++ integer(C_INT_FAST64_T) :: x = -9223372036854775807 ++ integer(8) :: y = 9223372036854775807 ++ end type t ++ type(t) :: my_t ++ integer(C_INT_FAST64_T) :: my_x = 3 ++ interface ++ subroutine c_func(a, b) ++ use iso_c_binding ++ import :: t ++ type(t) :: a ++ integer(C_INT_FAST64_T) :: b ++ end ++ end interface ++ call c_func(my_t, my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/fortran_main019.f90 b/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/fortran_main019.f90 +new file mode 100755 +index 0000000..d18bfaa +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/fortran_main019.f90 +@@ -0,0 +1,26 @@ ++! Test fortran call c for the derived type and the derived type has ++! multiple components and one component is the derived type. remaining ++! components are mixed type int_intmax_t ++! ++program main ++ use iso_c_binding ++ type, bind(c) :: base ++ integer(C_INTMAX_T) :: j(2) = -2 ++ end type base ++ type, bind(c) :: t ++ type(base) :: bt ++ integer(C_INTMAX_T) :: x = 11548694 ++ integer(8) :: y = 916519685 ++ end type t ++ type(t) :: my_t ++ integer(C_INTMAX_T) :: my_x = 3 ++ interface ++ subroutine c_func(a, b) ++ use iso_c_binding ++ import :: t ++ type(t) :: a ++ integer(C_INTMAX_T) :: b ++ end ++ end interface ++ call c_func(my_t, my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/fortran_main020.f90 b/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/fortran_main020.f90 +new file mode 100755 +index 0000000..849525a +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/fortran_main020.f90 +@@ -0,0 +1,26 @@ ++! Test fortran call c for the derived type and the derived type has ++! multiple components and one component is the derived type. remaining ++! components are mixed type intptr_t ++! ++program main ++ use iso_c_binding ++ type, bind(c) :: base ++ integer(C_INTPTR_T) :: j(2) = -2 ++ end type base ++ type, bind(c) :: t ++ type(base) :: bt ++ integer(C_INTPTR_T) :: x = -922337 ++ integer(8) :: y = 922337 ++ end type t ++ type(t) :: my_t ++ integer(C_INTPTR_T) :: my_x = 3 ++ interface ++ subroutine c_func(a, b) ++ use iso_c_binding ++ import :: t ++ type(t) :: a ++ integer(C_INTPTR_T) :: b ++ end ++ end interface ++ call c_func(my_t, my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/fortran_main021.f90 b/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/fortran_main021.f90 +new file mode 100755 +index 0000000..ecb0e02 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/fortran_main021.f90 +@@ -0,0 +1,24 @@ ++! Test fortran call c for the derived type and the derived type has ++! multiple components and one component is the derived type. remaining ++! components are mixed type float ++! ++program main ++ use iso_c_binding ++ type, bind(c) :: base ++ real(C_FLOAT) :: j(2) = -2.36 ++ end type base ++ type, bind(c) :: t ++ type(base) :: bt ++ real(C_FLOAT) :: x = -3.14 ++ real(4) :: y = 3.14 ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) ++ use iso_c_binding ++ import :: t ++ type(t) :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/fortran_main022.f90 b/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/fortran_main022.f90 +new file mode 100755 +index 0000000..7865856 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/fortran_main022.f90 +@@ -0,0 +1,24 @@ ++! Test fortran call c for the derived type and the derived type has ++! multiple components and one component is the derived type. remaining ++! components are mixed type double ++! ++program main ++ use iso_c_binding ++ type, bind(c) :: base ++ real(C_DOUBLE) :: j(2) = 450359962737049.621345 ++ end type base ++ type, bind(c) :: t ++ type(base) :: bt ++ real(C_DOUBLE) :: x = -450359962737049.621113 ++ real(8) :: y = 12345678.7654321 ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) ++ use iso_c_binding ++ import :: t ++ type(t) :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/fortran_main023.f90 b/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/fortran_main023.f90 +new file mode 100755 +index 0000000..d88c887 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/fortran_main023.f90 +@@ -0,0 +1,25 @@ ++! Test fortran call c for the derived type and the derived type has ++! multiple components and one component is the derived type. remaining ++! components are mixed type long double ++! ++program main ++ use iso_c_binding ++ integer, parameter :: K = selected_real_kind(16) ++ type, bind(c) :: base ++ real(C_LONG_DOUBLE) :: j(2) = 50359534651234685432213246841962737049.621345 ++ end type base ++ type, bind(c) :: t ++ type(base) :: bt ++ real(C_LONG_DOUBLE) :: x = -450359962737049.621113 ++ real(K) :: y = 12345678.7654321 ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) ++ use iso_c_binding ++ import :: t ++ type(t) :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/fortran_main024.f90 b/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/fortran_main024.f90 +new file mode 100755 +index 0000000..033c05a +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/fortran_main024.f90 +@@ -0,0 +1,24 @@ ++! Test fortran call c for the derived type and the derived type has ++! multiple components and one component is the derived type. remaining ++! components are mixed type float complex ++! ++program main ++ use iso_c_binding ++ type, bind(c) :: base ++ complex(C_FLOAT_COMPLEX) :: j(2) = (1, 2); ++ end type base ++ type, bind(c) :: t ++ type(base) :: bt ++ complex(C_FLOAT_COMPLEX) :: x = (-3, 1) ++ complex(4) :: y = (3, 1) ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) ++ use iso_c_binding ++ import :: t ++ type(t) :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/fortran_main025.f90 b/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/fortran_main025.f90 +new file mode 100755 +index 0000000..e03cd28 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/fortran_main025.f90 +@@ -0,0 +1,24 @@ ++! Test fortran call c for the derived type and the derived type has ++! multiple components and one component is the derived type. remaining ++! components are mixed type double complex ++! ++program main ++ use iso_c_binding ++ type, bind(c) :: base ++ complex(C_DOUBLE_COMPLEX) :: j(2) = (4503599.6, 621.345); ++ end type base ++ type, bind(c) :: t ++ type(base) :: bt ++ complex(C_DOUBLE_COMPLEX) :: x = (-3.14159265358979, 1) ++ complex(8) :: y = (3.14159265358979, 1) ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) ++ use iso_c_binding ++ import :: t ++ type(t) :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/fortran_main026.f90 b/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/fortran_main026.f90 +new file mode 100755 +index 0000000..a3af173 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/fortran_main026.f90 +@@ -0,0 +1,25 @@ ++! Test fortran call c for the derived type and the derived type has ++! multiple components and one component is the derived type. remaining ++! components are mixed type long double complex ++! ++program main ++ use iso_c_binding ++ integer, parameter :: K = selected_real_kind(16) ++ type, bind(c) :: base ++ complex(C_LONG_DOUBLE_COMPLEX) :: j(2) = (45545204745299.6, 621.345); ++ end type base ++ type, bind(c) :: t ++ type(base) :: bt ++ complex(C_LONG_DOUBLE_COMPLEX) :: x = (-3.14159265358979, 1) ++ complex(K) :: y = (3.14159265358979, 1) ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) ++ use iso_c_binding ++ import :: t ++ type(t) :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/fortran_main027.f90 b/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/fortran_main027.f90 +new file mode 100755 +index 0000000..2df1f57 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/fortran_main027.f90 +@@ -0,0 +1,26 @@ ++! Test fortran call c for the derived type and the derived type has ++! multiple components and one component is the derived type. remaining ++! components are mixed type bool ++! ++program main ++ use iso_c_binding ++ type, bind(c) :: base ++ logical(C_BOOL) :: j(2) = .TRUE. ++ end type base ++ type, bind(c) :: t ++ type(base) :: bt ++ logical(C_BOOL) :: x = .FALSE. ++ logical(1) :: y = .TRUE. ++ end type t ++ type(t) :: my_t ++ logical(C_BOOL) :: my_x = .FALSE. ++ interface ++ subroutine c_func(a, b) ++ use iso_c_binding ++ import :: t ++ type(t) :: a ++ logical(C_BOOL) :: b ++ end ++ end interface ++ call c_func(my_t, my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/fortran_main028.f90 b/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/fortran_main028.f90 +new file mode 100755 +index 0000000..23450cd +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/fortran_main028.f90 +@@ -0,0 +1,26 @@ ++! Test fortran call c for the derived type and the derived type has ++! multiple components and one component is the derived type. remaining ++! components are mixed type char ++! ++program main ++ use iso_c_binding ++ type, bind(c) :: base ++ character(C_CHAR) :: j(2) = 'a' ++ end type base ++ type, bind(c) :: t ++ type(base) :: bt ++ character(C_CHAR) :: x = 'b' ++ character(1) :: y = 'c' ++ end type t ++ type(t) :: my_t ++ character(C_CHAR) :: my_x = 'd' ++ interface ++ subroutine c_func(a, b) ++ use iso_c_binding ++ import :: t ++ type(t) :: a ++ character(C_CHAR) :: b ++ end ++ end interface ++ call c_func(my_t, my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/run.sh b/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/run.sh +new file mode 100644 +index 0000000..b865403 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/014_fortran_call_c_mix/run.sh +@@ -0,0 +1,16 @@ ++for i in {001..028} ++do ++echo "------- test $i ------." ++#echo "----- gfortran result:" ++#gcc c_func$i.c -c -o c-test.o ++#gfortran fortran_main$i.f90 -fno-range-check -c -o fortran-test.o ++#gfortran c-test.o fortran-test.o ++#./a.out ++#rm *.o a.out ++echo "----- flang-new result : " ++clang c_func$i.c -c -o c-test.o ++flang-new fortran_main$i.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o a.out ++done +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c/015_fortran_call_c_special_case/c_func001.c b/test/interoperability_with_c_fortran_call_c/015_fortran_call_c_special_case/c_func001.c +new file mode 100644 +index 0000000..87c1454 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/015_fortran_call_c_special_case/c_func001.c +@@ -0,0 +1,4 @@ ++#include ++void c_func_(int *a) { ++ printf("ok\n"); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/015_fortran_call_c_special_case/c_func002.c b/test/interoperability_with_c_fortran_call_c/015_fortran_call_c_special_case/c_func002.c +new file mode 100644 +index 0000000..061affd +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/015_fortran_call_c_special_case/c_func002.c +@@ -0,0 +1,7 @@ ++#include ++struct Ty { ++ int x[0]; ++}; ++void c_func_(struct Ty *t) { ++ printf("ok\n"); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/015_fortran_call_c_special_case/c_func003.c b/test/interoperability_with_c_fortran_call_c/015_fortran_call_c_special_case/c_func003.c +new file mode 100644 +index 0000000..ed175d9 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/015_fortran_call_c_special_case/c_func003.c +@@ -0,0 +1,12 @@ ++#include ++struct BaseTy { ++}; ++struct Ty { ++ struct BaseTy bt; ++ int x, y; ++}; ++void c_func_(struct Ty *t, int *a) { ++ printf("%d\t", t->x); ++ printf("%d\t", t->y); ++ printf("%d\n", *a); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/015_fortran_call_c_special_case/c_func004.c b/test/interoperability_with_c_fortran_call_c/015_fortran_call_c_special_case/c_func004.c +new file mode 100644 +index 0000000..f35b45c +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/015_fortran_call_c_special_case/c_func004.c +@@ -0,0 +1,16 @@ ++#include ++#include ++struct BaseTy { ++ int_fast16_t j[2]; ++}; ++struct Ty { ++ struct BaseTy bt; ++ int_fast16_t x, y; ++}; ++void c_func_(struct Ty *t, int_fast16_t *a) { ++ printf("%ld\t", t->bt.j[0]); ++ printf("%ld\t", t->bt.j[1]); ++ printf("%ld\t", t->x); ++ printf("%ld\t", t->y); ++ printf("%ld\n", *a); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/015_fortran_call_c_special_case/c_func005.c b/test/interoperability_with_c_fortran_call_c/015_fortran_call_c_special_case/c_func005.c +new file mode 100644 +index 0000000..4d6e335 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/015_fortran_call_c_special_case/c_func005.c +@@ -0,0 +1,16 @@ ++#include ++#include ++struct BaseTy { ++ int_fast32_t j[2]; ++}; ++struct Ty { ++ struct BaseTy bt; ++ int_fast32_t x, y; ++}; ++void c_func_(struct Ty *t, int_fast32_t *a) { ++ printf("%ld\t", t->bt.j[0]); ++ printf("%ld\t", t->bt.j[1]); ++ printf("%ld\t", t->x); ++ printf("%ld\t", t->y); ++ printf("%ld\n", *a); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/015_fortran_call_c_special_case/c_func006.c b/test/interoperability_with_c_fortran_call_c/015_fortran_call_c_special_case/c_func006.c +new file mode 100644 +index 0000000..48600a8 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/015_fortran_call_c_special_case/c_func006.c +@@ -0,0 +1,16 @@ ++#include ++#include ++struct BaseTy { ++ intmax_t j[2]; ++}; ++struct Ty { ++ struct BaseTy bt; ++ intmax_t x, y; ++}; ++void c_func_(struct Ty *t, intmax_t *a) { ++ printf("%ld\t", t->bt.j[0]); ++ printf("%ld\t", t->bt.j[1]); ++ printf("%ld\t", t->x); ++ printf("%ld\t", t->y); ++ printf("%ld\n", *a); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/015_fortran_call_c_special_case/fortran_main001.f90 b/test/interoperability_with_c_fortran_call_c/015_fortran_call_c_special_case/fortran_main001.f90 +new file mode 100644 +index 0000000..8247452 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/015_fortran_call_c_special_case/fortran_main001.f90 +@@ -0,0 +1,11 @@ ++! Test fortran call c for an array of integer and the array is null ++! ++program main ++ integer :: my_x(0) ++ interface ++ subroutine c_func(b) ++ integer :: b(0) ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/015_fortran_call_c_special_case/fortran_main002.f90 b/test/interoperability_with_c_fortran_call_c/015_fortran_call_c_special_case/fortran_main002.f90 +new file mode 100644 +index 0000000..f32f396 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/015_fortran_call_c_special_case/fortran_main002.f90 +@@ -0,0 +1,16 @@ ++! Test fortran call c for the derived type and one component of the ++! derived type is a null array ++! ++program main ++ type, bind(c) :: t ++ integer :: x(0) ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) ++ import :: t ++ type(t) :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/015_fortran_call_c_special_case/fortran_main003.f90 b/test/interoperability_with_c_fortran_call_c/015_fortran_call_c_special_case/fortran_main003.f90 +new file mode 100644 +index 0000000..7130845 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/015_fortran_call_c_special_case/fortran_main003.f90 +@@ -0,0 +1,24 @@ ++! Test fortran call c for the derived type and one component of the ++! derived type is a null derived type ++! ++program main ++ use iso_c_binding ++ type, bind(c) :: base ++ end type base ++ type, bind(c) :: t ++ type(base) :: bt ++ integer(C_INT) :: x = -2147483647 ++ integer(C_INT) :: y = 2147483647 ++ end type t ++ type(t) :: my_t ++ integer(C_INT) :: my_x = 3 ++ interface ++ subroutine c_func(a, b) ++ use iso_c_binding ++ import :: t ++ type(t) :: a ++ integer(C_INT) :: b ++ end ++ end interface ++ call c_func(my_t, my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/015_fortran_call_c_special_case/fortran_main004.f90 b/test/interoperability_with_c_fortran_call_c/015_fortran_call_c_special_case/fortran_main004.f90 +new file mode 100644 +index 0000000..2d50b2b +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/015_fortran_call_c_special_case/fortran_main004.f90 +@@ -0,0 +1,24 @@ ++! Test fortran call c for composite scenario of type int_fast16_t ++! ++program main ++ use iso_c_binding ++ type, bind(c) :: base ++ integer(C_INT_FAST16_T) :: j(2) = -2 ++ end type base ++ type, bind(c) :: t ++ type(base) :: bt ++ integer(C_INT_FAST16_T) :: x = -32768 ++ integer(C_INT_FAST16_T) :: y = 32767 ++ end type t ++ type(t) :: my_t ++ integer(C_INT_FAST16_T) :: my_x = 3 ++ interface ++ subroutine c_func(a, b) ++ use iso_c_binding ++ import :: t ++ type(t) :: a ++ integer(C_INT_FAST16_T) :: b ++ end ++ end interface ++ call c_func(my_t, my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/015_fortran_call_c_special_case/fortran_main005.f90 b/test/interoperability_with_c_fortran_call_c/015_fortran_call_c_special_case/fortran_main005.f90 +new file mode 100644 +index 0000000..c084956 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/015_fortran_call_c_special_case/fortran_main005.f90 +@@ -0,0 +1,24 @@ ++! Test fortran call c for composite scenario of type int_fast32_t ++! ++program main ++ use iso_c_binding ++ type, bind(c) :: base ++ integer(C_INT_FAST32_T) :: j(2) = -2 ++ end type base ++ type, bind(c) :: t ++ type(base) :: bt ++ integer(C_INT_FAST32_T) :: x = -2147483647 ++ integer(C_INT_FAST32_T) :: y = 2147483647 ++ end type t ++ type(t) :: my_t ++ integer(C_INT_FAST32_T) :: my_x = 3 ++ interface ++ subroutine c_func(a, b) ++ use iso_c_binding ++ import :: t ++ type(t) :: a ++ integer(C_INT_FAST32_T) :: b ++ end ++ end interface ++ call c_func(my_t, my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/015_fortran_call_c_special_case/fortran_main006.f90 b/test/interoperability_with_c_fortran_call_c/015_fortran_call_c_special_case/fortran_main006.f90 +new file mode 100644 +index 0000000..681705c +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/015_fortran_call_c_special_case/fortran_main006.f90 +@@ -0,0 +1,24 @@ ++! Test fortran call c for composite scenario of type intmax_t ++! ++program main ++ use iso_c_binding ++ type, bind(c) :: base ++ integer(C_INTMAX_T) :: j(2) = -2 ++ end type base ++ type, bind(c) :: t ++ type(base) :: bt ++ integer(C_INTMAX_T) :: x = -2147483647 ++ integer(C_INTMAX_T) :: y = 2147483647 ++ end type t ++ type(t) :: my_t ++ integer(C_INTMAX_T) :: my_x = 3 ++ interface ++ subroutine c_func(a, b) ++ use iso_c_binding ++ import :: t ++ type(t) :: a ++ integer(C_INTMAX_T) :: b ++ end ++ end interface ++ call c_func(my_t, my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/015_fortran_call_c_special_case/run.sh b/test/interoperability_with_c_fortran_call_c/015_fortran_call_c_special_case/run.sh +new file mode 100644 +index 0000000..b865403 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/015_fortran_call_c_special_case/run.sh +@@ -0,0 +1,16 @@ ++for i in {001..028} ++do ++echo "------- test $i ------." ++#echo "----- gfortran result:" ++#gcc c_func$i.c -c -o c-test.o ++#gfortran fortran_main$i.f90 -fno-range-check -c -o fortran-test.o ++#gfortran c-test.o fortran-test.o ++#./a.out ++#rm *.o a.out ++echo "----- flang-new result : " ++clang c_func$i.c -c -o c-test.o ++flang-new fortran_main$i.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o a.out ++done +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c/016_fortran_call_c_string/c_func001.c b/test/interoperability_with_c_fortran_call_c/016_fortran_call_c_string/c_func001.c +new file mode 100644 +index 0000000..8df9e4b +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/016_fortran_call_c_string/c_func001.c +@@ -0,0 +1,8 @@ ++#include ++#include ++void c_func_(char *s) ++{ ++ char str1[4]; ++ strcpy(str1, s); ++ printf("the string is:%s\n", str1); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c/016_fortran_call_c_string/c_func002.c b/test/interoperability_with_c_fortran_call_c/016_fortran_call_c_string/c_func002.c +new file mode 100644 +index 0000000..22ed279 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/016_fortran_call_c_string/c_func002.c +@@ -0,0 +1,11 @@ ++#include ++#include ++#include ++void c_func_(char *s) ++{ ++ char *str1; ++ str1 = (char*) malloc(4 * sizeof(char)); ++ strcpy(str1, s); ++ printf("the string is:%s\n", str1); ++ free(str1); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c/016_fortran_call_c_string/c_func003.c b/test/interoperability_with_c_fortran_call_c/016_fortran_call_c_string/c_func003.c +new file mode 100644 +index 0000000..6d6d589 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/016_fortran_call_c_string/c_func003.c +@@ -0,0 +1,16 @@ ++#include ++#include ++#include ++void c_func_(char *s) ++{ ++ char **str1; ++ str1 = (char **) malloc(4 * sizeof(char *)); ++ for(int i = 0; i < 4; i++) { ++ str1[i] = (char * )malloc(4 * sizeof(char)); ++ for(int j = 0; j < 4; j++) { ++ str1[i][j] = s[i * 4 + j]; ++ } ++ printf("the string%d is:%s\n", i+1, str1[i]); ++ } ++ free(str1); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c/016_fortran_call_c_string/c_func004.c b/test/interoperability_with_c_fortran_call_c/016_fortran_call_c_string/c_func004.c +new file mode 100644 +index 0000000..5bd6a5a +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/016_fortran_call_c_string/c_func004.c +@@ -0,0 +1,10 @@ ++#include ++#include ++#include ++char* c_func_(char *s) ++{ ++ for(int i = 0; i < 4; i++) { ++ s[i]++; ++ } ++ return s; ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c/016_fortran_call_c_string/c_func005.c b/test/interoperability_with_c_fortran_call_c/016_fortran_call_c_string/c_func005.c +new file mode 100644 +index 0000000..6d7781a +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/016_fortran_call_c_string/c_func005.c +@@ -0,0 +1,11 @@ ++#include ++#include ++#include ++void c_func_(char *in, char *out) ++{ ++ int i = 0; ++ while(in[i] != '\0') { ++ out[i] = in[i]; ++ i++; ++ } ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c/016_fortran_call_c_string/fortran_main001.f90 b/test/interoperability_with_c_fortran_call_c/016_fortran_call_c_string/fortran_main001.f90 +new file mode 100644 +index 0000000..aa23d5d +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/016_fortran_call_c_string/fortran_main001.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the char array and use character array to ++! store data in C files ++! ++program main ++ character :: my_x(4) = 'abcd' ++ interface ++ subroutine c_func(b) ++ character :: b(4) ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/016_fortran_call_c_string/fortran_main002.f90 b/test/interoperability_with_c_fortran_call_c/016_fortran_call_c_string/fortran_main002.f90 +new file mode 100644 +index 0000000..e9f831e +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/016_fortran_call_c_string/fortran_main002.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the char array and use character pointer to ++! store data in C files ++! ++program main ++ character :: my_x(4) = 'abcd' ++ interface ++ subroutine c_func(b) ++ character :: b(4) ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/016_fortran_call_c_string/fortran_main003.f90 b/test/interoperability_with_c_fortran_call_c/016_fortran_call_c_string/fortran_main003.f90 +new file mode 100644 +index 0000000..105de51 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/016_fortran_call_c_string/fortran_main003.f90 +@@ -0,0 +1,16 @@ ++! Test fortran call c for the char two-dimensional array ++! ++program main ++ character, dimension(4, 4) :: my_x ++ interface ++ subroutine c_func(b) ++ character, dimension(4, 4) :: b ++ end ++ end interface ++ do i = 1, 4 ++ do j = 1, 4 ++ my_x(i, j) = ACHAR(64 + i + j) ++ end do ++ end do ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/016_fortran_call_c_string/fortran_main004.f90 b/test/interoperability_with_c_fortran_call_c/016_fortran_call_c_string/fortran_main004.f90 +new file mode 100644 +index 0000000..78a3e48 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/016_fortran_call_c_string/fortran_main004.f90 +@@ -0,0 +1,15 @@ ++! Test fortran call c for the char array and return char pointer ++! ++program main ++ character :: my_x(4) = 'abcd' ++ character :: r(4) ++ interface ++ function c_func(b) result(res) bind(c, name = "c_func_") ++ character :: b(4) ++ character, pointer :: res ++ end ++ end interface ++ print *, c_func(my_x) ++ r = c_func(my_x) ++ print *, r ++end +diff --git a/test/interoperability_with_c_fortran_call_c/016_fortran_call_c_string/fortran_main005.f90 b/test/interoperability_with_c_fortran_call_c/016_fortran_call_c_string/fortran_main005.f90 +new file mode 100644 +index 0000000..46b8a73 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/016_fortran_call_c_string/fortran_main005.f90 +@@ -0,0 +1,13 @@ ++! Test fortran call c for the char dynamic arrays ++! ++program main ++ character(len = 9) :: my_x = 'abcddbcaw' ++ interface ++ subroutine c_func(a, b) ++ character, dimension(*) :: a, b ++ end ++ end interface ++ character, dimension(9) :: res ++ call c_func(my_x, res) ++ print *, res ++end +diff --git a/test/interoperability_with_c_fortran_call_c/016_fortran_call_c_string/run.sh b/test/interoperability_with_c_fortran_call_c/016_fortran_call_c_string/run.sh +new file mode 100644 +index 0000000..8fc2dc0 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/016_fortran_call_c_string/run.sh +@@ -0,0 +1,16 @@ ++for i in {001..005} ++do ++echo "------- test $i ------." ++#echo "----- gfortran result:" ++#gcc c_func$i.c -c -o c-test.o ++#gfortran fortran_main$i.f90 -fno-range-check -c -o fortran-test.o ++#gfortran c-test.o fortran-test.o ++#./a.out ++#rm *.o a.out ++echo "----- flang-new result : " ++clang c_func$i.c -c -o c-test.o ++flang-new fortran_main$i.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o a.out ++done +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c/017_fortran_call_c_pointer/c_func001.c b/test/interoperability_with_c_fortran_call_c/017_fortran_call_c_pointer/c_func001.c +new file mode 100644 +index 0000000..f8cbea0 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/017_fortran_call_c_pointer/c_func001.c +@@ -0,0 +1,7 @@ ++#include ++#include ++void c_func_(int *s) ++{ ++ *s = 2; ++ printf("the num is:%d\n", *s); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c/017_fortran_call_c_pointer/c_func002.c b/test/interoperability_with_c_fortran_call_c/017_fortran_call_c_pointer/c_func002.c +new file mode 100644 +index 0000000..f8cbea0 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/017_fortran_call_c_pointer/c_func002.c +@@ -0,0 +1,7 @@ ++#include ++#include ++void c_func_(int *s) ++{ ++ *s = 2; ++ printf("the num is:%d\n", *s); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c/017_fortran_call_c_pointer/c_func003.c b/test/interoperability_with_c_fortran_call_c/017_fortran_call_c_pointer/c_func003.c +new file mode 100644 +index 0000000..1964fe8 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/017_fortran_call_c_pointer/c_func003.c +@@ -0,0 +1,8 @@ ++#include ++#include ++void c_func_(int *s) ++{ ++ for(int i = 0;i < sizeof(s); i++) { ++ s[i] = i; ++ } ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c/017_fortran_call_c_pointer/c_func004.c b/test/interoperability_with_c_fortran_call_c/017_fortran_call_c_pointer/c_func004.c +new file mode 100644 +index 0000000..4822ea9 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/017_fortran_call_c_pointer/c_func004.c +@@ -0,0 +1,8 @@ ++#include ++#include ++void c_func_(int *s) ++{ ++ for(int i = 0;i < sizeof(s); i++) { ++ s[i] = 0; ++ } ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c/017_fortran_call_c_pointer/fortran_main001.f90 b/test/interoperability_with_c_fortran_call_c/017_fortran_call_c_pointer/fortran_main001.f90 +new file mode 100644 +index 0000000..87908b1 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/017_fortran_call_c_pointer/fortran_main001.f90 +@@ -0,0 +1,17 @@ ++! Test fortran call c for the pointer type and allocate a free space ++! for the pointer ++! ++program main ++ integer, pointer :: my_x ++ interface ++ subroutine c_func(b) ++ integer :: b ++ end ++ end interface ++ allocate(my_x) ++ my_x = 1 ++ print *, my_x ++ call c_func(my_x) ++ print *, my_x ++ deallocate(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/017_fortran_call_c_pointer/fortran_main002.f90 b/test/interoperability_with_c_fortran_call_c/017_fortran_call_c_pointer/fortran_main002.f90 +new file mode 100644 +index 0000000..78f8a20 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/017_fortran_call_c_pointer/fortran_main002.f90 +@@ -0,0 +1,18 @@ ++! Test fortran call c for the pointer type and let the pointer point to ++! a target variable ++! ++program main ++ integer, pointer :: my_x ++ integer, target :: x = 3 ++ interface ++ subroutine c_func(b) ++ integer :: b ++ end ++ end interface ++ allocate(my_x) ++ my_x => x ++ print *, my_x ++ call c_func(my_x) ++ print *, my_x ++ print *, x ++end +diff --git a/test/interoperability_with_c_fortran_call_c/017_fortran_call_c_pointer/fortran_main003.f90 b/test/interoperability_with_c_fortran_call_c/017_fortran_call_c_pointer/fortran_main003.f90 +new file mode 100644 +index 0000000..99c2ca4 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/017_fortran_call_c_pointer/fortran_main003.f90 +@@ -0,0 +1,20 @@ ++! Test fortran call c for the pointer type and let the pointer point to ++! a target variable array ++! ++program main ++ integer, pointer :: my_x(:) ++ integer, target :: x(10) ++ interface ++ subroutine c_func(b) ++ integer, dimension(*) :: b ++ end ++ end interface ++ do i =1, 10 ++ x(i) = i ++ end do ++ my_x => x(5: 10) ++ print *, my_x ++ call c_func(my_x) ++ print *, my_x ++ print *, x ++end +diff --git a/test/interoperability_with_c_fortran_call_c/017_fortran_call_c_pointer/fortran_main004.f90 b/test/interoperability_with_c_fortran_call_c/017_fortran_call_c_pointer/fortran_main004.f90 +new file mode 100644 +index 0000000..149c338 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/017_fortran_call_c_pointer/fortran_main004.f90 +@@ -0,0 +1,23 @@ ++! Test fortran call c for the pointer type and let the pointer point to ++! a target two-dimensional array ++! ++program main ++ integer, pointer :: my_x(:, :) ++ integer, target :: x(4, 4) ++ interface ++ subroutine c_func(b) ++ integer, dimension(*) :: b ++ end ++ end interface ++ do i =1, 4 ++ do j = 1, 4 ++ x(i, j) = i + j ++ end do ++ end do ++ my_x => x(1: 2, 2: 3) ++ print *, x ++ print *, my_x ++ call c_func(my_x) ++ print *, my_x ++ print *, x ++end +diff --git a/test/interoperability_with_c_fortran_call_c/017_fortran_call_c_pointer/run.sh b/test/interoperability_with_c_fortran_call_c/017_fortran_call_c_pointer/run.sh +new file mode 100644 +index 0000000..552627d +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/017_fortran_call_c_pointer/run.sh +@@ -0,0 +1,16 @@ ++for i in {001..004} ++do ++echo "------- test $i ------." ++#echo "----- gfortran result:" ++#gcc c_func$i.c -c -o c-test.o ++#gfortran fortran_main$i.f90 -fno-range-check -c -o fortran-test.o ++#gfortran c-test.o fortran-test.o ++#./a.out ++#rm *.o a.out ++echo "----- flang-new result : " ++clang c_func$i.c -c -o c-test.o ++flang-new fortran_main$i.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o a.out ++done +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/c_func001.c b/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/c_func001.c +new file mode 100755 +index 0000000..042849e +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/c_func001.c +@@ -0,0 +1,8 @@ ++#include ++struct Ty { ++ int x, y; ++}; ++void c_func_(struct Ty *t) { ++ printf("%d\t", t->x); ++ printf("%d\n", t->y); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/c_func002.c b/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/c_func002.c +new file mode 100755 +index 0000000..ad72ffd +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/c_func002.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ short x, y; ++}; ++void c_func_(struct Ty *t) { ++ printf("%hd\t", t->x); ++ printf("%hd\n", t->y); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/c_func003.c b/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/c_func003.c +new file mode 100755 +index 0000000..78540c0 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/c_func003.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ long x, y; ++}; ++void c_func_(struct Ty *t) { ++ printf("%ld\t", t->x); ++ printf("%ld\n", t->y); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/c_func004.c b/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/c_func004.c +new file mode 100755 +index 0000000..83bc034 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/c_func004.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ long long x, y; ++}; ++void c_func_(struct Ty *t) { ++ printf("%lld\t", t->x); ++ printf("%lld\n", t->y); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/c_func005.c b/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/c_func005.c +new file mode 100755 +index 0000000..f0ec8b1 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/c_func005.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ signed char x, y; ++}; ++void c_func_(struct Ty *t) { ++ printf("%c\t", t->x); ++ printf("%c\n", t->y); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/c_func006.c b/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/c_func006.c +new file mode 100755 +index 0000000..a37766e +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/c_func006.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ size_t x, y; ++}; ++void c_func_(struct Ty *t) { ++ printf("%ld\t", t->x); ++ printf("%ld\n", t->y); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/c_func007.c b/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/c_func007.c +new file mode 100755 +index 0000000..71c4460 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/c_func007.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ int8_t x, y; ++}; ++void c_func_(struct Ty *t) { ++ printf("%hhd\t", t->x); ++ printf("%hhd\n", t->y); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/c_func008.c b/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/c_func008.c +new file mode 100755 +index 0000000..cc4c156 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/c_func008.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ int16_t x, y; ++}; ++void c_func_(struct Ty *t) { ++ printf("%hd\t", t->x); ++ printf("%hd\n", t->y); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/c_func009.c b/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/c_func009.c +new file mode 100755 +index 0000000..81c3db1 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/c_func009.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ int32_t x, y; ++}; ++void c_func_(struct Ty *t) { ++ printf("%d\t", t->x); ++ printf("%d\n", t->y); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/c_func010.c b/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/c_func010.c +new file mode 100755 +index 0000000..0d8b990 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/c_func010.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ int64_t x,y; ++}; ++void c_func_(struct Ty *t) { ++ printf("%ld\t", t->x); ++ printf("%ld\n", t->y); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/c_func011.c b/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/c_func011.c +new file mode 100755 +index 0000000..9d65b2a +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/c_func011.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ int_least8_t x, y; ++}; ++void c_func_(struct Ty *t) { ++ printf("%hhd\t", t->x); ++ printf("%hhd\n", t->y); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/c_func012.c b/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/c_func012.c +new file mode 100755 +index 0000000..e77ab58 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/c_func012.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ int_least16_t x, y; ++}; ++void c_func_(struct Ty *t) { ++ printf("%hd\t", t->x); ++ printf("%hd\n", t->y); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/c_func013.c b/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/c_func013.c +new file mode 100755 +index 0000000..c37c94e +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/c_func013.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ int_least32_t x, y; ++}; ++void c_func_(struct Ty *t) { ++ printf("%d\t", t->x); ++ printf("%d\n", t->y); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/c_func014.c b/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/c_func014.c +new file mode 100755 +index 0000000..6f8a5b4 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/c_func014.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ int_least64_t x, y; ++}; ++void c_func_(struct Ty *t) { ++ printf("%ld\t", t->x); ++ printf("%ld\n", t->y); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/c_func015.c b/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/c_func015.c +new file mode 100755 +index 0000000..9308c5b +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/c_func015.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ int_fast8_t x, y; ++}; ++void c_func_(struct Ty *t) { ++ printf("%hhd\t", t->x); ++ printf("%hhd\n", t->y); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/c_func016.c b/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/c_func016.c +new file mode 100755 +index 0000000..1bdc74a +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/c_func016.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ int_fast16_t x, y; ++}; ++void c_func_(struct Ty *t) { ++ printf("%ld\t", t->x); ++ printf("%ld\n", t->y); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/c_func017.c b/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/c_func017.c +new file mode 100755 +index 0000000..017daeb +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/c_func017.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ int_fast32_t x, y; ++}; ++void c_func_(struct Ty *t) { ++ printf("%ld\t", t->x); ++ printf("%ld\n", t->y); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/c_func018.c b/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/c_func018.c +new file mode 100755 +index 0000000..3ab58e9 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/c_func018.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ int_fast64_t x, y; ++}; ++void c_func_(struct Ty *t) { ++ printf("%ld\t", t->x); ++ printf("%ld\n", t->y); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/c_func019.c b/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/c_func019.c +new file mode 100755 +index 0000000..9c68e8d +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/c_func019.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ intmax_t x, y; ++}; ++void c_func_(struct Ty *t) { ++ printf("%ld\t", t->x); ++ printf("%ld\n", t->y); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/c_func020.c b/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/c_func020.c +new file mode 100755 +index 0000000..9c41124 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/c_func020.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ intptr_t x, y; ++}; ++void c_func_(struct Ty *t) { ++ printf("%ld\t", t->x); ++ printf("%ld\n", t->y); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/c_func021.c b/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/c_func021.c +new file mode 100755 +index 0000000..33704de +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/c_func021.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ float x, y; ++}; ++void c_func_(struct Ty *t) { ++ printf("%f\t", t->x); ++ printf("%f\n", t->y); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/c_func022.c b/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/c_func022.c +new file mode 100755 +index 0000000..e8beea1 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/c_func022.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ double x, y; ++}; ++void c_func_(struct Ty *t) { ++ printf("%0.20lf\t", t->x); ++ printf("%0.20lf\n", t->y); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/c_func023.c b/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/c_func023.c +new file mode 100755 +index 0000000..a735b8d +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/c_func023.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ long double x, y; ++}; ++void c_func_(struct Ty *t) { ++ printf("%0.20Lf\t", t->x); ++ printf("%0.20Lf\n", t->y); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/c_func024.c b/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/c_func024.c +new file mode 100755 +index 0000000..aff5eaf +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/c_func024.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ float _Complex x, y; ++}; ++void c_func_(struct Ty *t) { ++ printf("%f + %fi\n", creal(t->x), cimag(t->x)); ++ printf("%f + %fi\n", creal(t->y), cimag(t->y)); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/c_func025.c b/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/c_func025.c +new file mode 100755 +index 0000000..cac2da2 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/c_func025.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ double _Complex x, y; ++}; ++void c_func_(struct Ty *t) { ++ printf("%lf + %lfi\n", creal(t->x), cimag(t->x)); ++ printf("%lf + %lfi\n", creal(t->y), cimag(t->y)); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/c_func026.c b/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/c_func026.c +new file mode 100755 +index 0000000..886667b +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/c_func026.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ long double _Complex x, y; ++}; ++void c_func_(struct Ty *t) { ++ printf("%f + %fi\n", creal(t->x), cimag(t->x)); ++ printf("%f + %fi\n", creal(t->y), cimag(t->y)); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/c_func027.c b/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/c_func027.c +new file mode 100755 +index 0000000..ef8ac27 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/c_func027.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ _Bool x, y; ++}; ++void c_func_(struct Ty *t) { ++ printf("%d\t", t->x); ++ printf("%d\n", t->y); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/c_func028.c b/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/c_func028.c +new file mode 100755 +index 0000000..1b00b60 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/c_func028.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ char x, y; ++}; ++void c_func_(struct Ty *t) { ++ printf("%c\t", t->x); ++ printf("%c\n", t->y); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/fortran_main001.f90 b/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/fortran_main001.f90 +new file mode 100755 +index 0000000..908fbdf +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/fortran_main001.f90 +@@ -0,0 +1,17 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type int ++! ++program main ++ type :: t ++ integer :: x = -2147483647 ++ integer :: y = 2147483647 ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) ++ import :: t ++ type(t) :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/fortran_main002.f90 b/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/fortran_main002.f90 +new file mode 100755 +index 0000000..b42f21e +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/fortran_main002.f90 +@@ -0,0 +1,17 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type short ++! ++program main ++ type :: t ++ integer(2) :: x = -32768 ++ integer(2) :: y = 32767 ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) ++ import :: t ++ type(t) :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/fortran_main003.f90 b/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/fortran_main003.f90 +new file mode 100755 +index 0000000..4ef184f +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/fortran_main003.f90 +@@ -0,0 +1,17 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type long ++! ++program main ++ type :: t ++ integer(8) :: x = -2147483647 ++ integer(8) :: y = 2147483647 ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) ++ import :: t ++ type(t) :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/fortran_main004.f90 b/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/fortran_main004.f90 +new file mode 100755 +index 0000000..636140d +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/fortran_main004.f90 +@@ -0,0 +1,17 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type long long ++! ++program main ++ type :: t ++ integer(8) :: x = -9223372036854775807 ++ integer(8) :: y = 9223372036854775807 ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) ++ import :: t ++ type(t) :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/fortran_main005.f90 b/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/fortran_main005.f90 +new file mode 100755 +index 0000000..220b2c5 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/fortran_main005.f90 +@@ -0,0 +1,17 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type signed char ++! ++program main ++ type :: t ++ integer(1) :: x = 65 ++ integer(1) :: y = 66 ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) ++ import :: t ++ type(t) :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/fortran_main006.f90 b/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/fortran_main006.f90 +new file mode 100755 +index 0000000..570af7d +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/fortran_main006.f90 +@@ -0,0 +1,17 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type size_t ++! ++program main ++ type :: t ++ integer(8) :: x = 0 ++ integer(8) :: y = 9223372036854775807 ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) ++ import :: t ++ type(t) :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/fortran_main007.f90 b/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/fortran_main007.f90 +new file mode 100755 +index 0000000..00e3dc9 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/fortran_main007.f90 +@@ -0,0 +1,17 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type int8_t ++! ++program main ++ type :: t ++ integer(1) :: x = -128 ++ integer(1) :: y = 127 ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) ++ import :: t ++ type(t) :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/fortran_main008.f90 b/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/fortran_main008.f90 +new file mode 100755 +index 0000000..ee668bc +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/fortran_main008.f90 +@@ -0,0 +1,17 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type int16_t ++! ++program main ++ type :: t ++ integer(2) :: x = -32768 ++ integer(2) :: y = 32767 ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) ++ import :: t ++ type(t) :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/fortran_main009.f90 b/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/fortran_main009.f90 +new file mode 100755 +index 0000000..f2afc38 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/fortran_main009.f90 +@@ -0,0 +1,17 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type int32_t ++! ++program main ++ type :: t ++ integer(4) :: x = -2147483647 ++ integer(4) :: y = 2147483647 ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) ++ import :: t ++ type(t) :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/fortran_main010.f90 b/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/fortran_main010.f90 +new file mode 100755 +index 0000000..f683925 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/fortran_main010.f90 +@@ -0,0 +1,17 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type int64_t ++! ++program main ++ type :: t ++ integer(8) :: x = -9223372036854775807 ++ integer(8) :: y = 9223372036854775807 ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) ++ import :: t ++ type(t) :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/fortran_main011.f90 b/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/fortran_main011.f90 +new file mode 100755 +index 0000000..0819311 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/fortran_main011.f90 +@@ -0,0 +1,17 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type int_least8_t ++! ++program main ++ type :: t ++ integer(1) :: x = -128 ++ integer(1) :: y = 127 ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) ++ import :: t ++ type(t) :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/fortran_main012.f90 b/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/fortran_main012.f90 +new file mode 100755 +index 0000000..86fb06d +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/fortran_main012.f90 +@@ -0,0 +1,17 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type int_least16_t ++! ++program main ++ type :: t ++ integer(2) :: x = -32768 ++ integer(2) :: y = 32767 ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) ++ import :: t ++ type(t) :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/fortran_main013.f90 b/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/fortran_main013.f90 +new file mode 100755 +index 0000000..a7ad109 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/fortran_main013.f90 +@@ -0,0 +1,17 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type int_least32_t ++! ++program main ++ type :: t ++ integer(4) :: x = -2147483647 ++ integer(4) :: y = 2147483647 ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) ++ import :: t ++ type(t) :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/fortran_main014.f90 b/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/fortran_main014.f90 +new file mode 100755 +index 0000000..5e38bc1 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/fortran_main014.f90 +@@ -0,0 +1,17 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type int_least64_t ++! ++program main ++ type :: t ++ integer(8) :: x = -9223372036854775807 ++ integer(8) :: y = 9223372036854775807 ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) ++ import :: t ++ type(t) :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/fortran_main015.f90 b/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/fortran_main015.f90 +new file mode 100755 +index 0000000..f4c1206 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/fortran_main015.f90 +@@ -0,0 +1,17 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type int_fast8_t ++! ++program main ++ type :: t ++ integer(1) :: x = -128 ++ integer(1) :: y = 127 ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) ++ import :: t ++ type(t) :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/fortran_main016.f90 b/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/fortran_main016.f90 +new file mode 100755 +index 0000000..47b7225 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/fortran_main016.f90 +@@ -0,0 +1,17 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type int_fast16_t ++! ++program main ++ type :: t ++ integer(8) :: x = -32768 ++ integer(8) :: y = 32767 ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) ++ import :: t ++ type(t) :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/fortran_main017.f90 b/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/fortran_main017.f90 +new file mode 100755 +index 0000000..ae54ebf +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/fortran_main017.f90 +@@ -0,0 +1,17 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type int_fast32_t ++! ++program main ++ type :: t ++ integer(8) :: x = -2147483647 ++ integer(8) :: y = 2147483647 ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) ++ import :: t ++ type(t) :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/fortran_main018.f90 b/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/fortran_main018.f90 +new file mode 100755 +index 0000000..d483e87 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/fortran_main018.f90 +@@ -0,0 +1,17 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type int_fast64_t ++! ++program main ++ type :: t ++ integer(8) :: x = -9223372036854775807 ++ integer(8) :: y = 9223372036854775807 ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) ++ import :: t ++ type(t) :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/fortran_main019.f90 b/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/fortran_main019.f90 +new file mode 100755 +index 0000000..87c0877 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/fortran_main019.f90 +@@ -0,0 +1,17 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type intmax_t ++! ++program main ++ type :: t ++ integer(8) :: x = -9223372036854775807 ++ integer(8) :: y = 9223372036854775807 ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) ++ import :: t ++ type(t) :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/fortran_main020.f90 b/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/fortran_main020.f90 +new file mode 100755 +index 0000000..18d3b49 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/fortran_main020.f90 +@@ -0,0 +1,17 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type intptr_t ++! ++program main ++ type :: t ++ integer(8) :: x = -9223372036854775807 ++ integer(8) :: y = 9223372036854775807 ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) ++ import :: t ++ type(t) :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/fortran_main021.f90 b/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/fortran_main021.f90 +new file mode 100755 +index 0000000..f28143e +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/fortran_main021.f90 +@@ -0,0 +1,17 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type float ++! ++program main ++ type :: t ++ real(4) :: x = 3.14 ++ real(4) :: y = 12345678.7654321 ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) ++ import :: t ++ type(t) :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/fortran_main022.f90 b/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/fortran_main022.f90 +new file mode 100755 +index 0000000..cefa8f8 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/fortran_main022.f90 +@@ -0,0 +1,17 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type double ++! ++program main ++ type :: t ++ real(8) :: x = 3.14159265358979626 ++ real(8) :: y = 12345678.7654321 ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) ++ import :: t ++ type(t) :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/fortran_main023.f90 b/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/fortran_main023.f90 +new file mode 100755 +index 0000000..ca88777 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/fortran_main023.f90 +@@ -0,0 +1,18 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type long double ++! ++program main ++ integer, parameter :: K = selected_real_kind(16) ++ type :: t ++ real(K) :: x = 3.14159265358979626 ++ real(K) :: y = 12345678.7654321 ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) ++ import :: t ++ type(t) :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/fortran_main024.f90 b/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/fortran_main024.f90 +new file mode 100755 +index 0000000..bb08e74 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/fortran_main024.f90 +@@ -0,0 +1,17 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type float _Complex ++! ++program main ++ type :: t ++ complex(4) :: x = (-3, 1) ++ complex(4) :: y = (3, 1) ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) ++ import :: t ++ type(t) :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/fortran_main025.f90 b/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/fortran_main025.f90 +new file mode 100755 +index 0000000..a77c739 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/fortran_main025.f90 +@@ -0,0 +1,17 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type double _Complex ++! ++program main ++ type :: t ++ complex(8) :: x = (-3, 1) ++ complex(8) :: y = (3, 1) ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) ++ import :: t ++ type(t) :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/fortran_main026.f90 b/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/fortran_main026.f90 +new file mode 100755 +index 0000000..2cbf480 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/fortran_main026.f90 +@@ -0,0 +1,18 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type long double _Complex ++! ++program main ++ integer, parameter :: K = selected_real_kind(16) ++ type :: t ++ complex(K) :: x = (-3.1415926, 1.654) ++ complex(K) :: y = (3, 1) ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) ++ import :: t ++ type(t) :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/fortran_main027.f90 b/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/fortran_main027.f90 +new file mode 100755 +index 0000000..b4f71e1 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/fortran_main027.f90 +@@ -0,0 +1,17 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type bool ++! ++program main ++ type :: t ++ logical(1) :: x = .TRUE. ++ logical(1) :: y = .FALSE. ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) ++ import :: t ++ type(t) :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/fortran_main028.f90 b/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/fortran_main028.f90 +new file mode 100755 +index 0000000..b09c1f3 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/fortran_main028.f90 +@@ -0,0 +1,17 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type char ++! ++program main ++ type :: t ++ character(1) :: x = 'b' ++ character(1) :: y = 'c' ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) ++ import :: t ++ type(t) :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/run.sh b/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/run.sh +new file mode 100644 +index 0000000..b865403 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/018_fortran_call_c_struct/run.sh +@@ -0,0 +1,16 @@ ++for i in {001..028} ++do ++echo "------- test $i ------." ++#echo "----- gfortran result:" ++#gcc c_func$i.c -c -o c-test.o ++#gfortran fortran_main$i.f90 -fno-range-check -c -o fortran-test.o ++#gfortran c-test.o fortran-test.o ++#./a.out ++#rm *.o a.out ++echo "----- flang-new result : " ++clang c_func$i.c -c -o c-test.o ++flang-new fortran_main$i.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o a.out ++done +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/c_func001.c b/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/c_func001.c +new file mode 100755 +index 0000000..042849e +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/c_func001.c +@@ -0,0 +1,8 @@ ++#include ++struct Ty { ++ int x, y; ++}; ++void c_func_(struct Ty *t) { ++ printf("%d\t", t->x); ++ printf("%d\n", t->y); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/c_func002.c b/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/c_func002.c +new file mode 100755 +index 0000000..ad72ffd +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/c_func002.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ short x, y; ++}; ++void c_func_(struct Ty *t) { ++ printf("%hd\t", t->x); ++ printf("%hd\n", t->y); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/c_func003.c b/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/c_func003.c +new file mode 100755 +index 0000000..78540c0 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/c_func003.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ long x, y; ++}; ++void c_func_(struct Ty *t) { ++ printf("%ld\t", t->x); ++ printf("%ld\n", t->y); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/c_func004.c b/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/c_func004.c +new file mode 100755 +index 0000000..83bc034 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/c_func004.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ long long x, y; ++}; ++void c_func_(struct Ty *t) { ++ printf("%lld\t", t->x); ++ printf("%lld\n", t->y); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/c_func005.c b/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/c_func005.c +new file mode 100755 +index 0000000..f0ec8b1 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/c_func005.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ signed char x, y; ++}; ++void c_func_(struct Ty *t) { ++ printf("%c\t", t->x); ++ printf("%c\n", t->y); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/c_func006.c b/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/c_func006.c +new file mode 100755 +index 0000000..a37766e +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/c_func006.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ size_t x, y; ++}; ++void c_func_(struct Ty *t) { ++ printf("%ld\t", t->x); ++ printf("%ld\n", t->y); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/c_func007.c b/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/c_func007.c +new file mode 100755 +index 0000000..71c4460 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/c_func007.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ int8_t x, y; ++}; ++void c_func_(struct Ty *t) { ++ printf("%hhd\t", t->x); ++ printf("%hhd\n", t->y); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/c_func008.c b/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/c_func008.c +new file mode 100755 +index 0000000..cc4c156 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/c_func008.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ int16_t x, y; ++}; ++void c_func_(struct Ty *t) { ++ printf("%hd\t", t->x); ++ printf("%hd\n", t->y); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/c_func009.c b/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/c_func009.c +new file mode 100755 +index 0000000..81c3db1 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/c_func009.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ int32_t x, y; ++}; ++void c_func_(struct Ty *t) { ++ printf("%d\t", t->x); ++ printf("%d\n", t->y); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/c_func010.c b/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/c_func010.c +new file mode 100755 +index 0000000..0d8b990 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/c_func010.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ int64_t x,y; ++}; ++void c_func_(struct Ty *t) { ++ printf("%ld\t", t->x); ++ printf("%ld\n", t->y); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/c_func011.c b/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/c_func011.c +new file mode 100755 +index 0000000..9d65b2a +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/c_func011.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ int_least8_t x, y; ++}; ++void c_func_(struct Ty *t) { ++ printf("%hhd\t", t->x); ++ printf("%hhd\n", t->y); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/c_func012.c b/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/c_func012.c +new file mode 100755 +index 0000000..e77ab58 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/c_func012.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ int_least16_t x, y; ++}; ++void c_func_(struct Ty *t) { ++ printf("%hd\t", t->x); ++ printf("%hd\n", t->y); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/c_func013.c b/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/c_func013.c +new file mode 100755 +index 0000000..c37c94e +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/c_func013.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ int_least32_t x, y; ++}; ++void c_func_(struct Ty *t) { ++ printf("%d\t", t->x); ++ printf("%d\n", t->y); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/c_func014.c b/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/c_func014.c +new file mode 100755 +index 0000000..6f8a5b4 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/c_func014.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ int_least64_t x, y; ++}; ++void c_func_(struct Ty *t) { ++ printf("%ld\t", t->x); ++ printf("%ld\n", t->y); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/c_func015.c b/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/c_func015.c +new file mode 100755 +index 0000000..9308c5b +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/c_func015.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ int_fast8_t x, y; ++}; ++void c_func_(struct Ty *t) { ++ printf("%hhd\t", t->x); ++ printf("%hhd\n", t->y); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/c_func016.c b/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/c_func016.c +new file mode 100755 +index 0000000..1bdc74a +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/c_func016.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ int_fast16_t x, y; ++}; ++void c_func_(struct Ty *t) { ++ printf("%ld\t", t->x); ++ printf("%ld\n", t->y); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/c_func017.c b/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/c_func017.c +new file mode 100755 +index 0000000..017daeb +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/c_func017.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ int_fast32_t x, y; ++}; ++void c_func_(struct Ty *t) { ++ printf("%ld\t", t->x); ++ printf("%ld\n", t->y); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/c_func018.c b/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/c_func018.c +new file mode 100755 +index 0000000..3ab58e9 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/c_func018.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ int_fast64_t x, y; ++}; ++void c_func_(struct Ty *t) { ++ printf("%ld\t", t->x); ++ printf("%ld\n", t->y); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/c_func019.c b/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/c_func019.c +new file mode 100755 +index 0000000..9c68e8d +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/c_func019.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ intmax_t x, y; ++}; ++void c_func_(struct Ty *t) { ++ printf("%ld\t", t->x); ++ printf("%ld\n", t->y); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/c_func020.c b/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/c_func020.c +new file mode 100755 +index 0000000..9c41124 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/c_func020.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ intptr_t x, y; ++}; ++void c_func_(struct Ty *t) { ++ printf("%ld\t", t->x); ++ printf("%ld\n", t->y); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/c_func021.c b/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/c_func021.c +new file mode 100755 +index 0000000..33704de +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/c_func021.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ float x, y; ++}; ++void c_func_(struct Ty *t) { ++ printf("%f\t", t->x); ++ printf("%f\n", t->y); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/c_func022.c b/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/c_func022.c +new file mode 100755 +index 0000000..e8beea1 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/c_func022.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ double x, y; ++}; ++void c_func_(struct Ty *t) { ++ printf("%0.20lf\t", t->x); ++ printf("%0.20lf\n", t->y); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/c_func023.c b/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/c_func023.c +new file mode 100755 +index 0000000..a735b8d +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/c_func023.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ long double x, y; ++}; ++void c_func_(struct Ty *t) { ++ printf("%0.20Lf\t", t->x); ++ printf("%0.20Lf\n", t->y); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/c_func024.c b/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/c_func024.c +new file mode 100755 +index 0000000..aff5eaf +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/c_func024.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ float _Complex x, y; ++}; ++void c_func_(struct Ty *t) { ++ printf("%f + %fi\n", creal(t->x), cimag(t->x)); ++ printf("%f + %fi\n", creal(t->y), cimag(t->y)); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/c_func025.c b/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/c_func025.c +new file mode 100755 +index 0000000..cac2da2 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/c_func025.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ double _Complex x, y; ++}; ++void c_func_(struct Ty *t) { ++ printf("%lf + %lfi\n", creal(t->x), cimag(t->x)); ++ printf("%lf + %lfi\n", creal(t->y), cimag(t->y)); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/c_func026.c b/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/c_func026.c +new file mode 100755 +index 0000000..886667b +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/c_func026.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ long double _Complex x, y; ++}; ++void c_func_(struct Ty *t) { ++ printf("%f + %fi\n", creal(t->x), cimag(t->x)); ++ printf("%f + %fi\n", creal(t->y), cimag(t->y)); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/c_func027.c b/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/c_func027.c +new file mode 100755 +index 0000000..ef8ac27 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/c_func027.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ _Bool x, y; ++}; ++void c_func_(struct Ty *t) { ++ printf("%d\t", t->x); ++ printf("%d\n", t->y); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/c_func028.c b/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/c_func028.c +new file mode 100755 +index 0000000..1b00b60 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/c_func028.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ char x, y; ++}; ++void c_func_(struct Ty *t) { ++ printf("%c\t", t->x); ++ printf("%c\n", t->y); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/fortran_main001.f90 b/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/fortran_main001.f90 +new file mode 100755 +index 0000000..f8a10fd +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/fortran_main001.f90 +@@ -0,0 +1,17 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type int with bindc ++! ++program main ++ type, bind(c) :: t ++ integer :: x = -2147483647 ++ integer :: y = 2147483647 ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) bind(c, name = "c_func_") ++ import :: t ++ type(t) :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/fortran_main002.f90 b/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/fortran_main002.f90 +new file mode 100755 +index 0000000..b53b9e7 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/fortran_main002.f90 +@@ -0,0 +1,17 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type short with bindc ++! ++program main ++ type, bind(c) :: t ++ integer(2) :: x = -32768 ++ integer(2) :: y = 32767 ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) bind(c, name = "c_func_") ++ import :: t ++ type(t) :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/fortran_main003.f90 b/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/fortran_main003.f90 +new file mode 100755 +index 0000000..a3d7c1a +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/fortran_main003.f90 +@@ -0,0 +1,17 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type long with bindc ++! ++program main ++ type, bind(c) :: t ++ integer(8) :: x = -2147483647 ++ integer(8) :: y = 2147483647 ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) bind(c, name = "c_func_") ++ import :: t ++ type(t) :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/fortran_main004.f90 b/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/fortran_main004.f90 +new file mode 100755 +index 0000000..d10bb01 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/fortran_main004.f90 +@@ -0,0 +1,17 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type long long with bindc ++! ++program main ++ type, bind(c) :: t ++ integer(8) :: x = -9223372036854775807 ++ integer(8) :: y = 9223372036854775807 ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) bind(c, name = "c_func_") ++ import :: t ++ type(t) :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/fortran_main005.f90 b/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/fortran_main005.f90 +new file mode 100755 +index 0000000..6cabf1e +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/fortran_main005.f90 +@@ -0,0 +1,17 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type signed char with bindc ++! ++program main ++ type, bind(c) :: t ++ integer(1) :: x = 65 ++ integer(1) :: y = 66 ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) bind(c, name = "c_func_") ++ import :: t ++ type(t) :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/fortran_main006.f90 b/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/fortran_main006.f90 +new file mode 100755 +index 0000000..3887fa0 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/fortran_main006.f90 +@@ -0,0 +1,17 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type size_t with bindc ++! ++program main ++ type, bind(c) :: t ++ integer(8) :: x = 0 ++ integer(8) :: y = 9223372036854775807 ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) bind(c, name = "c_func_") ++ import :: t ++ type(t) :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/fortran_main007.f90 b/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/fortran_main007.f90 +new file mode 100755 +index 0000000..1d7951e +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/fortran_main007.f90 +@@ -0,0 +1,17 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type int8_t with bindc ++! ++program main ++ type, bind(c) :: t ++ integer(1) :: x = -128 ++ integer(1) :: y = 127 ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) bind(c, name = "c_func_") ++ import :: t ++ type(t) :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/fortran_main008.f90 b/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/fortran_main008.f90 +new file mode 100755 +index 0000000..6fc5715 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/fortran_main008.f90 +@@ -0,0 +1,17 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type int16_t with bindc ++! ++program main ++ type, bind(c) :: t ++ integer(2) :: x = -32768 ++ integer(2) :: y = 32767 ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) bind(c, name = "c_func_") ++ import :: t ++ type(t) :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/fortran_main009.f90 b/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/fortran_main009.f90 +new file mode 100755 +index 0000000..22b4634 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/fortran_main009.f90 +@@ -0,0 +1,17 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type int32_t with bindc ++! ++program main ++ type, bind(c) :: t ++ integer(4) :: x = -2147483647 ++ integer(4) :: y = 2147483647 ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) bind(c, name = "c_func_") ++ import :: t ++ type(t) :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/fortran_main010.f90 b/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/fortran_main010.f90 +new file mode 100755 +index 0000000..766fd46 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/fortran_main010.f90 +@@ -0,0 +1,17 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type int64_t with bindc ++! ++program main ++ type, bind(c) :: t ++ integer(8) :: x = -9223372036854775807 ++ integer(8) :: y = 9223372036854775807 ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) bind(c, name = "c_func_") ++ import :: t ++ type(t) :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/fortran_main011.f90 b/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/fortran_main011.f90 +new file mode 100755 +index 0000000..a7f9f0b +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/fortran_main011.f90 +@@ -0,0 +1,17 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type int_least8_t with bindc ++! ++program main ++ type, bind(c) :: t ++ integer(1) :: x = -128 ++ integer(1) :: y = 127 ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) bind(c, name = "c_func_") ++ import :: t ++ type(t) :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/fortran_main012.f90 b/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/fortran_main012.f90 +new file mode 100755 +index 0000000..b8499ac +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/fortran_main012.f90 +@@ -0,0 +1,17 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type int_least16_t with bindc ++! ++program main ++ type, bind(c) :: t ++ integer(2) :: x = -32768 ++ integer(2) :: y = 32767 ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) bind(c, name = "c_func_") ++ import :: t ++ type(t) :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/fortran_main013.f90 b/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/fortran_main013.f90 +new file mode 100755 +index 0000000..43e293e +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/fortran_main013.f90 +@@ -0,0 +1,17 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type int_least32_t with bindc ++! ++program main ++ type, bind(c) :: t ++ integer(4) :: x = -2147483647 ++ integer(4) :: y = 2147483647 ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) bind(c, name = "c_func_") ++ import :: t ++ type(t) :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/fortran_main014.f90 b/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/fortran_main014.f90 +new file mode 100755 +index 0000000..455ea93 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/fortran_main014.f90 +@@ -0,0 +1,17 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type int_least64_t with bindc ++! ++program main ++ type, bind(c) :: t ++ integer(8) :: x = -9223372036854775807 ++ integer(8) :: y = 9223372036854775807 ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) bind(c, name = "c_func_") ++ import :: t ++ type(t) :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/fortran_main015.f90 b/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/fortran_main015.f90 +new file mode 100755 +index 0000000..f66e589 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/fortran_main015.f90 +@@ -0,0 +1,17 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type int_fast8_t with bindc ++! ++program main ++ type, bind(c) :: t ++ integer(1) :: x = -128 ++ integer(1) :: y = 127 ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) bind(c, name = "c_func_") ++ import :: t ++ type(t) :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/fortran_main016.f90 b/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/fortran_main016.f90 +new file mode 100755 +index 0000000..3cb82eb +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/fortran_main016.f90 +@@ -0,0 +1,17 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type int_fast16_t with bindc ++! ++program main ++ type, bind(c) :: t ++ integer(8) :: x = -32768 ++ integer(8) :: y = 32767 ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) bind(c, name = "c_func_") ++ import :: t ++ type(t) :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/fortran_main017.f90 b/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/fortran_main017.f90 +new file mode 100755 +index 0000000..2a30b03 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/fortran_main017.f90 +@@ -0,0 +1,17 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type int_fast32_t with bindc ++! ++program main ++ type, bind(c) :: t ++ integer(8) :: x = -2147483647 ++ integer(8) :: y = 2147483647 ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) bind(c, name = "c_func_") ++ import :: t ++ type(t) :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/fortran_main018.f90 b/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/fortran_main018.f90 +new file mode 100755 +index 0000000..498f973 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/fortran_main018.f90 +@@ -0,0 +1,17 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type int_fast64_t with bindc ++! ++program main ++ type, bind(c) :: t ++ integer(8) :: x = -9223372036854775807 ++ integer(8) :: y = 9223372036854775807 ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) bind(c, name = "c_func_") ++ import :: t ++ type(t) :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/fortran_main019.f90 b/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/fortran_main019.f90 +new file mode 100755 +index 0000000..8bb8438 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/fortran_main019.f90 +@@ -0,0 +1,17 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type intmax_t with bindc ++! ++program main ++ type, bind(c) :: t ++ integer(8) :: x = -9223372036854775807 ++ integer(8) :: y = 9223372036854775807 ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) bind(c, name = "c_func_") ++ import :: t ++ type(t) :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/fortran_main020.f90 b/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/fortran_main020.f90 +new file mode 100755 +index 0000000..390252e +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/fortran_main020.f90 +@@ -0,0 +1,17 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type intptr_t with bindc ++! ++program main ++ type, bind(c) :: t ++ integer(8) :: x = -9223372036854775807 ++ integer(8) :: y = 9223372036854775807 ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) bind(c, name = "c_func_") ++ import :: t ++ type(t) :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/fortran_main021.f90 b/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/fortran_main021.f90 +new file mode 100755 +index 0000000..76280d0 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/fortran_main021.f90 +@@ -0,0 +1,17 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type float with bindc ++! ++program main ++ type, bind(c) :: t ++ real(4) :: x = 3.14 ++ real(4) :: y = 12345678.7654321 ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) bind(c, name = "c_func_") ++ import :: t ++ type(t) :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/fortran_main022.f90 b/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/fortran_main022.f90 +new file mode 100755 +index 0000000..7e9c07b +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/fortran_main022.f90 +@@ -0,0 +1,17 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type double with bindc ++! ++program main ++ type, bind(c) :: t ++ real(8) :: x = 3.14159265358979626 ++ real(8) :: y = 12345678.7654321 ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) bind(c, name = "c_func_") ++ import :: t ++ type(t) :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/fortran_main023.f90 b/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/fortran_main023.f90 +new file mode 100755 +index 0000000..9b11204 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/fortran_main023.f90 +@@ -0,0 +1,18 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type long double with bindc ++! ++program main ++ integer, parameter :: K = selected_real_kind(16) ++ type, bind(c) :: t ++ real(K) :: x = 3.14159265358979626 ++ real(K) :: y = 12345678.7654321 ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) bind(c, name = "c_func_") ++ import :: t ++ type(t) :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/fortran_main024.f90 b/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/fortran_main024.f90 +new file mode 100755 +index 0000000..07ba6e3 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/fortran_main024.f90 +@@ -0,0 +1,17 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type float _Complex with bindc ++! ++program main ++ type, bind(c) :: t ++ complex(4) :: x = (-3, 1) ++ complex(4) :: y = (3, 1) ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) bind(c, name = "c_func_") ++ import :: t ++ type(t) :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/fortran_main025.f90 b/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/fortran_main025.f90 +new file mode 100755 +index 0000000..345db90 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/fortran_main025.f90 +@@ -0,0 +1,17 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type double _Complex with bindc ++! ++program main ++ type, bind(c) :: t ++ complex(8) :: x = (-3, 1) ++ complex(8) :: y = (3, 1) ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) bind(c, name = "c_func_") ++ import :: t ++ type(t) :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/fortran_main026.f90 b/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/fortran_main026.f90 +new file mode 100755 +index 0000000..ddff0aa +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/fortran_main026.f90 +@@ -0,0 +1,18 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type long double _Complex with bindc ++! ++program main ++ integer, parameter :: K = selected_real_kind(16) ++ type, bind(c) :: t ++ complex(K) :: x = (-3.1415926, 1.654) ++ complex(K) :: y = (3, 1) ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) bind(c, name = "c_func_") ++ import :: t ++ type(t) :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/fortran_main027.f90 b/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/fortran_main027.f90 +new file mode 100755 +index 0000000..d88a33b +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/fortran_main027.f90 +@@ -0,0 +1,17 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type bool with bindc ++! ++program main ++ type, bind(c) :: t ++ logical(1) :: x = .TRUE. ++ logical(1) :: y = .FALSE. ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) bind(c, name = "c_func_") ++ import :: t ++ type(t) :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/fortran_main028.f90 b/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/fortran_main028.f90 +new file mode 100755 +index 0000000..a95ae9d +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/fortran_main028.f90 +@@ -0,0 +1,17 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type char with bindc ++! ++program main ++ type, bind(c) :: t ++ character(1) :: x = 'b' ++ character(1) :: y = 'c' ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) bind(c, name = "c_func_") ++ import :: t ++ type(t) :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/run.sh b/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/run.sh +new file mode 100644 +index 0000000..b865403 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/019_fortran_call_c_struct_bindc/run.sh +@@ -0,0 +1,16 @@ ++for i in {001..028} ++do ++echo "------- test $i ------." ++#echo "----- gfortran result:" ++#gcc c_func$i.c -c -o c-test.o ++#gfortran fortran_main$i.f90 -fno-range-check -c -o fortran-test.o ++#gfortran c-test.o fortran-test.o ++#./a.out ++#rm *.o a.out ++echo "----- flang-new result : " ++clang c_func$i.c -c -o c-test.o ++flang-new fortran_main$i.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o a.out ++done +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/c_func001.c b/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/c_func001.c +new file mode 100755 +index 0000000..7a8788f +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/c_func001.c +@@ -0,0 +1,8 @@ ++#include ++struct Ty { ++ int x, y; ++}; ++void c_func_(struct Ty t) { ++ printf("%d\t", t.x); ++ printf("%d\n", t.y); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/c_func002.c b/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/c_func002.c +new file mode 100755 +index 0000000..7cba7f9 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/c_func002.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ short x, y; ++}; ++void c_func_(struct Ty t) { ++ printf("%hd\t", t.x); ++ printf("%hd\n", t.y); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/c_func003.c b/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/c_func003.c +new file mode 100755 +index 0000000..41cb86c +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/c_func003.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ long x, y; ++}; ++void c_func_(struct Ty t) { ++ printf("%ld\t", t.x); ++ printf("%ld\n", t.y); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/c_func004.c b/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/c_func004.c +new file mode 100755 +index 0000000..6640290 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/c_func004.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ long long x, y; ++}; ++void c_func_(struct Ty t) { ++ printf("%lld\t", t.x); ++ printf("%lld\n", t.y); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/c_func005.c b/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/c_func005.c +new file mode 100755 +index 0000000..d9a1ec5 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/c_func005.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ signed char x, y; ++}; ++void c_func_(struct Ty t) { ++ printf("%c\t", t.x); ++ printf("%c\n", t.y); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/c_func006.c b/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/c_func006.c +new file mode 100755 +index 0000000..e0b93d1 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/c_func006.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ size_t x, y; ++}; ++void c_func_(struct Ty t) { ++ printf("%ld\t", t.x); ++ printf("%ld\n", t.y); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/c_func007.c b/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/c_func007.c +new file mode 100755 +index 0000000..3b17b2a +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/c_func007.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ int8_t x, y; ++}; ++void c_func_(struct Ty t) { ++ printf("%hhd\t", t.x); ++ printf("%hhd\n", t.y); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/c_func008.c b/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/c_func008.c +new file mode 100755 +index 0000000..08c7afe +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/c_func008.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ int16_t x, y; ++}; ++void c_func_(struct Ty t) { ++ printf("%hd\t", t.x); ++ printf("%hd\n", t.y); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/c_func009.c b/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/c_func009.c +new file mode 100755 +index 0000000..5f3993b +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/c_func009.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ int32_t x, y; ++}; ++void c_func_(struct Ty t) { ++ printf("%d\t", t.x); ++ printf("%d\n", t.y); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/c_func010.c b/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/c_func010.c +new file mode 100755 +index 0000000..3541573 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/c_func010.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ int64_t x,y; ++}; ++void c_func_(struct Ty t) { ++ printf("%ld\t", t.x); ++ printf("%ld\n", t.y); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/c_func011.c b/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/c_func011.c +new file mode 100755 +index 0000000..6901a13 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/c_func011.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ int_least8_t x, y; ++}; ++void c_func_(struct Ty t) { ++ printf("%hhd\t", t.x); ++ printf("%hhd\n", t.y); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/c_func012.c b/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/c_func012.c +new file mode 100755 +index 0000000..5dfb29d +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/c_func012.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ int_least16_t x, y; ++}; ++void c_func_(struct Ty t) { ++ printf("%hd\t", t.x); ++ printf("%hd\n", t.y); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/c_func013.c b/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/c_func013.c +new file mode 100755 +index 0000000..cb167d2 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/c_func013.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ int_least32_t x, y; ++}; ++void c_func_(struct Ty t) { ++ printf("%d\t", t.x); ++ printf("%d\n", t.y); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/c_func014.c b/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/c_func014.c +new file mode 100755 +index 0000000..ed52fea +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/c_func014.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ int_least64_t x, y; ++}; ++void c_func_(struct Ty t) { ++ printf("%ld\t", t.x); ++ printf("%ld\n", t.y); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/c_func015.c b/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/c_func015.c +new file mode 100755 +index 0000000..160b6e2 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/c_func015.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ int_fast8_t x, y; ++}; ++void c_func_(struct Ty t) { ++ printf("%hhd\t", t.x); ++ printf("%hhd\n", t.y); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/c_func016.c b/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/c_func016.c +new file mode 100755 +index 0000000..55557b7 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/c_func016.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ int_fast16_t x, y; ++}; ++void c_func_(struct Ty t) { ++ printf("%ld\t", t.x); ++ printf("%ld\n", t.y); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/c_func017.c b/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/c_func017.c +new file mode 100755 +index 0000000..a684869 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/c_func017.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ int_fast32_t x, y; ++}; ++void c_func_(struct Ty t) { ++ printf("%ld\t", t.x); ++ printf("%ld\n", t.y); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/c_func018.c b/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/c_func018.c +new file mode 100755 +index 0000000..c0a9a57 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/c_func018.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ int_fast64_t x, y; ++}; ++void c_func_(struct Ty t) { ++ printf("%ld\t", t.x); ++ printf("%ld\n", t.y); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/c_func019.c b/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/c_func019.c +new file mode 100755 +index 0000000..e85eacc +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/c_func019.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ intmax_t x, y; ++}; ++void c_func_(struct Ty t) { ++ printf("%ld\t", t.x); ++ printf("%ld\n", t.y); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/c_func020.c b/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/c_func020.c +new file mode 100755 +index 0000000..e4db45f +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/c_func020.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ intptr_t x, y; ++}; ++void c_func_(struct Ty t) { ++ printf("%ld\t", t.x); ++ printf("%ld\n", t.y); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/c_func021.c b/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/c_func021.c +new file mode 100755 +index 0000000..8b9411f +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/c_func021.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ float x, y; ++}; ++void c_func_(struct Ty t) { ++ printf("%f\t", t.x); ++ printf("%f\n", t.y); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/c_func022.c b/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/c_func022.c +new file mode 100755 +index 0000000..b9a6b7d +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/c_func022.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ double x, y; ++}; ++void c_func_(struct Ty t) { ++ printf("%0.20lf\t", t.x); ++ printf("%0.20lf\n", t.y); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/c_func023.c b/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/c_func023.c +new file mode 100755 +index 0000000..f7e21ce +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/c_func023.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ long double x, y; ++}; ++void c_func_(struct Ty t) { ++ printf("%0.20Lf\t", t.x); ++ printf("%0.20Lf\n", t.y); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/c_func024.c b/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/c_func024.c +new file mode 100755 +index 0000000..ea4e139 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/c_func024.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ float _Complex x, y; ++}; ++void c_func_(struct Ty t) { ++ printf("%f + %fi\n", creal(t.x), cimag(t.x)); ++ printf("%f + %fi\n", creal(t.y), cimag(t.y)); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/c_func025.c b/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/c_func025.c +new file mode 100755 +index 0000000..763db48 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/c_func025.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ double _Complex x, y; ++}; ++void c_func_(struct Ty t) { ++ printf("%lf + %lfi\n", creal(t.x), cimag(t.x)); ++ printf("%lf + %lfi\n", creal(t.y), cimag(t.y)); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/c_func026.c b/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/c_func026.c +new file mode 100755 +index 0000000..04022b0 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/c_func026.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ long double _Complex x, y; ++}; ++void c_func_(struct Ty t) { ++ printf("%f + %fi\n", creal(t.x), cimag(t.x)); ++ printf("%f + %fi\n", creal(t.y), cimag(t.y)); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/c_func027.c b/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/c_func027.c +new file mode 100755 +index 0000000..fada375 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/c_func027.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ _Bool x, y; ++}; ++void c_func_(struct Ty t) { ++ printf("%d\t", t.x); ++ printf("%d\n", t.y); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/c_func028.c b/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/c_func028.c +new file mode 100755 +index 0000000..eb28312 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/c_func028.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ char x, y; ++}; ++void c_func_(struct Ty t) { ++ printf("%c\t", t.x); ++ printf("%c\n", t.y); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/fortran_main001.f90 b/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/fortran_main001.f90 +new file mode 100755 +index 0000000..b7c763c +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/fortran_main001.f90 +@@ -0,0 +1,17 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type int with value attribute ++! ++program main ++ type :: t ++ integer :: x = -2147483647 ++ integer :: y = 2147483647 ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) ++ import :: t ++ type(t), value :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/fortran_main002.f90 b/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/fortran_main002.f90 +new file mode 100755 +index 0000000..0131d2a +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/fortran_main002.f90 +@@ -0,0 +1,17 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type short with value attribute ++! ++program main ++ type :: t ++ integer(2) :: x = -32768 ++ integer(2) :: y = 32767 ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) ++ import :: t ++ type(t), value :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/fortran_main003.f90 b/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/fortran_main003.f90 +new file mode 100755 +index 0000000..1307540 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/fortran_main003.f90 +@@ -0,0 +1,17 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type long with value attribute ++! ++program main ++ type :: t ++ integer(8) :: x = -2147483647 ++ integer(8) :: y = 2147483647 ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) ++ import :: t ++ type(t), value :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/fortran_main004.f90 b/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/fortran_main004.f90 +new file mode 100755 +index 0000000..42cd2b2 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/fortran_main004.f90 +@@ -0,0 +1,17 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type long long with value attribute ++! ++program main ++ type :: t ++ integer(8) :: x = -9223372036854775807 ++ integer(8) :: y = 9223372036854775807 ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) ++ import :: t ++ type(t), value :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/fortran_main005.f90 b/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/fortran_main005.f90 +new file mode 100755 +index 0000000..1127bd7 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/fortran_main005.f90 +@@ -0,0 +1,17 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type signed char with value attribute ++! ++program main ++ type :: t ++ integer(1) :: x = 65 ++ integer(1) :: y = 66 ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) ++ import :: t ++ type(t), value :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/fortran_main006.f90 b/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/fortran_main006.f90 +new file mode 100755 +index 0000000..8480c92 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/fortran_main006.f90 +@@ -0,0 +1,17 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type size_t with value attribute ++! ++program main ++ type :: t ++ integer(8) :: x = 0 ++ integer(8) :: y = 9223372036854775807 ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) ++ import :: t ++ type(t), value :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/fortran_main007.f90 b/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/fortran_main007.f90 +new file mode 100755 +index 0000000..b0c1278 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/fortran_main007.f90 +@@ -0,0 +1,17 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type int8_t with value attribute ++! ++program main ++ type :: t ++ integer(1) :: x = -128 ++ integer(1) :: y = 127 ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) ++ import :: t ++ type(t), value :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/fortran_main008.f90 b/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/fortran_main008.f90 +new file mode 100755 +index 0000000..081b48c +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/fortran_main008.f90 +@@ -0,0 +1,17 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type int16_t with value attribute ++! ++program main ++ type :: t ++ integer(2) :: x = -32768 ++ integer(2) :: y = 32767 ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) ++ import :: t ++ type(t), value :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/fortran_main009.f90 b/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/fortran_main009.f90 +new file mode 100755 +index 0000000..7943885 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/fortran_main009.f90 +@@ -0,0 +1,17 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type int32_t with value attribute ++! ++program main ++ type :: t ++ integer(4) :: x = -2147483647 ++ integer(4) :: y = 2147483647 ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) ++ import :: t ++ type(t), value :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/fortran_main010.f90 b/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/fortran_main010.f90 +new file mode 100755 +index 0000000..0941f1c +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/fortran_main010.f90 +@@ -0,0 +1,17 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type int64_t with value attribute ++! ++program main ++ type :: t ++ integer(8) :: x = -9223372036854775807 ++ integer(8) :: y = 9223372036854775807 ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) ++ import :: t ++ type(t), value :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/fortran_main011.f90 b/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/fortran_main011.f90 +new file mode 100755 +index 0000000..40d02f1 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/fortran_main011.f90 +@@ -0,0 +1,17 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type int_least8_t with value attribute ++! ++program main ++ type :: t ++ integer(1) :: x = -128 ++ integer(1) :: y = 127 ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) ++ import :: t ++ type(t), value :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/fortran_main012.f90 b/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/fortran_main012.f90 +new file mode 100755 +index 0000000..7c3ea58 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/fortran_main012.f90 +@@ -0,0 +1,17 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type int_least16_t with value attribute ++! ++program main ++ type :: t ++ integer(2) :: x = -32768 ++ integer(2) :: y = 32767 ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) ++ import :: t ++ type(t), value :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/fortran_main013.f90 b/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/fortran_main013.f90 +new file mode 100755 +index 0000000..ae7a853 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/fortran_main013.f90 +@@ -0,0 +1,17 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type int_least32_t with value attribute ++! ++program main ++ type :: t ++ integer(4) :: x = -2147483647 ++ integer(4) :: y = 2147483647 ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) ++ import :: t ++ type(t), value :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/fortran_main014.f90 b/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/fortran_main014.f90 +new file mode 100755 +index 0000000..8a6068a +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/fortran_main014.f90 +@@ -0,0 +1,17 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type int_least64_t with value attribute ++! ++program main ++ type :: t ++ integer(8) :: x = -9223372036854775807 ++ integer(8) :: y = 9223372036854775807 ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) ++ import :: t ++ type(t), value :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/fortran_main015.f90 b/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/fortran_main015.f90 +new file mode 100755 +index 0000000..b34abd9 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/fortran_main015.f90 +@@ -0,0 +1,17 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type int_fast8_t with value attribute ++! ++program main ++ type :: t ++ integer(1) :: x = -128 ++ integer(1) :: y = 127 ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) ++ import :: t ++ type(t), value :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/fortran_main016.f90 b/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/fortran_main016.f90 +new file mode 100755 +index 0000000..eabd0a7 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/fortran_main016.f90 +@@ -0,0 +1,17 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type int_fast16_t with value attribute ++! ++program main ++ type :: t ++ integer(8) :: x = -32768 ++ integer(8) :: y = 32767 ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) ++ import :: t ++ type(t), value :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/fortran_main017.f90 b/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/fortran_main017.f90 +new file mode 100755 +index 0000000..6575a1d +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/fortran_main017.f90 +@@ -0,0 +1,17 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type int_fast32_t with value attribute ++! ++program main ++ type :: t ++ integer(8) :: x = -2147483647 ++ integer(8) :: y = 2147483647 ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) ++ import :: t ++ type(t), value :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/fortran_main018.f90 b/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/fortran_main018.f90 +new file mode 100755 +index 0000000..df9c321 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/fortran_main018.f90 +@@ -0,0 +1,17 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type int_fast64_t with value attribute ++! ++program main ++ type :: t ++ integer(8) :: x = -9223372036854775807 ++ integer(8) :: y = 9223372036854775807 ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) ++ import :: t ++ type(t), value :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/fortran_main019.f90 b/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/fortran_main019.f90 +new file mode 100755 +index 0000000..3f766e2 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/fortran_main019.f90 +@@ -0,0 +1,17 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type intmax_t with value attribute ++! ++program main ++ type :: t ++ integer(8) :: x = -9223372036854775807 ++ integer(8) :: y = 9223372036854775807 ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) ++ import :: t ++ type(t), value :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/fortran_main020.f90 b/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/fortran_main020.f90 +new file mode 100755 +index 0000000..37bd9f2 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/fortran_main020.f90 +@@ -0,0 +1,17 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type intptr_t with value attribute ++! ++program main ++ type :: t ++ integer(8) :: x = -9223372036854775807 ++ integer(8) :: y = 9223372036854775807 ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) ++ import :: t ++ type(t), value :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/fortran_main021.f90 b/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/fortran_main021.f90 +new file mode 100755 +index 0000000..b71e819 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/fortran_main021.f90 +@@ -0,0 +1,17 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type float with value attribute ++! ++program main ++ type :: t ++ real(4) :: x = 3.14 ++ real(4) :: y = 12345678.7654321 ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) ++ import :: t ++ type(t), value :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/fortran_main022.f90 b/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/fortran_main022.f90 +new file mode 100755 +index 0000000..94d0458 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/fortran_main022.f90 +@@ -0,0 +1,17 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type double with value attribute ++! ++program main ++ type :: t ++ real(8) :: x = 3.14159265358979626 ++ real(8) :: y = 12345678.7654321 ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) ++ import :: t ++ type(t), value :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/fortran_main023.f90 b/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/fortran_main023.f90 +new file mode 100755 +index 0000000..ef25d3a +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/fortran_main023.f90 +@@ -0,0 +1,18 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type long double with value attribute ++! ++program main ++ integer, parameter :: K = selected_real_kind(16) ++ type :: t ++ real(K) :: x = 3.14159265358979626 ++ real(K) :: y = 12345678.7654321 ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) ++ import :: t ++ type(t), value :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/fortran_main024.f90 b/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/fortran_main024.f90 +new file mode 100755 +index 0000000..047c181 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/fortran_main024.f90 +@@ -0,0 +1,17 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type float _Complex with value attribute ++! ++program main ++ type :: t ++ complex(4) :: x = (-3, 1) ++ complex(4) :: y = (3, 1) ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) ++ import :: t ++ type(t), value :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/fortran_main025.f90 b/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/fortran_main025.f90 +new file mode 100755 +index 0000000..af39334 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/fortran_main025.f90 +@@ -0,0 +1,17 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type double _Complex with value attribute ++! ++program main ++ type :: t ++ complex(8) :: x = (-3, 1) ++ complex(8) :: y = (3, 1) ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) ++ import :: t ++ type(t), value :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/fortran_main026.f90 b/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/fortran_main026.f90 +new file mode 100755 +index 0000000..95e1d73 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/fortran_main026.f90 +@@ -0,0 +1,19 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type long double _Complex with value ++! attribute ++! ++program main ++ integer, parameter :: K = selected_real_kind(16) ++ type :: t ++ complex(K) :: x = (-3.1415926, 1.654) ++ complex(K) :: y = (3, 1) ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) ++ import :: t ++ type(t), value :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/fortran_main027.f90 b/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/fortran_main027.f90 +new file mode 100755 +index 0000000..a68f152 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/fortran_main027.f90 +@@ -0,0 +1,17 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type bool with value attribute ++! ++program main ++ type :: t ++ logical(1) :: x = .TRUE. ++ logical(1) :: y = .FALSE. ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) ++ import :: t ++ type(t), value :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/fortran_main028.f90 b/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/fortran_main028.f90 +new file mode 100755 +index 0000000..0492231 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/fortran_main028.f90 +@@ -0,0 +1,17 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type char with value attribute ++! ++program main ++ type :: t ++ character(1) :: x = 'b' ++ character(1) :: y = 'c' ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) ++ import :: t ++ type(t), value :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/run.sh b/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/run.sh +new file mode 100644 +index 0000000..b865403 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/020_fortran_call_c_struct_value/run.sh +@@ -0,0 +1,16 @@ ++for i in {001..028} ++do ++echo "------- test $i ------." ++#echo "----- gfortran result:" ++#gcc c_func$i.c -c -o c-test.o ++#gfortran fortran_main$i.f90 -fno-range-check -c -o fortran-test.o ++#gfortran c-test.o fortran-test.o ++#./a.out ++#rm *.o a.out ++echo "----- flang-new result : " ++clang c_func$i.c -c -o c-test.o ++flang-new fortran_main$i.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o a.out ++done +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/c_func001.c b/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/c_func001.c +new file mode 100755 +index 0000000..7a8788f +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/c_func001.c +@@ -0,0 +1,8 @@ ++#include ++struct Ty { ++ int x, y; ++}; ++void c_func_(struct Ty t) { ++ printf("%d\t", t.x); ++ printf("%d\n", t.y); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/c_func002.c b/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/c_func002.c +new file mode 100755 +index 0000000..7cba7f9 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/c_func002.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ short x, y; ++}; ++void c_func_(struct Ty t) { ++ printf("%hd\t", t.x); ++ printf("%hd\n", t.y); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/c_func003.c b/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/c_func003.c +new file mode 100755 +index 0000000..41cb86c +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/c_func003.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ long x, y; ++}; ++void c_func_(struct Ty t) { ++ printf("%ld\t", t.x); ++ printf("%ld\n", t.y); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/c_func004.c b/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/c_func004.c +new file mode 100755 +index 0000000..6640290 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/c_func004.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ long long x, y; ++}; ++void c_func_(struct Ty t) { ++ printf("%lld\t", t.x); ++ printf("%lld\n", t.y); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/c_func005.c b/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/c_func005.c +new file mode 100755 +index 0000000..d9a1ec5 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/c_func005.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ signed char x, y; ++}; ++void c_func_(struct Ty t) { ++ printf("%c\t", t.x); ++ printf("%c\n", t.y); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/c_func006.c b/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/c_func006.c +new file mode 100755 +index 0000000..e0b93d1 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/c_func006.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ size_t x, y; ++}; ++void c_func_(struct Ty t) { ++ printf("%ld\t", t.x); ++ printf("%ld\n", t.y); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/c_func007.c b/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/c_func007.c +new file mode 100755 +index 0000000..3b17b2a +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/c_func007.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ int8_t x, y; ++}; ++void c_func_(struct Ty t) { ++ printf("%hhd\t", t.x); ++ printf("%hhd\n", t.y); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/c_func008.c b/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/c_func008.c +new file mode 100755 +index 0000000..08c7afe +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/c_func008.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ int16_t x, y; ++}; ++void c_func_(struct Ty t) { ++ printf("%hd\t", t.x); ++ printf("%hd\n", t.y); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/c_func009.c b/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/c_func009.c +new file mode 100755 +index 0000000..5f3993b +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/c_func009.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ int32_t x, y; ++}; ++void c_func_(struct Ty t) { ++ printf("%d\t", t.x); ++ printf("%d\n", t.y); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/c_func010.c b/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/c_func010.c +new file mode 100755 +index 0000000..3541573 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/c_func010.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ int64_t x,y; ++}; ++void c_func_(struct Ty t) { ++ printf("%ld\t", t.x); ++ printf("%ld\n", t.y); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/c_func011.c b/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/c_func011.c +new file mode 100755 +index 0000000..6901a13 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/c_func011.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ int_least8_t x, y; ++}; ++void c_func_(struct Ty t) { ++ printf("%hhd\t", t.x); ++ printf("%hhd\n", t.y); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/c_func012.c b/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/c_func012.c +new file mode 100755 +index 0000000..5dfb29d +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/c_func012.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ int_least16_t x, y; ++}; ++void c_func_(struct Ty t) { ++ printf("%hd\t", t.x); ++ printf("%hd\n", t.y); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/c_func013.c b/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/c_func013.c +new file mode 100755 +index 0000000..cb167d2 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/c_func013.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ int_least32_t x, y; ++}; ++void c_func_(struct Ty t) { ++ printf("%d\t", t.x); ++ printf("%d\n", t.y); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/c_func014.c b/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/c_func014.c +new file mode 100755 +index 0000000..ed52fea +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/c_func014.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ int_least64_t x, y; ++}; ++void c_func_(struct Ty t) { ++ printf("%ld\t", t.x); ++ printf("%ld\n", t.y); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/c_func015.c b/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/c_func015.c +new file mode 100755 +index 0000000..160b6e2 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/c_func015.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ int_fast8_t x, y; ++}; ++void c_func_(struct Ty t) { ++ printf("%hhd\t", t.x); ++ printf("%hhd\n", t.y); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/c_func016.c b/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/c_func016.c +new file mode 100755 +index 0000000..55557b7 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/c_func016.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ int_fast16_t x, y; ++}; ++void c_func_(struct Ty t) { ++ printf("%ld\t", t.x); ++ printf("%ld\n", t.y); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/c_func017.c b/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/c_func017.c +new file mode 100755 +index 0000000..a684869 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/c_func017.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ int_fast32_t x, y; ++}; ++void c_func_(struct Ty t) { ++ printf("%ld\t", t.x); ++ printf("%ld\n", t.y); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/c_func018.c b/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/c_func018.c +new file mode 100755 +index 0000000..c0a9a57 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/c_func018.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ int_fast64_t x, y; ++}; ++void c_func_(struct Ty t) { ++ printf("%ld\t", t.x); ++ printf("%ld\n", t.y); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/c_func019.c b/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/c_func019.c +new file mode 100755 +index 0000000..e85eacc +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/c_func019.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ intmax_t x, y; ++}; ++void c_func_(struct Ty t) { ++ printf("%ld\t", t.x); ++ printf("%ld\n", t.y); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/c_func020.c b/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/c_func020.c +new file mode 100755 +index 0000000..e4db45f +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/c_func020.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ intptr_t x, y; ++}; ++void c_func_(struct Ty t) { ++ printf("%ld\t", t.x); ++ printf("%ld\n", t.y); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/c_func021.c b/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/c_func021.c +new file mode 100755 +index 0000000..8b9411f +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/c_func021.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ float x, y; ++}; ++void c_func_(struct Ty t) { ++ printf("%f\t", t.x); ++ printf("%f\n", t.y); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/c_func022.c b/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/c_func022.c +new file mode 100755 +index 0000000..b9a6b7d +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/c_func022.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ double x, y; ++}; ++void c_func_(struct Ty t) { ++ printf("%0.20lf\t", t.x); ++ printf("%0.20lf\n", t.y); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/c_func023.c b/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/c_func023.c +new file mode 100755 +index 0000000..f7e21ce +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/c_func023.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ long double x, y; ++}; ++void c_func_(struct Ty t) { ++ printf("%0.20Lf\t", t.x); ++ printf("%0.20Lf\n", t.y); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/c_func024.c b/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/c_func024.c +new file mode 100755 +index 0000000..ea4e139 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/c_func024.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ float _Complex x, y; ++}; ++void c_func_(struct Ty t) { ++ printf("%f + %fi\n", creal(t.x), cimag(t.x)); ++ printf("%f + %fi\n", creal(t.y), cimag(t.y)); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/c_func025.c b/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/c_func025.c +new file mode 100755 +index 0000000..763db48 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/c_func025.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ double _Complex x, y; ++}; ++void c_func_(struct Ty t) { ++ printf("%lf + %lfi\n", creal(t.x), cimag(t.x)); ++ printf("%lf + %lfi\n", creal(t.y), cimag(t.y)); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/c_func026.c b/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/c_func026.c +new file mode 100755 +index 0000000..04022b0 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/c_func026.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ long double _Complex x, y; ++}; ++void c_func_(struct Ty t) { ++ printf("%f + %fi\n", creal(t.x), cimag(t.x)); ++ printf("%f + %fi\n", creal(t.y), cimag(t.y)); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/c_func027.c b/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/c_func027.c +new file mode 100755 +index 0000000..fada375 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/c_func027.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ _Bool x, y; ++}; ++void c_func_(struct Ty t) { ++ printf("%d\t", t.x); ++ printf("%d\n", t.y); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/c_func028.c b/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/c_func028.c +new file mode 100755 +index 0000000..eb28312 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/c_func028.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ char x, y; ++}; ++void c_func_(struct Ty t) { ++ printf("%c\t", t.x); ++ printf("%c\n", t.y); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/fortran_main001.f90 b/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/fortran_main001.f90 +new file mode 100755 +index 0000000..59e2790 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/fortran_main001.f90 +@@ -0,0 +1,17 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type int with value attribute and bindc ++! ++program main ++ type, bind(c) :: t ++ integer :: x = -2147483647 ++ integer :: y = 2147483647 ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) bind(c, name = "c_func_") ++ import :: t ++ type(t), value :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/fortran_main002.f90 b/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/fortran_main002.f90 +new file mode 100755 +index 0000000..5be6f1a +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/fortran_main002.f90 +@@ -0,0 +1,17 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type short with value attribute and bindc ++! ++program main ++ type, bind(c) :: t ++ integer(2) :: x = -32768 ++ integer(2) :: y = 32767 ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) bind(c, name = "c_func_") ++ import :: t ++ type(t), value :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/fortran_main003.f90 b/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/fortran_main003.f90 +new file mode 100755 +index 0000000..8fbfe15 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/fortran_main003.f90 +@@ -0,0 +1,17 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type long with value attribute and bindc ++! ++program main ++ type, bind(c) :: t ++ integer(8) :: x = -2147483647 ++ integer(8) :: y = 2147483647 ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) bind(c, name = "c_func_") ++ import :: t ++ type(t), value :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/fortran_main004.f90 b/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/fortran_main004.f90 +new file mode 100755 +index 0000000..92fbb6c +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/fortran_main004.f90 +@@ -0,0 +1,18 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type long long with value attribute and ++! bindc ++! ++program main ++ type, bind(c) :: t ++ integer(8) :: x = -9223372036854775807 ++ integer(8) :: y = 9223372036854775807 ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) bind(c, name = "c_func_") ++ import :: t ++ type(t), value :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/fortran_main005.f90 b/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/fortran_main005.f90 +new file mode 100755 +index 0000000..1f4a323 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/fortran_main005.f90 +@@ -0,0 +1,18 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type signed char with value attribute and ++! bindc ++! ++program main ++ type, bind(c) :: t ++ integer(1) :: x = 65 ++ integer(1) :: y = 66 ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) bind(c, name = "c_func_") ++ import :: t ++ type(t), value :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/fortran_main006.f90 b/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/fortran_main006.f90 +new file mode 100755 +index 0000000..ffbf545 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/fortran_main006.f90 +@@ -0,0 +1,17 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type size_t with value attribute and bindc ++! ++program main ++ type, bind(c) :: t ++ integer(8) :: x = 0 ++ integer(8) :: y = 9223372036854775807 ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) bind(c, name = "c_func_") ++ import :: t ++ type(t), value :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/fortran_main007.f90 b/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/fortran_main007.f90 +new file mode 100755 +index 0000000..ecfa7d4 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/fortran_main007.f90 +@@ -0,0 +1,17 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type int8_t with value attribute and bindc ++! ++program main ++ type, bind(c) :: t ++ integer(1) :: x = -128 ++ integer(1) :: y = 127 ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) bind(c, name = "c_func_") ++ import :: t ++ type(t), value :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/fortran_main008.f90 b/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/fortran_main008.f90 +new file mode 100755 +index 0000000..7d6ba7a +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/fortran_main008.f90 +@@ -0,0 +1,17 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type int16_t with value attribute and bindc ++! ++program main ++ type, bind(c) :: t ++ integer(2) :: x = -32768 ++ integer(2) :: y = 32767 ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) bind(c, name = "c_func_") ++ import :: t ++ type(t), value :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/fortran_main009.f90 b/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/fortran_main009.f90 +new file mode 100755 +index 0000000..02373ac +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/fortran_main009.f90 +@@ -0,0 +1,17 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type int32_t with value attribute and bindc ++! ++program main ++ type, bind(c) :: t ++ integer(4) :: x = -2147483647 ++ integer(4) :: y = 2147483647 ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) bind(c, name = "c_func_") ++ import :: t ++ type(t), value :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/fortran_main010.f90 b/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/fortran_main010.f90 +new file mode 100755 +index 0000000..45b0048 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/fortran_main010.f90 +@@ -0,0 +1,17 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type int64_t with value attribute and bindc ++! ++program main ++ type, bind(c) :: t ++ integer(8) :: x = -9223372036854775807 ++ integer(8) :: y = 9223372036854775807 ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) bind(c, name = "c_func_") ++ import :: t ++ type(t), value :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/fortran_main011.f90 b/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/fortran_main011.f90 +new file mode 100755 +index 0000000..2d66252 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/fortran_main011.f90 +@@ -0,0 +1,18 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type int_least8_t with value attribute and ++! bindc ++! ++program main ++ type, bind(c) :: t ++ integer(1) :: x = -128 ++ integer(1) :: y = 127 ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) bind(c, name = "c_func_") ++ import :: t ++ type(t), value :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/fortran_main012.f90 b/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/fortran_main012.f90 +new file mode 100755 +index 0000000..43813de +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/fortran_main012.f90 +@@ -0,0 +1,18 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type int_least16_t with value attribute and ++! bindc ++! ++program main ++ type, bind(c) :: t ++ integer(2) :: x = -32768 ++ integer(2) :: y = 32767 ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) bind(c, name = "c_func_") ++ import :: t ++ type(t), value :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/fortran_main013.f90 b/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/fortran_main013.f90 +new file mode 100755 +index 0000000..7be34fc +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/fortran_main013.f90 +@@ -0,0 +1,18 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type int_least32_t with value attribute and ++! bindc ++! ++program main ++ type, bind(c) :: t ++ integer(4) :: x = -2147483647 ++ integer(4) :: y = 2147483647 ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) bind(c, name = "c_func_") ++ import :: t ++ type(t), value :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/fortran_main014.f90 b/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/fortran_main014.f90 +new file mode 100755 +index 0000000..a131900 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/fortran_main014.f90 +@@ -0,0 +1,18 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type int_least64_t with value attribute and ++! bindc ++! ++program main ++ type, bind(c) :: t ++ integer(8) :: x = -9223372036854775807 ++ integer(8) :: y = 9223372036854775807 ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) bind(c, name = "c_func_") ++ import :: t ++ type(t), value :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/fortran_main015.f90 b/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/fortran_main015.f90 +new file mode 100755 +index 0000000..f818e3f +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/fortran_main015.f90 +@@ -0,0 +1,18 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type int_fast8_t with value attribute and ++! bindc ++! ++program main ++ type, bind(c) :: t ++ integer(1) :: x = -128 ++ integer(1) :: y = 127 ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) bind(c, name = "c_func_") ++ import :: t ++ type(t), value :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/fortran_main016.f90 b/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/fortran_main016.f90 +new file mode 100755 +index 0000000..dc10b7a +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/fortran_main016.f90 +@@ -0,0 +1,18 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type int_fast16_t with value attribute and ++! bindc ++! ++program main ++ type, bind(c) :: t ++ integer(8) :: x = -32768 ++ integer(8) :: y = 32767 ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) bind(c, name = "c_func_") ++ import :: t ++ type(t), value :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/fortran_main017.f90 b/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/fortran_main017.f90 +new file mode 100755 +index 0000000..b179389 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/fortran_main017.f90 +@@ -0,0 +1,18 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type int_fast32_t with value attribute and ++! bindc ++! ++program main ++ type, bind(c) :: t ++ integer(8) :: x = -2147483647 ++ integer(8) :: y = 2147483647 ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) bind(c, name = "c_func_") ++ import :: t ++ type(t), value :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/fortran_main018.f90 b/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/fortran_main018.f90 +new file mode 100755 +index 0000000..dce7a9b +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/fortran_main018.f90 +@@ -0,0 +1,18 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type int_fast64_t with value attribute and ++! bindc ++! ++program main ++ type, bind(c) :: t ++ integer(8) :: x = -9223372036854775807 ++ integer(8) :: y = 9223372036854775807 ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) bind(c, name = "c_func_") ++ import :: t ++ type(t), value :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/fortran_main019.f90 b/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/fortran_main019.f90 +new file mode 100755 +index 0000000..5112bc5 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/fortran_main019.f90 +@@ -0,0 +1,18 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type intmax_t with value attribute and ++! bindc ++! ++program main ++ type, bind(c) :: t ++ integer(8) :: x = -9223372036854775807 ++ integer(8) :: y = 9223372036854775807 ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) bind(c, name = "c_func_") ++ import :: t ++ type(t), value :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/fortran_main020.f90 b/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/fortran_main020.f90 +new file mode 100755 +index 0000000..f2fdf25 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/fortran_main020.f90 +@@ -0,0 +1,18 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type intptr_t with value attribute and ++! bindc ++! ++program main ++ type, bind(c) :: t ++ integer(8) :: x = -9223372036854775807 ++ integer(8) :: y = 9223372036854775807 ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) bind(c, name = "c_func_") ++ import :: t ++ type(t), value :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/fortran_main021.f90 b/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/fortran_main021.f90 +new file mode 100755 +index 0000000..e0032c4 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/fortran_main021.f90 +@@ -0,0 +1,17 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type float with value attribute and bindc ++! ++program main ++ type, bind(c) :: t ++ real(4) :: x = 3.14 ++ real(4) :: y = 12345678.7654321 ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) bind(c, name = "c_func_") ++ import :: t ++ type(t), value :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/fortran_main022.f90 b/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/fortran_main022.f90 +new file mode 100755 +index 0000000..3d4e7d6 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/fortran_main022.f90 +@@ -0,0 +1,17 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type double with value attribute and bindc ++! ++program main ++ type, bind(c) :: t ++ real(8) :: x = 3.14159265358979626 ++ real(8) :: y = 12345678.7654321 ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) bind(c, name = "c_func_") ++ import :: t ++ type(t), value :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/fortran_main023.f90 b/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/fortran_main023.f90 +new file mode 100755 +index 0000000..bb2e0ac +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/fortran_main023.f90 +@@ -0,0 +1,19 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type long double with value attribute and ++! bindc ++! ++program main ++ integer, parameter :: K = selected_real_kind(16) ++ type, bind(c) :: t ++ real(K) :: x = 3.14159265358979626 ++ real(K) :: y = 12345678.7654321 ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) bind(c, name = "c_func_") ++ import :: t ++ type(t), value :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/fortran_main024.f90 b/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/fortran_main024.f90 +new file mode 100755 +index 0000000..9060ca6 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/fortran_main024.f90 +@@ -0,0 +1,18 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type float _Complex with value attribute ++! and bindc ++! ++program main ++ type, bind(c) :: t ++ complex(4) :: x = (-3, 1) ++ complex(4) :: y = (3, 1) ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) bind(c, name = "c_func_") ++ import :: t ++ type(t), value :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/fortran_main025.f90 b/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/fortran_main025.f90 +new file mode 100755 +index 0000000..7601a57 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/fortran_main025.f90 +@@ -0,0 +1,18 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type double _Complex with value attribute ++! and bindc ++! ++program main ++ type, bind(c) :: t ++ complex(8) :: x = (-3, 1) ++ complex(8) :: y = (3, 1) ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) bind(c, name = "c_func_") ++ import :: t ++ type(t), value :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/fortran_main026.f90 b/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/fortran_main026.f90 +new file mode 100755 +index 0000000..11a7d6c +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/fortran_main026.f90 +@@ -0,0 +1,19 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type long double _Complex with value ++! attribute and bindc ++! ++program main ++ integer, parameter :: K = selected_real_kind(16) ++ type, bind(c) :: t ++ complex(K) :: x = (-3.1415926, 1.654) ++ complex(K) :: y = (3, 1) ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) bind(c, name = "c_func_") ++ import :: t ++ type(t), value :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/fortran_main027.f90 b/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/fortran_main027.f90 +new file mode 100755 +index 0000000..886ec57 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/fortran_main027.f90 +@@ -0,0 +1,17 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type bool with value attribute and bindc ++! ++program main ++ type, bind(c) :: t ++ logical(1) :: x = .TRUE. ++ logical(1) :: y = .FALSE. ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) bind(c, name = "c_func_") ++ import :: t ++ type(t), value :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/fortran_main028.f90 b/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/fortran_main028.f90 +new file mode 100755 +index 0000000..6462bbf +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/fortran_main028.f90 +@@ -0,0 +1,17 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type char with value attribute and bindc ++! ++program main ++ type, bind(c) :: t ++ character(1) :: x = 'b' ++ character(1) :: y = 'c' ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) bind(c, name = "c_func_") ++ import :: t ++ type(t), value :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/run.sh b/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/run.sh +new file mode 100644 +index 0000000..b865403 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/021_fortran_call_c_struct_value_bindc/run.sh +@@ -0,0 +1,16 @@ ++for i in {001..028} ++do ++echo "------- test $i ------." ++#echo "----- gfortran result:" ++#gcc c_func$i.c -c -o c-test.o ++#gfortran fortran_main$i.f90 -fno-range-check -c -o fortran-test.o ++#gfortran c-test.o fortran-test.o ++#./a.out ++#rm *.o a.out ++echo "----- flang-new result : " ++clang c_func$i.c -c -o c-test.o ++flang-new fortran_main$i.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o a.out ++done +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/c_func001.c b/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/c_func001.c +new file mode 100644 +index 0000000..6535dd7 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/c_func001.c +@@ -0,0 +1,10 @@ ++#include ++struct BaseTy { ++ int j; ++}; ++struct Ty { ++ struct BaseTy bt; ++}; ++void c_func_(struct Ty *t) { ++ printf("%d\n", t->bt.j); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/c_func002.c b/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/c_func002.c +new file mode 100644 +index 0000000..e9bb160 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/c_func002.c +@@ -0,0 +1,10 @@ ++#include ++struct BaseTy { ++ short j; ++}; ++struct Ty { ++ struct BaseTy bt; ++}; ++void c_func_(struct Ty *t) { ++ printf("%hd\n", t->bt.j); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/c_func003.c b/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/c_func003.c +new file mode 100644 +index 0000000..99c95b0 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/c_func003.c +@@ -0,0 +1,10 @@ ++#include ++struct BaseTy { ++ long j; ++}; ++struct Ty { ++ struct BaseTy bt; ++}; ++void c_func_(struct Ty *t) { ++ printf("%ld\n", t->bt.j); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/c_func004.c b/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/c_func004.c +new file mode 100644 +index 0000000..69a1176 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/c_func004.c +@@ -0,0 +1,10 @@ ++#include ++struct BaseTy { ++ long long j; ++}; ++struct Ty { ++ struct BaseTy bt; ++}; ++void c_func_(struct Ty *t) { ++ printf("%lld\n", t->bt.j); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/c_func005.c b/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/c_func005.c +new file mode 100644 +index 0000000..d5e28b1 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/c_func005.c +@@ -0,0 +1,10 @@ ++#include ++struct BaseTy { ++ signed char j; ++}; ++struct Ty { ++ struct BaseTy bt; ++}; ++void c_func_(struct Ty *t) { ++ printf("%c\n", t->bt.j); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/c_func006.c b/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/c_func006.c +new file mode 100644 +index 0000000..542ddbc +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/c_func006.c +@@ -0,0 +1,10 @@ ++#include ++struct BaseTy { ++ size_t j; ++}; ++struct Ty { ++ struct BaseTy bt; ++}; ++void c_func_(struct Ty *t) { ++ printf("%ld\n", t->bt.j); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/c_func007.c b/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/c_func007.c +new file mode 100644 +index 0000000..71ceb1c +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/c_func007.c +@@ -0,0 +1,11 @@ ++#include ++#include ++struct BaseTy { ++ int8_t j; ++}; ++struct Ty { ++ struct BaseTy bt; ++}; ++void c_func_(struct Ty *t) { ++ printf("%hhd\n", t->bt.j); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/c_func008.c b/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/c_func008.c +new file mode 100644 +index 0000000..b6489b2 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/c_func008.c +@@ -0,0 +1,11 @@ ++#include ++#include ++struct BaseTy { ++ int16_t j; ++}; ++struct Ty { ++ struct BaseTy bt; ++}; ++void c_func_(struct Ty *t) { ++ printf("%hd\n", t->bt.j); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/c_func009.c b/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/c_func009.c +new file mode 100644 +index 0000000..7ba6646 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/c_func009.c +@@ -0,0 +1,11 @@ ++#include ++#include ++struct BaseTy { ++ int32_t j; ++}; ++struct Ty { ++ struct BaseTy bt; ++}; ++void c_func_(struct Ty *t) { ++ printf("%d\n", t->bt.j); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/c_func010.c b/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/c_func010.c +new file mode 100644 +index 0000000..672e95b +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/c_func010.c +@@ -0,0 +1,11 @@ ++#include ++#include ++struct BaseTy { ++ int64_t j; ++}; ++struct Ty { ++ struct BaseTy bt; ++}; ++void c_func_(struct Ty *t) { ++ printf("%ld\n", t->bt.j); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/c_func011.c b/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/c_func011.c +new file mode 100644 +index 0000000..802995a +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/c_func011.c +@@ -0,0 +1,11 @@ ++#include ++#include ++struct BaseTy { ++ int_least8_t j; ++}; ++struct Ty { ++ struct BaseTy bt; ++}; ++void c_func_(struct Ty *t) { ++ printf("%hhd\n", t->bt.j); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/c_func012.c b/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/c_func012.c +new file mode 100644 +index 0000000..bcc8dbd +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/c_func012.c +@@ -0,0 +1,11 @@ ++#include ++#include ++struct BaseTy { ++ int_least16_t j; ++}; ++struct Ty { ++ struct BaseTy bt; ++}; ++void c_func_(struct Ty *t) { ++ printf("%hd\n", t->bt.j); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/c_func013.c b/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/c_func013.c +new file mode 100644 +index 0000000..4688138 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/c_func013.c +@@ -0,0 +1,11 @@ ++#include ++#include ++struct BaseTy { ++ int_least32_t j; ++}; ++struct Ty { ++ struct BaseTy bt; ++}; ++void c_func_(struct Ty *t) { ++ printf("%d\n", t->bt.j); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/c_func014.c b/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/c_func014.c +new file mode 100644 +index 0000000..1c30ccc +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/c_func014.c +@@ -0,0 +1,11 @@ ++#include ++#include ++struct BaseTy { ++ int_least64_t j; ++}; ++struct Ty { ++ struct BaseTy bt; ++}; ++void c_func_(struct Ty *t) { ++ printf("%ld\n", t->bt.j); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/c_func015.c b/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/c_func015.c +new file mode 100644 +index 0000000..0d3e522 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/c_func015.c +@@ -0,0 +1,11 @@ ++#include ++#include ++struct BaseTy { ++ int_fast8_t j; ++}; ++struct Ty { ++ struct BaseTy bt; ++}; ++void c_func_(struct Ty *t) { ++ printf("%hhd\n", t->bt.j); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/c_func016.c b/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/c_func016.c +new file mode 100644 +index 0000000..e98a73b +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/c_func016.c +@@ -0,0 +1,11 @@ ++#include ++#include ++struct BaseTy { ++ int_fast16_t j; ++}; ++struct Ty { ++ struct BaseTy bt; ++}; ++void c_func_(struct Ty *t) { ++ printf("%ld\n", t->bt.j); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/c_func017.c b/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/c_func017.c +new file mode 100644 +index 0000000..ef890d5 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/c_func017.c +@@ -0,0 +1,11 @@ ++#include ++#include ++struct BaseTy { ++ int_fast32_t j; ++}; ++struct Ty { ++ struct BaseTy bt; ++}; ++void c_func_(struct Ty *t) { ++ printf("%ld\n", t->bt.j); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/c_func018.c b/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/c_func018.c +new file mode 100644 +index 0000000..4eb17aa +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/c_func018.c +@@ -0,0 +1,11 @@ ++#include ++#include ++struct BaseTy { ++ int_fast64_t j; ++}; ++struct Ty { ++ struct BaseTy bt; ++}; ++void c_func_(struct Ty *t) { ++ printf("%ld\n", t->bt.j); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/c_func019.c b/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/c_func019.c +new file mode 100644 +index 0000000..e88ed31 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/c_func019.c +@@ -0,0 +1,11 @@ ++#include ++#include ++struct BaseTy { ++ intmax_t j; ++}; ++struct Ty { ++ struct BaseTy bt; ++}; ++void c_func_(struct Ty *t) { ++ printf("%ld\n", t->bt.j); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/c_func020.c b/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/c_func020.c +new file mode 100644 +index 0000000..8a50887 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/c_func020.c +@@ -0,0 +1,11 @@ ++#include ++#include ++struct BaseTy { ++ intptr_t j; ++}; ++struct Ty { ++ struct BaseTy bt; ++}; ++void c_func_(struct Ty *t) { ++ printf("%ld\n", t->bt.j); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/c_func021.c b/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/c_func021.c +new file mode 100644 +index 0000000..c8f6dac +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/c_func021.c +@@ -0,0 +1,10 @@ ++#include ++struct BaseTy { ++ float j; ++}; ++struct Ty { ++ struct BaseTy bt; ++}; ++void c_func_(struct Ty *t) { ++ printf("%.2f\n", t->bt.j); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/c_func022.c b/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/c_func022.c +new file mode 100644 +index 0000000..72ce135 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/c_func022.c +@@ -0,0 +1,10 @@ ++#include ++struct BaseTy { ++ double j; ++}; ++struct Ty { ++ struct BaseTy bt; ++}; ++void c_func_(struct Ty *t) { ++ printf("%.2f\n", t->bt.j); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/c_func023.c b/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/c_func023.c +new file mode 100644 +index 0000000..b3f0db5 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/c_func023.c +@@ -0,0 +1,10 @@ ++#include ++struct BaseTy { ++ long double j; ++}; ++struct Ty { ++ struct BaseTy bt; ++}; ++void c_func_(struct Ty *t) { ++ printf("%.2Lf\n", t->bt.j); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/c_func024.c b/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/c_func024.c +new file mode 100644 +index 0000000..315c5c4 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/c_func024.c +@@ -0,0 +1,11 @@ ++#include ++#include ++struct BaseTy { ++ float _Complex j; ++}; ++struct Ty { ++ struct BaseTy bt; ++}; ++void c_func_(struct Ty *t) { ++ printf("%f + %fi\n", creal(t->bt.j), cimag(t->bt.j)); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/c_func025.c b/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/c_func025.c +new file mode 100644 +index 0000000..4bfcf58 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/c_func025.c +@@ -0,0 +1,11 @@ ++#include ++#include ++struct BaseTy { ++ double _Complex j; ++}; ++struct Ty { ++ struct BaseTy bt; ++}; ++void c_func_(struct Ty *t) { ++ printf("%.20lf + %.20lfi\n", creal(t->bt.j), cimag(t->bt.j)); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/c_func026.c b/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/c_func026.c +new file mode 100644 +index 0000000..40b4a7b +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/c_func026.c +@@ -0,0 +1,11 @@ ++#include ++#include ++struct BaseTy { ++ long double _Complex j; ++}; ++struct Ty { ++ struct BaseTy bt; ++}; ++void c_func_(struct Ty *t) { ++ printf("%f + %fi\n", creal(t->bt.j), cimag(t->bt.j)); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/c_func027.c b/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/c_func027.c +new file mode 100644 +index 0000000..5614736 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/c_func027.c +@@ -0,0 +1,10 @@ ++#include ++struct BaseTy { ++ _Bool j; ++}; ++struct Ty { ++ struct BaseTy bt; ++}; ++void c_func_(struct Ty *t, _Bool *a) { ++ printf("%d\n", t->bt.j); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/c_func028.c b/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/c_func028.c +new file mode 100644 +index 0000000..82233e7 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/c_func028.c +@@ -0,0 +1,11 @@ ++#include ++#include ++struct BaseTy { ++ char j; ++}; ++struct Ty { ++ struct BaseTy bt; ++}; ++void c_func_(struct Ty *t) { ++ printf("%c\n", t->bt.j); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/fortran_main001.f90 b/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/fortran_main001.f90 +new file mode 100644 +index 0000000..a87b80c +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/fortran_main001.f90 +@@ -0,0 +1,20 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is derived type the other component of derived type is ++! scalar type of int ++! ++program main ++ type, bind(c) :: base ++ integer :: j = -2 ++ end type base ++ type, bind(c) :: t ++ type(base) :: bt ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) ++ import :: t ++ type(t) :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/fortran_main002.f90 b/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/fortran_main002.f90 +new file mode 100644 +index 0000000..eba5ed5 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/fortran_main002.f90 +@@ -0,0 +1,20 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is derived type the other component of derived type is ++! scalar type of short ++! ++program main ++ type, bind(c) :: base ++ integer(2) :: j = -2 ++ end type base ++ type, bind(c) :: t ++ type(base) :: bt ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) ++ import :: t ++ type(t) :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/fortran_main003.f90 b/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/fortran_main003.f90 +new file mode 100644 +index 0000000..73a5bcf +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/fortran_main003.f90 +@@ -0,0 +1,20 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is derived type the other component of derived type is ++! scalar type of long ++! ++program main ++ type, bind(c) :: base ++ integer(8) :: j = -2 ++ end type base ++ type, bind(c) :: t ++ type(base) :: bt ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) ++ import :: t ++ type(t) :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/fortran_main004.f90 b/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/fortran_main004.f90 +new file mode 100644 +index 0000000..55a915f +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/fortran_main004.f90 +@@ -0,0 +1,20 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is derived type the other component of derived type is ++! scalar type of long long ++! ++program main ++ type, bind(c) :: base ++ integer(8) :: j = -2 ++ end type base ++ type, bind(c) :: t ++ type(base) :: bt ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) ++ import :: t ++ type(t) :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/fortran_main005.f90 b/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/fortran_main005.f90 +new file mode 100644 +index 0000000..2531e8c +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/fortran_main005.f90 +@@ -0,0 +1,20 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is derived type the other component of derived type is ++! scalar type of signed char ++! ++program main ++ type, bind(c) :: base ++ integer(1) :: j = 65 ++ end type base ++ type, bind(c) :: t ++ type(base) :: bt ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) ++ import :: t ++ type(t) :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/fortran_main006.f90 b/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/fortran_main006.f90 +new file mode 100644 +index 0000000..c9ae956 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/fortran_main006.f90 +@@ -0,0 +1,20 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is derived type the other component of derived type is ++! scalar type of size_t ++! ++program main ++ type, bind(c) :: base ++ integer(8) :: j = 0 ++ end type base ++ type, bind(c) :: t ++ type(base) :: bt ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) ++ import :: t ++ type(t) :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/fortran_main007.f90 b/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/fortran_main007.f90 +new file mode 100644 +index 0000000..c864163 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/fortran_main007.f90 +@@ -0,0 +1,20 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is derived type the other component of derived type is ++! scalar type of int8_t ++! ++program main ++ type, bind(c) :: base ++ integer(1) :: j = -2 ++ end type base ++ type, bind(c) :: t ++ type(base) :: bt ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) ++ import :: t ++ type(t) :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/fortran_main008.f90 b/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/fortran_main008.f90 +new file mode 100644 +index 0000000..4adf5fe +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/fortran_main008.f90 +@@ -0,0 +1,20 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is derived type the other component of derived type is ++! scalar type of int16_t ++! ++program main ++ type, bind(c) :: base ++ integer(2) :: j = -2 ++ end type base ++ type, bind(c) :: t ++ type(base) :: bt ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) ++ import :: t ++ type(t) :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/fortran_main009.f90 b/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/fortran_main009.f90 +new file mode 100644 +index 0000000..57b4035 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/fortran_main009.f90 +@@ -0,0 +1,20 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is derived type the other component of derived type is ++! scalar type of int32_t ++! ++program main ++ type, bind(c) :: base ++ integer(4) :: j = -2 ++ end type base ++ type, bind(c) :: t ++ type(base) :: bt ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) ++ import :: t ++ type(t) :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/fortran_main010.f90 b/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/fortran_main010.f90 +new file mode 100644 +index 0000000..0183cad +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/fortran_main010.f90 +@@ -0,0 +1,20 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is derived type the other component of derived type is ++! scalar type of int64_t ++! ++program main ++ type, bind(c) :: base ++ integer(8) :: j = -2 ++ end type base ++ type, bind(c) :: t ++ type(base) :: bt ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) ++ import :: t ++ type(t) :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/fortran_main011.f90 b/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/fortran_main011.f90 +new file mode 100644 +index 0000000..7b5942f +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/fortran_main011.f90 +@@ -0,0 +1,20 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is derived type the other component of derived type is ++! scalar type of int_least_8 ++! ++program main ++ type, bind(c) :: base ++ integer(1) :: j = -2 ++ end type base ++ type, bind(c) :: t ++ type(base) :: bt ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) ++ import :: t ++ type(t) :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/fortran_main012.f90 b/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/fortran_main012.f90 +new file mode 100644 +index 0000000..44c8378 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/fortran_main012.f90 +@@ -0,0 +1,20 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is derived type the other component of derived type is ++! scalar type of int_least16_t ++! ++program main ++ type, bind(c) :: base ++ integer(2) :: j = -2 ++ end type base ++ type, bind(c) :: t ++ type(base) :: bt ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) ++ import :: t ++ type(t) :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/fortran_main013.f90 b/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/fortran_main013.f90 +new file mode 100644 +index 0000000..f3e8018 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/fortran_main013.f90 +@@ -0,0 +1,20 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is derived type the other component of derived type is ++! scalar type of int_least32_t ++! ++program main ++ type, bind(c) :: base ++ integer(4) :: j = -2 ++ end type base ++ type, bind(c) :: t ++ type(base) :: bt ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) ++ import :: t ++ type(t) :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/fortran_main014.f90 b/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/fortran_main014.f90 +new file mode 100644 +index 0000000..143d75e +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/fortran_main014.f90 +@@ -0,0 +1,20 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is derived type the other component of derived type is ++! scalar type of int_least64_t ++! ++program main ++ type, bind(c) :: base ++ integer(8) :: j = -2 ++ end type base ++ type, bind(c) :: t ++ type(base) :: bt ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) ++ import :: t ++ type(t) :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/fortran_main015.f90 b/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/fortran_main015.f90 +new file mode 100644 +index 0000000..ded38dd +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/fortran_main015.f90 +@@ -0,0 +1,20 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is derived type the other component of derived type is ++! scalar type of int_fast8_t ++! ++program main ++ type, bind(c) :: base ++ integer(1) :: j = -2 ++ end type base ++ type, bind(c) :: t ++ type(base) :: bt ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) ++ import :: t ++ type(t) :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/fortran_main016.f90 b/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/fortran_main016.f90 +new file mode 100644 +index 0000000..79d6f7f +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/fortran_main016.f90 +@@ -0,0 +1,20 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is derived type the other component of derived type is ++! scalar type of int_fast16_t ++! ++program main ++ type, bind(c) :: base ++ integer(8) :: j = -2 ++ end type base ++ type, bind(c) :: t ++ type(base) :: bt ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) ++ import :: t ++ type(t) :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/fortran_main017.f90 b/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/fortran_main017.f90 +new file mode 100644 +index 0000000..b48cc58 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/fortran_main017.f90 +@@ -0,0 +1,20 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is derived type the other component of derived type is ++! scalar type of int_fast32_t ++! ++program main ++ type, bind(c) :: base ++ integer(8) :: j = -2 ++ end type base ++ type, bind(c) :: t ++ type(base) :: bt ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) ++ import :: t ++ type(t) :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/fortran_main018.f90 b/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/fortran_main018.f90 +new file mode 100644 +index 0000000..82878b7 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/fortran_main018.f90 +@@ -0,0 +1,20 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is derived type the other component of derived type is ++! scalar type of int_fast64_t ++! ++program main ++ type, bind(c) :: base ++ integer(8) :: j = -2 ++ end type base ++ type, bind(c) :: t ++ type(base) :: bt ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) ++ import :: t ++ type(t) :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/fortran_main019.f90 b/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/fortran_main019.f90 +new file mode 100644 +index 0000000..b60089f +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/fortran_main019.f90 +@@ -0,0 +1,20 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is derived type the other component of derived type is ++! scalar type of intmax_t ++! ++program main ++ type, bind(c) :: base ++ integer(8) :: j = -2 ++ end type base ++ type, bind(c) :: t ++ type(base) :: bt ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) ++ import :: t ++ type(t) :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/fortran_main020.f90 b/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/fortran_main020.f90 +new file mode 100644 +index 0000000..277b313 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/fortran_main020.f90 +@@ -0,0 +1,20 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is derived type the other component of derived type is ++! scalar type of intptr_t ++! ++program main ++ type, bind(c) :: base ++ integer(8) :: j = -2 ++ end type base ++ type, bind(c) :: t ++ type(base) :: bt ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) ++ import :: t ++ type(t) :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/fortran_main021.f90 b/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/fortran_main021.f90 +new file mode 100644 +index 0000000..a191c0d +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/fortran_main021.f90 +@@ -0,0 +1,20 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is derived type the other component of derived type is ++! scalar type of float ++! ++program main ++ type, bind(c) :: base ++ real(4) :: j = -2.36 ++ end type base ++ type, bind(c) :: t ++ type(base) :: bt ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) ++ import :: t ++ type(t) :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/fortran_main022.f90 b/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/fortran_main022.f90 +new file mode 100644 +index 0000000..e8df525 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/fortran_main022.f90 +@@ -0,0 +1,20 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is derived type the other component of derived type is ++! scalar type of float ++! ++program main ++ type, bind(c) :: base ++ real(8) :: j = -2.36 ++ end type base ++ type, bind(c) :: t ++ type(base) :: bt ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) ++ import :: t ++ type(t) :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/fortran_main023.f90 b/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/fortran_main023.f90 +new file mode 100644 +index 0000000..90e2060 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/fortran_main023.f90 +@@ -0,0 +1,21 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is derived type the other component of derived type is ++! scalar type of long double ++! ++program main ++ integer, parameter :: K = selected_real_kind(16) ++ type, bind(c) :: base ++ real(K) :: j = -2.36 ++ end type base ++ type, bind(c) :: t ++ type(base) :: bt ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) ++ import :: t ++ type(t) :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/fortran_main024.f90 b/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/fortran_main024.f90 +new file mode 100644 +index 0000000..a5a051a +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/fortran_main024.f90 +@@ -0,0 +1,21 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is derived type the other component of derived type is ++! scalar type of float _Complex ++! ++program main ++ type, bind(c) :: base ++ complex(4) :: j = (1, 2); ++ end type base ++ type, bind(c) :: t ++ type(base) :: bt ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) ++ use iso_c_binding ++ import :: t ++ type(t) :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/fortran_main025.f90 b/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/fortran_main025.f90 +new file mode 100644 +index 0000000..be78fcc +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/fortran_main025.f90 +@@ -0,0 +1,21 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is derived type the other component of derived type is ++! scalar type of double _Complex ++! ++program main ++ type, bind(c) :: base ++ complex(8) :: j = (1, 2); ++ end type base ++ type, bind(c) :: t ++ type(base) :: bt ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) ++ use iso_c_binding ++ import :: t ++ type(t) :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/fortran_main026.f90 b/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/fortran_main026.f90 +new file mode 100644 +index 0000000..6d7c710 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/fortran_main026.f90 +@@ -0,0 +1,22 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is derived type the other component of derived type is ++! scalar type of long double _Complex ++! ++program main ++ integer, parameter :: K = selected_real_kind(16) ++ type, bind(c) :: base ++ complex(K) :: j = (1, 2); ++ end type base ++ type, bind(c) :: t ++ type(base) :: bt ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) ++ use iso_c_binding ++ import :: t ++ type(t) :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/fortran_main027.f90 b/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/fortran_main027.f90 +new file mode 100644 +index 0000000..ed52db7 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/fortran_main027.f90 +@@ -0,0 +1,20 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is derived type the other component of derived type is ++! scalar type of _Bool ++! ++program main ++ type, bind(c) :: base ++ logical(1) :: j = .TRUE. ++ end type base ++ type, bind(c) :: t ++ type(base) :: bt ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) ++ import :: t ++ type(t) :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/fortran_main028.f90 b/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/fortran_main028.f90 +new file mode 100644 +index 0000000..7bd346a +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/fortran_main028.f90 +@@ -0,0 +1,20 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is derived type the other component of derived type is ++! scalar type of char ++! ++program main ++ type, bind(c) :: base ++ character(1) :: j = 'a' ++ end type base ++ type, bind(c) :: t ++ type(base) :: bt ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) ++ import :: t ++ type(t) :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/run.sh b/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/run.sh +new file mode 100644 +index 0000000..b865403 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/022_fortran_call_c_nested_struct_simple/run.sh +@@ -0,0 +1,16 @@ ++for i in {001..028} ++do ++echo "------- test $i ------." ++#echo "----- gfortran result:" ++#gcc c_func$i.c -c -o c-test.o ++#gfortran fortran_main$i.f90 -fno-range-check -c -o fortran-test.o ++#gfortran c-test.o fortran-test.o ++#./a.out ++#rm *.o a.out ++echo "----- flang-new result : " ++clang c_func$i.c -c -o c-test.o ++flang-new fortran_main$i.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o a.out ++done +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c/023_fortran_call_c_nested_struct_complicated/c_func001.c b/test/interoperability_with_c_fortran_call_c/023_fortran_call_c_nested_struct_complicated/c_func001.c +new file mode 100644 +index 0000000..111e43b +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/023_fortran_call_c_nested_struct_complicated/c_func001.c +@@ -0,0 +1,16 @@ ++#include ++struct BaseTy { ++ int j; ++}; ++struct Ty { ++ struct BaseTy bt; ++ int n[4]; ++}; ++void c_func_(struct Ty *t) { ++ printf("%d\n", t->bt.j); ++ printf("%d\n", t->n[0]); ++ printf("%d\n", t->n[0]+t->bt.j); ++ printf("%d\n", t->n[1]); ++ printf("%d\n", t->n[2]); ++ printf("%d\n", t->n[3]); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/023_fortran_call_c_nested_struct_complicated/c_func002.c b/test/interoperability_with_c_fortran_call_c/023_fortran_call_c_nested_struct_complicated/c_func002.c +new file mode 100644 +index 0000000..c1df231 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/023_fortran_call_c_nested_struct_complicated/c_func002.c +@@ -0,0 +1,22 @@ ++#include ++struct BaseTy { ++ int j; ++}; ++struct Ty { ++ struct BaseTy bt; ++ int n[4]; ++}; ++void c_func_(struct Ty *t) { ++ printf("%d\n", t[0].bt.j); ++ printf("%d\n", t[0].n[0]); ++ printf("%d\n", t[0].n[0]+t->bt.j); ++ printf("%d\n", t[0].n[1]); ++ printf("%d\n", t[0].n[2]); ++ printf("%d\n", t[0].n[3]); ++ printf("%d\n", t[1].bt.j); ++ printf("%d\n", t[1].n[0]); ++ printf("%d\n", t[1].n[0]+t->bt.j); ++ printf("%d\n", t[1].n[1]); ++ printf("%d\n", t[1].n[2]); ++ printf("%d\n", t[1].n[3]); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/023_fortran_call_c_nested_struct_complicated/c_func003.c b/test/interoperability_with_c_fortran_call_c/023_fortran_call_c_nested_struct_complicated/c_func003.c +new file mode 100644 +index 0000000..8d0298b +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/023_fortran_call_c_nested_struct_complicated/c_func003.c +@@ -0,0 +1,23 @@ ++#include ++struct BaseTy { ++ int j; ++}; ++struct Ty1 { ++ struct BaseTy bt; ++ int k; ++}; ++struct Ty { ++ struct BaseTy bt; ++ struct Ty1 yt; ++ int n[4]; ++}; ++void c_func_(struct Ty *t) { ++ printf("%d\n", t->bt.j); ++ printf("%d\n", t->n[0]); ++ printf("%d\n", t->n[0]+t->bt.j); ++ printf("%d\n", t->n[1]); ++ printf("%d\n", t->n[2]); ++ printf("%d\n", t->n[3]); ++ printf("%d\n", t->yt.k); ++ printf("%d\n", t->yt.bt.j); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/023_fortran_call_c_nested_struct_complicated/c_func004.c b/test/interoperability_with_c_fortran_call_c/023_fortran_call_c_nested_struct_complicated/c_func004.c +new file mode 100644 +index 0000000..ff232d9 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/023_fortran_call_c_nested_struct_complicated/c_func004.c +@@ -0,0 +1,30 @@ ++#include ++struct BaseTy { ++ int j; ++}; ++struct Ty1 { ++ struct BaseTy bt; ++ int k1; ++}; ++struct Ty2 { ++ struct Ty1 bty1; ++ int k2; ++}; ++struct Ty3 { ++ struct Ty2 bty2; ++ int k3; ++}; ++struct Ty { ++ struct Ty3 yt; ++ int n[4]; ++}; ++void c_func_(struct Ty *t) { ++ printf("%d\n", t->n[0]); ++ printf("%d\n", t->n[1]); ++ printf("%d\n", t->n[2]); ++ printf("%d\n", t->n[3]); ++ printf("%d\n", t->yt.k3); ++ printf("%d\n", t->yt.bty2.k2); ++ printf("%d\n", t->yt.bty2.bty1.k1); ++ printf("%d\n", t->yt.bty2.bty1.bt.j); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/023_fortran_call_c_nested_struct_complicated/c_func005.c b/test/interoperability_with_c_fortran_call_c/023_fortran_call_c_nested_struct_complicated/c_func005.c +new file mode 100644 +index 0000000..9cff8b8 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/023_fortran_call_c_nested_struct_complicated/c_func005.c +@@ -0,0 +1,18 @@ ++#include ++struct BaseTy { ++ int j; ++}; ++struct Ty { ++ struct BaseTy bt[3]; ++ int n[4]; ++}; ++void c_func_(struct Ty *t) { ++ printf("%d\n", t->bt[0].j); ++ printf("%d\n", t->bt[1].j); ++ printf("%d\n", t->bt[2].j); ++ printf("%d\n", t->n[0]); ++ printf("%d\n", t->n[0]+t->bt[0].j); ++ printf("%d\n", t->n[1]); ++ printf("%d\n", t->n[2]); ++ printf("%d\n", t->n[3]); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/023_fortran_call_c_nested_struct_complicated/c_func006.c b/test/interoperability_with_c_fortran_call_c/023_fortran_call_c_nested_struct_complicated/c_func006.c +new file mode 100644 +index 0000000..6bd160d +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/023_fortran_call_c_nested_struct_complicated/c_func006.c +@@ -0,0 +1,19 @@ ++#include ++struct BaseTy { ++ int j; ++}; ++struct Ty { ++ struct BaseTy bt[3]; ++ int n[4]; ++}; ++struct Ty* c_func_(struct Ty *t) { ++ printf("%d\n", t->bt[0].j); ++ printf("%d\n", t->bt[1].j); ++ printf("%d\n", t->bt[2].j); ++ printf("%d\n", t->n[0]); ++ printf("%d\n", t->n[0]+t->bt[0].j); ++ printf("%d\n", t->n[1]); ++ printf("%d\n", t->n[2]); ++ printf("%d\n", t->n[3]); ++ return t; ++} +diff --git a/test/interoperability_with_c_fortran_call_c/023_fortran_call_c_nested_struct_complicated/fortran_main001.f90 b/test/interoperability_with_c_fortran_call_c/023_fortran_call_c_nested_struct_complicated/fortran_main001.f90 +new file mode 100644 +index 0000000..2647a97 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/023_fortran_call_c_nested_struct_complicated/fortran_main001.f90 +@@ -0,0 +1,20 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is derived type ++! ++program main ++ type, bind(c) :: base ++ integer(4) :: j = -1 ++ end type base ++ type, bind(c) :: t ++ type(base) :: bt ++ integer(4) :: i(4) = 1 ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) ++ import :: t ++ type(t) :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/023_fortran_call_c_nested_struct_complicated/fortran_main002.f90 b/test/interoperability_with_c_fortran_call_c/023_fortran_call_c_nested_struct_complicated/fortran_main002.f90 +new file mode 100644 +index 0000000..edf7112 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/023_fortran_call_c_nested_struct_complicated/fortran_main002.f90 +@@ -0,0 +1,20 @@ ++! Test fortran call c for the array of derived type and the component ++! of the derived type is derived type ++! ++program main ++ type, bind(c) :: base ++ integer(4) :: j = -1 ++ end type base ++ type, bind(c) :: t ++ type(base) :: bt ++ integer(4) :: i(4) = 1 ++ end type t ++ type(t) :: my_t(2) ++ interface ++ subroutine c_func(a) ++ import :: t ++ type(t) :: a(2) ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/023_fortran_call_c_nested_struct_complicated/fortran_main003.f90 b/test/interoperability_with_c_fortran_call_c/023_fortran_call_c_nested_struct_complicated/fortran_main003.f90 +new file mode 100644 +index 0000000..e0d5848 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/023_fortran_call_c_nested_struct_complicated/fortran_main003.f90 +@@ -0,0 +1,25 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type are derived types ++! ++program main ++ type, bind(c) :: base ++ integer(4) :: j = -1 ++ end type base ++ type, bind(c) :: base2 ++ type(base) :: bt ++ integer(4) :: k = 256 ++ end type base2 ++ type, bind(c) :: t ++ type(base) :: bt ++ type(base2) :: yt ++ integer(4) :: i(4) = 1 ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) ++ import :: t ++ type(t) :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/023_fortran_call_c_nested_struct_complicated/fortran_main004.f90 b/test/interoperability_with_c_fortran_call_c/023_fortran_call_c_nested_struct_complicated/fortran_main004.f90 +new file mode 100644 +index 0000000..66e62eb +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/023_fortran_call_c_nested_struct_complicated/fortran_main004.f90 +@@ -0,0 +1,31 @@ ++! Test fortran call c for the nesting of derived types ++! ++program main ++ type, bind(c) :: base ++ integer(4) :: j = -1 ++ end type base ++ type, bind(c) :: base1 ++ type(base) :: bt1 ++ integer(4) :: k1 = 256 ++ end type base1 ++ type, bind(c) :: base2 ++ type(base1) :: bt2 ++ integer(4) :: k2 = 257 ++ end type base2 ++ type, bind(c) :: base3 ++ type(base2) :: bt3 ++ integer(4) :: k3 = 258 ++ end type base3 ++ type, bind(c) :: t ++ type(base3) :: yt ++ integer(4) :: i(4) = 1 ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) ++ import :: t ++ type(t) :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/023_fortran_call_c_nested_struct_complicated/fortran_main005.f90 b/test/interoperability_with_c_fortran_call_c/023_fortran_call_c_nested_struct_complicated/fortran_main005.f90 +new file mode 100644 +index 0000000..60cd8ac +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/023_fortran_call_c_nested_struct_complicated/fortran_main005.f90 +@@ -0,0 +1,20 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is array of derived type ++! ++program main ++ type, bind(c) :: base ++ integer(4) :: j = -1 ++ end type base ++ type, bind(c) :: t ++ type(base) :: bt(3) ++ integer(4) :: i(4) = 1 ++ end type t ++ type(t) :: my_t ++ interface ++ subroutine c_func(a) ++ import :: t ++ type(t) :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/023_fortran_call_c_nested_struct_complicated/fortran_main006.f90 b/test/interoperability_with_c_fortran_call_c/023_fortran_call_c_nested_struct_complicated/fortran_main006.f90 +new file mode 100644 +index 0000000..36ef4a9 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/023_fortran_call_c_nested_struct_complicated/fortran_main006.f90 +@@ -0,0 +1,20 @@ ++! Test fortran call c for the return type is derived type ++! ++program main ++ type, bind(c) :: base ++ integer(4) :: j = -1 ++ end type base ++ type, bind(c) :: t ++ type(base) :: bt(3) ++ integer(4) :: i(4) = 1 ++ end type t ++ type(t) :: my_t ++ interface ++ function c_func(a) result(res) bind(c, name = "c_func_") ++ import :: t ++ type(t) :: a ++ type(t), pointer :: res ++ end ++ end interface ++ print *, c_func(my_t) ++end +diff --git a/test/interoperability_with_c_fortran_call_c/023_fortran_call_c_nested_struct_complicated/run.sh b/test/interoperability_with_c_fortran_call_c/023_fortran_call_c_nested_struct_complicated/run.sh +new file mode 100644 +index 0000000..4d1b0a2 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/023_fortran_call_c_nested_struct_complicated/run.sh +@@ -0,0 +1,16 @@ ++for i in {001..006} ++do ++echo "------- test $i ------." ++#echo "----- gfortran result:" ++#gcc c_func$i.c -c -o c-test.o ++#gfortran fortran_main$i.f90 -fno-range-check -c -o fortran-test.o ++#gfortran c-test.o fortran-test.o ++#./a.out ++#rm *.o a.out ++echo "----- flang-new result : " ++clang c_func$i.c -c -o c-test.o ++flang-new fortran_main$i.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o a.out ++done +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/c_func001.c b/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/c_func001.c +new file mode 100644 +index 0000000..af6f0af +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/c_func001.c +@@ -0,0 +1,8 @@ ++#include ++struct Ty { ++ int x[2]; ++}; ++void c_func_(struct Ty *t) { ++ printf("%d\t", t->x[0]); ++ printf("%d\n", t->x[1]); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/c_func002.c b/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/c_func002.c +new file mode 100644 +index 0000000..8a69b38 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/c_func002.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ short x[2]; ++}; ++void c_func_(struct Ty *t) { ++ printf("%hd\t", t->x[0]); ++ printf("%hd\n", t->x[1]); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/c_func003.c b/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/c_func003.c +new file mode 100644 +index 0000000..2daf4d0 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/c_func003.c +@@ -0,0 +1,8 @@ ++#include ++struct Ty { ++ long x[2]; ++}; ++void c_func_(struct Ty *t) { ++ printf("%ld\t", t->x[0]); ++ printf("%ld\n", t->x[1]); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/c_func004.c b/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/c_func004.c +new file mode 100644 +index 0000000..2dba23e +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/c_func004.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ long long x[2]; ++}; ++void c_func_(struct Ty *t) { ++ printf("%lld\t", t->x[0]); ++ printf("%lld\n", t->x[1]); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/c_func005.c b/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/c_func005.c +new file mode 100644 +index 0000000..3ff03dc +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/c_func005.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ signed char x[2]; ++}; ++void c_func_(struct Ty *t) { ++ printf("%c\t", t->x[0]); ++ printf("%c\n", t->x[1]); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/c_func006.c b/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/c_func006.c +new file mode 100644 +index 0000000..15c7b76 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/c_func006.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ size_t x[2]; ++}; ++void c_func_(struct Ty *t) { ++ printf("%ld\t", t->x[0]); ++ printf("%ld\n", t->x[1]); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/c_func007.c b/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/c_func007.c +new file mode 100644 +index 0000000..ab5a40e +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/c_func007.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ int8_t x[2]; ++}; ++void c_func_(struct Ty *t) { ++ printf("%hhd\t", t->x[0]); ++ printf("%hhd\n", t->x[1]); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/c_func008.c b/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/c_func008.c +new file mode 100644 +index 0000000..48e1926 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/c_func008.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ int16_t x[2]; ++}; ++void c_func_(struct Ty *t) { ++ printf("%hd\t", t->x[0]); ++ printf("%hd\n", t->x[1]); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/c_func009.c b/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/c_func009.c +new file mode 100644 +index 0000000..0cb1972 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/c_func009.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ int32_t x[2]; ++}; ++void c_func_(struct Ty *t) { ++ printf("%d\t", t->x[0]); ++ printf("%d\n", t->x[1]); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/c_func010.c b/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/c_func010.c +new file mode 100644 +index 0000000..c158eee +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/c_func010.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ int64_t x[2]; ++}; ++void c_func_(struct Ty *t) { ++ printf("%ld\t", t->x[0]); ++ printf("%ld\n", t->x[1]); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/c_func011.c b/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/c_func011.c +new file mode 100644 +index 0000000..7fb9f41 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/c_func011.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ int_least8_t x[2]; ++}; ++void c_func_(struct Ty *t) { ++ printf("%hhd\t", t->x[0]); ++ printf("%hhd\n", t->x[1]); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/c_func012.c b/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/c_func012.c +new file mode 100644 +index 0000000..1ab424d +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/c_func012.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ int_least16_t x[2]; ++}; ++void c_func_(struct Ty *t) { ++ printf("%hd\t", t->x[0]); ++ printf("%hd\n", t->x[1]); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/c_func013.c b/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/c_func013.c +new file mode 100644 +index 0000000..98a7568 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/c_func013.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ int_least32_t x[2]; ++}; ++void c_func_(struct Ty *t) { ++ printf("%d\t", t->x[0]); ++ printf("%d\n", t->x[1]); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/c_func014.c b/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/c_func014.c +new file mode 100644 +index 0000000..56cd691 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/c_func014.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ int_least64_t x[2]; ++}; ++void c_func_(struct Ty *t) { ++ printf("%ld\t", t->x[0]); ++ printf("%ld\n", t->x[1]); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/c_func015.c b/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/c_func015.c +new file mode 100644 +index 0000000..91823ae +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/c_func015.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ int_fast8_t x[2]; ++}; ++void c_func_(struct Ty *t) { ++ printf("%hhd\t", t->x[0]); ++ printf("%hhd\n", t->x[1]); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/c_func016.c b/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/c_func016.c +new file mode 100644 +index 0000000..99bd5f1 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/c_func016.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ int_fast16_t x[2]; ++}; ++void c_func_(struct Ty *t) { ++ printf("%ld\t", t->x[0]); ++ printf("%ld\n", t->x[1]); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/c_func017.c b/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/c_func017.c +new file mode 100644 +index 0000000..51c3977 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/c_func017.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ int_fast32_t x[2]; ++}; ++void c_func_(struct Ty *t) { ++ printf("%ld\t", t->x[0]); ++ printf("%ld\n", t->x[1]); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/c_func018.c b/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/c_func018.c +new file mode 100644 +index 0000000..575e915 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/c_func018.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ int_fast64_t x[2]; ++}; ++void c_func_(struct Ty *t) { ++ printf("%ld\t", t->x[0]); ++ printf("%ld\n", t->x[1]); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/c_func019.c b/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/c_func019.c +new file mode 100644 +index 0000000..45f0beb +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/c_func019.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ intmax_t x[2]; ++}; ++void c_func_(struct Ty *t) { ++ printf("%ld\t", t->x[0]); ++ printf("%ld\n", t->x[1]); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/c_func020.c b/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/c_func020.c +new file mode 100644 +index 0000000..553b51b +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/c_func020.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ intptr_t x[2]; ++}; ++void c_func_(struct Ty *t) { ++ printf("%ld\t", t->x[0]); ++ printf("%ld\n", t->x[1]); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/c_func021.c b/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/c_func021.c +new file mode 100644 +index 0000000..13cce4d +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/c_func021.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ float x[2]; ++}; ++void c_func_(struct Ty *t) { ++ printf("%f\t", t->x[0]); ++ printf("%f\n", t->x[1]); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/c_func022.c b/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/c_func022.c +new file mode 100644 +index 0000000..d1f7b9d +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/c_func022.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ double x[2]; ++}; ++void c_func_(struct Ty *t) { ++ printf("%lf\t", t->x[0]); ++ printf("%lf\n", t->x[1]); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/c_func023.c b/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/c_func023.c +new file mode 100644 +index 0000000..5f383b1 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/c_func023.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ long double x[2]; ++}; ++void c_func_(struct Ty *t) { ++ printf("%Lf\t", t->x[0]); ++ printf("%Lf\n", t->x[1]); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/c_func024.c b/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/c_func024.c +new file mode 100644 +index 0000000..65309d7 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/c_func024.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ float _Complex x[2]; ++}; ++void c_func_(struct Ty *t) { ++ printf("%f + %fi\n", creal(t->x[0]), cimag(t->x[0])); ++ printf("%f + %fi\n", creal(t->x[1]), cimag(t->x[1])); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/c_func025.c b/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/c_func025.c +new file mode 100644 +index 0000000..b36c40e +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/c_func025.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ double _Complex x[2]; ++}; ++void c_func_(struct Ty *t) { ++ printf("%lf + %lfi\n", creal(t->x[0]), cimag(t->x[0])); ++ printf("%lf + %lfi\n", creal(t->x[1]), cimag(t->x[1])); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/c_func026.c b/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/c_func026.c +new file mode 100644 +index 0000000..a7bcf01 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/c_func026.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ long double _Complex x[2]; ++}; ++void c_func_(struct Ty *t) { ++ printf("%f + %fi\n", creal(t->x[0]), cimag(t->x[0])); ++ printf("%f + %fi\n", creal(t->x[1]), cimag(t->x[1])); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/c_func027.c b/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/c_func027.c +new file mode 100644 +index 0000000..5723427 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/c_func027.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ _Bool x[2]; ++}; ++void c_func_(struct Ty *t) { ++ printf("%d\t", t->x[0]); ++ printf("%d\n", t->x[1]); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/c_func028.c b/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/c_func028.c +new file mode 100644 +index 0000000..47138e9 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/c_func028.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ char x[2]; ++}; ++void c_func_(struct Ty *t) { ++ printf("%c\t", t->x[0]); ++ printf("%c\n", t->x[1]); ++} +diff --git a/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/fortran_main001.f90 b/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/fortran_main001.f90 +new file mode 100644 +index 0000000..6c8c711 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/fortran_main001.f90 +@@ -0,0 +1,16 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is array of type int without iso_c_binding ++! ++program main + type, bind(c) :: t -+ type(base) :: bt -+ integer(C_INT8_T) :: x = -128 -+ integer(1) :: y = 127 ++ integer :: x(2) = 1 + end type t + type(t) :: my_t -+ integer(C_INT8_T) :: my_x = 3 + interface -+ subroutine c_func(a, b) -+ use iso_c_binding ++ subroutine c_func(a) + import :: t + type(t) :: a -+ integer(C_INT8_T) :: b + end + end interface -+ call c_func(my_t, my_x) ++ call c_func(my_t) +end -diff --git a/test/interoperability_with_c/014_fortran_call_c_mix/fortran_main008.f90 b/test/interoperability_with_c/014_fortran_call_c_mix/fortran_main008.f90 -new file mode 100755 -index 0000000..8b5a4ce +diff --git a/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/fortran_main002.f90 b/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/fortran_main002.f90 +new file mode 100644 +index 0000000..4c9f0b9 --- /dev/null -+++ b/test/interoperability_with_c/014_fortran_call_c_mix/fortran_main008.f90 -@@ -0,0 +1,26 @@ -+! Test fortran call c for the derived type and the derived type has -+! multiple components and one component is the derived type. remaining -+! components are mixed type int16_t ++++ b/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/fortran_main002.f90 +@@ -0,0 +1,16 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is array of type short without iso_c_binding +! +program main -+ use iso_c_binding -+ type, bind(c) :: base -+ integer(C_INT16_T) :: j(2) = -2 -+ end type base + type, bind(c) :: t -+ type(base) :: bt -+ integer(C_INT16_T) :: x = -32768 -+ integer(2) :: y = 32767 ++ integer(2) :: x(2) = -32768 + end type t + type(t) :: my_t -+ integer(C_INT16_T) :: my_x = 3 + interface -+ subroutine c_func(a, b) -+ use iso_c_binding ++ subroutine c_func(a) + import :: t + type(t) :: a -+ integer(C_INT16_T) :: b + end + end interface -+ call c_func(my_t, my_x) ++ call c_func(my_t) +end -diff --git a/test/interoperability_with_c/014_fortran_call_c_mix/fortran_main009.f90 b/test/interoperability_with_c/014_fortran_call_c_mix/fortran_main009.f90 -new file mode 100755 -index 0000000..2674ede +diff --git a/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/fortran_main003.f90 b/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/fortran_main003.f90 +new file mode 100644 +index 0000000..f8962b2 --- /dev/null -+++ b/test/interoperability_with_c/014_fortran_call_c_mix/fortran_main009.f90 -@@ -0,0 +1,26 @@ -+! Test fortran call c for the derived type and the derived type has -+! multiple components and one component is the derived type. remaining -+! components are mixed type int32_t ++++ b/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/fortran_main003.f90 +@@ -0,0 +1,16 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is array of type long without iso_c_binding +! +program main -+ use iso_c_binding -+ type, bind(c) :: base -+ integer(C_INT32_T) :: j(2) = -2 -+ end type base + type, bind(c) :: t -+ type(base) :: bt -+ integer(C_INT32_T) :: x = -2147483647 -+ integer(4) :: y = 2147483647 ++ integer(8) :: x(2) = -2147483647 + end type t + type(t) :: my_t -+ integer(C_INT32_T) :: my_x = 3 + interface -+ subroutine c_func(a, b) -+ use iso_c_binding ++ subroutine c_func(a) + import :: t + type(t) :: a -+ integer(C_INT32_T) :: b + end + end interface -+ call c_func(my_t, my_x) ++ call c_func(my_t) +end -diff --git a/test/interoperability_with_c/014_fortran_call_c_mix/fortran_main010.f90 b/test/interoperability_with_c/014_fortran_call_c_mix/fortran_main010.f90 -new file mode 100755 -index 0000000..9d50708 +diff --git a/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/fortran_main004.f90 b/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/fortran_main004.f90 +new file mode 100644 +index 0000000..1bdf578 --- /dev/null -+++ b/test/interoperability_with_c/014_fortran_call_c_mix/fortran_main010.f90 -@@ -0,0 +1,26 @@ -+! Test fortran call c for the derived type and the derived type has -+! multiple components and one component is the derived type. remaining -+! components are mixed type int64_t ++++ b/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/fortran_main004.f90 +@@ -0,0 +1,16 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is array of type long long without iso_c_binding +! +program main -+ use iso_c_binding -+ type, bind(c) :: base -+ integer(C_INT64_T) :: j(2) = -2 -+ end type base + type, bind(c) :: t -+ type(base) :: bt -+ integer(C_INT64_T) :: x = -9223372036854775807 -+ integer(8) :: y = 9223372036854775807 ++ integer(8) :: x(2) = -9223372036854775807 + end type t + type(t) :: my_t -+ integer(C_INT64_T) :: my_x = 3 + interface -+ subroutine c_func(a, b) -+ use iso_c_binding ++ subroutine c_func(a) + import :: t + type(t) :: a -+ integer(C_INT64_T) :: b + end + end interface -+ call c_func(my_t, my_x) ++ call c_func(my_t) +end -diff --git a/test/interoperability_with_c/014_fortran_call_c_mix/fortran_main011.f90 b/test/interoperability_with_c/014_fortran_call_c_mix/fortran_main011.f90 -new file mode 100755 -index 0000000..3e895fc +diff --git a/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/fortran_main005.f90 b/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/fortran_main005.f90 +new file mode 100644 +index 0000000..b8d6d20 --- /dev/null -+++ b/test/interoperability_with_c/014_fortran_call_c_mix/fortran_main011.f90 -@@ -0,0 +1,26 @@ -+! Test fortran call c for the derived type and the derived type has -+! multiple components and one component is the derived type. remaining -+! components are mixed type int_least8_t ++++ b/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/fortran_main005.f90 +@@ -0,0 +1,16 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is array of type signed char without iso_c_binding +! +program main -+ use iso_c_binding -+ type, bind(c) :: base -+ integer(C_INT_LEAST8_T) :: j(2) = -2 -+ end type base + type, bind(c) :: t -+ type(base) :: bt -+ integer(C_INT_LEAST8_T) :: x = -128 -+ integer(1) :: y = 127 ++ integer(1) :: x(2) = 65 + end type t + type(t) :: my_t -+ integer(C_INT_LEAST8_T) :: my_x = 3 + interface -+ subroutine c_func(a, b) -+ use iso_c_binding ++ subroutine c_func(a) + import :: t + type(t) :: a -+ integer(C_INT_LEAST8_T) :: b + end + end interface -+ call c_func(my_t, my_x) ++ call c_func(my_t) +end -diff --git a/test/interoperability_with_c/014_fortran_call_c_mix/fortran_main012.f90 b/test/interoperability_with_c/014_fortran_call_c_mix/fortran_main012.f90 -new file mode 100755 -index 0000000..a8b0ef5 +diff --git a/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/fortran_main006.f90 b/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/fortran_main006.f90 +new file mode 100644 +index 0000000..24f4d74 --- /dev/null -+++ b/test/interoperability_with_c/014_fortran_call_c_mix/fortran_main012.f90 -@@ -0,0 +1,26 @@ -+! Test fortran call c for the derived type and the derived type has -+! multiple components and one component is the derived type. remaining -+! components are mixed type int_least16_t ++++ b/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/fortran_main006.f90 +@@ -0,0 +1,16 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is array of type size_t without iso_c_binding +! +program main -+ use iso_c_binding -+ type, bind(c) :: base -+ integer(C_INT_LEAST16_T) :: j(2) = -2 -+ end type base + type, bind(c) :: t -+ type(base) :: bt -+ integer(C_INT_LEAST16_T) :: x = -32768 -+ integer(2) :: y = 32767 ++ integer(8) :: x(2) = 0 + end type t + type(t) :: my_t -+ integer(C_INT_LEAST16_T) :: my_x = 3 + interface -+ subroutine c_func(a, b) -+ use iso_c_binding ++ subroutine c_func(a) + import :: t + type(t) :: a -+ integer(C_INT_LEAST16_T) :: b + end + end interface -+ call c_func(my_t, my_x) ++ call c_func(my_t) +end -diff --git a/test/interoperability_with_c/014_fortran_call_c_mix/fortran_main013.f90 b/test/interoperability_with_c/014_fortran_call_c_mix/fortran_main013.f90 -new file mode 100755 -index 0000000..62e8b11 +diff --git a/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/fortran_main007.f90 b/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/fortran_main007.f90 +new file mode 100644 +index 0000000..4c868b3 --- /dev/null -+++ b/test/interoperability_with_c/014_fortran_call_c_mix/fortran_main013.f90 -@@ -0,0 +1,26 @@ -+! Test fortran call c for the derived type and the derived type has -+! multiple components and one component is the derived type. remaining -+! components are mixed type int_least32_t ++++ b/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/fortran_main007.f90 +@@ -0,0 +1,16 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is array of type int8_t without iso_c_binding +! +program main -+ use iso_c_binding -+ type, bind(c) :: base -+ integer(C_INT_LEAST32_T) :: j(2) = -2 -+ end type base + type, bind(c) :: t -+ type(base) :: bt -+ integer(C_INT_LEAST32_T) :: x = -2147483647 -+ integer(4) :: y = 2147483647 ++ integer(1) :: x(2) = -128 + end type t + type(t) :: my_t -+ integer(C_INT_LEAST32_T) :: my_x = 3 + interface -+ subroutine c_func(a, b) -+ use iso_c_binding ++ subroutine c_func(a) + import :: t + type(t) :: a -+ integer(C_INT_LEAST32_T) :: b + end + end interface -+ call c_func(my_t, my_x) ++ call c_func(my_t) +end -diff --git a/test/interoperability_with_c/014_fortran_call_c_mix/fortran_main014.f90 b/test/interoperability_with_c/014_fortran_call_c_mix/fortran_main014.f90 -new file mode 100755 -index 0000000..1b0aa8e +diff --git a/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/fortran_main008.f90 b/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/fortran_main008.f90 +new file mode 100644 +index 0000000..0fd89db --- /dev/null -+++ b/test/interoperability_with_c/014_fortran_call_c_mix/fortran_main014.f90 -@@ -0,0 +1,26 @@ -+! Test fortran call ! Test fortran call c for the derived type and the derived type has -+! multiple components and one component is the derived type. remaining -+! components are mixed type int_least64_t ++++ b/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/fortran_main008.f90 +@@ -0,0 +1,16 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is array of type int16_t without iso_c_binding +! +program main -+ use iso_c_binding -+ type, bind(c) :: base -+ integer(C_INT_LEAST64_T) :: j(2) = -2 -+ end type base + type, bind(c) :: t -+ type(base) :: bt -+ integer(C_INT_LEAST64_T) :: x = -9223372036854775807 -+ integer(8) :: y = 9223372036854775807 ++ integer(2) :: x(2) = -32768 + end type t + type(t) :: my_t -+ integer(C_INT_LEAST64_T) :: my_x = 3 + interface -+ subroutine c_func(a, b) -+ use iso_c_binding ++ subroutine c_func(a) + import :: t + type(t) :: a -+ integer(C_INT_LEAST64_T) :: b + end + end interface -+ call c_func(my_t, my_x) ++ call c_func(my_t) +end -diff --git a/test/interoperability_with_c/014_fortran_call_c_mix/fortran_main015.f90 b/test/interoperability_with_c/014_fortran_call_c_mix/fortran_main015.f90 -new file mode 100755 -index 0000000..52d7e1d +diff --git a/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/fortran_main009.f90 b/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/fortran_main009.f90 +new file mode 100644 +index 0000000..2dee9f6 --- /dev/null -+++ b/test/interoperability_with_c/014_fortran_call_c_mix/fortran_main015.f90 -@@ -0,0 +1,26 @@ -+! Test fortran call c for the derived type and the derived type has -+! multiple components and one component is the derived type. remaining -+! components are mixed type int_fast8_t ++++ b/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/fortran_main009.f90 +@@ -0,0 +1,16 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is array of type int32_t without iso_c_binding +! +program main -+ use iso_c_binding -+ type, bind(c) :: base -+ integer(C_INT_FAST8_T) :: j(2) = -2 -+ end type base + type, bind(c) :: t -+ type(base) :: bt -+ integer(C_INT_FAST8_T) :: x = -128 -+ integer(1) :: y = 127 ++ integer(4) :: x(2) = -2147483647 + end type t + type(t) :: my_t -+ integer(C_INT_FAST8_T) :: my_x = 3 + interface -+ subroutine c_func(a, b) -+ use iso_c_binding ++ subroutine c_func(a) + import :: t + type(t) :: a -+ integer(C_INT_FAST8_T) :: b + end + end interface -+ call c_func(my_t, my_x) ++ call c_func(my_t) +end -diff --git a/test/interoperability_with_c/014_fortran_call_c_mix/fortran_main016.f90 b/test/interoperability_with_c/014_fortran_call_c_mix/fortran_main016.f90 -new file mode 100755 -index 0000000..05bd335 +diff --git a/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/fortran_main010.f90 b/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/fortran_main010.f90 +new file mode 100644 +index 0000000..60b3af9 --- /dev/null -+++ b/test/interoperability_with_c/014_fortran_call_c_mix/fortran_main016.f90 -@@ -0,0 +1,26 @@ -+! Test fortran call c for the derived type and the derived type has -+! multiple components and one component is the derived type. remaining -+! components are mixed type int_fast16_t ++++ b/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/fortran_main010.f90 +@@ -0,0 +1,16 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is array of type int64_t without iso_c_binding +! +program main -+ use iso_c_binding -+ type, bind(c) :: base -+ integer(C_INT_FAST16_T) :: j(2) = -2 -+ end type base + type, bind(c) :: t -+ type(base) :: bt -+ integer(C_INT_FAST16_T) :: x = -32768 -+ integer(8) :: y = 32767 ++ integer(8) :: x(2) = -9223372036854775807 + end type t + type(t) :: my_t -+ integer(C_INT_FAST16_T) :: my_x = 3 + interface -+ subroutine c_func(a, b) -+ use iso_c_binding ++ subroutine c_func(a) + import :: t + type(t) :: a -+ integer(C_INT_FAST16_T) :: b + end + end interface -+ call c_func(my_t, my_x) ++ call c_func(my_t) +end -diff --git a/test/interoperability_with_c/014_fortran_call_c_mix/fortran_main017.f90 b/test/interoperability_with_c/014_fortran_call_c_mix/fortran_main017.f90 -new file mode 100755 -index 0000000..0a648b4 +diff --git a/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/fortran_main011.f90 b/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/fortran_main011.f90 +new file mode 100644 +index 0000000..2ac8242 --- /dev/null -+++ b/test/interoperability_with_c/014_fortran_call_c_mix/fortran_main017.f90 -@@ -0,0 +1,26 @@ -+! Test fortran call c for the derived type and the derived type has -+! multiple components and one component is the derived type. remaining -+! components are mixed type int_fast32_t ++++ b/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/fortran_main011.f90 +@@ -0,0 +1,16 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is array of type int_least8_t without iso_c_binding +! +program main -+ use iso_c_binding -+ type, bind(c) :: base -+ integer(C_INT_FAST32_T) :: j(2) = -2 -+ end type base + type, bind(c) :: t -+ type(base) :: bt -+ integer(C_INT_FAST32_T) :: x = -2147483647 -+ integer(8) :: y = 2147483647 ++ integer(1) :: x(2) = -128 + end type t + type(t) :: my_t -+ integer(C_INT_FAST32_T) :: my_x = 3 + interface -+ subroutine c_func(a, b) -+ use iso_c_binding ++ subroutine c_func(a) + import :: t + type(t) :: a -+ integer(C_INT_FAST32_T) :: b + end + end interface -+ call c_func(my_t, my_x) ++ call c_func(my_t) +end -diff --git a/test/interoperability_with_c/014_fortran_call_c_mix/fortran_main018.f90 b/test/interoperability_with_c/014_fortran_call_c_mix/fortran_main018.f90 -new file mode 100755 -index 0000000..34fd6b2 +diff --git a/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/fortran_main012.f90 b/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/fortran_main012.f90 +new file mode 100644 +index 0000000..50c6ca8 --- /dev/null -+++ b/test/interoperability_with_c/014_fortran_call_c_mix/fortran_main018.f90 -@@ -0,0 +1,26 @@ -+! Test fortran call c for the derived type and the derived type has -+! multiple components and one component is the derived type. remaining -+! components are mixed type int_fast64_t ++++ b/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/fortran_main012.f90 +@@ -0,0 +1,16 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is array of type int_least16_t without iso_c_binding +! +program main -+ use iso_c_binding -+ type, bind(c) :: base -+ integer(C_INT_FAST64_T) :: j(2) = -2 -+ end type base + type, bind(c) :: t -+ type(base) :: bt -+ integer(C_INT_FAST64_T) :: x = -9223372036854775807 -+ integer(8) :: y = 9223372036854775807 ++ integer(2) :: x(2) = -32768 + end type t + type(t) :: my_t -+ integer(C_INT_FAST64_T) :: my_x = 3 + interface -+ subroutine c_func(a, b) -+ use iso_c_binding ++ subroutine c_func(a) + import :: t + type(t) :: a -+ integer(C_INT_FAST64_T) :: b + end + end interface -+ call c_func(my_t, my_x) ++ call c_func(my_t) +end -diff --git a/test/interoperability_with_c/014_fortran_call_c_mix/fortran_main019.f90 b/test/interoperability_with_c/014_fortran_call_c_mix/fortran_main019.f90 -new file mode 100755 -index 0000000..d18bfaa +diff --git a/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/fortran_main013.f90 b/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/fortran_main013.f90 +new file mode 100644 +index 0000000..ff3b140 --- /dev/null -+++ b/test/interoperability_with_c/014_fortran_call_c_mix/fortran_main019.f90 -@@ -0,0 +1,26 @@ -+! Test fortran call c for the derived type and the derived type has -+! multiple components and one component is the derived type. remaining -+! components are mixed type int_intmax_t ++++ b/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/fortran_main013.f90 +@@ -0,0 +1,16 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is array of type int_least32_t without iso_c_binding +! +program main -+ use iso_c_binding -+ type, bind(c) :: base -+ integer(C_INTMAX_T) :: j(2) = -2 -+ end type base + type, bind(c) :: t -+ type(base) :: bt -+ integer(C_INTMAX_T) :: x = 11548694 -+ integer(8) :: y = 916519685 ++ integer(4) :: x(2) = -2147483647 + end type t + type(t) :: my_t -+ integer(C_INTMAX_T) :: my_x = 3 + interface -+ subroutine c_func(a, b) -+ use iso_c_binding ++ subroutine c_func(a) + import :: t + type(t) :: a -+ integer(C_INTMAX_T) :: b + end + end interface -+ call c_func(my_t, my_x) ++ call c_func(my_t) +end -diff --git a/test/interoperability_with_c/014_fortran_call_c_mix/fortran_main020.f90 b/test/interoperability_with_c/014_fortran_call_c_mix/fortran_main020.f90 -new file mode 100755 -index 0000000..849525a +diff --git a/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/fortran_main014.f90 b/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/fortran_main014.f90 +new file mode 100644 +index 0000000..366a7a3 --- /dev/null -+++ b/test/interoperability_with_c/014_fortran_call_c_mix/fortran_main020.f90 -@@ -0,0 +1,26 @@ -+! Test fortran call c for the derived type and the derived type has -+! multiple components and one component is the derived type. remaining -+! components are mixed type intptr_t ++++ b/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/fortran_main014.f90 +@@ -0,0 +1,16 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is array of type int_least64_t without iso_c_binding +! +program main -+ use iso_c_binding -+ type, bind(c) :: base -+ integer(C_INTPTR_T) :: j(2) = -2 -+ end type base + type, bind(c) :: t -+ type(base) :: bt -+ integer(C_INTPTR_T) :: x = -922337 -+ integer(8) :: y = 922337 ++ integer(8) :: x(2) = -9223372036854775807 + end type t + type(t) :: my_t -+ integer(C_INTPTR_T) :: my_x = 3 + interface -+ subroutine c_func(a, b) -+ use iso_c_binding ++ subroutine c_func(a) + import :: t + type(t) :: a -+ integer(C_INTPTR_T) :: b + end + end interface -+ call c_func(my_t, my_x) ++ call c_func(my_t) +end -diff --git a/test/interoperability_with_c/014_fortran_call_c_mix/fortran_main021.f90 b/test/interoperability_with_c/014_fortran_call_c_mix/fortran_main021.f90 -new file mode 100755 -index 0000000..ecb0e02 +diff --git a/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/fortran_main015.f90 b/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/fortran_main015.f90 +new file mode 100644 +index 0000000..654302d --- /dev/null -+++ b/test/interoperability_with_c/014_fortran_call_c_mix/fortran_main021.f90 -@@ -0,0 +1,24 @@ -+! Test fortran call c for the derived type and the derived type has -+! multiple components and one component is the derived type. remaining -+! components are mixed type float ++++ b/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/fortran_main015.f90 +@@ -0,0 +1,16 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is array of type int_fast8_t without iso_c_binding +! +program main -+ use iso_c_binding -+ type, bind(c) :: base -+ real(C_FLOAT) :: j(2) = -2.36 -+ end type base + type, bind(c) :: t -+ type(base) :: bt -+ real(C_FLOAT) :: x = -3.14 -+ real(4) :: y = 3.14 ++ integer(1) :: x(2) = -128 + end type t + type(t) :: my_t + interface + subroutine c_func(a) -+ use iso_c_binding + import :: t + type(t) :: a + end + end interface + call c_func(my_t) +end -diff --git a/test/interoperability_with_c/014_fortran_call_c_mix/fortran_main022.f90 b/test/interoperability_with_c/014_fortran_call_c_mix/fortran_main022.f90 -new file mode 100755 -index 0000000..7865856 +diff --git a/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/fortran_main016.f90 b/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/fortran_main016.f90 +new file mode 100644 +index 0000000..78727d9 --- /dev/null -+++ b/test/interoperability_with_c/014_fortran_call_c_mix/fortran_main022.f90 -@@ -0,0 +1,24 @@ -+! Test fortran call c for the derived type and the derived type has -+! multiple components and one component is the derived type. remaining -+! components are mixed type double ++++ b/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/fortran_main016.f90 +@@ -0,0 +1,16 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is array of type int_fast16_t without iso_c_binding +! +program main -+ use iso_c_binding -+ type, bind(c) :: base -+ real(C_DOUBLE) :: j(2) = 450359962737049.621345 -+ end type base + type, bind(c) :: t -+ type(base) :: bt -+ real(C_DOUBLE) :: x = -450359962737049.621113 -+ real(8) :: y = 12345678.7654321 ++ integer(8) :: x(2) = -32768 + end type t + type(t) :: my_t + interface + subroutine c_func(a) -+ use iso_c_binding + import :: t + type(t) :: a + end + end interface + call c_func(my_t) +end -diff --git a/test/interoperability_with_c/014_fortran_call_c_mix/fortran_main023.f90 b/test/interoperability_with_c/014_fortran_call_c_mix/fortran_main023.f90 -new file mode 100755 -index 0000000..d88c887 +diff --git a/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/fortran_main017.f90 b/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/fortran_main017.f90 +new file mode 100644 +index 0000000..122b60d --- /dev/null -+++ b/test/interoperability_with_c/014_fortran_call_c_mix/fortran_main023.f90 -@@ -0,0 +1,25 @@ -+! Test fortran call c for the derived type and the derived type has -+! multiple components and one component is the derived type. remaining -+! components are mixed type long double ++++ b/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/fortran_main017.f90 +@@ -0,0 +1,16 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is array of type int_fast32_t without iso_c_binding +! +program main -+ use iso_c_binding -+ integer, parameter :: K = selected_real_kind(16) -+ type, bind(c) :: base -+ real(C_LONG_DOUBLE) :: j(2) = 50359534651234685432213246841962737049.621345 -+ end type base + type, bind(c) :: t -+ type(base) :: bt -+ real(C_LONG_DOUBLE) :: x = -450359962737049.621113 -+ real(K) :: y = 12345678.7654321 ++ integer(8) :: x(2) = -2147483647 + end type t + type(t) :: my_t + interface + subroutine c_func(a) -+ use iso_c_binding + import :: t + type(t) :: a + end + end interface + call c_func(my_t) +end -diff --git a/test/interoperability_with_c/014_fortran_call_c_mix/fortran_main024.f90 b/test/interoperability_with_c/014_fortran_call_c_mix/fortran_main024.f90 -new file mode 100755 -index 0000000..033c05a +diff --git a/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/fortran_main018.f90 b/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/fortran_main018.f90 +new file mode 100644 +index 0000000..245cca8 --- /dev/null -+++ b/test/interoperability_with_c/014_fortran_call_c_mix/fortran_main024.f90 -@@ -0,0 +1,24 @@ -+! Test fortran call c for the derived type and the derived type has -+! multiple components and one component is the derived type. remaining -+! components are mixed type float complex ++++ b/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/fortran_main018.f90 +@@ -0,0 +1,16 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is array of type int_fast64_t without iso_c_binding +! +program main -+ use iso_c_binding -+ type, bind(c) :: base -+ complex(C_FLOAT_COMPLEX) :: j(2) = (1, 2); -+ end type base + type, bind(c) :: t -+ type(base) :: bt -+ complex(C_FLOAT_COMPLEX) :: x = (-3, 1) -+ complex(4) :: y = (3, 1) ++ integer(8) :: x(2) = -9223372036854775807 + end type t + type(t) :: my_t + interface + subroutine c_func(a) -+ use iso_c_binding + import :: t + type(t) :: a + end + end interface + call c_func(my_t) +end -diff --git a/test/interoperability_with_c/014_fortran_call_c_mix/fortran_main025.f90 b/test/interoperability_with_c/014_fortran_call_c_mix/fortran_main025.f90 -new file mode 100755 -index 0000000..e03cd28 +diff --git a/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/fortran_main019.f90 b/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/fortran_main019.f90 +new file mode 100644 +index 0000000..f46b68f --- /dev/null -+++ b/test/interoperability_with_c/014_fortran_call_c_mix/fortran_main025.f90 -@@ -0,0 +1,24 @@ -+! Test fortran call c for the derived type and the derived type has -+! multiple components and one component is the derived type. remaining -+! components are mixed type double complex ++++ b/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/fortran_main019.f90 +@@ -0,0 +1,16 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is array of type intmax_t without iso_c_binding +! +program main -+ use iso_c_binding -+ type, bind(c) :: base -+ complex(C_DOUBLE_COMPLEX) :: j(2) = (4503599.6, 621.345); -+ end type base + type, bind(c) :: t -+ type(base) :: bt -+ complex(C_DOUBLE_COMPLEX) :: x = (-3.14159265358979, 1) -+ complex(8) :: y = (3.14159265358979, 1) ++ integer(8) :: x(2) = -9223372036854775807 + end type t + type(t) :: my_t + interface + subroutine c_func(a) -+ use iso_c_binding + import :: t + type(t) :: a + end + end interface + call c_func(my_t) +end -diff --git a/test/interoperability_with_c/014_fortran_call_c_mix/fortran_main026.f90 b/test/interoperability_with_c/014_fortran_call_c_mix/fortran_main026.f90 -new file mode 100755 -index 0000000..a3af173 +diff --git a/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/fortran_main020.f90 b/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/fortran_main020.f90 +new file mode 100644 +index 0000000..21ec77a --- /dev/null -+++ b/test/interoperability_with_c/014_fortran_call_c_mix/fortran_main026.f90 -@@ -0,0 +1,25 @@ -+! Test fortran call c for the derived type and the derived type has -+! multiple components and one component is the derived type. remaining -+! components are mixed type long double complex ++++ b/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/fortran_main020.f90 +@@ -0,0 +1,16 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is array of type intptr_t without iso_c_binding +! +program main -+ use iso_c_binding -+ integer, parameter :: K = selected_real_kind(16) -+ type, bind(c) :: base -+ complex(C_LONG_DOUBLE_COMPLEX) :: j(2) = (45545204745299.6, 621.345); -+ end type base + type, bind(c) :: t -+ type(base) :: bt -+ complex(C_LONG_DOUBLE_COMPLEX) :: x = (-3.14159265358979, 1) -+ complex(K) :: y = (3.14159265358979, 1) ++ integer(8) :: x(2) = -9223372036854775807 + end type t + type(t) :: my_t + interface + subroutine c_func(a) -+ use iso_c_binding + import :: t + type(t) :: a + end + end interface + call c_func(my_t) +end -diff --git a/test/interoperability_with_c/014_fortran_call_c_mix/fortran_main027.f90 b/test/interoperability_with_c/014_fortran_call_c_mix/fortran_main027.f90 -new file mode 100755 -index 0000000..2df1f57 +diff --git a/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/fortran_main021.f90 b/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/fortran_main021.f90 +new file mode 100644 +index 0000000..fe827d4 --- /dev/null -+++ b/test/interoperability_with_c/014_fortran_call_c_mix/fortran_main027.f90 -@@ -0,0 +1,26 @@ -+! Test fortran call c for the derived type and the derived type has -+! multiple components and one component is the derived type. remaining -+! components are mixed type bool ++++ b/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/fortran_main021.f90 +@@ -0,0 +1,16 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is array of type float without iso_c_binding +! +program main -+ use iso_c_binding -+ type, bind(c) :: base -+ logical(C_BOOL) :: j(2) = .TRUE. -+ end type base + type, bind(c) :: t -+ type(base) :: bt -+ logical(C_BOOL) :: x = .FALSE. -+ logical(1) :: y = .TRUE. ++ real(4) :: x(2) = 3.14 + end type t + type(t) :: my_t -+ logical(C_BOOL) :: my_x = .FALSE. + interface -+ subroutine c_func(a, b) -+ use iso_c_binding ++ subroutine c_func(a) + import :: t + type(t) :: a -+ logical(C_BOOL) :: b + end + end interface -+ call c_func(my_t, my_x) ++ call c_func(my_t) +end -diff --git a/test/interoperability_with_c/014_fortran_call_c_mix/fortran_main028.f90 b/test/interoperability_with_c/014_fortran_call_c_mix/fortran_main028.f90 -new file mode 100755 -index 0000000..23450cd ---- /dev/null -+++ b/test/interoperability_with_c/014_fortran_call_c_mix/fortran_main028.f90 -@@ -0,0 +1,26 @@ -+! Test fortran call c for the derived type and the derived type has -+! multiple components and one component is the derived type. remaining -+! components are mixed type char +diff --git a/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/fortran_main022.f90 b/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/fortran_main022.f90 +new file mode 100644 +index 0000000..55bd7d1 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/fortran_main022.f90 +@@ -0,0 +1,16 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is array of type double without iso_c_binding +! +program main -+ use iso_c_binding -+ type, bind(c) :: base -+ character(C_CHAR) :: j(2) = 'a' -+ end type base + type, bind(c) :: t -+ type(base) :: bt -+ character(C_CHAR) :: x = 'b' -+ character(1) :: y = 'c' ++ real(8) :: x(2) = 450359962737049.621345 + end type t + type(t) :: my_t -+ character(C_CHAR) :: my_x = 'd' + interface -+ subroutine c_func(a, b) -+ use iso_c_binding ++ subroutine c_func(a) + import :: t + type(t) :: a -+ character(C_CHAR) :: b + end + end interface -+ call c_func(my_t, my_x) ++ call c_func(my_t) +end -diff --git a/test/interoperability_with_c/014_fortran_call_c_mix/run.sh b/test/interoperability_with_c/014_fortran_call_c_mix/run.sh +diff --git a/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/fortran_main023.f90 b/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/fortran_main023.f90 new file mode 100644 -index 0000000..632b582 +index 0000000..8f17598 --- /dev/null -+++ b/test/interoperability_with_c/014_fortran_call_c_mix/run.sh ++++ b/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/fortran_main023.f90 @@ -0,0 +1,17 @@ -+for i in {001..028} -+do -+echo "------- test $i ------." -+#echo "----- gfortran result:" -+#gcc c_func$i.c -c -o c-test.o -+#gfortran fortran_main$i.f90 -fno-range-check -c -o fortran-test.o -+#gfortran c-test.o fortran-test.o -+#./a.out -+#rm *.o a.out -+echo "----- flang-new result : " -+clang c_func$i.c -c -o c-test.o -+flang-new fortran_main$i.f90 -c -o fortran-test.o -+flang-new -flang-experimental-exec c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+done -+ -diff --git a/test/interoperability_with_c/015_fortran_call_c_special_case/c_func001.c b/test/interoperability_with_c/015_fortran_call_c_special_case/c_func001.c -new file mode 100644 -index 0000000..87c1454 ---- /dev/null -+++ b/test/interoperability_with_c/015_fortran_call_c_special_case/c_func001.c -@@ -0,0 +1,4 @@ -+#include -+void c_func_(int *a) { -+ printf("ok\n"); -+} -diff --git a/test/interoperability_with_c/015_fortran_call_c_special_case/c_func002.c b/test/interoperability_with_c/015_fortran_call_c_special_case/c_func002.c -new file mode 100644 -index 0000000..061affd ---- /dev/null -+++ b/test/interoperability_with_c/015_fortran_call_c_special_case/c_func002.c -@@ -0,0 +1,7 @@ -+#include -+struct Ty { -+ int x[0]; -+}; -+void c_func_(struct Ty *t) { -+ printf("ok\n"); -+} -diff --git a/test/interoperability_with_c/015_fortran_call_c_special_case/c_func003.c b/test/interoperability_with_c/015_fortran_call_c_special_case/c_func003.c -new file mode 100644 -index 0000000..ed175d9 ---- /dev/null -+++ b/test/interoperability_with_c/015_fortran_call_c_special_case/c_func003.c -@@ -0,0 +1,12 @@ -+#include -+struct BaseTy { -+}; -+struct Ty { -+ struct BaseTy bt; -+ int x, y; -+}; -+void c_func_(struct Ty *t, int *a) { -+ printf("%d\t", t->x); -+ printf("%d\t", t->y); -+ printf("%d\n", *a); -+} -diff --git a/test/interoperability_with_c/015_fortran_call_c_special_case/c_func004.c b/test/interoperability_with_c/015_fortran_call_c_special_case/c_func004.c -new file mode 100644 -index 0000000..f35b45c ---- /dev/null -+++ b/test/interoperability_with_c/015_fortran_call_c_special_case/c_func004.c -@@ -0,0 +1,16 @@ -+#include -+#include -+struct BaseTy { -+ int_fast16_t j[2]; -+}; -+struct Ty { -+ struct BaseTy bt; -+ int_fast16_t x, y; -+}; -+void c_func_(struct Ty *t, int_fast16_t *a) { -+ printf("%ld\t", t->bt.j[0]); -+ printf("%ld\t", t->bt.j[1]); -+ printf("%ld\t", t->x); -+ printf("%ld\t", t->y); -+ printf("%ld\n", *a); -+} -diff --git a/test/interoperability_with_c/015_fortran_call_c_special_case/c_func005.c b/test/interoperability_with_c/015_fortran_call_c_special_case/c_func005.c -new file mode 100644 -index 0000000..4d6e335 ---- /dev/null -+++ b/test/interoperability_with_c/015_fortran_call_c_special_case/c_func005.c -@@ -0,0 +1,16 @@ -+#include -+#include -+struct BaseTy { -+ int_fast32_t j[2]; -+}; -+struct Ty { -+ struct BaseTy bt; -+ int_fast32_t x, y; -+}; -+void c_func_(struct Ty *t, int_fast32_t *a) { -+ printf("%ld\t", t->bt.j[0]); -+ printf("%ld\t", t->bt.j[1]); -+ printf("%ld\t", t->x); -+ printf("%ld\t", t->y); -+ printf("%ld\n", *a); -+} -diff --git a/test/interoperability_with_c/015_fortran_call_c_special_case/c_func006.c b/test/interoperability_with_c/015_fortran_call_c_special_case/c_func006.c -new file mode 100644 -index 0000000..48600a8 ---- /dev/null -+++ b/test/interoperability_with_c/015_fortran_call_c_special_case/c_func006.c -@@ -0,0 +1,16 @@ -+#include -+#include -+struct BaseTy { -+ intmax_t j[2]; -+}; -+struct Ty { -+ struct BaseTy bt; -+ intmax_t x, y; -+}; -+void c_func_(struct Ty *t, intmax_t *a) { -+ printf("%ld\t", t->bt.j[0]); -+ printf("%ld\t", t->bt.j[1]); -+ printf("%ld\t", t->x); -+ printf("%ld\t", t->y); -+ printf("%ld\n", *a); -+} -diff --git a/test/interoperability_with_c/015_fortran_call_c_special_case/fortran_main001.f90 b/test/interoperability_with_c/015_fortran_call_c_special_case/fortran_main001.f90 -new file mode 100644 -index 0000000..8247452 ---- /dev/null -+++ b/test/interoperability_with_c/015_fortran_call_c_special_case/fortran_main001.f90 -@@ -0,0 +1,11 @@ -+! Test fortran call c for an array of integer and the array is null ++! Test fortran call c for the derived type and the component of the ++! derived type is array of type long double without iso_c_binding +! +program main -+ integer :: my_x(0) ++ integer, parameter :: K = selected_real_kind(16) ++ type, bind(c) :: t ++ real(K) :: x(2) = 450359962737049.621345 ++ end type t ++ type(t) :: my_t + interface -+ subroutine c_func(b) -+ integer :: b(0) ++ subroutine c_func(a) ++ import :: t ++ type(t) :: a + end + end interface -+ call c_func(my_x) ++ call c_func(my_t) +end -diff --git a/test/interoperability_with_c/015_fortran_call_c_special_case/fortran_main002.f90 b/test/interoperability_with_c/015_fortran_call_c_special_case/fortran_main002.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/fortran_main024.f90 b/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/fortran_main024.f90 new file mode 100644 -index 0000000..f32f396 +index 0000000..635ac18 --- /dev/null -+++ b/test/interoperability_with_c/015_fortran_call_c_special_case/fortran_main002.f90 ++++ b/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/fortran_main024.f90 @@ -0,0 +1,16 @@ -+! Test fortran call c for the derived type and one component of the -+! derived type is a null array ++! Test fortran call c for the derived type and the component of the ++! derived type is array of type float _Complex without iso_c_binding +! +program main + type, bind(c) :: t -+ integer :: x(0) ++ complex(4) :: x(2) = (-3, 1) + end type t + type(t) :: my_t + interface @@ -13186,133 +19512,102 @@ index 0000000..f32f396 + end interface + call c_func(my_t) +end -diff --git a/test/interoperability_with_c/015_fortran_call_c_special_case/fortran_main003.f90 b/test/interoperability_with_c/015_fortran_call_c_special_case/fortran_main003.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/fortran_main025.f90 b/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/fortran_main025.f90 new file mode 100644 -index 0000000..7130845 +index 0000000..66ec48b --- /dev/null -+++ b/test/interoperability_with_c/015_fortran_call_c_special_case/fortran_main003.f90 -@@ -0,0 +1,24 @@ -+! Test fortran call c for the derived type and one component of the -+! derived type is a null derived type ++++ b/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/fortran_main025.f90 +@@ -0,0 +1,16 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is array of type double _Complex without iso_c_binding +! +program main -+ use iso_c_binding -+ type, bind(c) :: base -+ end type base + type, bind(c) :: t -+ type(base) :: bt -+ integer(C_INT) :: x = -2147483647 -+ integer(C_INT) :: y = 2147483647 ++ complex(8) :: x(2) = (-3, 1) + end type t + type(t) :: my_t -+ integer(C_INT) :: my_x = 3 + interface -+ subroutine c_func(a, b) -+ use iso_c_binding ++ subroutine c_func(a) + import :: t + type(t) :: a -+ integer(C_INT) :: b + end + end interface -+ call c_func(my_t, my_x) ++ call c_func(my_t) +end -diff --git a/test/interoperability_with_c/015_fortran_call_c_special_case/fortran_main004.f90 b/test/interoperability_with_c/015_fortran_call_c_special_case/fortran_main004.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/fortran_main026.f90 b/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/fortran_main026.f90 new file mode 100644 -index 0000000..2d50b2b +index 0000000..304647b --- /dev/null -+++ b/test/interoperability_with_c/015_fortran_call_c_special_case/fortran_main004.f90 -@@ -0,0 +1,24 @@ -+! Test fortran call c for composite scenario of type int_fast16_t ++++ b/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/fortran_main026.f90 +@@ -0,0 +1,18 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is array of type long double _Complex without ++! iso_c_binding +! +program main -+ use iso_c_binding -+ type, bind(c) :: base -+ integer(C_INT_FAST16_T) :: j(2) = -2 -+ end type base ++ integer, parameter :: K = selected_real_kind(16) + type, bind(c) :: t -+ type(base) :: bt -+ integer(C_INT_FAST16_T) :: x = -32768 -+ integer(C_INT_FAST16_T) :: y = 32767 ++ complex(K) :: x(2) = (-3.1415926, 1.654) + end type t + type(t) :: my_t -+ integer(C_INT_FAST16_T) :: my_x = 3 + interface -+ subroutine c_func(a, b) -+ use iso_c_binding ++ subroutine c_func(a) + import :: t + type(t) :: a -+ integer(C_INT_FAST16_T) :: b + end + end interface -+ call c_func(my_t, my_x) ++ call c_func(my_t) +end -diff --git a/test/interoperability_with_c/015_fortran_call_c_special_case/fortran_main005.f90 b/test/interoperability_with_c/015_fortran_call_c_special_case/fortran_main005.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/fortran_main027.f90 b/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/fortran_main027.f90 new file mode 100644 -index 0000000..c084956 +index 0000000..e454591 --- /dev/null -+++ b/test/interoperability_with_c/015_fortran_call_c_special_case/fortran_main005.f90 -@@ -0,0 +1,24 @@ -+! Test fortran call c for composite scenario of type int_fast32_t ++++ b/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/fortran_main027.f90 +@@ -0,0 +1,15 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is array of type _Bool without iso_c_binding +! -+program main -+ use iso_c_binding -+ type, bind(c) :: base -+ integer(C_INT_FAST32_T) :: j(2) = -2 -+ end type base + type, bind(c) :: t -+ type(base) :: bt -+ integer(C_INT_FAST32_T) :: x = -2147483647 -+ integer(C_INT_FAST32_T) :: y = 2147483647 ++ logical(1) :: x(2) = .TRUE. + end type t + type(t) :: my_t -+ integer(C_INT_FAST32_T) :: my_x = 3 + interface -+ subroutine c_func(a, b) -+ use iso_c_binding ++ subroutine c_func(a) + import :: t + type(t) :: a -+ integer(C_INT_FAST32_T) :: b + end + end interface -+ call c_func(my_t, my_x) ++ call c_func(my_t) +end -diff --git a/test/interoperability_with_c/015_fortran_call_c_special_case/fortran_main006.f90 b/test/interoperability_with_c/015_fortran_call_c_special_case/fortran_main006.f90 +diff --git a/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/fortran_main028.f90 b/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/fortran_main028.f90 new file mode 100644 -index 0000000..681705c +index 0000000..e2ee053 --- /dev/null -+++ b/test/interoperability_with_c/015_fortran_call_c_special_case/fortran_main006.f90 -@@ -0,0 +1,24 @@ -+! Test fortran call c for composite scenario of type intmax_t ++++ b/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/fortran_main028.f90 +@@ -0,0 +1,16 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is array of type char without iso_c_binding +! +program main -+ use iso_c_binding -+ type, bind(c) :: base -+ integer(C_INTMAX_T) :: j(2) = -2 -+ end type base + type, bind(c) :: t -+ type(base) :: bt -+ integer(C_INTMAX_T) :: x = -2147483647 -+ integer(C_INTMAX_T) :: y = 2147483647 ++ character :: x(2) = 'b' + end type t + type(t) :: my_t -+ integer(C_INTMAX_T) :: my_x = 3 + interface -+ subroutine c_func(a, b) -+ use iso_c_binding ++ subroutine c_func(a) + import :: t + type(t) :: a -+ integer(C_INTMAX_T) :: b + end + end interface -+ call c_func(my_t, my_x) ++ call c_func(my_t) +end -diff --git a/test/interoperability_with_c/015_fortran_call_c_special_case/run.sh b/test/interoperability_with_c/015_fortran_call_c_special_case/run.sh +diff --git a/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/run.sh b/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/run.sh new file mode 100644 -index 0000000..5ad075b +index 0000000..b865403 --- /dev/null -+++ b/test/interoperability_with_c/015_fortran_call_c_special_case/run.sh -@@ -0,0 +1,17 @@ -+for i in {001..006} ++++ b/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_struct/run.sh +@@ -0,0 +1,16 @@ ++for i in {001..028} +do +echo "------- test $i ------." +#echo "----- gfortran result:" @@ -13328,7 +19623,7 @@ index 0000000..5ad075b +./a.out +rm *.o a.out +done -+ +\ No newline at end of file -- -2.7.4 +2.25.1 diff --git a/5-test-for-interoperability-with-c-c-call-fortran.patch b/5-test-for-interoperability-with-c-c-call-fortran.patch index a54e42d..2af0656 100644 --- a/5-test-for-interoperability-with-c-c-call-fortran.patch +++ b/5-test-for-interoperability-with-c-c-call-fortran.patch @@ -1,6 +1,6 @@ -From 394858d91d11d06457a7c63685d3cedf066daf34 Mon Sep 17 00:00:00 2001 +From eb07defe0fcb8bbe0581bc3d2fd85fd9033324ea Mon Sep 17 00:00:00 2001 From: xieyihui -Date: Sun, 16 Oct 2022 23:00:30 +0800 +Date: Fri, 21 Oct 2022 00:00:39 +0800 Subject: [PATCH] add test cases for interoperability with c about c call fortran @@ -799,7 +799,7 @@ index 0000000..14181a4 \ No newline at end of file diff --git a/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/run.sh b/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/run.sh new file mode 100644 -index 0000000..f6f089a +index 0000000..ad3abb0 --- /dev/null +++ b/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/run.sh @@ -0,0 +1,16 @@ @@ -812,7 +812,7 @@ index 0000000..f6f089a +#gfortran fortran-test.o c-test.o +#./a.out +#rm *.o a.out -+#echo "----- flang-new result : " ++echo "----- flang-new result : " +clang c_main$i.c -c -o c-test.o +flang-new fortran_func$i.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o @@ -1630,7 +1630,7 @@ index 0000000..55d210f \ No newline at end of file diff --git a/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/run.sh b/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/run.sh new file mode 100644 -index 0000000..f6f089a +index 0000000..ad3abb0 --- /dev/null +++ b/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/run.sh @@ -0,0 +1,16 @@ @@ -1643,7 +1643,7 @@ index 0000000..f6f089a +#gfortran fortran-test.o c-test.o +#./a.out +#rm *.o a.out -+#echo "----- flang-new result : " ++echo "----- flang-new result : " +clang c_main$i.c -c -o c-test.o +flang-new fortran_func$i.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o @@ -2446,7 +2446,7 @@ index 0000000..364a371 \ No newline at end of file diff --git a/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/run.sh b/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/run.sh new file mode 100644 -index 0000000..f6f089a +index 0000000..ad3abb0 --- /dev/null +++ b/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/run.sh @@ -0,0 +1,16 @@ @@ -2459,7 +2459,7 @@ index 0000000..f6f089a +#gfortran fortran-test.o c-test.o +#./a.out +#rm *.o a.out -+#echo "----- flang-new result : " ++echo "----- flang-new result : " +clang c_main$i.c -c -o c-test.o +flang-new fortran_func$i.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o @@ -3303,7 +3303,7 @@ index 0000000..ce5cc88 \ No newline at end of file diff --git a/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/run.sh b/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/run.sh new file mode 100644 -index 0000000..f6f089a +index 0000000..ad3abb0 --- /dev/null +++ b/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/run.sh @@ -0,0 +1,16 @@ @@ -3316,7 +3316,7 @@ index 0000000..f6f089a +#gfortran fortran-test.o c-test.o +#./a.out +#rm *.o a.out -+#echo "----- flang-new result : " ++echo "----- flang-new result : " +clang c_main$i.c -c -o c-test.o +flang-new fortran_func$i.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o @@ -4119,7 +4119,7 @@ index 0000000..7881678 \ No newline at end of file diff --git a/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/run.sh b/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/run.sh new file mode 100644 -index 0000000..f6f089a +index 0000000..ad3abb0 --- /dev/null +++ b/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/run.sh @@ -0,0 +1,16 @@ @@ -4132,7 +4132,7 @@ index 0000000..f6f089a +#gfortran fortran-test.o c-test.o +#./a.out +#rm *.o a.out -+#echo "----- flang-new result : " ++echo "----- flang-new result : " +clang c_main$i.c -c -o c-test.o +flang-new fortran_func$i.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o @@ -5026,7 +5026,7 @@ index 0000000..2153d9b \ No newline at end of file diff --git a/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/run.sh b/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/run.sh new file mode 100644 -index 0000000..f6f089a +index 0000000..ad3abb0 --- /dev/null +++ b/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/run.sh @@ -0,0 +1,16 @@ @@ -5039,7 +5039,7 @@ index 0000000..f6f089a +#gfortran fortran-test.o c-test.o +#./a.out +#rm *.o a.out -+#echo "----- flang-new result : " ++echo "----- flang-new result : " +clang c_main$i.c -c -o c-test.o +flang-new fortran_func$i.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o @@ -5944,7 +5944,7 @@ index 0000000..e039766 \ No newline at end of file diff --git a/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/run.sh b/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/run.sh new file mode 100644 -index 0000000..f6f089a +index 0000000..ad3abb0 --- /dev/null +++ b/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/run.sh @@ -0,0 +1,16 @@ @@ -5957,7 +5957,7 @@ index 0000000..f6f089a +#gfortran fortran-test.o c-test.o +#./a.out +#rm *.o a.out -+#echo "----- flang-new result : " ++echo "----- flang-new result : " +clang c_main$i.c -c -o c-test.o +flang-new fortran_func$i.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o @@ -6887,7 +6887,7 @@ index 0000000..af8daba +end diff --git a/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/run.sh b/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/run.sh new file mode 100644 -index 0000000..f6f089a +index 0000000..ad3abb0 --- /dev/null +++ b/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/run.sh @@ -0,0 +1,16 @@ @@ -6900,7 +6900,7 @@ index 0000000..f6f089a +#gfortran fortran-test.o c-test.o +#./a.out +#rm *.o a.out -+#echo "----- flang-new result : " ++echo "----- flang-new result : " +clang c_main$i.c -c -o c-test.o +flang-new fortran_func$i.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o @@ -8004,7 +8004,7 @@ index 0000000..0b4f672 +end diff --git a/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/run.sh b/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/run.sh new file mode 100644 -index 0000000..f6f089a +index 0000000..ad3abb0 --- /dev/null +++ b/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/run.sh @@ -0,0 +1,16 @@ @@ -8017,7 +8017,7 @@ index 0000000..f6f089a +#gfortran fortran-test.o c-test.o +#./a.out +#rm *.o a.out -+#echo "----- flang-new result : " ++echo "----- flang-new result : " +clang c_main$i.c -c -o c-test.o +flang-new fortran_func$i.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o @@ -8329,7 +8329,7 @@ index 0000000..95c3653 \ No newline at end of file diff --git a/test/interoperability_with_c_c_call_fortran/010_c_call_fortran_nested_struct_complicated/run.sh b/test/interoperability_with_c_c_call_fortran/010_c_call_fortran_nested_struct_complicated/run.sh new file mode 100644 -index 0000000..4c1d7aa +index 0000000..7f7ca3d --- /dev/null +++ b/test/interoperability_with_c_c_call_fortran/010_c_call_fortran_nested_struct_complicated/run.sh @@ -0,0 +1,16 @@ @@ -8342,7 +8342,7 @@ index 0000000..4c1d7aa +#gfortran fortran-test.o c-test.o +#./a.out +#rm *.o a.out -+#echo "----- flang-new result : " ++echo "----- flang-new result : " +clang c_main$i.c -c -o c-test.o +flang-new fortran_func$i.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o @@ -8350,11 +8350,11 @@ index 0000000..4c1d7aa +rm *.o a.out +done \ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main001.c b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main001.c +diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main001.c b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main001.c new file mode 100644 index 0000000..8889aba --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main001.c ++++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main001.c @@ -0,0 +1,9 @@ +// Test c call fortran for the return type is int +// @@ -8365,13 +8365,13 @@ index 0000000..8889aba + int res = f_func_(&s1); + printf("%d\n", res); +} -diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main002.c b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main002.c +diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main002.c b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main002.c new file mode 100644 -index 0000000..7ee12cd +index 0000000..31b044f --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main002.c ++++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main002.c @@ -0,0 +1,9 @@ -+// Test c call fortran for the return type is ptr of type short ++// Test c call fortran for the return type is short +// +#include +extern short f_func_(short *i); @@ -8380,13 +8380,13 @@ index 0000000..7ee12cd + short res = f_func_(&s1); + printf("%hd\n", res); +} -diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main003.c b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main003.c +diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main003.c b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main003.c new file mode 100644 -index 0000000..e9aff63 +index 0000000..d01bca9 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main003.c ++++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main003.c @@ -0,0 +1,9 @@ -+// Test c call fortran for the return type is ptr of type long ++// Test c call fortran for the return type is long +// +#include +extern long f_func_(long *i); @@ -8395,13 +8395,13 @@ index 0000000..e9aff63 + long res = f_func_(&s1); + printf("%ld\n", res); +} -diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main004.c b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main004.c +diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main004.c b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main004.c new file mode 100644 -index 0000000..5e48491 +index 0000000..7680380 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main004.c ++++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main004.c @@ -0,0 +1,9 @@ -+// Test c call fortran for the return type is ptr of type long long ++// Test c call fortran for the return type is long long +// +#include +extern long long f_func_(long long *i); @@ -8410,13 +8410,13 @@ index 0000000..5e48491 + long long res = f_func_(&s1); + printf("%Ld\n", res); +} -diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main005.c b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main005.c +diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main005.c b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main005.c new file mode 100644 -index 0000000..558c28f +index 0000000..4cf34d1 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main005.c ++++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main005.c @@ -0,0 +1,9 @@ -+// Test c call fortran for the return type is ptr of type signed char ++// Test c call fortran for the return type is signed char +// +#include +extern signed char f_func_(signed char *i); @@ -8425,13 +8425,13 @@ index 0000000..558c28f + signed char res = f_func_(&s1); + printf("%c\n", res); +} -diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main006.c b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main006.c +diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main006.c b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main006.c new file mode 100644 -index 0000000..b8f248c +index 0000000..1066139 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main006.c ++++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main006.c @@ -0,0 +1,9 @@ -+// Test c call fortran for the return type is ptr of type size_t ++// Test c call fortran for the return type is size_t +// +#include +extern size_t f_func_(size_t *i); @@ -8440,13 +8440,13 @@ index 0000000..b8f248c + size_t res = f_func_(&s1); + printf("%ld\n", res); +} -diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main007.c b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main007.c +diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main007.c b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main007.c new file mode 100644 -index 0000000..38589ce +index 0000000..547b2a1 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main007.c ++++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main007.c @@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is ptr of type int8_t ++// Test c call fortran for the return type is int8_t +// +#include +#include @@ -8456,13 +8456,13 @@ index 0000000..38589ce + int8_t res = f_func_(&s1); + printf("%hhd\n", res); +} -diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main008.c b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main008.c +diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main008.c b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main008.c new file mode 100644 -index 0000000..913e417 +index 0000000..0a91427 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main008.c ++++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main008.c @@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is ptr of type int16_t ++// Test c call fortran for the return type is int16_t +// +#include +#include @@ -8472,13 +8472,13 @@ index 0000000..913e417 + int16_t res = f_func_(&s1); + printf("%hd\n", res); +} -diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main009.c b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main009.c +diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main009.c b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main009.c new file mode 100644 -index 0000000..f76b36e +index 0000000..ec7c9dd --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main009.c ++++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main009.c @@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is ptr of type int32_t ++// Test c call fortran for the return type is int32_t +// +#include +#include @@ -8488,13 +8488,13 @@ index 0000000..f76b36e + int32_t res = f_func_(&s1); + printf("%d\n", res); +} -diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main010.c b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main010.c +diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main010.c b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main010.c new file mode 100644 -index 0000000..b843a6a +index 0000000..40aa8e9 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main010.c ++++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main010.c @@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is ptr of type int64_t ++// Test c call fortran for the return type is int64_t +// +#include +#include @@ -8504,11 +8504,11 @@ index 0000000..b843a6a + int64_t res = f_func_(&s1); + printf("%ld\n", res); +} -diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main011.c b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main011.c +diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main011.c b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main011.c new file mode 100644 index 0000000..2ff6688 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main011.c ++++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main011.c @@ -0,0 +1,10 @@ +// Test c call fortran for the return type is int_least8_t +// @@ -8520,11 +8520,11 @@ index 0000000..2ff6688 + int_least8_t res = f_func_(&s1); + printf("%hhd\n", res); +} -diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main012.c b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main012.c +diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main012.c b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main012.c new file mode 100644 index 0000000..c332da0 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main012.c ++++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main012.c @@ -0,0 +1,10 @@ +// Test c call fortran for the return type is int_least16_t +// @@ -8536,11 +8536,11 @@ index 0000000..c332da0 + int_least16_t res = f_func_(&s1); + printf("%hd\n", res); +} -diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main013.c b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main013.c +diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main013.c b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main013.c new file mode 100644 index 0000000..f72441e --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main013.c ++++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main013.c @@ -0,0 +1,10 @@ +// Test c call fortran for the return type is int_least32_t +// @@ -8552,11 +8552,11 @@ index 0000000..f72441e + int_least32_t res = f_func_(&s1); + printf("%d\n", res); +} -diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main014.c b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main014.c +diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main014.c b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main014.c new file mode 100644 index 0000000..4d98217 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main014.c ++++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main014.c @@ -0,0 +1,10 @@ +// Test c call fortran for the return type is int_least64_t +// @@ -8568,11 +8568,11 @@ index 0000000..4d98217 + int_least64_t res = f_func_(&s1); + printf("%ld\n", res); +} -diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main015.c b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main015.c +diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main015.c b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main015.c new file mode 100644 index 0000000..dd99955 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main015.c ++++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main015.c @@ -0,0 +1,10 @@ +// Test c call fortran for the return type is int_fast8_t +// @@ -8584,11 +8584,11 @@ index 0000000..dd99955 + int_fast8_t res = f_func_(&s1); + printf("%hhd\n", res); +} -diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main016.c b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main016.c +diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main016.c b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main016.c new file mode 100644 index 0000000..c8ca6e2 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main016.c ++++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main016.c @@ -0,0 +1,10 @@ +// Test c call fortran for the return type is int_fast16_t +// @@ -8600,11 +8600,11 @@ index 0000000..c8ca6e2 + int_fast16_t res = f_func_(&s1); + printf("%ld\n", res); +} -diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main017.c b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main017.c +diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main017.c b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main017.c new file mode 100644 index 0000000..d5dbfa1 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main017.c ++++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main017.c @@ -0,0 +1,10 @@ +// Test c call fortran for the return type is int_fast32_t +// @@ -8616,11 +8616,11 @@ index 0000000..d5dbfa1 + int_fast32_t res = f_func_(&s1); + printf("%ld\n", res); +} -diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main018.c b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main018.c +diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main018.c b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main018.c new file mode 100644 index 0000000..11536d8 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main018.c ++++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main018.c @@ -0,0 +1,10 @@ +// Test c call fortran for the return type is int_fast64_t +// @@ -8632,11 +8632,11 @@ index 0000000..11536d8 + int_fast64_t res = f_func_(&s1); + printf("%ld\n", res); +} -diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main019.c b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main019.c +diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main019.c b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main019.c new file mode 100644 index 0000000..c5c0ac0 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main019.c ++++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main019.c @@ -0,0 +1,10 @@ +// Test c call fortran for the return type is intmax_t +// @@ -8648,11 +8648,11 @@ index 0000000..c5c0ac0 + intmax_t res = f_func_(&s1); + printf("%ld\n", res); +} -diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main020.c b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main020.c +diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main020.c b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main020.c new file mode 100644 index 0000000..3985c08 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main020.c ++++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main020.c @@ -0,0 +1,10 @@ +// Test c call fortran for the return type is intptr_t +// @@ -8664,11 +8664,11 @@ index 0000000..3985c08 + intptr_t res = f_func_(&s1); + printf("%ld\n", res); +} -diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main021.c b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main021.c +diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main021.c b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main021.c new file mode 100644 index 0000000..e260dd4 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main021.c ++++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main021.c @@ -0,0 +1,10 @@ +// Test c call fortran for the return type is float +// @@ -8681,11 +8681,11 @@ index 0000000..e260dd4 + printf("%0.20f\n", res); +} \ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main022.c b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main022.c +diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main022.c b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main022.c new file mode 100644 index 0000000..1e9fdd4 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main022.c ++++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main022.c @@ -0,0 +1,10 @@ +// Test c call fortran for the return type is double +// @@ -8698,11 +8698,11 @@ index 0000000..1e9fdd4 + printf("%0.20lf\n", res); +} \ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main023.c b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main023.c +diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main023.c b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main023.c new file mode 100644 index 0000000..8b1d692 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main023.c ++++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main023.c @@ -0,0 +1,10 @@ +// Test c call fortran for the return type is long double +// @@ -8715,11 +8715,11 @@ index 0000000..8b1d692 + printf("%0.20Lf\n", res); +} \ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main024.c b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main024.c +diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main024.c b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main024.c new file mode 100644 index 0000000..350055a --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main024.c ++++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main024.c @@ -0,0 +1,10 @@ +// Test c call fortran for the return type is float _Complex +// @@ -8732,11 +8732,11 @@ index 0000000..350055a + printf("%0.20f + %0.20fi\n", creal(res), cimag(res)); +} \ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main025.c b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main025.c +diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main025.c b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main025.c new file mode 100644 index 0000000..b81188d --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main025.c ++++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main025.c @@ -0,0 +1,10 @@ +// Test c call fortran for the return type is double _Complex +// @@ -8749,11 +8749,11 @@ index 0000000..b81188d + printf("%0.20lf + %0.20lfi\n", creal(res), cimag(res)); +} \ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main026.c b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main026.c +diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main026.c b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main026.c new file mode 100644 index 0000000..630ab26 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main026.c ++++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main026.c @@ -0,0 +1,10 @@ +// Test c call fortran for the return type is long double _Complex +// @@ -8766,11 +8766,11 @@ index 0000000..630ab26 + printf("%0.20lf + %0.20lfi\n", creal(res), cimag(res)); +} \ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main027.c b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main027.c +diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main027.c b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main027.c new file mode 100644 index 0000000..dd95917 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main027.c ++++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main027.c @@ -0,0 +1,10 @@ +// Test c call fortran for the return type is _Bool +// @@ -8783,11 +8783,11 @@ index 0000000..dd95917 + printf("%d\n", res); +} \ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main028.c b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main028.c +diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main028.c b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main028.c new file mode 100644 -index 0000000..1cbcc50 +index 0000000..1bbb2a6 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main028.c ++++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main028.c @@ -0,0 +1,10 @@ +// Test c call fortran for the return type is char +// @@ -8797,236 +8797,236 @@ index 0000000..1cbcc50 +int main() { + char i; + char res = f_func_(&i); -+ printf("%c\n", i); ++ printf("%c\n", res); +} \ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func001.f90 b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func001.f90 +diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func001.f90 b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func001.f90 new file mode 100644 index 0000000..8809b59 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func001.f90 ++++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func001.f90 @@ -0,0 +1,4 @@ +integer function f_func(i) + integer :: i + f_func = 10 + i +end -diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func002.f90 b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func002.f90 +diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func002.f90 b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func002.f90 new file mode 100644 index 0000000..91a5d95 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func002.f90 ++++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func002.f90 @@ -0,0 +1,4 @@ +integer function f_func(i) + integer(2) :: i + f_func = 10 + i +end -diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func003.f90 b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func003.f90 +diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func003.f90 b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func003.f90 new file mode 100644 index 0000000..d91ed67 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func003.f90 ++++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func003.f90 @@ -0,0 +1,4 @@ +integer function f_func(i) + integer(8) :: i + f_func = 10 + i +end -diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func004.f90 b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func004.f90 +diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func004.f90 b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func004.f90 new file mode 100644 index 0000000..d91ed67 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func004.f90 ++++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func004.f90 @@ -0,0 +1,4 @@ +integer function f_func(i) + integer(8) :: i + f_func = 10 + i +end -diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func005.f90 b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func005.f90 +diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func005.f90 b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func005.f90 new file mode 100644 index 0000000..bd7b3fc --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func005.f90 ++++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func005.f90 @@ -0,0 +1,4 @@ +integer function f_func(i) + integer(1) :: i + f_func = 10 + i +end -diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func006.f90 b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func006.f90 +diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func006.f90 b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func006.f90 new file mode 100644 index 0000000..d91ed67 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func006.f90 ++++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func006.f90 @@ -0,0 +1,4 @@ +integer function f_func(i) + integer(8) :: i + f_func = 10 + i +end -diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func007.f90 b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func007.f90 +diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func007.f90 b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func007.f90 new file mode 100644 index 0000000..bd7b3fc --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func007.f90 ++++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func007.f90 @@ -0,0 +1,4 @@ +integer function f_func(i) + integer(1) :: i + f_func = 10 + i +end -diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func008.f90 b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func008.f90 +diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func008.f90 b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func008.f90 new file mode 100644 index 0000000..91a5d95 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func008.f90 ++++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func008.f90 @@ -0,0 +1,4 @@ +integer function f_func(i) + integer(2) :: i + f_func = 10 + i +end -diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func009.f90 b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func009.f90 +diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func009.f90 b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func009.f90 new file mode 100644 index 0000000..c386948 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func009.f90 ++++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func009.f90 @@ -0,0 +1,4 @@ +integer function f_func(i) + integer(4) :: i + f_func = 10 + i +end -diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func010.f90 b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func010.f90 +diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func010.f90 b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func010.f90 new file mode 100644 index 0000000..d91ed67 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func010.f90 ++++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func010.f90 @@ -0,0 +1,4 @@ +integer function f_func(i) + integer(8) :: i + f_func = 10 + i +end -diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func011.f90 b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func011.f90 +diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func011.f90 b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func011.f90 new file mode 100644 index 0000000..bd7b3fc --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func011.f90 ++++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func011.f90 @@ -0,0 +1,4 @@ +integer function f_func(i) + integer(1) :: i + f_func = 10 + i +end -diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func012.f90 b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func012.f90 +diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func012.f90 b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func012.f90 new file mode 100644 index 0000000..91a5d95 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func012.f90 ++++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func012.f90 @@ -0,0 +1,4 @@ +integer function f_func(i) + integer(2) :: i + f_func = 10 + i +end -diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func013.f90 b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func013.f90 +diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func013.f90 b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func013.f90 new file mode 100644 index 0000000..c386948 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func013.f90 ++++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func013.f90 @@ -0,0 +1,4 @@ +integer function f_func(i) + integer(4) :: i + f_func = 10 + i +end -diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func014.f90 b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func014.f90 +diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func014.f90 b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func014.f90 new file mode 100644 index 0000000..d91ed67 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func014.f90 ++++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func014.f90 @@ -0,0 +1,4 @@ +integer function f_func(i) + integer(8) :: i + f_func = 10 + i +end -diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func015.f90 b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func015.f90 +diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func015.f90 b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func015.f90 new file mode 100644 index 0000000..bd7b3fc --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func015.f90 ++++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func015.f90 @@ -0,0 +1,4 @@ +integer function f_func(i) + integer(1) :: i + f_func = 10 + i +end -diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func016.f90 b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func016.f90 +diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func016.f90 b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func016.f90 new file mode 100644 index 0000000..d91ed67 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func016.f90 ++++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func016.f90 @@ -0,0 +1,4 @@ +integer function f_func(i) + integer(8) :: i + f_func = 10 + i +end -diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func017.f90 b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func017.f90 +diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func017.f90 b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func017.f90 new file mode 100644 index 0000000..d91ed67 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func017.f90 ++++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func017.f90 @@ -0,0 +1,4 @@ +integer function f_func(i) + integer(8) :: i + f_func = 10 + i +end -diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func018.f90 b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func018.f90 +diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func018.f90 b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func018.f90 new file mode 100644 index 0000000..d91ed67 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func018.f90 ++++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func018.f90 @@ -0,0 +1,4 @@ +integer function f_func(i) + integer(8) :: i + f_func = 10 + i +end -diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func019.f90 b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func019.f90 +diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func019.f90 b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func019.f90 new file mode 100644 index 0000000..d91ed67 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func019.f90 ++++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func019.f90 @@ -0,0 +1,4 @@ +integer function f_func(i) + integer(8) :: i + f_func = 10 + i +end -diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func020.f90 b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func020.f90 +diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func020.f90 b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func020.f90 new file mode 100644 index 0000000..d91ed67 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func020.f90 ++++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func020.f90 @@ -0,0 +1,4 @@ +integer function f_func(i) + integer(8) :: i + f_func = 10 + i +end -diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func021.f90 b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func021.f90 +diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func021.f90 b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func021.f90 new file mode 100644 index 0000000..27c8008 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func021.f90 ++++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func021.f90 @@ -0,0 +1,4 @@ +real function f_func(i) + real(4) :: i + f_func = i + 0.1 +end \ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func022.f90 b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func022.f90 +diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func022.f90 b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func022.f90 new file mode 100644 index 0000000..b862910 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func022.f90 ++++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func022.f90 @@ -0,0 +1,4 @@ +real(8) function f_func(i) + real(8) :: i + f_func = i + 0.1 +end \ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func023.f90 b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func023.f90 +diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func023.f90 b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func023.f90 new file mode 100644 index 0000000..5a24ed7 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func023.f90 ++++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func023.f90 @@ -0,0 +1,6 @@ +function f_func(i) + integer, parameter :: K = selected_real_kind(16) @@ -9035,33 +9035,33 @@ index 0000000..5a24ed7 + f_func = i + 0.1 +end \ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func024.f90 b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func024.f90 +diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func024.f90 b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func024.f90 new file mode 100644 index 0000000..e158cce --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func024.f90 ++++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func024.f90 @@ -0,0 +1,4 @@ +complex(4) function f_func(i) + complex(4) :: i + f_func = (-12345678.7654321, 1) +end \ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func025.f90 b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func025.f90 +diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func025.f90 b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func025.f90 new file mode 100644 index 0000000..3cd9e4e --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func025.f90 ++++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func025.f90 @@ -0,0 +1,4 @@ +complex(8) function f_func(i) + complex(8) :: i + f_func = (-12345678.7654321, 1) +end \ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func026.f90 b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func026.f90 +diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func026.f90 b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func026.f90 new file mode 100644 index 0000000..fb3c477 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func026.f90 ++++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func026.f90 @@ -0,0 +1,6 @@ +function f_func(i) + integer, parameter :: K = selected_real_kind(16) @@ -9070,33 +9070,33 @@ index 0000000..fb3c477 + f_func = (-12345678.7654321, 1) +end \ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func027.f90 b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func027.f90 +diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func027.f90 b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func027.f90 new file mode 100644 index 0000000..f331e96 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func027.f90 ++++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func027.f90 @@ -0,0 +1,4 @@ +logical function f_func(i) + logical(1) :: i + f_func = .TRUE. +end \ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func028.f90 b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func028.f90 +diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func028.f90 b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func028.f90 new file mode 100644 -index 0000000..c7b4c7e +index 0000000..228b066 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func028.f90 ++++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func028.f90 @@ -0,0 +1,4 @@ +character function f_func(i) + character(1) :: i -+ f_func = 'a' ++ f_func = 'b' +end \ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/run.sh b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/run.sh +diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/run.sh b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/run.sh new file mode 100644 -index 0000000..f6f089a +index 0000000..ad3abb0 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/run.sh ++++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/run.sh @@ -0,0 +1,16 @@ +for i in {001..028} +do @@ -9107,7 +9107,7 @@ index 0000000..f6f089a +#gfortran fortran-test.o c-test.o +#./a.out +#rm *.o a.out -+#echo "----- flang-new result : " ++echo "----- flang-new result : " +clang c_main$i.c -c -o c-test.o +flang-new fortran_func$i.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o @@ -9115,11 +9115,11 @@ index 0000000..f6f089a +rm *.o a.out +done \ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main001.c b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main001.c +diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main001.c b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main001.c new file mode 100644 index 0000000..750e07c --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main001.c ++++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main001.c @@ -0,0 +1,9 @@ +// Test c call fortran for the return type is int with bindc +// @@ -9130,11 +9130,11 @@ index 0000000..750e07c + int res = f_func_(&s1); + printf("%d\n", res); +} -diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main002.c b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main002.c +diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main002.c b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main002.c new file mode 100644 index 0000000..801bbd9 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main002.c ++++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main002.c @@ -0,0 +1,9 @@ +// Test c call fortran for the return type is short with bindc +// @@ -9145,11 +9145,11 @@ index 0000000..801bbd9 + short res = f_func_(&s1); + printf("%hd\n", res); +} -diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main003.c b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main003.c +diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main003.c b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main003.c new file mode 100644 index 0000000..d141bc0 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main003.c ++++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main003.c @@ -0,0 +1,9 @@ +// Test c call fortran for the return type is long with bindc +// @@ -9160,11 +9160,11 @@ index 0000000..d141bc0 + long res = f_func_(&s1); + printf("%ld\n", res); +} -diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main004.c b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main004.c +diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main004.c b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main004.c new file mode 100644 index 0000000..447e373 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main004.c ++++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main004.c @@ -0,0 +1,9 @@ +// Test c call fortran for the return type is long long with bindc +// @@ -9175,11 +9175,11 @@ index 0000000..447e373 + long long res = f_func_(&s1); + printf("%Ld\n", res); +} -diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main005.c b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main005.c +diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main005.c b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main005.c new file mode 100644 index 0000000..2f680d5 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main005.c ++++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main005.c @@ -0,0 +1,9 @@ +// Test c call fortran for the return type is signed char with bindc +// @@ -9190,11 +9190,11 @@ index 0000000..2f680d5 + signed char res = f_func_(&s1); + printf("%c\n", res); +} -diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main006.c b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main006.c +diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main006.c b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main006.c new file mode 100644 index 0000000..47eec77 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main006.c ++++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main006.c @@ -0,0 +1,9 @@ +// Test c call fortran for the return type is size_t with bindc +// @@ -9205,11 +9205,11 @@ index 0000000..47eec77 + size_t res = f_func_(&s1); + printf("%ld\n", res); +} -diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main007.c b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main007.c +diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main007.c b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main007.c new file mode 100644 index 0000000..7e39eb4 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main007.c ++++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main007.c @@ -0,0 +1,10 @@ +// Test c call fortran for the return type is int8_t with bindc +// @@ -9221,11 +9221,11 @@ index 0000000..7e39eb4 + int8_t res = f_func_(&s1); + printf("%hhd\n", res); +} -diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main008.c b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main008.c +diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main008.c b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main008.c new file mode 100644 index 0000000..5a96518 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main008.c ++++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main008.c @@ -0,0 +1,10 @@ +// Test c call fortran for the return type is int16_t with bindc +// @@ -9237,11 +9237,11 @@ index 0000000..5a96518 + int16_t res = f_func_(&s1); + printf("%hd\n", res); +} -diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main009.c b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main009.c +diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main009.c b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main009.c new file mode 100644 index 0000000..61b0a1c --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main009.c ++++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main009.c @@ -0,0 +1,10 @@ +// Test c call fortran for the return type is int32_t with bindc +// @@ -9253,11 +9253,11 @@ index 0000000..61b0a1c + int32_t res = f_func_(&s1); + printf("%d\n", res); +} -diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main010.c b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main010.c +diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main010.c b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main010.c new file mode 100644 index 0000000..f74292e --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main010.c ++++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main010.c @@ -0,0 +1,10 @@ +// Test c call fortran for the return type is int64_t with bindc +// @@ -9269,11 +9269,11 @@ index 0000000..f74292e + int64_t res = f_func_(&s1); + printf("%ld\n", res); +} -diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main011.c b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main011.c +diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main011.c b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main011.c new file mode 100644 index 0000000..034044f --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main011.c ++++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main011.c @@ -0,0 +1,10 @@ +// Test c call fortran for the return type is int_least8_t with bindc +// @@ -9285,11 +9285,11 @@ index 0000000..034044f + int_least8_t res = f_func_(&s1); + printf("%hhd\n", res); +} -diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main012.c b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main012.c +diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main012.c b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main012.c new file mode 100644 index 0000000..1597575 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main012.c ++++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main012.c @@ -0,0 +1,10 @@ +// Test c call fortran for the return type is int_least16_t with bindc +// @@ -9301,11 +9301,11 @@ index 0000000..1597575 + int_least16_t res = f_func_(&s1); + printf("%hd\n", res); +} -diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main013.c b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main013.c +diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main013.c b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main013.c new file mode 100644 index 0000000..dc2226d --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main013.c ++++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main013.c @@ -0,0 +1,10 @@ +// Test c call fortran for the return type is int_least32_t with bindc +// @@ -9317,11 +9317,11 @@ index 0000000..dc2226d + int_least32_t res = f_func_(&s1); + printf("%d\n", res); +} -diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main014.c b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main014.c +diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main014.c b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main014.c new file mode 100644 index 0000000..b935d4a --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main014.c ++++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main014.c @@ -0,0 +1,10 @@ +// Test c call fortran for the return type is int_least64_t with bindc +// @@ -9333,11 +9333,11 @@ index 0000000..b935d4a + int_least64_t res = f_func_(&s1); + printf("%ld\n", res); +} -diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main015.c b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main015.c +diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main015.c b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main015.c new file mode 100644 index 0000000..ce49dad --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main015.c ++++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main015.c @@ -0,0 +1,10 @@ +// Test c call fortran for the return type is int_fast8_t with bindc +// @@ -9349,11 +9349,11 @@ index 0000000..ce49dad + int_fast8_t res = f_func_(&s1); + printf("%hhd\n", res); +} -diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main016.c b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main016.c +diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main016.c b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main016.c new file mode 100644 index 0000000..9f0bef4 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main016.c ++++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main016.c @@ -0,0 +1,10 @@ +// Test c call fortran for the return type is int_fast16_t with bindc +// @@ -9365,11 +9365,11 @@ index 0000000..9f0bef4 + int_fast16_t res = f_func_(&s1); + printf("%ld\n", res); +} -diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main017.c b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main017.c +diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main017.c b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main017.c new file mode 100644 index 0000000..8ab1c0a --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main017.c ++++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main017.c @@ -0,0 +1,10 @@ +// Test c call fortran for the return type is int_fast32_t with bindc +// @@ -9381,11 +9381,11 @@ index 0000000..8ab1c0a + int_fast32_t res = f_func_(&s1); + printf("%ld\n", res); +} -diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main018.c b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main018.c +diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main018.c b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main018.c new file mode 100644 index 0000000..9310bfa --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main018.c ++++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main018.c @@ -0,0 +1,10 @@ +// Test c call fortran for the return type is int_fast64_t with bindc +// @@ -9397,11 +9397,11 @@ index 0000000..9310bfa + int_fast64_t res = f_func_(&s1); + printf("%ld\n", res); +} -diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main019.c b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main019.c +diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main019.c b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main019.c new file mode 100644 index 0000000..af4c9c7 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main019.c ++++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main019.c @@ -0,0 +1,10 @@ +// Test c call fortran for the return type is intmax_t with bindc +// @@ -9413,11 +9413,11 @@ index 0000000..af4c9c7 + intmax_t res = f_func_(&s1); + printf("%ld\n", res); +} -diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main020.c b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main020.c +diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main020.c b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main020.c new file mode 100644 index 0000000..f3fbe2f --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main020.c ++++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main020.c @@ -0,0 +1,10 @@ +// Test c call fortran for the return type is intptr_t with bindc +// @@ -9429,11 +9429,11 @@ index 0000000..f3fbe2f + intptr_t res = f_func_(&s1); + printf("%ld\n", res); +} -diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main021.c b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main021.c +diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main021.c b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main021.c new file mode 100644 index 0000000..850d4ad --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main021.c ++++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main021.c @@ -0,0 +1,10 @@ +// Test c call fortran for the return type is float with bindc +// @@ -9446,11 +9446,11 @@ index 0000000..850d4ad + printf("%0.20f\n", res); +} \ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main022.c b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main022.c +diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main022.c b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main022.c new file mode 100644 index 0000000..6340c04 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main022.c ++++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main022.c @@ -0,0 +1,10 @@ +// Test c call fortran for the return type is double with bindc +// @@ -9463,11 +9463,11 @@ index 0000000..6340c04 + printf("%0.20lf\n", res); +} \ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main023.c b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main023.c +diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main023.c b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main023.c new file mode 100644 index 0000000..66a84a1 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main023.c ++++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main023.c @@ -0,0 +1,10 @@ +// Test c call fortran for the return type is long double with bindc +// @@ -9480,11 +9480,11 @@ index 0000000..66a84a1 + printf("%0.20Lf\n", res); +} \ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main024.c b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main024.c +diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main024.c b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main024.c new file mode 100644 index 0000000..c508d13 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main024.c ++++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main024.c @@ -0,0 +1,10 @@ +// Test c call fortran for the return type is float _Complex with bindc +// @@ -9497,11 +9497,11 @@ index 0000000..c508d13 + printf("%0.20f + %0.20fi\n", creal(res), cimag(res)); +} \ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main025.c b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main025.c +diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main025.c b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main025.c new file mode 100644 index 0000000..cae3878 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main025.c ++++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main025.c @@ -0,0 +1,11 @@ +// Test c call fortran for the return type is double _Complex with +// bindc @@ -9515,11 +9515,11 @@ index 0000000..cae3878 + printf("%0.20lf + %0.20lfi\n", creal(res), cimag(res)); +} \ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main026.c b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main026.c +diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main026.c b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main026.c new file mode 100644 index 0000000..b1aabf8 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main026.c ++++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main026.c @@ -0,0 +1,11 @@ +// Test c call fortran for the return type is long double _Complex with +// bindc @@ -9533,11 +9533,11 @@ index 0000000..b1aabf8 + printf("%0.20lf + %0.20lfi\n", creal(res), cimag(res)); +} \ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main027.c b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main027.c +diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main027.c b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main027.c new file mode 100644 index 0000000..e90c830 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main027.c ++++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main027.c @@ -0,0 +1,10 @@ +// Test c call fortran for the return type is _Bool with bindc +// @@ -9550,11 +9550,11 @@ index 0000000..e90c830 + printf("%d\n", res); +} \ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main028.c b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main028.c +diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main028.c b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main028.c new file mode 100644 -index 0000000..5bf1ef5 +index 0000000..7885475 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main028.c ++++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main028.c @@ -0,0 +1,10 @@ +// Test c call fortran for the return type is char with bindc +// @@ -9564,236 +9564,236 @@ index 0000000..5bf1ef5 +int main() { + char i; + char res = f_func_(&i); -+ printf("%c\n", i); ++ printf("%c\n", res); +} \ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func001.f90 b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func001.f90 +diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func001.f90 b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func001.f90 new file mode 100644 index 0000000..97fc0ff --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func001.f90 ++++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func001.f90 @@ -0,0 +1,4 @@ +integer function f_func(i) bind(c, name = "f_func_") + integer :: i + f_func = 10 + i +end -diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func002.f90 b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func002.f90 +diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func002.f90 b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func002.f90 new file mode 100644 index 0000000..a92967c --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func002.f90 ++++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func002.f90 @@ -0,0 +1,4 @@ +integer function f_func(i) bind(c, name = "f_func_") + integer(2) :: i + f_func = 10 + i +end -diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func003.f90 b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func003.f90 +diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func003.f90 b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func003.f90 new file mode 100644 index 0000000..0003034 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func003.f90 ++++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func003.f90 @@ -0,0 +1,4 @@ +integer function f_func(i) bind(c, name = "f_func_") + integer(8) :: i + f_func = 10 + i +end -diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func004.f90 b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func004.f90 +diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func004.f90 b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func004.f90 new file mode 100644 index 0000000..0003034 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func004.f90 ++++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func004.f90 @@ -0,0 +1,4 @@ +integer function f_func(i) bind(c, name = "f_func_") + integer(8) :: i + f_func = 10 + i +end -diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func005.f90 b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func005.f90 +diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func005.f90 b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func005.f90 new file mode 100644 index 0000000..4a50645 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func005.f90 ++++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func005.f90 @@ -0,0 +1,4 @@ +integer function f_func(i) bind(c, name = "f_func_") + integer(1) :: i + f_func = 10 + i +end -diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func006.f90 b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func006.f90 +diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func006.f90 b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func006.f90 new file mode 100644 index 0000000..0003034 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func006.f90 ++++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func006.f90 @@ -0,0 +1,4 @@ +integer function f_func(i) bind(c, name = "f_func_") + integer(8) :: i + f_func = 10 + i +end -diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func007.f90 b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func007.f90 +diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func007.f90 b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func007.f90 new file mode 100644 index 0000000..4a50645 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func007.f90 ++++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func007.f90 @@ -0,0 +1,4 @@ +integer function f_func(i) bind(c, name = "f_func_") + integer(1) :: i + f_func = 10 + i +end -diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func008.f90 b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func008.f90 +diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func008.f90 b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func008.f90 new file mode 100644 index 0000000..a92967c --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func008.f90 ++++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func008.f90 @@ -0,0 +1,4 @@ +integer function f_func(i) bind(c, name = "f_func_") + integer(2) :: i + f_func = 10 + i +end -diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func009.f90 b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func009.f90 +diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func009.f90 b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func009.f90 new file mode 100644 index 0000000..fbe023b --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func009.f90 ++++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func009.f90 @@ -0,0 +1,4 @@ +integer function f_func(i) bind(c, name = "f_func_") + integer(4) :: i + f_func = 10 + i +end -diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func010.f90 b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func010.f90 +diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func010.f90 b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func010.f90 new file mode 100644 index 0000000..0003034 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func010.f90 ++++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func010.f90 @@ -0,0 +1,4 @@ +integer function f_func(i) bind(c, name = "f_func_") + integer(8) :: i + f_func = 10 + i +end -diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func011.f90 b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func011.f90 +diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func011.f90 b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func011.f90 new file mode 100644 index 0000000..4a50645 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func011.f90 ++++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func011.f90 @@ -0,0 +1,4 @@ +integer function f_func(i) bind(c, name = "f_func_") + integer(1) :: i + f_func = 10 + i +end -diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func012.f90 b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func012.f90 +diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func012.f90 b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func012.f90 new file mode 100644 index 0000000..a92967c --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func012.f90 ++++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func012.f90 @@ -0,0 +1,4 @@ +integer function f_func(i) bind(c, name = "f_func_") + integer(2) :: i + f_func = 10 + i +end -diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func013.f90 b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func013.f90 +diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func013.f90 b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func013.f90 new file mode 100644 index 0000000..fbe023b --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func013.f90 ++++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func013.f90 @@ -0,0 +1,4 @@ +integer function f_func(i) bind(c, name = "f_func_") + integer(4) :: i + f_func = 10 + i +end -diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func014.f90 b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func014.f90 +diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func014.f90 b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func014.f90 new file mode 100644 index 0000000..0003034 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func014.f90 ++++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func014.f90 @@ -0,0 +1,4 @@ +integer function f_func(i) bind(c, name = "f_func_") + integer(8) :: i + f_func = 10 + i +end -diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func015.f90 b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func015.f90 +diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func015.f90 b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func015.f90 new file mode 100644 index 0000000..4a50645 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func015.f90 ++++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func015.f90 @@ -0,0 +1,4 @@ +integer function f_func(i) bind(c, name = "f_func_") + integer(1) :: i + f_func = 10 + i +end -diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func016.f90 b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func016.f90 +diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func016.f90 b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func016.f90 new file mode 100644 index 0000000..0003034 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func016.f90 ++++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func016.f90 @@ -0,0 +1,4 @@ +integer function f_func(i) bind(c, name = "f_func_") + integer(8) :: i + f_func = 10 + i +end -diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func017.f90 b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func017.f90 +diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func017.f90 b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func017.f90 new file mode 100644 index 0000000..0003034 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func017.f90 ++++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func017.f90 @@ -0,0 +1,4 @@ +integer function f_func(i) bind(c, name = "f_func_") + integer(8) :: i + f_func = 10 + i +end -diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func018.f90 b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func018.f90 +diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func018.f90 b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func018.f90 new file mode 100644 index 0000000..0003034 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func018.f90 ++++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func018.f90 @@ -0,0 +1,4 @@ +integer function f_func(i) bind(c, name = "f_func_") + integer(8) :: i + f_func = 10 + i +end -diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func019.f90 b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func019.f90 +diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func019.f90 b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func019.f90 new file mode 100644 index 0000000..0003034 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func019.f90 ++++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func019.f90 @@ -0,0 +1,4 @@ +integer function f_func(i) bind(c, name = "f_func_") + integer(8) :: i + f_func = 10 + i +end -diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func020.f90 b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func020.f90 +diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func020.f90 b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func020.f90 new file mode 100644 index 0000000..0003034 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func020.f90 ++++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func020.f90 @@ -0,0 +1,4 @@ +integer function f_func(i) bind(c, name = "f_func_") + integer(8) :: i + f_func = 10 + i +end -diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func021.f90 b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func021.f90 +diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func021.f90 b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func021.f90 new file mode 100644 index 0000000..830bae6 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func021.f90 ++++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func021.f90 @@ -0,0 +1,4 @@ +real function f_func(i) bind(c, name = "f_func_") + real(4) :: i + f_func = i + 0.1 +end \ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func022.f90 b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func022.f90 +diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func022.f90 b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func022.f90 new file mode 100644 index 0000000..5e78483 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func022.f90 ++++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func022.f90 @@ -0,0 +1,4 @@ +real(8) function f_func(i) bind(c, name = "f_func_") + real(8) :: i + f_func = i + 0.1 +end \ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func023.f90 b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func023.f90 +diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func023.f90 b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func023.f90 new file mode 100644 index 0000000..af3887a --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func023.f90 ++++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func023.f90 @@ -0,0 +1,6 @@ +function f_func(i) bind(c, name = "f_func_") + integer, parameter :: K = selected_real_kind(16) @@ -9802,33 +9802,33 @@ index 0000000..af3887a + f_func = i + 0.1 +end \ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func024.f90 b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func024.f90 +diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func024.f90 b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func024.f90 new file mode 100644 index 0000000..62de96e --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func024.f90 ++++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func024.f90 @@ -0,0 +1,4 @@ +complex(4) function f_func(i) bind(c, name = "f_func_") + complex(4) :: i + f_func = (-12345678.7654321, 1) +end \ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func025.f90 b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func025.f90 +diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func025.f90 b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func025.f90 new file mode 100644 index 0000000..9474d00 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func025.f90 ++++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func025.f90 @@ -0,0 +1,4 @@ +complex(8) function f_func(i) bind(c, name = "f_func_") + complex(8) :: i + f_func = (-12345678.7654321, 1) +end \ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func026.f90 b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func026.f90 +diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func026.f90 b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func026.f90 new file mode 100644 index 0000000..4221aff --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func026.f90 ++++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func026.f90 @@ -0,0 +1,6 @@ +function f_func(i) bind(c, name = "f_func_") + integer, parameter :: K = selected_real_kind(16) @@ -9837,33 +9837,33 @@ index 0000000..4221aff + f_func = (-12345678.7654321, 1) +end \ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func027.f90 b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func027.f90 +diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func027.f90 b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func027.f90 new file mode 100644 index 0000000..d6a9631 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func027.f90 ++++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func027.f90 @@ -0,0 +1,4 @@ +logical function f_func(i) bind(c, name = "f_func_") + logical(1) :: i + f_func = .TRUE. +end \ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func028.f90 b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func028.f90 +diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func028.f90 b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func028.f90 new file mode 100644 -index 0000000..6eb68f1 +index 0000000..ae4df1e --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func028.f90 ++++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func028.f90 @@ -0,0 +1,4 @@ +character function f_func(i) bind(c, name = "f_func_") -+ character(1) :: i ++ character :: i + f_func = 'a' +end \ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/run.sh b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/run.sh +diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/run.sh b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/run.sh new file mode 100644 -index 0000000..f6f089a +index 0000000..ad3abb0 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/run.sh ++++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/run.sh @@ -0,0 +1,16 @@ +for i in {001..028} +do @@ -9874,7 +9874,7 @@ index 0000000..f6f089a +#gfortran fortran-test.o c-test.o +#./a.out +#rm *.o a.out -+#echo "----- flang-new result : " ++echo "----- flang-new result : " +clang c_main$i.c -c -o c-test.o +flang-new fortran_func$i.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o @@ -9882,781 +9882,825 @@ index 0000000..f6f089a +rm *.o a.out +done \ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main001.c b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main001.c +diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main001.c b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main001.c new file mode 100644 -index 0000000..4ce0401 +index 0000000..8eb1204 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main001.c ++++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main001.c @@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is int passing parameter -+// with value attribute ++// Test c call fortran for the return type is ptr of type int +// +#include -+extern int f_func_(int i); ++extern int* f_func_(int *i); +int main() { + int s1 = 5; -+ int res = f_func_(s1); -+ printf("%d\n", res); ++ int *res = f_func_(&s1); ++ printf("%d\n", *res); +} -diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main002.c b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main002.c ++ +diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main002.c b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main002.c new file mode 100644 -index 0000000..84a0c5c +index 0000000..325438b --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main002.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is short passing parameter -+// with value attribute ++++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main002.c +@@ -0,0 +1,9 @@ ++// Test c call fortran for the return type is ptr of type short +// +#include -+extern short f_func_(short i); ++extern short* f_func_(short *i); +int main() { + short s1 = 5; -+ short res = f_func_(s1); -+ printf("%hd\n", res); ++ short *res = f_func_(&s1); ++ printf("%hd\n", *res); +} -diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main003.c b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main003.c +diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main003.c b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main003.c new file mode 100644 -index 0000000..e961466 +index 0000000..3afb3b2 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main003.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is long passing parameter -+// with value attribute ++++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main003.c +@@ -0,0 +1,9 @@ ++// Test c call fortran for the return type is ptr of type long +// +#include -+extern long f_func_(long i); ++extern long* f_func_(long *i); +int main() { + long s1 = 5; -+ long res = f_func_(s1); -+ printf("%ld\n", res); ++ long *res = f_func_(&s1); ++ printf("%ld\n", *res); +} -diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main004.c b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main004.c +diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main004.c b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main004.c new file mode 100644 -index 0000000..87f258d +index 0000000..d1031ab --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main004.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is long long passing -+// parameter with value attribute ++++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main004.c +@@ -0,0 +1,9 @@ ++// Test c call fortran for the return type is ptr of type long long +// +#include -+extern long long f_func_(long long i); ++extern long long* f_func_(long long *i); +int main() { + long long s1 = 5; -+ long long res = f_func_(s1); -+ printf("%Ld\n", res); ++ long long *res = f_func_(&s1); ++ printf("%Ld\n", *res); +} -diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main005.c b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main005.c +diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main005.c b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main005.c new file mode 100644 -index 0000000..ac31b35 +index 0000000..51b51d4 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main005.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is signed char passing -+// parameter with value attribute ++++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main005.c +@@ -0,0 +1,9 @@ ++// Test c call fortran for the return type is ptr of type signed char +// +#include -+extern signed char f_func_(signed char i); ++extern signed char* f_func_(signed char *i); +int main() { + signed char s1 = 85; -+ signed char res = f_func_(s1); -+ printf("%c\n", res); ++ signed char *res = f_func_(&s1); ++ printf("%c\n", *res); +} -diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main006.c b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main006.c +diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main006.c b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main006.c new file mode 100644 -index 0000000..dbf6aac +index 0000000..cd3e8bb --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main006.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is size_t passing parameter -+// with value attribute ++++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main006.c +@@ -0,0 +1,9 @@ ++// Test c call fortran for the return type is ptr of type size_t +// +#include -+extern size_t f_func_(size_t i); ++extern size_t* f_func_(size_t *i); +int main() { + size_t s1 = 5; -+ size_t res = f_func_(s1); -+ printf("%ld\n", res); ++ size_t *res = f_func_(&s1); ++ printf("%ld\n", *res); +} -diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main007.c b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main007.c +diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main007.c b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main007.c new file mode 100644 -index 0000000..0694bbc +index 0000000..aff24d6 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main007.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the return type is int8_t passing parameter -+// with value attribute ++++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main007.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for the return type is ptr of type int8_t +// +#include +#include -+extern int8_t f_func_(int8_t i); ++extern int8_t* f_func_(int8_t *i); +int main() { + int8_t s1 = 5; -+ int8_t res = f_func_(s1); -+ printf("%hhd\n", res); ++ int8_t *res = f_func_(&s1); ++ printf("%hhd\n", *res); +} -diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main008.c b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main008.c +diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main008.c b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main008.c new file mode 100644 -index 0000000..a01796a +index 0000000..fa388de --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main008.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the return type is int16_t passing parameter -+// with value attribute ++++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main008.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for the return type is ptr of type int16_t +// +#include +#include -+extern int16_t f_func_(int16_t i); ++extern int16_t* f_func_(int16_t *i); +int main() { + int16_t s1 = 5; -+ int16_t res = f_func_(s1); -+ printf("%hd\n", res); ++ int16_t *res = f_func_(&s1); ++ printf("%hd\n", *res); +} -diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main009.c b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main009.c +diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main009.c b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main009.c new file mode 100644 -index 0000000..54eeffe +index 0000000..12fc747 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main009.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the return type is int32_t passing parameter -+// with value attribute ++++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main009.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for the return type is ptr of type int32_t +// +#include +#include -+extern int32_t f_func_(int32_t i); ++extern int32_t* f_func_(int32_t *i); +int main() { + int32_t s1 = 5; -+ int32_t res = f_func_(s1); -+ printf("%d\n", res); ++ int32_t *res = f_func_(&s1); ++ printf("%d\n", *res); +} -diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main010.c b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main010.c +diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main010.c b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main010.c new file mode 100644 -index 0000000..17c1e77 +index 0000000..0154808 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main010.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the return type is int64_t passing parameter -+// with value attribute ++++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main010.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for the return type is ptr of type int64_t +// +#include +#include -+extern int64_t f_func_(int64_t i); ++extern int64_t* f_func_(int64_t *i); +int main() { + int64_t s1 = 5; -+ int64_t res = f_func_(s1); -+ printf("%ld\n", res); ++ int64_t *res = f_func_(&s1); ++ printf("%ld\n", *res); +} -diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main011.c b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main011.c +diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main011.c b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main011.c new file mode 100644 -index 0000000..fa29ef8 +index 0000000..8ea7c30 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main011.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the return type is int_least8_t passing -+// parameter with value attribute ++++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main011.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for the return type is ptr of type int_least8_t +// +#include +#include -+extern int_least8_t f_func_(int_least8_t i); ++extern int_least8_t* f_func_(int_least8_t *i); +int main() { + int_least8_t s1 = 5; -+ int_least8_t res = f_func_(s1); -+ printf("%hhd\n", res); ++ int_least8_t *res = f_func_(&s1); ++ printf("%hhd\n", *res); +} -diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main012.c b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main012.c +diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main012.c b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main012.c new file mode 100644 -index 0000000..c6482e8 +index 0000000..aac8267 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main012.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the return type is int_least16_t passing -+// parameter with value attribute ++++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main012.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for the return type is ptr of type int_least16_t +// +#include +#include -+extern int_least16_t f_func_(int_least16_t i); ++extern int_least16_t* f_func_(int_least16_t *i); +int main() { + int_least16_t s1 = 5; -+ int_least16_t res = f_func_(s1); -+ printf("%hd\n", res); ++ int_least16_t *res = f_func_(&s1); ++ printf("%hd\n", *res); +} -diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main013.c b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main013.c +diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main013.c b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main013.c new file mode 100644 -index 0000000..8143ab1 +index 0000000..679a0b0 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main013.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the return type is int_least32_t passing -+// parameter with value attribute ++++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main013.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for the return type is ptr of type int_least32_t +// +#include +#include -+extern int_least32_t f_func_(int_least32_t i); ++extern int_least32_t* f_func_(int_least32_t *i); +int main() { + int_least32_t s1 = 5; -+ int_least32_t res = f_func_(s1); -+ printf("%d\n", res); ++ int_least32_t *res = f_func_(&s1); ++ printf("%d\n", *res); +} -diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main014.c b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main014.c +diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main014.c b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main014.c new file mode 100644 -index 0000000..9576f28 +index 0000000..451e0af --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main014.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the return type is int_least64_t passing -+// parameter with value attribute ++++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main014.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for the return type is ptr of type int_least64_t +// +#include +#include -+extern int_least64_t f_func_(int_least64_t i); ++extern int_least64_t* f_func_(int_least64_t *i); +int main() { + int_least64_t s1 = 5; -+ int_least64_t res = f_func_(s1); -+ printf("%ld\n", res); ++ int_least64_t *res = f_func_(&s1); ++ printf("%ld\n", *res); +} -diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main015.c b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main015.c +diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main015.c b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main015.c new file mode 100644 -index 0000000..9b00c68 +index 0000000..c71eb46 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main015.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the return type is int_fast8_t passing -+// parameter with value attribute ++++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main015.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for the return type is ptr of type int_fast8_t +// +#include +#include -+extern int_fast8_t f_func_(int_fast8_t i); ++extern int_fast8_t* f_func_(int_fast8_t *i); +int main() { + int_fast8_t s1 = 5; -+ int_fast8_t res = f_func_(s1); -+ printf("%hhd\n", res); ++ int_fast8_t *res = f_func_(&s1); ++ printf("%hhd\n", *res); +} -diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main016.c b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main016.c +diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main016.c b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main016.c new file mode 100644 -index 0000000..c040563 +index 0000000..14ef2eb --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main016.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the return type is int_fast16_t passing -+// parameter with value attribute ++++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main016.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for the return type is ptr of type int_fast16_t +// +#include +#include -+extern int_fast16_t f_func_(int_fast16_t i); ++extern int_fast16_t* f_func_(int_fast16_t *i); +int main() { + int_fast16_t s1 = 5; -+ int_fast16_t res = f_func_(s1); -+ printf("%ld\n", res); ++ int_fast16_t *res = f_func_(&s1); ++ printf("%ld\n", *res); +} -diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main017.c b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main017.c +diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main017.c b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main017.c new file mode 100644 -index 0000000..cd6baca +index 0000000..7539524 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main017.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the return type is int_fast32_t passing -+// parameter with value attribute ++++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main017.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for the return type is ptr of type int_fast32_t +// +#include +#include -+extern int_fast32_t f_func_(int_fast32_t i); ++extern int_fast32_t* f_func_(int_fast32_t *i); +int main() { + int_fast32_t s1 = 5; -+ int_fast32_t res = f_func_(s1); -+ printf("%ld\n", res); ++ int_fast32_t *res = f_func_(&s1); ++ printf("%ld\n", *res); +} -diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main018.c b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main018.c +diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main018.c b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main018.c new file mode 100644 -index 0000000..e353616 +index 0000000..fa74746 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main018.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the return type is int_fast64_t passing -+// parameter with value attribute ++++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main018.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for the return type is ptr of type int_fast64_t +// +#include +#include -+extern int_fast64_t f_func_(int_fast64_t i); ++extern int_fast64_t* f_func_(int_fast64_t *i); +int main() { + int_fast64_t s1 = 5; -+ int_fast64_t res = f_func_(s1); -+ printf("%ld\n", res); ++ int_fast64_t *res = f_func_(&s1); ++ printf("%ld\n", *res); +} -diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main019.c b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main019.c +diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main019.c b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main019.c new file mode 100644 -index 0000000..ab3aaca +index 0000000..88b466c --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main019.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the return type is intmax_t passing -+// parameter with value attribute ++++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main019.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for the return type is ptr of type intmax_t +// +#include +#include -+extern intmax_t f_func_(intmax_t i); ++extern intmax_t* f_func_(intmax_t *i); +int main() { + intmax_t s1 = 5; -+ intmax_t res = f_func_(s1); -+ printf("%ld\n", res); ++ intmax_t *res = f_func_(&s1); ++ printf("%ld\n", *res); +} -diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main020.c b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main020.c +diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main020.c b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main020.c new file mode 100644 -index 0000000..78d4a42 +index 0000000..198ff81 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main020.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the return type is intptr_t passing -+// parameter with value attribute ++++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main020.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for the return type is ptr of type intptr_t +// +#include +#include -+extern intptr_t f_func_(intptr_t i); ++extern intptr_t* f_func_(intptr_t *i); +int main() { + intptr_t s1 = 5; -+ intptr_t res = f_func_(s1); -+ printf("%ld\n", res); ++ intptr_t *res = f_func_(&s1); ++ printf("%ld\n", *res); +} -diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main021.c b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main021.c +diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main021.c b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main021.c new file mode 100644 -index 0000000..192a0a3 +index 0000000..381859e --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main021.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the return type is float passing parameter -+// with value attribute ++++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main021.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for the return type is ptr of type float +// +#include +#include -+extern float f_func_(float i); ++extern float* f_func_(float *i); +int main() { + float i = 0.5; -+ float res = f_func_(i); -+ printf("%0.20f\n", res); ++ float *res = f_func_(&i); ++ printf("%0.20f\n", *res); +} \ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main022.c b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main022.c +diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main022.c b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main022.c new file mode 100644 -index 0000000..5d25cfa +index 0000000..082273e --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main022.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the return type is double passing parameter -+// with value attribute ++++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main022.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for the return type is ptr of type double +// +#include +#include -+extern double f_func_(double i); ++extern double* f_func_(double *i); +int main() { + double i = 0.5; -+ double res = f_func_(i); -+ printf("%0.20lf\n", res); ++ double *res = f_func_(&i); ++ printf("%0.20lf\n", *res); +} \ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main023.c b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main023.c +diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main023.c b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main023.c new file mode 100644 -index 0000000..683adbb +index 0000000..1e4934d --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main023.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the return type is long double passing -+// parameter with value attribute ++++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main023.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for the return type is ptr of type long double +// +#include +#include -+extern long double f_func_(long double i); ++extern long double* f_func_(long double *i); +int main() { + long double i = 0.5; -+ long double res = f_func_(i); -+ printf("%0.20Lf\n", res); ++ long double *res = f_func_(&i); ++ printf("%0.20Lf\n", *res); +} \ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main024.c b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main024.c +diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main024.c b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main024.c new file mode 100644 -index 0000000..8b43b9f +index 0000000..e34d02b --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main024.c ++++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main024.c @@ -0,0 +1,11 @@ -+// Test c call fortran for the return type is float _Complex passing -+// parameter with value attribute ++// Test c call fortran for the return type is ptr of type float ++// _Complex +// +#include +#include -+extern float _Complex f_func_(float _Complex i); ++extern float _Complex* f_func_(float _Complex *i); +int main() { + float _Complex i; -+ float _Complex res = f_func_(i); -+ printf("%0.20f + %0.20fi\n", creal(res), cimag(res)); ++ float _Complex *res = f_func_(&i); ++ printf("%0.20f + %0.20fi\n", creal(*res), cimag(*res)); +} \ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main025.c b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main025.c +diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main025.c b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main025.c new file mode 100644 -index 0000000..b1de661 +index 0000000..fc3dd26 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main025.c ++++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main025.c @@ -0,0 +1,11 @@ -+// Test c call fortran for the return type is double _Complex passing -+// parameter with value attribute ++// Test c call fortran for the return type is ptr of type double ++// _Complex +// +#include +#include -+extern double _Complex f_func_(double _Complex i); ++extern double _Complex* f_func_(double _Complex *i); +int main() { + double _Complex i; -+ double _Complex res = f_func_(i); -+ printf("%0.20lf + %0.20lfi\n", creal(res), cimag(res)); ++ double _Complex *res = f_func_(&i); ++ printf("%0.20lf + %0.20lfi\n", creal(*res), cimag(*res)); +} \ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main026.c b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main026.c +diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main026.c b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main026.c new file mode 100644 -index 0000000..cf21cc9 +index 0000000..b2f0dc3 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main026.c ++++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main026.c @@ -0,0 +1,11 @@ -+// Test c call fortran for the return type is long double _Complex -+// passing parameter with value attribute ++// Test c call fortran for the return type is ptr of type long double ++// _Complex +// +#include +#include -+extern long double _Complex f_func_(long double _Complex i); ++extern long double _Complex* f_func_(long double _Complex *i); +int main() { + long double _Complex i; -+ long double _Complex res = f_func_(i); -+ printf("%0.20lf + %0.20lfi\n", creal(res), cimag(res)); ++ long double _Complex *res = f_func_(&i); ++ printf("%0.20lf + %0.20lfi\n", creal(*res), cimag(*res)); +} \ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main027.c b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main027.c +diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main027.c b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main027.c new file mode 100644 -index 0000000..a42293f +index 0000000..081b376 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main027.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the return type is _Bool passing parameter -+// with value attribute ++++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main027.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for the return type is ptr of type _Bool +// +#include +#include -+extern _Bool f_func_(_Bool i); ++extern _Bool* f_func_(_Bool *i); +int main() { + _Bool i = 0; -+ _Bool res = f_func_(i); -+ printf("%d\n", res); ++ _Bool *res = f_func_(&i); ++ printf("%d\n", *res); +} \ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main028.c b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main028.c +diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main028.c b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main028.c new file mode 100644 -index 0000000..424281c +index 0000000..a12499d --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main028.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the return type is char passing parameter -+// with value attribute ++++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main028.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for the return type is ptr of type char +// +#include +#include -+extern char f_func_(char i); ++extern char* f_func_(char *i); +int main() { + char i; -+ char res = f_func_(i); -+ printf("%c\n", i); ++ char *res = f_func_(&i); ++ printf("%c\n", *res); +} \ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func001.f90 b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func001.f90 +diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func001.f90 b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func001.f90 new file mode 100644 -index 0000000..60747b4 +index 0000000..d8cce54 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func001.f90 -@@ -0,0 +1,4 @@ -+integer function f_func(i) -+ integer, value :: i -+ f_func = 10 + i ++++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func001.f90 +@@ -0,0 +1,6 @@ ++function f_func(b) result(res) ++ integer, target :: b ++ integer, pointer :: res ++ b = b + 1 ++ res => b +end -diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func002.f90 b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func002.f90 +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func002.f90 b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func002.f90 new file mode 100644 -index 0000000..453e214 +index 0000000..393d5dc --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func002.f90 -@@ -0,0 +1,4 @@ -+integer function f_func(i) -+ integer(2), value :: i -+ f_func = 10 + i ++++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func002.f90 +@@ -0,0 +1,6 @@ ++function f_func(b) result(res) ++ integer(2), target :: b ++ integer(2), pointer :: res ++ b = b + 1 ++ res => b +end -diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func003.f90 b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func003.f90 +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func003.f90 b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func003.f90 new file mode 100644 -index 0000000..ca583ef +index 0000000..3080e86 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func003.f90 -@@ -0,0 +1,4 @@ -+integer function f_func(i) -+ integer(8), value :: i -+ f_func = 10 + i ++++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func003.f90 +@@ -0,0 +1,6 @@ ++function f_func(b) result(res) ++ integer(8), target :: b ++ integer(8), pointer :: res ++ b = b + 1 ++ res => b +end -diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func004.f90 b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func004.f90 +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func004.f90 b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func004.f90 new file mode 100644 -index 0000000..ca583ef +index 0000000..3080e86 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func004.f90 -@@ -0,0 +1,4 @@ -+integer function f_func(i) -+ integer(8), value :: i -+ f_func = 10 + i ++++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func004.f90 +@@ -0,0 +1,6 @@ ++function f_func(b) result(res) ++ integer(8), target :: b ++ integer(8), pointer :: res ++ b = b + 1 ++ res => b +end -diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func005.f90 b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func005.f90 +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func005.f90 b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func005.f90 new file mode 100644 -index 0000000..69c38fa +index 0000000..6b52903 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func005.f90 -@@ -0,0 +1,4 @@ -+integer function f_func(i) -+ integer(1), value :: i -+ f_func = 10 + i ++++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func005.f90 +@@ -0,0 +1,6 @@ ++function f_func(b) result(res) ++ integer(1), target :: b ++ integer(1), pointer :: res ++ b = b + 1 ++ res => b +end -diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func006.f90 b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func006.f90 +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func006.f90 b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func006.f90 new file mode 100644 -index 0000000..ca583ef +index 0000000..3080e86 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func006.f90 -@@ -0,0 +1,4 @@ -+integer function f_func(i) -+ integer(8), value :: i -+ f_func = 10 + i ++++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func006.f90 +@@ -0,0 +1,6 @@ ++function f_func(b) result(res) ++ integer(8), target :: b ++ integer(8), pointer :: res ++ b = b + 1 ++ res => b +end -diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func007.f90 b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func007.f90 +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func007.f90 b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func007.f90 new file mode 100644 -index 0000000..69c38fa +index 0000000..6b52903 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func007.f90 -@@ -0,0 +1,4 @@ -+integer function f_func(i) -+ integer(1), value :: i -+ f_func = 10 + i ++++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func007.f90 +@@ -0,0 +1,6 @@ ++function f_func(b) result(res) ++ integer(1), target :: b ++ integer(1), pointer :: res ++ b = b + 1 ++ res => b +end -diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func008.f90 b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func008.f90 +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func008.f90 b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func008.f90 new file mode 100644 -index 0000000..453e214 +index 0000000..393d5dc --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func008.f90 -@@ -0,0 +1,4 @@ -+integer function f_func(i) -+ integer(2), value :: i -+ f_func = 10 + i ++++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func008.f90 +@@ -0,0 +1,6 @@ ++function f_func(b) result(res) ++ integer(2), target :: b ++ integer(2), pointer :: res ++ b = b + 1 ++ res => b +end -diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func009.f90 b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func009.f90 +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func009.f90 b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func009.f90 new file mode 100644 -index 0000000..55301e2 +index 0000000..50d1fb2 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func009.f90 -@@ -0,0 +1,4 @@ -+integer function f_func(i) -+ integer(4), value :: i -+ f_func = 10 + i ++++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func009.f90 +@@ -0,0 +1,6 @@ ++function f_func(b) result(res) ++ integer(4), target :: b ++ integer(4), pointer :: res ++ b = b + 1 ++ res => b +end -diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func010.f90 b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func010.f90 +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func010.f90 b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func010.f90 new file mode 100644 -index 0000000..ca583ef +index 0000000..3080e86 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func010.f90 -@@ -0,0 +1,4 @@ -+integer function f_func(i) -+ integer(8), value :: i -+ f_func = 10 + i ++++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func010.f90 +@@ -0,0 +1,6 @@ ++function f_func(b) result(res) ++ integer(8), target :: b ++ integer(8), pointer :: res ++ b = b + 1 ++ res => b +end -diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func011.f90 b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func011.f90 +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func011.f90 b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func011.f90 new file mode 100644 -index 0000000..69c38fa +index 0000000..6b52903 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func011.f90 -@@ -0,0 +1,4 @@ -+integer function f_func(i) -+ integer(1), value :: i -+ f_func = 10 + i ++++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func011.f90 +@@ -0,0 +1,6 @@ ++function f_func(b) result(res) ++ integer(1), target :: b ++ integer(1), pointer :: res ++ b = b + 1 ++ res => b +end -diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func012.f90 b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func012.f90 +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func012.f90 b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func012.f90 new file mode 100644 -index 0000000..453e214 +index 0000000..393d5dc --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func012.f90 -@@ -0,0 +1,4 @@ -+integer function f_func(i) -+ integer(2), value :: i -+ f_func = 10 + i ++++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func012.f90 +@@ -0,0 +1,6 @@ ++function f_func(b) result(res) ++ integer(2), target :: b ++ integer(2), pointer :: res ++ b = b + 1 ++ res => b +end -diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func013.f90 b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func013.f90 +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func013.f90 b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func013.f90 new file mode 100644 -index 0000000..55301e2 +index 0000000..50d1fb2 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func013.f90 -@@ -0,0 +1,4 @@ -+integer function f_func(i) -+ integer(4), value :: i -+ f_func = 10 + i ++++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func013.f90 +@@ -0,0 +1,6 @@ ++function f_func(b) result(res) ++ integer(4), target :: b ++ integer(4), pointer :: res ++ b = b + 1 ++ res => b +end -diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func014.f90 b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func014.f90 +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func014.f90 b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func014.f90 new file mode 100644 -index 0000000..ca583ef +index 0000000..3080e86 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func014.f90 -@@ -0,0 +1,4 @@ -+integer function f_func(i) -+ integer(8), value :: i -+ f_func = 10 + i ++++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func014.f90 +@@ -0,0 +1,6 @@ ++function f_func(b) result(res) ++ integer(8), target :: b ++ integer(8), pointer :: res ++ b = b + 1 ++ res => b +end -diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func015.f90 b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func015.f90 +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func015.f90 b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func015.f90 new file mode 100644 -index 0000000..69c38fa +index 0000000..6b52903 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func015.f90 -@@ -0,0 +1,4 @@ -+integer function f_func(i) -+ integer(1), value :: i -+ f_func = 10 + i ++++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func015.f90 +@@ -0,0 +1,6 @@ ++function f_func(b) result(res) ++ integer(1), target :: b ++ integer(1), pointer :: res ++ b = b + 1 ++ res => b +end -diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func016.f90 b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func016.f90 +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func016.f90 b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func016.f90 new file mode 100644 -index 0000000..ca583ef +index 0000000..3080e86 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func016.f90 -@@ -0,0 +1,4 @@ -+integer function f_func(i) -+ integer(8), value :: i -+ f_func = 10 + i ++++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func016.f90 +@@ -0,0 +1,6 @@ ++function f_func(b) result(res) ++ integer(8), target :: b ++ integer(8), pointer :: res ++ b = b + 1 ++ res => b +end -diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func017.f90 b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func017.f90 +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func017.f90 b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func017.f90 new file mode 100644 -index 0000000..ca583ef +index 0000000..3080e86 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func017.f90 -@@ -0,0 +1,4 @@ -+integer function f_func(i) -+ integer(8), value :: i -+ f_func = 10 + i ++++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func017.f90 +@@ -0,0 +1,6 @@ ++function f_func(b) result(res) ++ integer(8), target :: b ++ integer(8), pointer :: res ++ b = b + 1 ++ res => b +end -diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func018.f90 b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func018.f90 +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func018.f90 b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func018.f90 new file mode 100644 -index 0000000..ca583ef +index 0000000..3080e86 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func018.f90 -@@ -0,0 +1,4 @@ -+integer function f_func(i) -+ integer(8), value :: i -+ f_func = 10 + i ++++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func018.f90 +@@ -0,0 +1,6 @@ ++function f_func(b) result(res) ++ integer(8), target :: b ++ integer(8), pointer :: res ++ b = b + 1 ++ res => b +end -diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func019.f90 b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func019.f90 +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func019.f90 b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func019.f90 new file mode 100644 -index 0000000..ca583ef +index 0000000..3080e86 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func019.f90 -@@ -0,0 +1,4 @@ -+integer function f_func(i) -+ integer(8), value :: i -+ f_func = 10 + i ++++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func019.f90 +@@ -0,0 +1,6 @@ ++function f_func(b) result(res) ++ integer(8), target :: b ++ integer(8), pointer :: res ++ b = b + 1 ++ res => b +end -diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func020.f90 b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func020.f90 +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func020.f90 b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func020.f90 new file mode 100644 -index 0000000..ca583ef +index 0000000..3080e86 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func020.f90 -@@ -0,0 +1,4 @@ -+integer function f_func(i) -+ integer(8), value :: i -+ f_func = 10 + i ++++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func020.f90 +@@ -0,0 +1,6 @@ ++function f_func(b) result(res) ++ integer(8), target :: b ++ integer(8), pointer :: res ++ b = b + 1 ++ res => b +end -diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func021.f90 b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func021.f90 +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func021.f90 b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func021.f90 new file mode 100644 -index 0000000..fa03457 +index 0000000..72c883d --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func021.f90 -@@ -0,0 +1,4 @@ -+real function f_func(i) -+ real(4), value :: i -+ f_func = i + 0.1 ++++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func021.f90 +@@ -0,0 +1,6 @@ ++function f_func(i) result(res) ++ real(4), target :: i ++ real(4), pointer :: res ++ i = i + 0.1 ++ res => i +end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func022.f90 b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func022.f90 +diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func022.f90 b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func022.f90 new file mode 100644 -index 0000000..8970836 +index 0000000..9c29036 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func022.f90 -@@ -0,0 +1,4 @@ -+real(8) function f_func(i) -+ real(8), value :: i -+ f_func = i + 0.1 ++++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func022.f90 +@@ -0,0 +1,6 @@ ++function f_func(i) result(res) ++ real(8), target :: i ++ real(8), pointer :: res ++ i = i + 0.1 ++ res => i +end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func023.f90 b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func023.f90 +diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func023.f90 b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func023.f90 new file mode 100644 -index 0000000..b26dd66 +index 0000000..2304e96 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func023.f90 -@@ -0,0 +1,6 @@ -+function f_func(i) ++++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func023.f90 +@@ -0,0 +1,7 @@ ++function f_func(i) result(res) + integer, parameter :: K = selected_real_kind(16) -+ real(K), value :: i -+ real(K) :: f_func -+ f_func = i + 0.1 ++ real(K), target :: i ++ real(K), pointer :: res ++ i = i + 0.1 ++ res => i +end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func024.f90 b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func024.f90 +diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func024.f90 b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func024.f90 new file mode 100644 -index 0000000..a56a5bb +index 0000000..bd11ffd --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func024.f90 -@@ -0,0 +1,4 @@ -+complex(4) function f_func(i) -+ complex(4), value :: i -+ f_func = (-12345678.7654321, 1) ++++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func024.f90 +@@ -0,0 +1,6 @@ ++function f_func(i) result(res) ++ complex(4), target :: i ++ complex(4), pointer :: res ++ i = (-12345678.7654321, 1) ++ res => i +end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func025.f90 b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func025.f90 +diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func025.f90 b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func025.f90 new file mode 100644 -index 0000000..43cf7ce +index 0000000..b67ac5d --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func025.f90 -@@ -0,0 +1,4 @@ -+complex(8) function f_func(i) -+ complex(8), value :: i -+ f_func = (-12345678.7654321, 1) ++++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func025.f90 +@@ -0,0 +1,6 @@ ++function f_func(i) result(res) ++ complex(8), target :: i ++ complex(8), pointer :: res ++ i = (-12345678.7654321, 1) ++ res => i +end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func026.f90 b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func026.f90 +diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func026.f90 b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func026.f90 new file mode 100644 -index 0000000..45f9458 +index 0000000..aaad4f2 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func026.f90 -@@ -0,0 +1,6 @@ -+function f_func(i) ++++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func026.f90 +@@ -0,0 +1,7 @@ ++function f_func(i) result(res) + integer, parameter :: K = selected_real_kind(16) -+ complex(K), value :: i -+ complex(K) :: f_func -+ f_func = (-12345678.7654321, 1) ++ complex(K), target :: i ++ complex(K), pointer :: res ++ i = (-12345678.7654321, 1) ++ res => i +end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func027.f90 b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func027.f90 +diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func027.f90 b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func027.f90 new file mode 100644 -index 0000000..3681f81 +index 0000000..51a5ae5 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func027.f90 -@@ -0,0 +1,4 @@ -+logical function f_func(i) -+ logical(1), value :: i -+ f_func = .TRUE. ++++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func027.f90 +@@ -0,0 +1,6 @@ ++function f_func(b) result(res) ++ logical(1), target :: b ++ logical(1), pointer :: res ++ b = .TRUE. ++ res => b +end \ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func028.f90 b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func028.f90 +diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func028.f90 b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func028.f90 new file mode 100644 -index 0000000..5feadc7 +index 0000000..6487ee2 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func028.f90 -@@ -0,0 +1,4 @@ -+character(1) function f_func(i) -+ character(1), value :: i -+ f_func = 'a' ++++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func028.f90 +@@ -0,0 +1,6 @@ ++function f_func(b) result(res) ++ character(1), target :: b ++ character(1), pointer :: res ++ b = 'a' ++ res => b +end \ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/run.sh b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/run.sh +diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/run.sh b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/run.sh new file mode 100644 -index 0000000..f6f089a +index 0000000..ad3abb0 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/run.sh ++++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/run.sh @@ -0,0 +1,16 @@ +for i in {001..028} +do @@ -10667,7 +10711,7 @@ index 0000000..f6f089a +#gfortran fortran-test.o c-test.o +#./a.out +#rm *.o a.out -+#echo "----- flang-new result : " ++echo "----- flang-new result : " +clang c_main$i.c -c -o c-test.o +flang-new fortran_func$i.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o @@ -10675,781 +10719,850 @@ index 0000000..f6f089a +rm *.o a.out +done \ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main001.c b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main001.c +diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main001.c b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main001.c new file mode 100644 -index 0000000..5b67b09 +index 0000000..b615d87 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main001.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is int passing parameter -+// with value attribute with bindc ++++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main001.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for the return type is ptr of type int with ++// bindc +// +#include -+extern int f_func_(int i); ++extern int* f_func_(int *i); +int main() { + int s1 = 5; -+ int res = f_func_(s1); -+ printf("%d\n", res); ++ int *res = f_func_(&s1); ++ printf("%d\n", *res); +} -diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main002.c b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main002.c ++ +diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main002.c b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main002.c new file mode 100644 -index 0000000..d426ee3 +index 0000000..6012316 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main002.c ++++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main002.c @@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is short passing parameter -+// with value attribute with bindc ++// Test c call fortran for the return type is ptr of type short with ++// bindc +// +#include -+extern short f_func_(short i); ++extern short* f_func_(short *i); +int main() { + short s1 = 5; -+ short res = f_func_(s1); -+ printf("%hd\n", res); ++ short *res = f_func_(&s1); ++ printf("%hd\n", *res); +} -diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main003.c b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main003.c +diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main003.c b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main003.c new file mode 100644 -index 0000000..a1b0fd3 +index 0000000..a6aef18 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main003.c ++++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main003.c @@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is long passing parameter -+// with value attribute with bindc ++// Test c call fortran for the return type is ptr of type long with ++// bindc +// +#include -+extern long f_func_(long i); ++extern long* f_func_(long *i); +int main() { + long s1 = 5; -+ long res = f_func_(s1); -+ printf("%ld\n", res); ++ long *res = f_func_(&s1); ++ printf("%ld\n", *res); +} -diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main004.c b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main004.c +diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main004.c b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main004.c new file mode 100644 -index 0000000..cdcff38 +index 0000000..342c438 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main004.c ++++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main004.c @@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is long long passing -+// parameter with value attribute with bindc ++// Test c call fortran for the return type is ptr of type long long ++// with bindc +// +#include -+extern long long f_func_(long long i); ++extern long long* f_func_(long long *i); +int main() { + long long s1 = 5; -+ long long res = f_func_(s1); -+ printf("%Ld\n", res); ++ long long *res = f_func_(&s1); ++ printf("%Ld\n", *res); +} -diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main005.c b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main005.c +diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main005.c b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main005.c new file mode 100644 -index 0000000..8f410ae +index 0000000..d4e4f55 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main005.c ++++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main005.c @@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is signed char passing -+// parameter with value attribute with bindc ++// Test c call fortran for the return type is ptr of type signed char ++// with bindc +// +#include -+extern signed char f_func_(signed char i); ++extern signed char* f_func_(signed char *i); +int main() { + signed char s1 = 85; -+ signed char res = f_func_(s1); -+ printf("%c\n", res); ++ signed char *res = f_func_(&s1); ++ printf("%c\n", *res); +} -diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main006.c b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main006.c +diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main006.c b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main006.c new file mode 100644 -index 0000000..1f61ee2 +index 0000000..5f0663e --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main006.c ++++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main006.c @@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is size_t passing parameter -+// with value attribute with bindc ++// Test c call fortran for the return type is ptr of type size_t with ++// bindc +// +#include -+extern size_t f_func_(size_t i); ++extern size_t* f_func_(size_t *i); +int main() { + size_t s1 = 5; -+ size_t res = f_func_(s1); -+ printf("%ld\n", res); ++ size_t *res = f_func_(&s1); ++ printf("%ld\n", *res); +} -diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main007.c b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main007.c +diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main007.c b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main007.c new file mode 100644 -index 0000000..fafb3f5 +index 0000000..dd19a2c --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main007.c ++++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main007.c @@ -0,0 +1,11 @@ -+// Test c call fortran for the return type is int8_t passing parameter -+// with value attribute with bindc ++// Test c call fortran for the return type is ptr of type int8_t with ++// bindc +// +#include +#include -+extern int8_t f_func_(int8_t i); ++extern int8_t* f_func_(int8_t *i); +int main() { + int8_t s1 = 5; -+ int8_t res = f_func_(s1); -+ printf("%hhd\n", res); ++ int8_t *res = f_func_(&s1); ++ printf("%hhd\n", *res); +} -diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main008.c b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main008.c +diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main008.c b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main008.c new file mode 100644 -index 0000000..eba1d6b +index 0000000..c8a62df --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main008.c ++++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main008.c @@ -0,0 +1,11 @@ -+// Test c call fortran for the return type is int16_t passing parameter -+// with value attribute with bindc ++// Test c call fortran for the return type is ptr of type int16_t with ++// bindc +// +#include +#include -+extern int16_t f_func_(int16_t i); ++extern int16_t* f_func_(int16_t *i); +int main() { + int16_t s1 = 5; -+ int16_t res = f_func_(s1); -+ printf("%hd\n", res); ++ int16_t *res = f_func_(&s1); ++ printf("%hd\n", *res); +} -diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main009.c b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main009.c +diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main009.c b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main009.c new file mode 100644 -index 0000000..6f67907 +index 0000000..992c05d --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main009.c ++++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main009.c @@ -0,0 +1,11 @@ -+// Test c call fortran for the return type is int32_t passing parameter -+// with value attribute with bindc ++// Test c call fortran for the return type is ptr of type int32_t with ++// bindc +// +#include +#include -+extern int32_t f_func_(int32_t i); ++extern int32_t* f_func_(int32_t *i); +int main() { + int32_t s1 = 5; -+ int32_t res = f_func_(s1); -+ printf("%d\n", res); ++ int32_t *res = f_func_(&s1); ++ printf("%d\n", *res); +} -diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main010.c b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main010.c +diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main010.c b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main010.c new file mode 100644 -index 0000000..72cc1d3 +index 0000000..44843b1 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main010.c ++++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main010.c @@ -0,0 +1,11 @@ -+// Test c call fortran for the return type is int64_t passing parameter -+// with value attribute with bindc ++// Test c call fortran for the return type is ptr of type int64_t with ++// bindc +// +#include +#include -+extern int64_t f_func_(int64_t i); ++extern int64_t* f_func_(int64_t *i); +int main() { + int64_t s1 = 5; -+ int64_t res = f_func_(s1); -+ printf("%ld\n", res); ++ int64_t *res = f_func_(&s1); ++ printf("%ld\n", *res); +} -diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main011.c b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main011.c +diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main011.c b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main011.c new file mode 100644 -index 0000000..8fa7b7a +index 0000000..5fc5115 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main011.c ++++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main011.c @@ -0,0 +1,11 @@ -+// Test c call fortran for the return type is int_least8_t passing -+// parameter with value attribute with bindc ++// Test c call fortran for the return type is ptr of type int_least8_t ++// with bindc +// +#include +#include -+extern int_least8_t f_func_(int_least8_t i); ++extern int_least8_t* f_func_(int_least8_t *i); +int main() { + int_least8_t s1 = 5; -+ int_least8_t res = f_func_(s1); -+ printf("%hhd\n", res); ++ int_least8_t *res = f_func_(&s1); ++ printf("%hhd\n", *res); +} -diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main012.c b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main012.c +diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main012.c b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main012.c new file mode 100644 -index 0000000..54e6c51 +index 0000000..2a51a21 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main012.c ++++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main012.c @@ -0,0 +1,11 @@ -+// Test c call fortran for the return type is int_least16_t passing -+// parameter with value attribute with bindc ++// Test c call fortran for the return type is ptr of type int_least16_t ++// with bindc +// +#include +#include -+extern int_least16_t f_func_(int_least16_t i); ++extern int_least16_t* f_func_(int_least16_t *i); +int main() { + int_least16_t s1 = 5; -+ int_least16_t res = f_func_(s1); -+ printf("%hd\n", res); ++ int_least16_t *res = f_func_(&s1); ++ printf("%hd\n", *res); +} -diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main013.c b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main013.c +diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main013.c b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main013.c new file mode 100644 -index 0000000..f3b3ba5 +index 0000000..ab81bab --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main013.c ++++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main013.c @@ -0,0 +1,11 @@ -+// Test c call fortran for the return type is int_least32_t passing -+// parameter with value attribute with bindc ++// Test c call fortran for the return type is ptr of type int_least32_t ++// with bindc +// +#include +#include -+extern int_least32_t f_func_(int_least32_t i); ++extern int_least32_t* f_func_(int_least32_t *i); +int main() { + int_least32_t s1 = 5; -+ int_least32_t res = f_func_(s1); -+ printf("%d\n", res); ++ int_least32_t *res = f_func_(&s1); ++ printf("%d\n", *res); +} -diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main014.c b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main014.c +diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main014.c b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main014.c new file mode 100644 -index 0000000..e0b8e4f +index 0000000..9576f05 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main014.c ++++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main014.c @@ -0,0 +1,11 @@ -+// Test c call fortran for the return type is int_least64_t passing -+// parameter with value attribute with bindc ++// Test c call fortran for the return type is ptr of type int_least64_t ++// with bindc +// +#include +#include -+extern int_least64_t f_func_(int_least64_t i); ++extern int_least64_t* f_func_(int_least64_t *i); +int main() { + int_least64_t s1 = 5; -+ int_least64_t res = f_func_(s1); -+ printf("%ld\n", res); ++ int_least64_t *res = f_func_(&s1); ++ printf("%ld\n", *res); +} -diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main015.c b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main015.c +diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main015.c b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main015.c new file mode 100644 -index 0000000..de6777f +index 0000000..c23aeca --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main015.c ++++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main015.c @@ -0,0 +1,11 @@ -+// Test c call fortran for the return type is int_fast8_t passing -+// parameter with value attribute with bindc ++// Test c call fortran for the return type is ptr of type int_fast8_t ++// with bindc +// +#include +#include -+extern int_fast8_t f_func_(int_fast8_t i); ++extern int_fast8_t* f_func_(int_fast8_t *i); +int main() { + int_fast8_t s1 = 5; -+ int_fast8_t res = f_func_(s1); -+ printf("%hhd\n", res); ++ int_fast8_t *res = f_func_(&s1); ++ printf("%hhd\n", *res); +} -diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main016.c b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main016.c +diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main016.c b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main016.c new file mode 100644 -index 0000000..b9f7483 +index 0000000..dfa53bf --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main016.c ++++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main016.c @@ -0,0 +1,11 @@ -+// Test c call fortran for the return type is int_fast16_t passing -+// parameter with value attribute with bindc ++// Test c call fortran for the return type is ptr of type int_fast16_t ++// with bindc +// +#include +#include -+extern int_fast16_t f_func_(int_fast16_t i); ++extern int_fast16_t* f_func_(int_fast16_t *i); +int main() { + int_fast16_t s1 = 5; -+ int_fast16_t res = f_func_(s1); -+ printf("%ld\n", res); ++ int_fast16_t *res = f_func_(&s1); ++ printf("%ld\n", *res); +} -diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main017.c b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main017.c +diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main017.c b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main017.c new file mode 100644 -index 0000000..e94b8d9 +index 0000000..e9414da --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main017.c ++++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main017.c @@ -0,0 +1,11 @@ -+// Test c call fortran for the return type is int_fast32_t passing -+// parameter with value attribute with bindc ++// Test c call fortran for the return type is ptr of type int_fast32_t ++// with bindc +// +#include +#include -+extern int_fast32_t f_func_(int_fast32_t i); ++extern int_fast32_t* f_func_(int_fast32_t *i); +int main() { + int_fast32_t s1 = 5; -+ int_fast32_t res = f_func_(s1); -+ printf("%ld\n", res); ++ int_fast32_t *res = f_func_(&s1); ++ printf("%ld\n", *res); +} -diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main018.c b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main018.c +diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main018.c b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main018.c new file mode 100644 -index 0000000..93e6508 +index 0000000..7b84fdf --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main018.c ++++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main018.c @@ -0,0 +1,11 @@ -+// Test c call fortran for the return type is int_fast64_t passing -+// parameter with value attribute with bindc ++// Test c call fortran for the return type is ptr of type int_fast64_t ++// with bindc +// +#include +#include -+extern int_fast64_t f_func_(int_fast64_t i); ++extern int_fast64_t* f_func_(int_fast64_t *i); +int main() { + int_fast64_t s1 = 5; -+ int_fast64_t res = f_func_(s1); -+ printf("%ld\n", res); ++ int_fast64_t *res = f_func_(&s1); ++ printf("%ld\n", *res); +} -diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main019.c b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main019.c +diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main019.c b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main019.c new file mode 100644 -index 0000000..719ce04 +index 0000000..9a74d6c --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main019.c ++++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main019.c @@ -0,0 +1,11 @@ -+// Test c call fortran for the return type is intmax_t passing -+// parameter with value attribute with bindc ++// Test c call fortran for the return type is ptr of type intmax_t with ++// bindc +// +#include +#include -+extern intmax_t f_func_(intmax_t i); ++extern intmax_t* f_func_(intmax_t *i); +int main() { + intmax_t s1 = 5; -+ intmax_t res = f_func_(s1); -+ printf("%ld\n", res); ++ intmax_t *res = f_func_(&s1); ++ printf("%ld\n", *res); +} -diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main020.c b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main020.c +diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main020.c b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main020.c new file mode 100644 -index 0000000..473ddd3 +index 0000000..7f073be --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main020.c ++++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main020.c @@ -0,0 +1,11 @@ -+// Test c call fortran for the return type is intptr_t passing -+// parameter with value attribute with bindc ++// Test c call fortran for the return type is ptr of type intptr_t with ++// bindc +// +#include +#include -+extern intptr_t f_func_(intptr_t i); ++extern intptr_t* f_func_(intptr_t *i); +int main() { + intptr_t s1 = 5; -+ intptr_t res = f_func_(s1); -+ printf("%ld\n", res); ++ intptr_t *res = f_func_(&s1); ++ printf("%ld\n", *res); +} -diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main021.c b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main021.c +diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main021.c b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main021.c new file mode 100644 -index 0000000..93035e6 +index 0000000..ab108c2 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main021.c ++++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main021.c @@ -0,0 +1,11 @@ -+// Test c call fortran for the return type is float passing parameter -+// with value attribute with bindc ++// Test c call fortran for the return type is ptr of type float with ++// bindc +// +#include +#include -+extern float f_func_(float i); ++extern float* f_func_(float *i); +int main() { + float i = 0.5; -+ float res = f_func_(i); -+ printf("%0.20f\n", res); ++ float *res = f_func_(&i); ++ printf("%0.20f\n", *res); +} \ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main022.c b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main022.c +diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main022.c b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main022.c new file mode 100644 -index 0000000..4ecfb80 +index 0000000..c814ef4 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main022.c ++++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main022.c @@ -0,0 +1,11 @@ -+// Test c call fortran for the return type is double passing parameter -+// with value attribute with bindc ++// Test c call fortran for the return type is ptr of type double with ++// bindc +// +#include +#include -+extern double f_func_(double i); ++extern double* f_func_(double *i); +int main() { + double i = 0.5; -+ double res = f_func_(i); -+ printf("%0.20lf\n", res); ++ double *res = f_func_(&i); ++ printf("%0.20lf\n", *res); +} \ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main023.c b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main023.c +diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main023.c b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main023.c new file mode 100644 -index 0000000..f9ddfa6 +index 0000000..707b692 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main023.c ++++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main023.c @@ -0,0 +1,11 @@ -+// Test c call fortran for the return type is long double passing -+// parameter with value attribute with bindc ++// Test c call fortran for the return type is ptr of type long double ++// with bindc +// +#include +#include -+extern long double f_func_(long double i); ++extern long double* f_func_(long double *i); +int main() { + long double i = 0.5; -+ long double res = f_func_(i); -+ printf("%0.20Lf\n", res); ++ long double *res = f_func_(&i); ++ printf("%0.20Lf\n", *res); +} \ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main024.c b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main024.c +diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main024.c b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main024.c new file mode 100644 -index 0000000..0000476 +index 0000000..ff6af62 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main024.c ++++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main024.c @@ -0,0 +1,11 @@ -+// Test c call fortran for the return type is float _Complex passing -+// parameter with value attribute with bindc ++// Test c call fortran for the return type is ptr of type float ++// _Complex with bindc +// +#include +#include -+extern float _Complex f_func_(float _Complex i); ++extern float _Complex* f_func_(float _Complex *i); +int main() { + float _Complex i; -+ float _Complex res = f_func_(i); -+ printf("%0.20f + %0.20fi\n", creal(res), cimag(res)); ++ float _Complex *res = f_func_(&i); ++ printf("%0.20f + %0.20fi\n", creal(*res), cimag(*res)); +} \ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main025.c b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main025.c +diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main025.c b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main025.c new file mode 100644 -index 0000000..6b9c9d9 +index 0000000..9d0e8b3 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main025.c ++++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main025.c @@ -0,0 +1,11 @@ -+// Test c call fortran for the return type is double _Complex passing -+// parameter with value attribute with bindc ++// Test c call fortran for the return type is ptr of type double ++// _Complex with bindc +// +#include +#include -+extern double _Complex f_func_(double _Complex i); ++extern double _Complex* f_func_(double _Complex *i); +int main() { + double _Complex i; -+ double _Complex res = f_func_(i); -+ printf("%0.20lf + %0.20lfi\n", creal(res), cimag(res)); ++ double _Complex *res = f_func_(&i); ++ printf("%0.20lf + %0.20lfi\n", creal(*res), cimag(*res)); +} \ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main026.c b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main026.c +diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main026.c b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main026.c new file mode 100644 -index 0000000..4c442b8 +index 0000000..7751d18 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main026.c ++++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main026.c @@ -0,0 +1,11 @@ -+// Test c call fortran for the return type is long double _Complex -+// passing parameter with value attribute with bindc ++// Test c call fortran for the return type is ptr of type long double ++// _Complex with bindc +// +#include +#include -+extern long double _Complex f_func_(long double _Complex i); ++extern long double _Complex* f_func_(long double _Complex *i); +int main() { + long double _Complex i; -+ long double _Complex res = f_func_(i); -+ printf("%0.20lf + %0.20lfi\n", creal(res), cimag(res)); ++ long double _Complex *res = f_func_(&i); ++ printf("%0.20lf + %0.20lfi\n", creal(*res), cimag(*res)); +} \ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main027.c b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main027.c +diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main027.c b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main027.c new file mode 100644 -index 0000000..ddf8821 +index 0000000..3a8a3de --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main027.c ++++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main027.c @@ -0,0 +1,11 @@ -+// Test c call fortran for the return type is _Bool passing parameter -+// with value attribute with bindc ++// Test c call fortran for the return type is ptr of type _Bool with ++// bindc +// +#include +#include -+extern _Bool f_func_(_Bool i); ++extern _Bool* f_func_(_Bool *i); +int main() { + _Bool i = 0; -+ _Bool res = f_func_(i); -+ printf("%d\n", res); ++ _Bool *res = f_func_(&i); ++ printf("%d\n", *res); +} \ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main028.c b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main028.c +diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main028.c b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main028.c new file mode 100644 -index 0000000..0af1308 +index 0000000..1184003 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main028.c ++++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main028.c @@ -0,0 +1,11 @@ -+// Test c call fortran for the return type is char passing parameter -+// with value attribute with bindc ++// Test c call fortran for the return type is ptr of type char with ++// bindc +// +#include +#include -+extern char f_func_(char i); ++extern char* f_func_(char *i); +int main() { + char i; -+ char res = f_func_(i); -+ printf("%c\n", i); ++ char *res = f_func_(&i); ++ printf("%c\n", *res); +} \ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func001.f90 b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func001.f90 +diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func001.f90 b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func001.f90 new file mode 100644 -index 0000000..c4ec5f5 +index 0000000..c36beda --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func001.f90 -@@ -0,0 +1,4 @@ -+integer function f_func(i) bind(c, name = "f_func_") -+ integer, value :: i -+ f_func = 10 + i ++++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func001.f90 +@@ -0,0 +1,6 @@ ++function f_func(b) result(res) bind(c, name = "f_func_") ++ integer, target :: b ++ integer, pointer :: res ++ b = b + 1 ++ res => b +end -diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func002.f90 b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func002.f90 +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func002.f90 b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func002.f90 new file mode 100644 -index 0000000..4ea712c +index 0000000..e3e115d --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func002.f90 -@@ -0,0 +1,4 @@ -+integer function f_func(i) bind(c, name = "f_func_") -+ integer(2), value :: i -+ f_func = 10 + i ++++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func002.f90 +@@ -0,0 +1,6 @@ ++function f_func(b) result(res) bind(c, name = "f_func_") ++ integer(2), target :: b ++ integer(2), pointer :: res ++ b = b + 1 ++ res => b +end -diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func003.f90 b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func003.f90 +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func003.f90 b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func003.f90 new file mode 100644 -index 0000000..1d4c1e7 +index 0000000..98b5ce1 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func003.f90 -@@ -0,0 +1,4 @@ -+integer function f_func(i) bind(c, name = "f_func_") -+ integer(8), value :: i -+ f_func = 10 + i ++++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func003.f90 +@@ -0,0 +1,6 @@ ++function f_func(b) result(res) bind(c, name = "f_func_") ++ integer(8), target :: b ++ integer(8), pointer :: res ++ b = b + 1 ++ res => b +end -diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func004.f90 b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func004.f90 +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func004.f90 b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func004.f90 new file mode 100644 -index 0000000..1d4c1e7 +index 0000000..98b5ce1 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func004.f90 -@@ -0,0 +1,4 @@ -+integer function f_func(i) bind(c, name = "f_func_") -+ integer(8), value :: i -+ f_func = 10 + i ++++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func004.f90 +@@ -0,0 +1,6 @@ ++function f_func(b) result(res) bind(c, name = "f_func_") ++ integer(8), target :: b ++ integer(8), pointer :: res ++ b = b + 1 ++ res => b +end -diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func005.f90 b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func005.f90 +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func005.f90 b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func005.f90 new file mode 100644 -index 0000000..8411259 +index 0000000..a86b428 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func005.f90 -@@ -0,0 +1,4 @@ -+integer function f_func(i) bind(c, name = "f_func_") -+ integer(1), value :: i -+ f_func = 10 + i ++++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func005.f90 +@@ -0,0 +1,6 @@ ++function f_func(b) result(res) bind(c, name = "f_func_") ++ integer(1), target :: b ++ integer(1), pointer :: res ++ b = b + 1 ++ res => b +end -diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func006.f90 b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func006.f90 +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func006.f90 b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func006.f90 new file mode 100644 -index 0000000..1d4c1e7 +index 0000000..98b5ce1 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func006.f90 -@@ -0,0 +1,4 @@ -+integer function f_func(i) bind(c, name = "f_func_") -+ integer(8), value :: i -+ f_func = 10 + i ++++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func006.f90 +@@ -0,0 +1,6 @@ ++function f_func(b) result(res) bind(c, name = "f_func_") ++ integer(8), target :: b ++ integer(8), pointer :: res ++ b = b + 1 ++ res => b +end -diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func007.f90 b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func007.f90 +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func007.f90 b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func007.f90 new file mode 100644 -index 0000000..8411259 +index 0000000..a86b428 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func007.f90 -@@ -0,0 +1,4 @@ -+integer function f_func(i) bind(c, name = "f_func_") -+ integer(1), value :: i -+ f_func = 10 + i ++++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func007.f90 +@@ -0,0 +1,6 @@ ++function f_func(b) result(res) bind(c, name = "f_func_") ++ integer(1), target :: b ++ integer(1), pointer :: res ++ b = b + 1 ++ res => b +end -diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func008.f90 b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func008.f90 +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func008.f90 b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func008.f90 new file mode 100644 -index 0000000..4ea712c +index 0000000..e3e115d --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func008.f90 -@@ -0,0 +1,4 @@ -+integer function f_func(i) bind(c, name = "f_func_") -+ integer(2), value :: i -+ f_func = 10 + i ++++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func008.f90 +@@ -0,0 +1,6 @@ ++function f_func(b) result(res) bind(c, name = "f_func_") ++ integer(2), target :: b ++ integer(2), pointer :: res ++ b = b + 1 ++ res => b +end -diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func009.f90 b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func009.f90 +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func009.f90 b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func009.f90 new file mode 100644 -index 0000000..ff94c2d +index 0000000..c5e3ff3 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func009.f90 -@@ -0,0 +1,4 @@ -+integer function f_func(i) bind(c, name = "f_func_") -+ integer(4), value :: i -+ f_func = 10 + i ++++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func009.f90 +@@ -0,0 +1,6 @@ ++function f_func(b) result(res) bind(c, name = "f_func_") ++ integer(4), target :: b ++ integer(4), pointer :: res ++ b = b + 1 ++ res => b +end -diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func010.f90 b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func010.f90 +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func010.f90 b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func010.f90 new file mode 100644 -index 0000000..1d4c1e7 +index 0000000..98b5ce1 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func010.f90 -@@ -0,0 +1,4 @@ -+integer function f_func(i) bind(c, name = "f_func_") -+ integer(8), value :: i -+ f_func = 10 + i ++++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func010.f90 +@@ -0,0 +1,6 @@ ++function f_func(b) result(res) bind(c, name = "f_func_") ++ integer(8), target :: b ++ integer(8), pointer :: res ++ b = b + 1 ++ res => b +end -diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func011.f90 b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func011.f90 +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func011.f90 b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func011.f90 new file mode 100644 -index 0000000..8411259 +index 0000000..a86b428 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func011.f90 -@@ -0,0 +1,4 @@ -+integer function f_func(i) bind(c, name = "f_func_") -+ integer(1), value :: i -+ f_func = 10 + i ++++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func011.f90 +@@ -0,0 +1,6 @@ ++function f_func(b) result(res) bind(c, name = "f_func_") ++ integer(1), target :: b ++ integer(1), pointer :: res ++ b = b + 1 ++ res => b +end -diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func012.f90 b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func012.f90 +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func012.f90 b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func012.f90 new file mode 100644 -index 0000000..4ea712c +index 0000000..e3e115d --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func012.f90 -@@ -0,0 +1,4 @@ -+integer function f_func(i) bind(c, name = "f_func_") -+ integer(2), value :: i -+ f_func = 10 + i ++++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func012.f90 +@@ -0,0 +1,6 @@ ++function f_func(b) result(res) bind(c, name = "f_func_") ++ integer(2), target :: b ++ integer(2), pointer :: res ++ b = b + 1 ++ res => b +end -diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func013.f90 b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func013.f90 +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func013.f90 b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func013.f90 new file mode 100644 -index 0000000..ff94c2d +index 0000000..c5e3ff3 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func013.f90 -@@ -0,0 +1,4 @@ -+integer function f_func(i) bind(c, name = "f_func_") -+ integer(4), value :: i -+ f_func = 10 + i ++++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func013.f90 +@@ -0,0 +1,6 @@ ++function f_func(b) result(res) bind(c, name = "f_func_") ++ integer(4), target :: b ++ integer(4), pointer :: res ++ b = b + 1 ++ res => b +end -diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func014.f90 b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func014.f90 +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func014.f90 b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func014.f90 new file mode 100644 -index 0000000..1d4c1e7 +index 0000000..98b5ce1 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func014.f90 -@@ -0,0 +1,4 @@ -+integer function f_func(i) bind(c, name = "f_func_") -+ integer(8), value :: i -+ f_func = 10 + i ++++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func014.f90 +@@ -0,0 +1,6 @@ ++function f_func(b) result(res) bind(c, name = "f_func_") ++ integer(8), target :: b ++ integer(8), pointer :: res ++ b = b + 1 ++ res => b +end -diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func015.f90 b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func015.f90 +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func015.f90 b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func015.f90 new file mode 100644 -index 0000000..8411259 +index 0000000..a86b428 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func015.f90 -@@ -0,0 +1,4 @@ -+integer function f_func(i) bind(c, name = "f_func_") -+ integer(1), value :: i -+ f_func = 10 + i ++++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func015.f90 +@@ -0,0 +1,6 @@ ++function f_func(b) result(res) bind(c, name = "f_func_") ++ integer(1), target :: b ++ integer(1), pointer :: res ++ b = b + 1 ++ res => b +end -diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func016.f90 b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func016.f90 +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func016.f90 b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func016.f90 new file mode 100644 -index 0000000..1d4c1e7 +index 0000000..98b5ce1 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func016.f90 -@@ -0,0 +1,4 @@ -+integer function f_func(i) bind(c, name = "f_func_") -+ integer(8), value :: i -+ f_func = 10 + i ++++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func016.f90 +@@ -0,0 +1,6 @@ ++function f_func(b) result(res) bind(c, name = "f_func_") ++ integer(8), target :: b ++ integer(8), pointer :: res ++ b = b + 1 ++ res => b +end -diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func017.f90 b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func017.f90 +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func017.f90 b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func017.f90 new file mode 100644 -index 0000000..1d4c1e7 +index 0000000..98b5ce1 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func017.f90 -@@ -0,0 +1,4 @@ -+integer function f_func(i) bind(c, name = "f_func_") -+ integer(8), value :: i -+ f_func = 10 + i ++++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func017.f90 +@@ -0,0 +1,6 @@ ++function f_func(b) result(res) bind(c, name = "f_func_") ++ integer(8), target :: b ++ integer(8), pointer :: res ++ b = b + 1 ++ res => b +end -diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func018.f90 b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func018.f90 +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func018.f90 b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func018.f90 new file mode 100644 -index 0000000..1d4c1e7 +index 0000000..98b5ce1 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func018.f90 -@@ -0,0 +1,4 @@ -+integer function f_func(i) bind(c, name = "f_func_") -+ integer(8), value :: i -+ f_func = 10 + i ++++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func018.f90 +@@ -0,0 +1,6 @@ ++function f_func(b) result(res) bind(c, name = "f_func_") ++ integer(8), target :: b ++ integer(8), pointer :: res ++ b = b + 1 ++ res => b +end -diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func019.f90 b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func019.f90 +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func019.f90 b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func019.f90 new file mode 100644 -index 0000000..1d4c1e7 +index 0000000..98b5ce1 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func019.f90 -@@ -0,0 +1,4 @@ -+integer function f_func(i) bind(c, name = "f_func_") -+ integer(8), value :: i -+ f_func = 10 + i ++++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func019.f90 +@@ -0,0 +1,6 @@ ++function f_func(b) result(res) bind(c, name = "f_func_") ++ integer(8), target :: b ++ integer(8), pointer :: res ++ b = b + 1 ++ res => b +end -diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func020.f90 b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func020.f90 +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func020.f90 b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func020.f90 new file mode 100644 -index 0000000..1d4c1e7 +index 0000000..98b5ce1 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func020.f90 -@@ -0,0 +1,4 @@ -+integer function f_func(i) bind(c, name = "f_func_") -+ integer(8), value :: i -+ f_func = 10 + i ++++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func020.f90 +@@ -0,0 +1,6 @@ ++function f_func(b) result(res) bind(c, name = "f_func_") ++ integer(8), target :: b ++ integer(8), pointer :: res ++ b = b + 1 ++ res => b +end -diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func021.f90 b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func021.f90 +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func021.f90 b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func021.f90 new file mode 100644 -index 0000000..97e2d47 +index 0000000..e58e139 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func021.f90 -@@ -0,0 +1,4 @@ -+real function f_func(i) bind(c, name = "f_func_") -+ real(4), value :: i -+ f_func = i + 0.1 ++++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func021.f90 +@@ -0,0 +1,6 @@ ++function f_func(i) result(res) bind(c, name = "f_func_") ++ real(4), target :: i ++ real(4), pointer :: res ++ i = i + 0.1 ++ res => i +end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func022.f90 b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func022.f90 +diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func022.f90 b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func022.f90 new file mode 100644 -index 0000000..2c8deb7 +index 0000000..340d2f2 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func022.f90 -@@ -0,0 +1,4 @@ -+real(8) function f_func(i) bind(c, name = "f_func_") -+ real(8), value :: i -+ f_func = i + 0.1 ++++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func022.f90 +@@ -0,0 +1,6 @@ ++function f_func(i) result(res) bind(c, name = "f_func_") ++ real(8), target :: i ++ real(8), pointer :: res ++ i = i + 0.1 ++ res => i +end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func023.f90 b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func023.f90 +diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func023.f90 b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func023.f90 new file mode 100644 -index 0000000..61444ce +index 0000000..7863881 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func023.f90 -@@ -0,0 +1,6 @@ -+function f_func(i) bind(c, name = "f_func_") ++++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func023.f90 +@@ -0,0 +1,7 @@ ++function f_func(i) result(res) bind(c, name = "f_func_") + integer, parameter :: K = selected_real_kind(16) -+ real(K), value :: i -+ real(K) :: f_func -+ f_func = i + 0.1 ++ real(K), target :: i ++ real(K), pointer :: res ++ i = i + 0.1 ++ res => i +end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func024.f90 b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func024.f90 +diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func024.f90 b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func024.f90 new file mode 100644 -index 0000000..f43c211 +index 0000000..cb093eb --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func024.f90 -@@ -0,0 +1,4 @@ -+complex(4) function f_func(i) bind(c, name = "f_func_") -+ complex(4), value :: i -+ f_func = (-12345678.7654321, 1) ++++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func024.f90 +@@ -0,0 +1,6 @@ ++function f_func(i) result(res) bind(c, name = "f_func_") ++ complex(4), target :: i ++ complex(4), pointer :: res ++ i = (-12345678.7654321, 1) ++ res => i +end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func025.f90 b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func025.f90 +diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func025.f90 b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func025.f90 new file mode 100644 -index 0000000..969dee9 +index 0000000..0ec6812 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func025.f90 -@@ -0,0 +1,4 @@ -+complex(8) function f_func(i) bind(c, name = "f_func_") -+ complex(8), value :: i -+ f_func = (-12345678.7654321, 1) ++++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func025.f90 +@@ -0,0 +1,6 @@ ++function f_func(i) result(res) bind(c, name = "f_func_") ++ complex(8), target :: i ++ complex(8), pointer :: res ++ i = (-12345678.7654321, 1) ++ res => i +end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func026.f90 b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func026.f90 +diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func026.f90 b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func026.f90 new file mode 100644 -index 0000000..f32d8af +index 0000000..97df80a --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func026.f90 -@@ -0,0 +1,6 @@ -+function f_func(i) bind(c, name = "f_func_") ++++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func026.f90 +@@ -0,0 +1,7 @@ ++function f_func(i) result(res) bind(c, name = "f_func_") + integer, parameter :: K = selected_real_kind(16) -+ complex(K), value :: i -+ complex(K) :: f_func -+ f_func = (-12345678.7654321, 1) ++ complex(K), target :: i ++ complex(K), pointer :: res ++ i = (-12345678.7654321, 1) ++ res => i +end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func027.f90 b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func027.f90 +diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func027.f90 b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func027.f90 new file mode 100644 -index 0000000..1b39ac6 +index 0000000..f8f22bd --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func027.f90 -@@ -0,0 +1,4 @@ -+logical function f_func(i) bind(c, name = "f_func_") -+ logical(1), value :: i -+ f_func = .TRUE. ++++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func027.f90 +@@ -0,0 +1,6 @@ ++function f_func(b) result(res) bind(c, name = "f_func_") ++ logical(1), target :: b ++ logical(1), pointer :: res ++ b = .TRUE. ++ res => b +end \ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func028.f90 b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func028.f90 +diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func028.f90 b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func028.f90 new file mode 100644 -index 0000000..26832c7 +index 0000000..69cff1e --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func028.f90 -@@ -0,0 +1,4 @@ -+character(1) function f_func(i) bind(c, name = "f_func_") -+ character(1), value :: i -+ f_func = 'a' ++++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func028.f90 +@@ -0,0 +1,6 @@ ++function f_func(b) result(res) bind(c, name = "f_func_") ++ character(1), target :: b ++ character(1), pointer :: res ++ b = 'a' ++ res => b +end \ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/run.sh b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/run.sh +diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/run.sh b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/run.sh new file mode 100644 -index 0000000..f6f089a +index 0000000..ad3abb0 --- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/run.sh ++++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/run.sh @@ -0,0 +1,16 @@ +for i in {001..028} +do @@ -11460,7 +11573,7 @@ index 0000000..f6f089a +#gfortran fortran-test.o c-test.o +#./a.out +#rm *.o a.out -+#echo "----- flang-new result : " ++echo "----- flang-new result : " +clang c_main$i.c -c -o c-test.o +flang-new fortran_func$i.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o @@ -11607,7 +11720,7 @@ index 0000000..0d721cb \ No newline at end of file diff --git a/test/interoperability_with_c_c_call_fortran/015_c_call_fortran_pointer/run.sh b/test/interoperability_with_c_c_call_fortran/015_c_call_fortran_pointer/run.sh new file mode 100644 -index 0000000..3fe053f +index 0000000..1a0cb99 --- /dev/null +++ b/test/interoperability_with_c_c_call_fortran/015_c_call_fortran_pointer/run.sh @@ -0,0 +1,16 @@ @@ -11620,7 +11733,7 @@ index 0000000..3fe053f +#gfortran fortran-test.o c-test.o +#./a.out +#rm *.o a.out -+#echo "----- flang-new result : " ++echo "----- flang-new result : " +clang c_main$i.c -c -o c-test.o +flang-new fortran_func$i.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o @@ -11762,7 +11875,7 @@ index 0000000..b855a95 +end diff --git a/test/interoperability_with_c_c_call_fortran/016_c_call_fortran_string/run.sh b/test/interoperability_with_c_c_call_fortran/016_c_call_fortran_string/run.sh new file mode 100644 -index 0000000..3fe053f +index 0000000..1a0cb99 --- /dev/null +++ b/test/interoperability_with_c_c_call_fortran/016_c_call_fortran_string/run.sh @@ -0,0 +1,16 @@ @@ -11775,7 +11888,7 @@ index 0000000..3fe053f +#gfortran fortran-test.o c-test.o +#./a.out +#rm *.o a.out -+#echo "----- flang-new result : " ++echo "----- flang-new result : " +clang c_main$i.c -c -o c-test.o +flang-new fortran_func$i.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o diff --git a/flang.spec b/flang.spec index 311a35b..d7e263d 100644 --- a/flang.spec +++ b/flang.spec @@ -2,7 +2,7 @@ Name: flang Version: flang_20210324 -Release: 9 +Release: 10 Summary: Fortran language compiler targeting LLVM License: Apache-2.0 @@ -13,7 +13,7 @@ BuildRequires: gcc Requires: gcc >= 9.3.0 Patch0: 1-flang-runtime-inline.patch Patch1: 2-inline_f90_str_copy_klen.patch -Patch2: 3-add-tests-interoperability-C.patch +Patch2: 3-test-for-interoperability-with-c-fortran-call-c.patch Patch3: 4-add-test-cases-for-openmp-optimization.patch Patch4: 5-test-for-interoperability-with-c-c-call-fortran.patch @@ -37,6 +37,9 @@ TODO: support build Flang. %changelog +* Fri Oct 21 2022 xieyihui - flang_20210324-10 +- Fix 3-test-for-interoperability-with-c-fortran-call-c.patch for add new test cases and fix test cases about bindc and Fix 5-test-for-interoperability-with-c-c-call-fortran.patch for test cases about function + * Sun Oct 16 2022 xieyihui - flang_20210324-9 - Add patch for add test cases for interoperability with C about C call fortran -- Gitee