From ef5332e72fbf39c84b122e3a4488bf454701b4c3 Mon Sep 17 00:00:00 2001 From: xieyihui Date: Tue, 18 Oct 2022 16:07:20 +0800 Subject: [PATCH] add new test cases and fix test cases about bindc --- ...teroperability-with-c-fortran-call-c.patch | 17541 +++++++++++----- flang.spec | 5 +- 2 files changed, 11922 insertions(+), 5624 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/flang.spec b/flang.spec index 109321e..9565fca 100644 --- a/flang.spec +++ b/flang.spec @@ -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 %description @@ -36,6 +36,9 @@ TODO: support build Flang. %changelog +* Thu Oct 20 2022 xieyihui - flang_20210324-9 +- Fix 3-test-for-interoperability-with-c-fortran-call-c.patch for add new test cases and fix test cases about bindc + * Mon Sep 19 2022 xieyihui - flang_20210324-8 - Add patch for add test cases for OpenMP optimization -- Gitee