From 73b377661760e15ca3c9572f690599f02ce9b27a Mon Sep 17 00:00:00 2001 From: xieyihui Date: Fri, 18 Nov 2022 13:21:41 +0800 Subject: [PATCH] Add test cases for procedure pointer, function about array and global and split patches about interoperability with C --- ...h-c-fortran-call-c-global-and-struct.patch | 9955 ++++++++ ...rability-with-c-c-call-fortran-array.patch | 1906 ++ ...ility-with-c-c-call-fortran-function.patch | 4345 ++++ ...h-c-c-call-fortran-global-and-struct.patch | 3583 +++ ...teroperability-with-c-fortran-call-c.patch | 19629 ---------------- ...ability-with-c-fortran-call-c-scalar.patch | 5011 ++++ ...teroperability-with-c-c-call-fortran.patch | 11901 ---------- ...ability-with-c-c-call-fortran-scalar.patch | 4814 ++++ ...rability-with-c-fortran-call-c-array.patch | 3066 +++ ...ility-with-c-fortran-call-c-function.patch | 7770 ++++++ flang.spec | 15 +- 11 files changed, 40462 insertions(+), 31533 deletions(-) create mode 100644 10-test-interoperability-with-c-fortran-call-c-global-and-struct.patch create mode 100644 11-test-interoperability-with-c-c-call-fortran-array.patch create mode 100644 12-test-interoperability-with-c-c-call-fortran-function.patch create mode 100644 13-test-interoperability-with-c-c-call-fortran-global-and-struct.patch delete mode 100644 3-test-for-interoperability-with-c-fortran-call-c.patch create mode 100644 3-test-interoperability-with-c-fortran-call-c-scalar.patch delete mode 100644 5-test-for-interoperability-with-c-c-call-fortran.patch create mode 100644 5-test-interoperability-with-c-c-call-fortran-scalar.patch create mode 100644 8-test-interoperability-with-c-fortran-call-c-array.patch create mode 100644 9-test-interoperability-with-c-fortran-call-c-function.patch diff --git a/10-test-interoperability-with-c-fortran-call-c-global-and-struct.patch b/10-test-interoperability-with-c-fortran-call-c-global-and-struct.patch new file mode 100644 index 0000000..622a3a3 --- /dev/null +++ b/10-test-interoperability-with-c-fortran-call-c-global-and-struct.patch @@ -0,0 +1,9955 @@ +From 46a782f947ae3de0bdb1aeabde50dfdd3585b64d Mon Sep 17 00:00:00 2001 +From: xieyihui +Date: Fri, 18 Nov 2022 12:40:12 +0800 +Subject: [PATCH] Add new test cases about global and struct for + interoperability with C about fortran call C + +diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func001.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func001.c +new file mode 100755 +index 0000000..0da9335 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func001.c +@@ -0,0 +1,15 @@ ++#include ++struct BaseTy { ++ int j[2]; ++}; ++struct Ty { ++ struct BaseTy bt; ++ int x, y; ++}; ++void c_func_(struct Ty *t, int *a) { ++ printf("%d\t", t->bt.j[0]); ++ printf("%d\t", t->bt.j[1]); ++ printf("%d\t", t->x); ++ printf("%d\t", t->y); ++ printf("%d\n", *a); ++} +diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func002.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func002.c +new file mode 100755 +index 0000000..d43d87c +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func002.c +@@ -0,0 +1,15 @@ ++#include ++struct BaseTy { ++ short j[2]; ++}; ++struct Ty { ++ struct BaseTy bt; ++ short x, y; ++}; ++void c_func_(struct Ty *t, short *a) { ++ printf("%hd\t", t->bt.j[0]); ++ printf("%hd\t", t->bt.j[1]); ++ printf("%hd\t", t->x); ++ printf("%hd\t", t->y); ++ printf("%hd\n", *a); ++} +diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func003.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func003.c +new file mode 100755 +index 0000000..7901c06 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func003.c +@@ -0,0 +1,15 @@ ++#include ++struct BaseTy { ++ long j[2]; ++}; ++struct Ty { ++ struct BaseTy bt; ++ long x, y; ++}; ++void c_func_(struct Ty *t, long *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_global_and_struct/001_fortran_call_c_mix/c_func004.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func004.c +new file mode 100755 +index 0000000..061fcfa +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func004.c +@@ -0,0 +1,15 @@ ++#include ++struct BaseTy { ++ long long int j[2]; ++}; ++struct Ty { ++ struct BaseTy bt; ++ long long int x, y; ++}; ++void c_func_(struct Ty *t, long long int *a) { ++ printf("%lld\t", t->bt.j[0]); ++ printf("%lld\t", t->bt.j[1]); ++ printf("%lld\t", t->x); ++ printf("%lld\t", t->y); ++ printf("%lld\n", *a); ++} +diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func005.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func005.c +new file mode 100755 +index 0000000..ca651e3 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func005.c +@@ -0,0 +1,15 @@ ++#include ++struct BaseTy { ++ signed char j[2]; ++}; ++struct Ty { ++ struct BaseTy bt; ++ signed char x, y; ++}; ++void c_func_(struct Ty *t, signed char *a) { ++ printf("%c\t", t->bt.j[0]); ++ printf("%c\t", t->bt.j[1]); ++ printf("%c\t", t->x); ++ printf("%c\t", t->y); ++ printf("%c\n", *a); ++} +diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func006.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func006.c +new file mode 100755 +index 0000000..56c7f41 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func006.c +@@ -0,0 +1,15 @@ ++#include ++struct BaseTy { ++ size_t j[2]; ++}; ++struct Ty { ++ struct BaseTy bt; ++ size_t x, y; ++}; ++void c_func_(struct Ty *t, size_t *a) { ++ printf("%lu\t", t->bt.j[0]); ++ printf("%lu\t", t->bt.j[1]); ++ printf("%lu\t", t->x); ++ printf("%lu\t", t->y); ++ printf("%lu\n", *a); ++} +diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func007.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func007.c +new file mode 100755 +index 0000000..2a8eaa8 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func007.c +@@ -0,0 +1,16 @@ ++#include ++#include ++struct BaseTy { ++ int8_t j[2]; ++}; ++struct Ty { ++ struct BaseTy bt; ++ int8_t x, y; ++}; ++void c_func_(struct Ty *t, int8_t *a) { ++ printf("%hhd\t", t->bt.j[0]); ++ printf("%hhd\t", t->bt.j[1]); ++ printf("%hhd\t", t->x); ++ printf("%hhd\t", t->y); ++ printf("%hhd\n", *a); ++} +diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func008.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func008.c +new file mode 100755 +index 0000000..f45f58e +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func008.c +@@ -0,0 +1,16 @@ ++#include ++#include ++struct BaseTy { ++ int16_t j[2]; ++}; ++struct Ty { ++ struct BaseTy bt; ++ int16_t x, y; ++}; ++void c_func_(struct Ty *t, int16_t *a) { ++ printf("%hd\t", t->bt.j[0]); ++ printf("%hd\t", t->bt.j[1]); ++ printf("%hd\t", t->x); ++ printf("%hd\t", t->y); ++ printf("%hd\n", *a); ++} +diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func009.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func009.c +new file mode 100755 +index 0000000..01ad489 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func009.c +@@ -0,0 +1,16 @@ ++#include ++#include ++struct BaseTy { ++ int32_t j[2]; ++}; ++struct Ty { ++ struct BaseTy bt; ++ int32_t x, y; ++}; ++void c_func_(struct Ty *t, int32_t *a) { ++ printf("%d\t", t->bt.j[0]); ++ printf("%d\t", t->bt.j[1]); ++ printf("%d\t", t->x); ++ printf("%d\t", t->y); ++ printf("%d\n", *a); ++} +diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func010.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func010.c +new file mode 100755 +index 0000000..105ad9a +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func010.c +@@ -0,0 +1,16 @@ ++#include ++#include ++struct BaseTy { ++ int64_t j[2]; ++}; ++struct Ty { ++ struct BaseTy bt; ++ int64_t x, y; ++}; ++void c_func_(struct Ty *t, int64_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_global_and_struct/001_fortran_call_c_mix/c_func011.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func011.c +new file mode 100755 +index 0000000..e19a9f0 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func011.c +@@ -0,0 +1,16 @@ ++#include ++#include ++struct BaseTy { ++ int_least8_t j[2]; ++}; ++struct Ty { ++ struct BaseTy bt; ++ int_least8_t x, y; ++}; ++void c_func_(struct Ty *t, int_least8_t *a) { ++ printf("%hhd\t", t->bt.j[0]); ++ printf("%hhd\t", t->bt.j[1]); ++ printf("%hhd\t", t->x); ++ printf("%hhd\t", t->y); ++ printf("%hhd\n", *a); ++} +diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func012.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func012.c +new file mode 100755 +index 0000000..1b9064b +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func012.c +@@ -0,0 +1,16 @@ ++#include ++#include ++struct BaseTy { ++ int_least16_t j[2]; ++}; ++struct Ty { ++ struct BaseTy bt; ++ int_least16_t x, y; ++}; ++void c_func_(struct Ty *t, int_least16_t *a) { ++ printf("%hd\t", t->bt.j[0]); ++ printf("%hd\t", t->bt.j[1]); ++ printf("%hd\t", t->x); ++ printf("%hd\t", t->y); ++ printf("%hd\n", *a); ++} +diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func013.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func013.c +new file mode 100755 +index 0000000..9ab4390 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func013.c +@@ -0,0 +1,16 @@ ++#include ++#include ++struct BaseTy { ++ int_least32_t j[2]; ++}; ++struct Ty { ++ struct BaseTy bt; ++ int_least32_t x, y; ++}; ++void c_func_(struct Ty *t, int_least32_t *a) { ++ printf("%d\t", t->bt.j[0]); ++ printf("%d\t", t->bt.j[1]); ++ printf("%d\t", t->x); ++ printf("%d\t", t->y); ++ printf("%d\n", *a); ++} +diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func014.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func014.c +new file mode 100755 +index 0000000..82bd2a2 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func014.c +@@ -0,0 +1,16 @@ ++#include ++#include ++struct BaseTy { ++ int_least64_t j[2]; ++}; ++struct Ty { ++ struct BaseTy bt; ++ int_least64_t x, y; ++}; ++void c_func_(struct Ty *t, int_least64_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_global_and_struct/001_fortran_call_c_mix/c_func015.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func015.c +new file mode 100755 +index 0000000..b2a9da9 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func015.c +@@ -0,0 +1,16 @@ ++#include ++#include ++struct BaseTy { ++ int_fast8_t j[2]; ++}; ++struct Ty { ++ struct BaseTy bt; ++ int_fast8_t x, y; ++}; ++void c_func_(struct Ty *t, int_fast8_t *a) { ++ printf("%hhd\t", t->bt.j[0]); ++ printf("%hhd\t", t->bt.j[1]); ++ printf("%hhd\t", t->x); ++ printf("%hhd\t", t->y); ++ printf("%hhd\n", *a); ++} +diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func016.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func016.c +new file mode 100755 +index 0000000..f35b45c +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func016.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_global_and_struct/001_fortran_call_c_mix/c_func017.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func017.c +new file mode 100755 +index 0000000..4d6e335 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func017.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_global_and_struct/001_fortran_call_c_mix/c_func018.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func018.c +new file mode 100755 +index 0000000..86d6afa +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func018.c +@@ -0,0 +1,16 @@ ++#include ++#include ++struct BaseTy { ++ int_fast64_t j[2]; ++}; ++struct Ty { ++ struct BaseTy bt; ++ int_fast64_t x, y; ++}; ++void c_func_(struct Ty *t, int_fast64_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_global_and_struct/001_fortran_call_c_mix/c_func019.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func019.c +new file mode 100755 +index 0000000..48600a8 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func019.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_global_and_struct/001_fortran_call_c_mix/c_func020.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func020.c +new file mode 100755 +index 0000000..88cb6d9 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func020.c +@@ -0,0 +1,16 @@ ++#include ++#include ++struct BaseTy { ++ intptr_t j[2]; ++}; ++struct Ty { ++ struct BaseTy bt; ++ intptr_t x, y; ++}; ++void c_func_(struct Ty *t, intptr_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_global_and_struct/001_fortran_call_c_mix/c_func021.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func021.c +new file mode 100755 +index 0000000..4ef4c87 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func021.c +@@ -0,0 +1,15 @@ ++#include ++#include ++struct BaseTy { ++ float j[2]; ++}; ++struct Ty { ++ struct BaseTy bt; ++ float x, y; ++}; ++void c_func_(struct Ty *t) { ++ printf("%.2f\t", t->bt.j[0]); ++ printf("%.2f\t", t->bt.j[1]); ++ printf("%.2f\t", t->x); ++ printf("%.2f\n", t->y); ++} +diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func022.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func022.c +new file mode 100755 +index 0000000..6a17869 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func022.c +@@ -0,0 +1,15 @@ ++#include ++#include ++struct BaseTy { ++ double j[2]; ++}; ++struct Ty { ++ struct BaseTy bt; ++ double x, y; ++}; ++void c_func_(struct Ty *t) { ++ printf("%.6lf\t", t->bt.j[0]); ++ printf("%.6lf\t", t->bt.j[1]); ++ printf("%.6lf\t", t->x); ++ printf("%.6lf\n", t->y); ++} +diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func023.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func023.c +new file mode 100755 +index 0000000..ce676c0 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func023.c +@@ -0,0 +1,15 @@ ++#include ++#include ++struct BaseTy { ++ long double j[2]; ++}; ++struct Ty { ++ struct BaseTy bt; ++ long double x, y; ++}; ++void c_func_(struct Ty *t) { ++ printf("%.6Lf\t", t->bt.j[0]); ++ printf("%.6Lf\t", t->bt.j[1]); ++ printf("%.6Lf\t", t->x); ++ printf("%.6Lf\n", t->y); ++} +diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func024.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func024.c +new file mode 100755 +index 0000000..65f9cd3 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func024.c +@@ -0,0 +1,15 @@ ++#include ++#include ++struct BaseTy { ++ float _Complex j[2]; ++}; ++struct Ty { ++ struct BaseTy bt; ++ float _Complex x, y; ++}; ++void c_func_(struct Ty *t) { ++ printf("%f + %fi\n", creal(t->bt.j[0]), cimag(t->bt.j[0])); ++ printf("%f + %fi\n", creal(t->bt.j[1]), cimag(t->bt.j[1])); ++ 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_global_and_struct/001_fortran_call_c_mix/c_func025.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func025.c +new file mode 100755 +index 0000000..5a508d3 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func025.c +@@ -0,0 +1,15 @@ ++#include ++#include ++struct BaseTy { ++ double _Complex j[2]; ++}; ++struct Ty { ++ struct BaseTy bt; ++ double _Complex x, y; ++}; ++void c_func_(struct Ty *t) { ++ printf("%lf + %lfi\n", creal(t->bt.j[0]), cimag(t->bt.j[0])); ++ printf("%lf + %lfi\n", creal(t->bt.j[1]), cimag(t->bt.j[1])); ++ 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_global_and_struct/001_fortran_call_c_mix/c_func026.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func026.c +new file mode 100755 +index 0000000..3969809 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func026.c +@@ -0,0 +1,15 @@ ++#include ++#include ++struct BaseTy { ++ long double _Complex j[2]; ++}; ++struct Ty { ++ struct BaseTy bt; ++ long double _Complex x, y; ++}; ++void c_func_(struct Ty *t) { ++ printf("%f + %fi\n", creal(t->bt.j[0]), cimag(t->bt.j[0])); ++ printf("%f + %fi\n", creal(t->bt.j[1]), cimag(t->bt.j[1])); ++ 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_global_and_struct/001_fortran_call_c_mix/c_func027.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func027.c +new file mode 100755 +index 0000000..8847072 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func027.c +@@ -0,0 +1,15 @@ ++#include ++struct BaseTy { ++ _Bool j[2]; ++}; ++struct Ty { ++ struct BaseTy bt; ++ _Bool x, y; ++}; ++void c_func_(struct Ty *t, _Bool *a) { ++ printf("%d\t", t->bt.j[0]); ++ printf("%d\t", t->bt.j[1]); ++ printf("%d\t", t->x); ++ printf("%d\t", t->y); ++ printf("%d\n", *a); ++} +diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func028.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func028.c +new file mode 100755 +index 0000000..988b739 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func028.c +@@ -0,0 +1,15 @@ ++#include ++struct BaseTy { ++ char j[2]; ++}; ++struct Ty { ++ struct BaseTy bt; ++ char x, y; ++}; ++void c_func_(struct Ty *t, int *a) { ++ printf("%c\t", t->bt.j[0]); ++ printf("%c\t", t->bt.j[1]); ++ printf("%c\t", t->x); ++ printf("%c\t", t->y); ++ printf("%c\n", *a); ++} +diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/fortran_main001.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/fortran_main001.f90 +new file mode 100755 +index 0000000..37bfd33 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_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 ++! components are mixed type int_t ++! ++program main ++ use iso_c_binding ++ type, bind(c) :: base ++ integer(C_INT) :: j(2) = -2 ++ end type base ++ type, bind(c) :: t ++ type(base) :: bt ++ integer(C_INT) :: x = -2147483647 ++ integer(4) :: 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_global_and_struct/001_fortran_call_c_mix/fortran_main002.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/fortran_main002.f90 +new file mode 100755 +index 0000000..ad07ec8 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_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 ++! components are mixed type short ++! ++program main ++ use iso_c_binding ++ type, bind(c) :: base ++ integer(C_SHORT) :: j(2) = -2 ++ end type base ++ type, bind(c) :: t ++ type(base) :: bt ++ integer(C_SHORT) :: x = -32768 ++ integer(2) :: y = 32767 ++ end type t ++ type(t) :: my_t ++ integer(C_SHORT) :: my_x = 3 ++ interface ++ subroutine c_func(a, b) ++ use iso_c_binding ++ import :: t ++ type(t) :: a ++ integer(C_SHORT) :: b ++ end ++ end interface ++ call c_func(my_t, my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/fortran_main003.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/fortran_main003.f90 +new file mode 100755 +index 0000000..4b182aa +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_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 ++! components are mixed type long ++! ++program main ++ use iso_c_binding ++ type, bind(c) :: base ++ integer(C_LONG) :: j(2) = -2 ++ end type base ++ type, bind(c) :: t ++ type(base) :: bt ++ integer(C_LONG) :: x = -2147483647 ++ integer(8) :: y = 2147483647 ++ end type t ++ type(t) :: my_t ++ integer(C_LONG) :: my_x = 3 ++ interface ++ subroutine c_func(a, b) ++ use iso_c_binding ++ import :: t ++ type(t) :: a ++ integer(C_LONG) :: b ++ end ++ end interface ++ call c_func(my_t, my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/fortran_main004.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/fortran_main004.f90 +new file mode 100755 +index 0000000..7a1d67a +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_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 ++! components are mixed type long long ++! ++program main ++ use iso_c_binding ++ type, bind(c) :: base ++ integer(C_LONG_LONG) :: j(2) = -2 ++ end type base ++ type, bind(c) :: t ++ type(base) :: bt ++ integer(C_LONG_LONG) :: x = -9223372036854775807 ++ integer(8) :: y = 9223372036854775807 ++ end type t ++ type(t) :: my_t ++ integer(C_LONG_LONG) :: my_x = 3 ++ interface ++ subroutine c_func(a, b) ++ use iso_c_binding ++ import :: t ++ type(t) :: a ++ integer(C_LONG_LONG) :: b ++ end ++ end interface ++ call c_func(my_t, my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/fortran_main005.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/fortran_main005.f90 +new file mode 100755 +index 0000000..5fa4d83 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_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 ++! components are mixed type signed char ++! ++program main ++ use iso_c_binding ++ type, bind(c) :: base ++ integer(C_SIGNED_CHAR) :: j(2) = 65 ++ end type base ++ type, bind(c) :: t ++ type(base) :: bt ++ integer(C_SIGNED_CHAR) :: x = 66 ++ integer(1) :: y = 67 ++ end type t ++ type(t) :: my_t ++ integer(C_SIGNED_CHAR) :: my_x = 68 ++ interface ++ subroutine c_func(a, b) ++ use iso_c_binding ++ import :: t ++ type(t) :: a ++ integer(C_SIGNED_CHAR) :: b ++ end ++ end interface ++ call c_func(my_t, my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/fortran_main006.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/fortran_main006.f90 +new file mode 100755 +index 0000000..1ef89d9 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_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 ++! components are mixed type size_t ++! ++program main ++ use iso_c_binding ++ type, bind(c) :: base ++ integer(C_SIZE_T) :: j(2) = 2 ++ end type base ++ type, bind(c) :: t ++ type(base) :: bt ++ integer(C_SIZE_T) :: x = 9223372036854775807 ++ integer(8) :: y = 0 ++ end type t ++ type(t) :: my_t ++ integer(C_SIZE_T) :: my_x = 3 ++ interface ++ subroutine c_func(a, b) ++ use iso_c_binding ++ import :: t ++ type(t) :: a ++ integer(C_SIZE_T) :: b ++ end ++ end interface ++ call c_func(my_t, my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/fortran_main007.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/fortran_main007.f90 +new file mode 100755 +index 0000000..56e5341 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_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 ++ 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_global_and_struct/001_fortran_call_c_mix/fortran_main008.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/fortran_main008.f90 +new file mode 100755 +index 0000000..8b5a4ce +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_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_global_and_struct/001_fortran_call_c_mix/fortran_main009.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/fortran_main009.f90 +new file mode 100755 +index 0000000..2674ede +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_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_global_and_struct/001_fortran_call_c_mix/fortran_main010.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/fortran_main010.f90 +new file mode 100755 +index 0000000..9d50708 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_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_global_and_struct/001_fortran_call_c_mix/fortran_main011.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/fortran_main011.f90 +new file mode 100755 +index 0000000..3e895fc +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_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_global_and_struct/001_fortran_call_c_mix/fortran_main012.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/fortran_main012.f90 +new file mode 100755 +index 0000000..a8b0ef5 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_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_global_and_struct/001_fortran_call_c_mix/fortran_main013.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/fortran_main013.f90 +new file mode 100755 +index 0000000..62e8b11 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_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_global_and_struct/001_fortran_call_c_mix/fortran_main014.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/fortran_main014.f90 +new file mode 100755 +index 0000000..1b0aa8e +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_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_global_and_struct/001_fortran_call_c_mix/fortran_main015.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/fortran_main015.f90 +new file mode 100755 +index 0000000..52d7e1d +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_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_global_and_struct/001_fortran_call_c_mix/fortran_main016.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/fortran_main016.f90 +new file mode 100755 +index 0000000..05bd335 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_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_global_and_struct/001_fortran_call_c_mix/fortran_main017.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/fortran_main017.f90 +new file mode 100755 +index 0000000..0a648b4 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_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_global_and_struct/001_fortran_call_c_mix/fortran_main018.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/fortran_main018.f90 +new file mode 100755 +index 0000000..34fd6b2 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_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_global_and_struct/001_fortran_call_c_mix/fortran_main019.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/fortran_main019.f90 +new file mode 100755 +index 0000000..d18bfaa +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_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_global_and_struct/001_fortran_call_c_mix/fortran_main020.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/fortran_main020.f90 +new file mode 100755 +index 0000000..849525a +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_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_global_and_struct/001_fortran_call_c_mix/fortran_main021.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/fortran_main021.f90 +new file mode 100755 +index 0000000..ecb0e02 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_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_global_and_struct/001_fortran_call_c_mix/fortran_main022.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/fortran_main022.f90 +new file mode 100755 +index 0000000..7865856 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_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_global_and_struct/001_fortran_call_c_mix/fortran_main023.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/fortran_main023.f90 +new file mode 100755 +index 0000000..d88c887 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_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_global_and_struct/001_fortran_call_c_mix/fortran_main024.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/fortran_main024.f90 +new file mode 100755 +index 0000000..033c05a +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_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_global_and_struct/001_fortran_call_c_mix/fortran_main025.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/fortran_main025.f90 +new file mode 100755 +index 0000000..e03cd28 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_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_global_and_struct/001_fortran_call_c_mix/fortran_main026.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/fortran_main026.f90 +new file mode 100755 +index 0000000..a3af173 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_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_global_and_struct/001_fortran_call_c_mix/fortran_main027.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/fortran_main027.f90 +new file mode 100755 +index 0000000..2df1f57 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_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_global_and_struct/001_fortran_call_c_mix/fortran_main028.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/fortran_main028.f90 +new file mode 100755 +index 0000000..23450cd +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_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_global_and_struct/001_fortran_call_c_mix/result.md b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/result.md +new file mode 100644 +index 0000000..a475ebc +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/result.md +@@ -0,0 +1,29 @@ ++ | test | gfortran | flang | nvfortran| ++ | 001 | PASS | PASS | PASS | ++ | 002 | PASS | PASS | PASS | ++ | 003 | PASS | PASS | PASS | ++ | 004 | PASS | PASS | ERROR | ++ | 005 | PASS | PASS | PASS | ++ | 006 | PASS | PASS | ERROR | ++ | 007 | PASS | PASS | PASS | ++ | 008 | PASS | PASS | PASS | ++ | 009 | PASS | PASS | PASS | ++ | 010 | PASS | PASS | ERROR | ++ | 011 | PASS | PASS | PASS | ++ | 012 | PASS | PASS | PASS | ++ | 013 | PASS | PASS | PASS | ++ | 014 | PASS | PASS | ERROR | ++ | 015 | PASS | PASS | PASS | ++ | 016 | PASS | ERROR | PASS | ++ | 017 | PASS | ERROR | PASS | ++ | 018 | PASS | PASS | ERROR | ++ | 019 | PASS | ERROR | PASS | ++ | 020 | PASS | PASS | PASS | ++ | 021 | PASS | PASS | PASS | ++ | 022 | PASS | PASS | PASS | ++ | 023 | PASS | ERROR | ERROR | ++ | 024 | PASS | PASS | PASS | ++ | 025 | PASS | PASS | PASS | ++ | 026 | PASS | ERROR | ERROR | ++ | 027 | PASS | PASS | PASS | ++ | 028 | PASS | PASS | PASS | +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/run.sh b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/run.sh +new file mode 100644 +index 0000000..dbbd62f +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/run.sh +@@ -0,0 +1,22 @@ ++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 ++echo "----- nvfortran result : " ++clang c_func$i.c -c -o c-test.o ++nvfortran fortran_main$i.f90 -c -o fortran-test.o ++nvfortran 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_global_and_struct/002_fortran_call_c_special_case/c_func001.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/002_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_global_and_struct/002_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_global_and_struct/002_fortran_call_c_special_case/c_func002.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/002_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_global_and_struct/002_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_global_and_struct/002_fortran_call_c_special_case/c_func003.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/002_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_global_and_struct/002_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_global_and_struct/002_fortran_call_c_special_case/c_func004.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/002_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_global_and_struct/002_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_global_and_struct/002_fortran_call_c_special_case/c_func005.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/002_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_global_and_struct/002_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_global_and_struct/002_fortran_call_c_special_case/c_func006.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/002_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_global_and_struct/002_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_global_and_struct/002_fortran_call_c_special_case/fortran_main001.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/002_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_global_and_struct/002_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_global_and_struct/002_fortran_call_c_special_case/fortran_main002.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/002_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_global_and_struct/002_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_global_and_struct/002_fortran_call_c_special_case/fortran_main003.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/002_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_global_and_struct/002_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_global_and_struct/002_fortran_call_c_special_case/fortran_main004.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/002_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_global_and_struct/002_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_global_and_struct/002_fortran_call_c_special_case/fortran_main005.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/002_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_global_and_struct/002_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_global_and_struct/002_fortran_call_c_special_case/fortran_main006.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/002_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_global_and_struct/002_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_global_and_struct/002_fortran_call_c_special_case/result.md b/test/interoperability_with_c_fortran_call_c_global_and_struct/002_fortran_call_c_special_case/result.md +new file mode 100644 +index 0000000..c8c9bb2 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/002_fortran_call_c_special_case/result.md +@@ -0,0 +1,7 @@ ++ | test | gfortran | flang | nvfortran| ++ | 001 | PASS | PASS | ERROR | ++ | 002 | PASS | PASS | ERROR | ++ | 003 | PASS | PASS | PASS | ++ | 004 | PASS | ERROR | PASS | ++ | 005 | PASS | ERROR | PASS | ++ | 006 | PASS | ERROR | PASS | +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/002_fortran_call_c_special_case/run.sh b/test/interoperability_with_c_fortran_call_c_global_and_struct/002_fortran_call_c_special_case/run.sh +new file mode 100644 +index 0000000..2392045 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/002_fortran_call_c_special_case/run.sh +@@ -0,0 +1,22 @@ ++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 ++echo "----- nvfortran result : " ++clang c_func$i.c -c -o c-test.o ++nvfortran fortran_main$i.f90 -c -o fortran-test.o ++nvfortran 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_global_and_struct/003_fortran_call_c_struct/c_func001.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/c_func001.c +new file mode 100755 +index 0000000..042849e +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_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_global_and_struct/003_fortran_call_c_struct/c_func002.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/c_func002.c +new file mode 100755 +index 0000000..ad72ffd +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_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_global_and_struct/003_fortran_call_c_struct/c_func003.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/c_func003.c +new file mode 100755 +index 0000000..78540c0 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_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_global_and_struct/003_fortran_call_c_struct/c_func004.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/c_func004.c +new file mode 100755 +index 0000000..83bc034 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_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_global_and_struct/003_fortran_call_c_struct/c_func005.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/c_func005.c +new file mode 100755 +index 0000000..f0ec8b1 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_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_global_and_struct/003_fortran_call_c_struct/c_func006.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/c_func006.c +new file mode 100755 +index 0000000..a37766e +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_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_global_and_struct/003_fortran_call_c_struct/c_func007.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/c_func007.c +new file mode 100755 +index 0000000..71c4460 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_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_global_and_struct/003_fortran_call_c_struct/c_func008.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/c_func008.c +new file mode 100755 +index 0000000..cc4c156 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_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_global_and_struct/003_fortran_call_c_struct/c_func009.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/c_func009.c +new file mode 100755 +index 0000000..81c3db1 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_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_global_and_struct/003_fortran_call_c_struct/c_func010.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/c_func010.c +new file mode 100755 +index 0000000..0d8b990 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_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_global_and_struct/003_fortran_call_c_struct/c_func011.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/c_func011.c +new file mode 100755 +index 0000000..9d65b2a +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_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_global_and_struct/003_fortran_call_c_struct/c_func012.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/c_func012.c +new file mode 100755 +index 0000000..e77ab58 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_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_global_and_struct/003_fortran_call_c_struct/c_func013.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/c_func013.c +new file mode 100755 +index 0000000..c37c94e +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_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_global_and_struct/003_fortran_call_c_struct/c_func014.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/c_func014.c +new file mode 100755 +index 0000000..6f8a5b4 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_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_global_and_struct/003_fortran_call_c_struct/c_func015.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/c_func015.c +new file mode 100755 +index 0000000..9308c5b +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_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_global_and_struct/003_fortran_call_c_struct/c_func016.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/c_func016.c +new file mode 100755 +index 0000000..1bdc74a +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_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_global_and_struct/003_fortran_call_c_struct/c_func017.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/c_func017.c +new file mode 100755 +index 0000000..017daeb +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_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_global_and_struct/003_fortran_call_c_struct/c_func018.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/c_func018.c +new file mode 100755 +index 0000000..3ab58e9 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_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_global_and_struct/003_fortran_call_c_struct/c_func019.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/c_func019.c +new file mode 100755 +index 0000000..9c68e8d +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_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_global_and_struct/003_fortran_call_c_struct/c_func020.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/c_func020.c +new file mode 100755 +index 0000000..9c41124 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_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_global_and_struct/003_fortran_call_c_struct/c_func021.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/c_func021.c +new file mode 100755 +index 0000000..33704de +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_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_global_and_struct/003_fortran_call_c_struct/c_func022.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/c_func022.c +new file mode 100755 +index 0000000..e8beea1 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_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_global_and_struct/003_fortran_call_c_struct/c_func023.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/c_func023.c +new file mode 100755 +index 0000000..a735b8d +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_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_global_and_struct/003_fortran_call_c_struct/c_func024.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/c_func024.c +new file mode 100755 +index 0000000..aff5eaf +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_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_global_and_struct/003_fortran_call_c_struct/c_func025.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/c_func025.c +new file mode 100755 +index 0000000..cac2da2 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_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_global_and_struct/003_fortran_call_c_struct/c_func026.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/c_func026.c +new file mode 100755 +index 0000000..886667b +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_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_global_and_struct/003_fortran_call_c_struct/c_func027.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/c_func027.c +new file mode 100755 +index 0000000..ef8ac27 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_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_global_and_struct/003_fortran_call_c_struct/c_func028.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/c_func028.c +new file mode 100755 +index 0000000..1b00b60 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_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_global_and_struct/003_fortran_call_c_struct/fortran_main001.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/fortran_main001.f90 +new file mode 100755 +index 0000000..908fbdf +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_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_global_and_struct/003_fortran_call_c_struct/fortran_main002.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/fortran_main002.f90 +new file mode 100755 +index 0000000..b42f21e +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_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_global_and_struct/003_fortran_call_c_struct/fortran_main003.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/fortran_main003.f90 +new file mode 100755 +index 0000000..4ef184f +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_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_global_and_struct/003_fortran_call_c_struct/fortran_main004.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/fortran_main004.f90 +new file mode 100755 +index 0000000..636140d +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_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_global_and_struct/003_fortran_call_c_struct/fortran_main005.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/fortran_main005.f90 +new file mode 100755 +index 0000000..220b2c5 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_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_global_and_struct/003_fortran_call_c_struct/fortran_main006.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/fortran_main006.f90 +new file mode 100755 +index 0000000..570af7d +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_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_global_and_struct/003_fortran_call_c_struct/fortran_main007.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/fortran_main007.f90 +new file mode 100755 +index 0000000..00e3dc9 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_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_global_and_struct/003_fortran_call_c_struct/fortran_main008.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/fortran_main008.f90 +new file mode 100755 +index 0000000..ee668bc +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_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_global_and_struct/003_fortran_call_c_struct/fortran_main009.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/fortran_main009.f90 +new file mode 100755 +index 0000000..f2afc38 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_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_global_and_struct/003_fortran_call_c_struct/fortran_main010.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/fortran_main010.f90 +new file mode 100755 +index 0000000..f683925 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_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_global_and_struct/003_fortran_call_c_struct/fortran_main011.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/fortran_main011.f90 +new file mode 100755 +index 0000000..0819311 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_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_global_and_struct/003_fortran_call_c_struct/fortran_main012.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/fortran_main012.f90 +new file mode 100755 +index 0000000..86fb06d +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_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_global_and_struct/003_fortran_call_c_struct/fortran_main013.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/fortran_main013.f90 +new file mode 100755 +index 0000000..a7ad109 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_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_global_and_struct/003_fortran_call_c_struct/fortran_main014.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/fortran_main014.f90 +new file mode 100755 +index 0000000..5e38bc1 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_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_global_and_struct/003_fortran_call_c_struct/fortran_main015.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/fortran_main015.f90 +new file mode 100755 +index 0000000..f4c1206 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_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_global_and_struct/003_fortran_call_c_struct/fortran_main016.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/fortran_main016.f90 +new file mode 100755 +index 0000000..47b7225 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_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_global_and_struct/003_fortran_call_c_struct/fortran_main017.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/fortran_main017.f90 +new file mode 100755 +index 0000000..ae54ebf +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_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_global_and_struct/003_fortran_call_c_struct/fortran_main018.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/fortran_main018.f90 +new file mode 100755 +index 0000000..d483e87 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_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_global_and_struct/003_fortran_call_c_struct/fortran_main019.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/fortran_main019.f90 +new file mode 100755 +index 0000000..87c0877 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_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_global_and_struct/003_fortran_call_c_struct/fortran_main020.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/fortran_main020.f90 +new file mode 100755 +index 0000000..18d3b49 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_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_global_and_struct/003_fortran_call_c_struct/fortran_main021.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/fortran_main021.f90 +new file mode 100755 +index 0000000..f28143e +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_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_global_and_struct/003_fortran_call_c_struct/fortran_main022.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/fortran_main022.f90 +new file mode 100755 +index 0000000..cefa8f8 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_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_global_and_struct/003_fortran_call_c_struct/fortran_main023.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/fortran_main023.f90 +new file mode 100755 +index 0000000..ca88777 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_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_global_and_struct/003_fortran_call_c_struct/fortran_main024.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/fortran_main024.f90 +new file mode 100755 +index 0000000..bb08e74 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_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_global_and_struct/003_fortran_call_c_struct/fortran_main025.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/fortran_main025.f90 +new file mode 100755 +index 0000000..a77c739 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_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_global_and_struct/003_fortran_call_c_struct/fortran_main026.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/fortran_main026.f90 +new file mode 100755 +index 0000000..2cbf480 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_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_global_and_struct/003_fortran_call_c_struct/fortran_main027.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/fortran_main027.f90 +new file mode 100755 +index 0000000..b4f71e1 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_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_global_and_struct/003_fortran_call_c_struct/fortran_main028.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/fortran_main028.f90 +new file mode 100755 +index 0000000..b09c1f3 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_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_global_and_struct/003_fortran_call_c_struct/result.md b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/result.md +new file mode 100644 +index 0000000..5d05d3e +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/result.md +@@ -0,0 +1,29 @@ ++ | test | gfortran | flang | nvfortran| ++ | 001 | PASS | PASS | PASS | ++ | 002 | PASS | PASS | PASS | ++ | 003 | PASS | PASS | PASS | ++ | 004 | PASS | PASS | ERROR | ++ | 005 | PASS | PASS | PASS | ++ | 006 | PASS | PASS | ERROR | ++ | 007 | PASS | PASS | PASS | ++ | 008 | PASS | PASS | PASS | ++ | 009 | PASS | PASS | PASS | ++ | 010 | PASS | PASS | ERROR | ++ | 011 | PASS | PASS | PASS | ++ | 012 | PASS | PASS | PASS | ++ | 013 | PASS | PASS | PASS | ++ | 014 | PASS | PASS | ERROR | ++ | 015 | PASS | PASS | PASS | ++ | 016 | PASS | PASS | PASS | ++ | 017 | PASS | PASS | PASS | ++ | 018 | PASS | PASS | ERROR | ++ | 019 | PASS | PASS | ERROR | ++ | 020 | PASS | PASS | ERROR | ++ | 021 | PASS | PASS | PASS | ++ | 022 | PASS | PASS | PASS | ++ | 023 | PASS | PASS | ERROR | ++ | 024 | PASS | PASS | PASS | ++ | 025 | PASS | PASS | PASS | ++ | 026 | PASS | ERROR | ERROR | ++ | 027 | PASS | PASS | PASS | ++ | 028 | PASS | PASS | PASS | +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/run.sh b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/run.sh +new file mode 100644 +index 0000000..dbbd62f +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/run.sh +@@ -0,0 +1,22 @@ ++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 ++echo "----- nvfortran result : " ++clang c_func$i.c -c -o c-test.o ++nvfortran fortran_main$i.f90 -c -o fortran-test.o ++nvfortran 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_global_and_struct/004_fortran_call_c_struct_bindc/c_func001.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_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_global_and_struct/004_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_global_and_struct/004_fortran_call_c_struct_bindc/c_func002.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_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_global_and_struct/004_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_global_and_struct/004_fortran_call_c_struct_bindc/c_func003.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_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_global_and_struct/004_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_global_and_struct/004_fortran_call_c_struct_bindc/c_func004.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_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_global_and_struct/004_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_global_and_struct/004_fortran_call_c_struct_bindc/c_func005.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_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_global_and_struct/004_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_global_and_struct/004_fortran_call_c_struct_bindc/c_func006.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_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_global_and_struct/004_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_global_and_struct/004_fortran_call_c_struct_bindc/c_func007.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_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_global_and_struct/004_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_global_and_struct/004_fortran_call_c_struct_bindc/c_func008.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_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_global_and_struct/004_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_global_and_struct/004_fortran_call_c_struct_bindc/c_func009.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_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_global_and_struct/004_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_global_and_struct/004_fortran_call_c_struct_bindc/c_func010.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_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_global_and_struct/004_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_global_and_struct/004_fortran_call_c_struct_bindc/c_func011.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_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_global_and_struct/004_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_global_and_struct/004_fortran_call_c_struct_bindc/c_func012.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_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_global_and_struct/004_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_global_and_struct/004_fortran_call_c_struct_bindc/c_func013.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_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_global_and_struct/004_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_global_and_struct/004_fortran_call_c_struct_bindc/c_func014.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_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_global_and_struct/004_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_global_and_struct/004_fortran_call_c_struct_bindc/c_func015.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_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_global_and_struct/004_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_global_and_struct/004_fortran_call_c_struct_bindc/c_func016.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_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_global_and_struct/004_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_global_and_struct/004_fortran_call_c_struct_bindc/c_func017.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_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_global_and_struct/004_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_global_and_struct/004_fortran_call_c_struct_bindc/c_func018.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_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_global_and_struct/004_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_global_and_struct/004_fortran_call_c_struct_bindc/c_func019.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_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_global_and_struct/004_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_global_and_struct/004_fortran_call_c_struct_bindc/c_func020.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_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_global_and_struct/004_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_global_and_struct/004_fortran_call_c_struct_bindc/c_func021.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_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_global_and_struct/004_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_global_and_struct/004_fortran_call_c_struct_bindc/c_func022.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_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_global_and_struct/004_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_global_and_struct/004_fortran_call_c_struct_bindc/c_func023.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_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_global_and_struct/004_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_global_and_struct/004_fortran_call_c_struct_bindc/c_func024.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_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_global_and_struct/004_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_global_and_struct/004_fortran_call_c_struct_bindc/c_func025.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_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_global_and_struct/004_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_global_and_struct/004_fortran_call_c_struct_bindc/c_func026.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_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_global_and_struct/004_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_global_and_struct/004_fortran_call_c_struct_bindc/c_func027.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_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_global_and_struct/004_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_global_and_struct/004_fortran_call_c_struct_bindc/c_func028.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_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_global_and_struct/004_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_global_and_struct/004_fortran_call_c_struct_bindc/fortran_main001.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_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_global_and_struct/004_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_global_and_struct/004_fortran_call_c_struct_bindc/fortran_main002.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_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_global_and_struct/004_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_global_and_struct/004_fortran_call_c_struct_bindc/fortran_main003.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_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_global_and_struct/004_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_global_and_struct/004_fortran_call_c_struct_bindc/fortran_main004.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_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_global_and_struct/004_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_global_and_struct/004_fortran_call_c_struct_bindc/fortran_main005.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_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_global_and_struct/004_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_global_and_struct/004_fortran_call_c_struct_bindc/fortran_main006.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_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_global_and_struct/004_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_global_and_struct/004_fortran_call_c_struct_bindc/fortran_main007.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_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_global_and_struct/004_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_global_and_struct/004_fortran_call_c_struct_bindc/fortran_main008.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_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_global_and_struct/004_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_global_and_struct/004_fortran_call_c_struct_bindc/fortran_main009.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_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_global_and_struct/004_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_global_and_struct/004_fortran_call_c_struct_bindc/fortran_main010.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_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_global_and_struct/004_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_global_and_struct/004_fortran_call_c_struct_bindc/fortran_main011.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_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_global_and_struct/004_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_global_and_struct/004_fortran_call_c_struct_bindc/fortran_main012.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_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_global_and_struct/004_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_global_and_struct/004_fortran_call_c_struct_bindc/fortran_main013.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_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_global_and_struct/004_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_global_and_struct/004_fortran_call_c_struct_bindc/fortran_main014.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_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_global_and_struct/004_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_global_and_struct/004_fortran_call_c_struct_bindc/fortran_main015.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_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_global_and_struct/004_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_global_and_struct/004_fortran_call_c_struct_bindc/fortran_main016.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_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_global_and_struct/004_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_global_and_struct/004_fortran_call_c_struct_bindc/fortran_main017.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_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_global_and_struct/004_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_global_and_struct/004_fortran_call_c_struct_bindc/fortran_main018.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_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_global_and_struct/004_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_global_and_struct/004_fortran_call_c_struct_bindc/fortran_main019.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_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_global_and_struct/004_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_global_and_struct/004_fortran_call_c_struct_bindc/fortran_main020.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_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_global_and_struct/004_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_global_and_struct/004_fortran_call_c_struct_bindc/fortran_main021.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_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_global_and_struct/004_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_global_and_struct/004_fortran_call_c_struct_bindc/fortran_main022.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_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_global_and_struct/004_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_global_and_struct/004_fortran_call_c_struct_bindc/fortran_main023.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_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_global_and_struct/004_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_global_and_struct/004_fortran_call_c_struct_bindc/fortran_main024.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_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_global_and_struct/004_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_global_and_struct/004_fortran_call_c_struct_bindc/fortran_main025.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_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_global_and_struct/004_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_global_and_struct/004_fortran_call_c_struct_bindc/fortran_main026.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_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_global_and_struct/004_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_global_and_struct/004_fortran_call_c_struct_bindc/fortran_main027.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_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_global_and_struct/004_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_global_and_struct/004_fortran_call_c_struct_bindc/fortran_main028.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_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_global_and_struct/004_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_global_and_struct/004_fortran_call_c_struct_bindc/result.md b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/result.md +new file mode 100644 +index 0000000..5d05d3e +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/result.md +@@ -0,0 +1,29 @@ ++ | test | gfortran | flang | nvfortran| ++ | 001 | PASS | PASS | PASS | ++ | 002 | PASS | PASS | PASS | ++ | 003 | PASS | PASS | PASS | ++ | 004 | PASS | PASS | ERROR | ++ | 005 | PASS | PASS | PASS | ++ | 006 | PASS | PASS | ERROR | ++ | 007 | PASS | PASS | PASS | ++ | 008 | PASS | PASS | PASS | ++ | 009 | PASS | PASS | PASS | ++ | 010 | PASS | PASS | ERROR | ++ | 011 | PASS | PASS | PASS | ++ | 012 | PASS | PASS | PASS | ++ | 013 | PASS | PASS | PASS | ++ | 014 | PASS | PASS | ERROR | ++ | 015 | PASS | PASS | PASS | ++ | 016 | PASS | PASS | PASS | ++ | 017 | PASS | PASS | PASS | ++ | 018 | PASS | PASS | ERROR | ++ | 019 | PASS | PASS | ERROR | ++ | 020 | PASS | PASS | ERROR | ++ | 021 | PASS | PASS | PASS | ++ | 022 | PASS | PASS | PASS | ++ | 023 | PASS | PASS | ERROR | ++ | 024 | PASS | PASS | PASS | ++ | 025 | PASS | PASS | PASS | ++ | 026 | PASS | ERROR | ERROR | ++ | 027 | PASS | PASS | PASS | ++ | 028 | PASS | PASS | PASS | +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/run.sh b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/run.sh +new file mode 100644 +index 0000000..dbbd62f +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/run.sh +@@ -0,0 +1,22 @@ ++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 ++echo "----- nvfortran result : " ++clang c_func$i.c -c -o c-test.o ++nvfortran fortran_main$i.f90 -c -o fortran-test.o ++nvfortran 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_global_and_struct/005_fortran_call_c_struct_value/c_func001.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_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_global_and_struct/005_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_global_and_struct/005_fortran_call_c_struct_value/c_func002.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_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_global_and_struct/005_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_global_and_struct/005_fortran_call_c_struct_value/c_func003.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_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_global_and_struct/005_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_global_and_struct/005_fortran_call_c_struct_value/c_func004.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_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_global_and_struct/005_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_global_and_struct/005_fortran_call_c_struct_value/c_func005.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_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_global_and_struct/005_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_global_and_struct/005_fortran_call_c_struct_value/c_func006.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_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_global_and_struct/005_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_global_and_struct/005_fortran_call_c_struct_value/c_func007.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_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_global_and_struct/005_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_global_and_struct/005_fortran_call_c_struct_value/c_func008.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_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_global_and_struct/005_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_global_and_struct/005_fortran_call_c_struct_value/c_func009.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_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_global_and_struct/005_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_global_and_struct/005_fortran_call_c_struct_value/c_func010.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_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_global_and_struct/005_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_global_and_struct/005_fortran_call_c_struct_value/c_func011.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_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_global_and_struct/005_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_global_and_struct/005_fortran_call_c_struct_value/c_func012.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_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_global_and_struct/005_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_global_and_struct/005_fortran_call_c_struct_value/c_func013.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_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_global_and_struct/005_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_global_and_struct/005_fortran_call_c_struct_value/c_func014.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_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_global_and_struct/005_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_global_and_struct/005_fortran_call_c_struct_value/c_func015.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_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_global_and_struct/005_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_global_and_struct/005_fortran_call_c_struct_value/c_func016.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_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_global_and_struct/005_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_global_and_struct/005_fortran_call_c_struct_value/c_func017.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_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_global_and_struct/005_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_global_and_struct/005_fortran_call_c_struct_value/c_func018.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_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_global_and_struct/005_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_global_and_struct/005_fortran_call_c_struct_value/c_func019.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_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_global_and_struct/005_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_global_and_struct/005_fortran_call_c_struct_value/c_func020.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_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_global_and_struct/005_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_global_and_struct/005_fortran_call_c_struct_value/c_func021.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_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_global_and_struct/005_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_global_and_struct/005_fortran_call_c_struct_value/c_func022.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_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_global_and_struct/005_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_global_and_struct/005_fortran_call_c_struct_value/c_func023.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_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_global_and_struct/005_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_global_and_struct/005_fortran_call_c_struct_value/c_func024.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_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_global_and_struct/005_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_global_and_struct/005_fortran_call_c_struct_value/c_func025.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_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_global_and_struct/005_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_global_and_struct/005_fortran_call_c_struct_value/c_func026.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_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_global_and_struct/005_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_global_and_struct/005_fortran_call_c_struct_value/c_func027.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_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_global_and_struct/005_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_global_and_struct/005_fortran_call_c_struct_value/c_func028.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_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_global_and_struct/005_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_global_and_struct/005_fortran_call_c_struct_value/fortran_main001.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_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_global_and_struct/005_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_global_and_struct/005_fortran_call_c_struct_value/fortran_main002.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_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_global_and_struct/005_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_global_and_struct/005_fortran_call_c_struct_value/fortran_main003.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_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_global_and_struct/005_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_global_and_struct/005_fortran_call_c_struct_value/fortran_main004.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_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_global_and_struct/005_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_global_and_struct/005_fortran_call_c_struct_value/fortran_main005.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_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_global_and_struct/005_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_global_and_struct/005_fortran_call_c_struct_value/fortran_main006.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_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_global_and_struct/005_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_global_and_struct/005_fortran_call_c_struct_value/fortran_main007.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_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_global_and_struct/005_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_global_and_struct/005_fortran_call_c_struct_value/fortran_main008.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_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_global_and_struct/005_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_global_and_struct/005_fortran_call_c_struct_value/fortran_main009.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_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_global_and_struct/005_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_global_and_struct/005_fortran_call_c_struct_value/fortran_main010.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_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_global_and_struct/005_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_global_and_struct/005_fortran_call_c_struct_value/fortran_main011.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_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_global_and_struct/005_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_global_and_struct/005_fortran_call_c_struct_value/fortran_main012.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_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_global_and_struct/005_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_global_and_struct/005_fortran_call_c_struct_value/fortran_main013.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_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_global_and_struct/005_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_global_and_struct/005_fortran_call_c_struct_value/fortran_main014.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_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_global_and_struct/005_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_global_and_struct/005_fortran_call_c_struct_value/fortran_main015.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_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_global_and_struct/005_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_global_and_struct/005_fortran_call_c_struct_value/fortran_main016.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_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_global_and_struct/005_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_global_and_struct/005_fortran_call_c_struct_value/fortran_main017.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_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_global_and_struct/005_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_global_and_struct/005_fortran_call_c_struct_value/fortran_main018.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_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_global_and_struct/005_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_global_and_struct/005_fortran_call_c_struct_value/fortran_main019.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_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_global_and_struct/005_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_global_and_struct/005_fortran_call_c_struct_value/fortran_main020.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_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_global_and_struct/005_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_global_and_struct/005_fortran_call_c_struct_value/fortran_main021.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_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_global_and_struct/005_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_global_and_struct/005_fortran_call_c_struct_value/fortran_main022.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_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_global_and_struct/005_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_global_and_struct/005_fortran_call_c_struct_value/fortran_main023.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_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_global_and_struct/005_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_global_and_struct/005_fortran_call_c_struct_value/fortran_main024.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_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_global_and_struct/005_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_global_and_struct/005_fortran_call_c_struct_value/fortran_main025.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_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_global_and_struct/005_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_global_and_struct/005_fortran_call_c_struct_value/fortran_main026.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_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_global_and_struct/005_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_global_and_struct/005_fortran_call_c_struct_value/fortran_main027.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_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_global_and_struct/005_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_global_and_struct/005_fortran_call_c_struct_value/fortran_main028.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_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_global_and_struct/005_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_global_and_struct/005_fortran_call_c_struct_value/result.md b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/result.md +new file mode 100644 +index 0000000..c92d729 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/result.md +@@ -0,0 +1,30 @@ ++ | test | gfortran | flang | nvfortran| ++ | 001 | PASS | ERROR | PASS | ++ | 002 | PASS | ERROR | PASS | ++ | 003 | PASS | ERROR | PASS | ++ | 004 | PASS | ERROR | ERROR | ++ | 005 | PASS | ERROR | PASS | ++ | 006 | PASS | ERROR | ERROR | ++ | 007 | PASS | ERROR | PASS | ++ | 008 | PASS | ERROR | PASS | ++ | 009 | PASS | ERROR | PASS | ++ | 010 | PASS | ERROR | ERROR | ++ | 011 | PASS | ERROR | PASS | ++ | 012 | PASS | ERROR | PASS | ++ | 013 | PASS | ERROR | PASS | ++ | 014 | PASS | ERROR | ERROR | ++ | 015 | PASS | ERROR | PASS | ++ | 016 | PASS | ERROR | PASS | ++ | 017 | PASS | ERROR | PASS | ++ | 018 | PASS | ERROR | ERROR | ++ | 019 | PASS | ERROR | ERROR | ++ | 020 | PASS | ERROR | ERROR | ++ | 021 | PASS | ERROR | PASS | ++ | 022 | PASS | ERROR | PASS | ++ | 023 | PASS | PASS | ERROR | ++ | 024 | PASS | ERROR | PASS | ++ | 025 | PASS | PASS | PASS | ++ | 026 | PASS | ERROR | ERROR | ++ | 027 | PASS | ERROR | PASS | ++ | 028 | PASS | ERROR | ERROR | ++ ! except 028, the others because kind K or 9223372036854775807 +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/run.sh b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/run.sh +new file mode 100644 +index 0000000..dbbd62f +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/run.sh +@@ -0,0 +1,22 @@ ++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 ++echo "----- nvfortran result : " ++clang c_func$i.c -c -o c-test.o ++nvfortran fortran_main$i.f90 -c -o fortran-test.o ++nvfortran 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_global_and_struct/006_fortran_call_c_struct_value_bindc/c_func001.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_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_global_and_struct/006_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_global_and_struct/006_fortran_call_c_struct_value_bindc/c_func002.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_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_global_and_struct/006_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_global_and_struct/006_fortran_call_c_struct_value_bindc/c_func003.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_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_global_and_struct/006_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_global_and_struct/006_fortran_call_c_struct_value_bindc/c_func004.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_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_global_and_struct/006_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_global_and_struct/006_fortran_call_c_struct_value_bindc/c_func005.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_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_global_and_struct/006_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_global_and_struct/006_fortran_call_c_struct_value_bindc/c_func006.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_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_global_and_struct/006_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_global_and_struct/006_fortran_call_c_struct_value_bindc/c_func007.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_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_global_and_struct/006_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_global_and_struct/006_fortran_call_c_struct_value_bindc/c_func008.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_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_global_and_struct/006_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_global_and_struct/006_fortran_call_c_struct_value_bindc/c_func009.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_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_global_and_struct/006_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_global_and_struct/006_fortran_call_c_struct_value_bindc/c_func010.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_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_global_and_struct/006_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_global_and_struct/006_fortran_call_c_struct_value_bindc/c_func011.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_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_global_and_struct/006_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_global_and_struct/006_fortran_call_c_struct_value_bindc/c_func012.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_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_global_and_struct/006_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_global_and_struct/006_fortran_call_c_struct_value_bindc/c_func013.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_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_global_and_struct/006_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_global_and_struct/006_fortran_call_c_struct_value_bindc/c_func014.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_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_global_and_struct/006_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_global_and_struct/006_fortran_call_c_struct_value_bindc/c_func015.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_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_global_and_struct/006_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_global_and_struct/006_fortran_call_c_struct_value_bindc/c_func016.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_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_global_and_struct/006_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_global_and_struct/006_fortran_call_c_struct_value_bindc/c_func017.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_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_global_and_struct/006_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_global_and_struct/006_fortran_call_c_struct_value_bindc/c_func018.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_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_global_and_struct/006_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_global_and_struct/006_fortran_call_c_struct_value_bindc/c_func019.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_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_global_and_struct/006_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_global_and_struct/006_fortran_call_c_struct_value_bindc/c_func020.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_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_global_and_struct/006_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_global_and_struct/006_fortran_call_c_struct_value_bindc/c_func021.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_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_global_and_struct/006_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_global_and_struct/006_fortran_call_c_struct_value_bindc/c_func022.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_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_global_and_struct/006_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_global_and_struct/006_fortran_call_c_struct_value_bindc/c_func023.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_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_global_and_struct/006_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_global_and_struct/006_fortran_call_c_struct_value_bindc/c_func024.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_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_global_and_struct/006_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_global_and_struct/006_fortran_call_c_struct_value_bindc/c_func025.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_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_global_and_struct/006_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_global_and_struct/006_fortran_call_c_struct_value_bindc/c_func026.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_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_global_and_struct/006_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_global_and_struct/006_fortran_call_c_struct_value_bindc/c_func027.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_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_global_and_struct/006_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_global_and_struct/006_fortran_call_c_struct_value_bindc/c_func028.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_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_global_and_struct/006_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_global_and_struct/006_fortran_call_c_struct_value_bindc/fortran_main001.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_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_global_and_struct/006_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_global_and_struct/006_fortran_call_c_struct_value_bindc/fortran_main002.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_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_global_and_struct/006_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_global_and_struct/006_fortran_call_c_struct_value_bindc/fortran_main003.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_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_global_and_struct/006_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_global_and_struct/006_fortran_call_c_struct_value_bindc/fortran_main004.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_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_global_and_struct/006_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_global_and_struct/006_fortran_call_c_struct_value_bindc/fortran_main005.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_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_global_and_struct/006_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_global_and_struct/006_fortran_call_c_struct_value_bindc/fortran_main006.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_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_global_and_struct/006_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_global_and_struct/006_fortran_call_c_struct_value_bindc/fortran_main007.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_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_global_and_struct/006_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_global_and_struct/006_fortran_call_c_struct_value_bindc/fortran_main008.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_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_global_and_struct/006_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_global_and_struct/006_fortran_call_c_struct_value_bindc/fortran_main009.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_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_global_and_struct/006_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_global_and_struct/006_fortran_call_c_struct_value_bindc/fortran_main010.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_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_global_and_struct/006_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_global_and_struct/006_fortran_call_c_struct_value_bindc/fortran_main011.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_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_global_and_struct/006_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_global_and_struct/006_fortran_call_c_struct_value_bindc/fortran_main012.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_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_global_and_struct/006_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_global_and_struct/006_fortran_call_c_struct_value_bindc/fortran_main013.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_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_global_and_struct/006_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_global_and_struct/006_fortran_call_c_struct_value_bindc/fortran_main014.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_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_global_and_struct/006_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_global_and_struct/006_fortran_call_c_struct_value_bindc/fortran_main015.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_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_global_and_struct/006_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_global_and_struct/006_fortran_call_c_struct_value_bindc/fortran_main016.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_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_global_and_struct/006_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_global_and_struct/006_fortran_call_c_struct_value_bindc/fortran_main017.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_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_global_and_struct/006_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_global_and_struct/006_fortran_call_c_struct_value_bindc/fortran_main018.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_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_global_and_struct/006_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_global_and_struct/006_fortran_call_c_struct_value_bindc/fortran_main019.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_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_global_and_struct/006_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_global_and_struct/006_fortran_call_c_struct_value_bindc/fortran_main020.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_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_global_and_struct/006_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_global_and_struct/006_fortran_call_c_struct_value_bindc/fortran_main021.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_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_global_and_struct/006_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_global_and_struct/006_fortran_call_c_struct_value_bindc/fortran_main022.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_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_global_and_struct/006_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_global_and_struct/006_fortran_call_c_struct_value_bindc/fortran_main023.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_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_global_and_struct/006_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_global_and_struct/006_fortran_call_c_struct_value_bindc/fortran_main024.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_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_global_and_struct/006_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_global_and_struct/006_fortran_call_c_struct_value_bindc/fortran_main025.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_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_global_and_struct/006_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_global_and_struct/006_fortran_call_c_struct_value_bindc/fortran_main026.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_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_global_and_struct/006_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_global_and_struct/006_fortran_call_c_struct_value_bindc/fortran_main027.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_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_global_and_struct/006_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_global_and_struct/006_fortran_call_c_struct_value_bindc/fortran_main028.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_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_global_and_struct/006_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_global_and_struct/006_fortran_call_c_struct_value_bindc/result.md b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/result.md +new file mode 100644 +index 0000000..a35d72b +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/result.md +@@ -0,0 +1,30 @@ ++ | test | gfortran | flang | nvfortran| ++ | 001 | PASS | ERROR | PASS | ++ | 002 | PASS | ERROR | PASS | ++ | 003 | PASS | ERROR | PASS | ++ | 004 | PASS | ERROR | ERROR | ++ | 005 | PASS | ERROR | PASS | ++ | 006 | PASS | ERROR | ERROR | ++ | 007 | PASS | ERROR | PASS | ++ | 008 | PASS | ERROR | PASS | ++ | 009 | PASS | ERROR | PASS | ++ | 010 | PASS | ERROR | ERROR | ++ | 011 | PASS | ERROR | PASS | ++ | 012 | PASS | ERROR | PASS | ++ | 013 | PASS | ERROR | PASS | ++ | 014 | PASS | ERROR | ERROR | ++ | 015 | PASS | ERROR | PASS | ++ | 016 | PASS | ERROR | PASS | ++ | 017 | PASS | ERROR | PASS | ++ | 018 | PASS | ERROR | ERROR | ++ | 019 | PASS | ERROR | ERROR | ++ | 020 | PASS | ERROR | ERROR | ++ | 021 | PASS | ERROR | PASS | ++ | 022 | PASS | ERROR | PASS | ++ | 023 | PASS | PASS | ERROR | ++ | 024 | PASS | ERROR | PASS | ++ | 025 | PASS | PASS | PASS | ++ | 026 | PASS | ERROR | ERROR | ++ | 027 | PASS | ERROR | PASS | ++ | 028 | PASS | ERROR | ERROR | ++! except 028, the others because kind K or 9223372036854775807 +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/run.sh b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/run.sh +new file mode 100644 +index 0000000..dbbd62f +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/run.sh +@@ -0,0 +1,22 @@ ++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 ++echo "----- nvfortran result : " ++clang c_func$i.c -c -o c-test.o ++nvfortran fortran_main$i.f90 -c -o fortran-test.o ++nvfortran 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_global_and_struct/007_fortran_call_c_nested_struct_simple/c_func001.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_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_global_and_struct/007_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_global_and_struct/007_fortran_call_c_nested_struct_simple/c_func002.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_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_global_and_struct/007_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_global_and_struct/007_fortran_call_c_nested_struct_simple/c_func003.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_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_global_and_struct/007_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_global_and_struct/007_fortran_call_c_nested_struct_simple/c_func004.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_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_global_and_struct/007_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_global_and_struct/007_fortran_call_c_nested_struct_simple/c_func005.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_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_global_and_struct/007_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_global_and_struct/007_fortran_call_c_nested_struct_simple/c_func006.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_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_global_and_struct/007_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_global_and_struct/007_fortran_call_c_nested_struct_simple/c_func007.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_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_global_and_struct/007_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_global_and_struct/007_fortran_call_c_nested_struct_simple/c_func008.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_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_global_and_struct/007_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_global_and_struct/007_fortran_call_c_nested_struct_simple/c_func009.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_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_global_and_struct/007_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_global_and_struct/007_fortran_call_c_nested_struct_simple/c_func010.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_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_global_and_struct/007_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_global_and_struct/007_fortran_call_c_nested_struct_simple/c_func011.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_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_global_and_struct/007_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_global_and_struct/007_fortran_call_c_nested_struct_simple/c_func012.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_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_global_and_struct/007_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_global_and_struct/007_fortran_call_c_nested_struct_simple/c_func013.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_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_global_and_struct/007_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_global_and_struct/007_fortran_call_c_nested_struct_simple/c_func014.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_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_global_and_struct/007_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_global_and_struct/007_fortran_call_c_nested_struct_simple/c_func015.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_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_global_and_struct/007_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_global_and_struct/007_fortran_call_c_nested_struct_simple/c_func016.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_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_global_and_struct/007_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_global_and_struct/007_fortran_call_c_nested_struct_simple/c_func017.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_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_global_and_struct/007_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_global_and_struct/007_fortran_call_c_nested_struct_simple/c_func018.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_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_global_and_struct/007_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_global_and_struct/007_fortran_call_c_nested_struct_simple/c_func019.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_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_global_and_struct/007_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_global_and_struct/007_fortran_call_c_nested_struct_simple/c_func020.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_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_global_and_struct/007_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_global_and_struct/007_fortran_call_c_nested_struct_simple/c_func021.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_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_global_and_struct/007_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_global_and_struct/007_fortran_call_c_nested_struct_simple/c_func022.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_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_global_and_struct/007_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_global_and_struct/007_fortran_call_c_nested_struct_simple/c_func023.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_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_global_and_struct/007_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_global_and_struct/007_fortran_call_c_nested_struct_simple/c_func024.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_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_global_and_struct/007_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_global_and_struct/007_fortran_call_c_nested_struct_simple/c_func025.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_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_global_and_struct/007_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_global_and_struct/007_fortran_call_c_nested_struct_simple/c_func026.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_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_global_and_struct/007_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_global_and_struct/007_fortran_call_c_nested_struct_simple/c_func027.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_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_global_and_struct/007_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_global_and_struct/007_fortran_call_c_nested_struct_simple/c_func028.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_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_global_and_struct/007_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_global_and_struct/007_fortran_call_c_nested_struct_simple/fortran_main001.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_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_global_and_struct/007_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_global_and_struct/007_fortran_call_c_nested_struct_simple/fortran_main002.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_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_global_and_struct/007_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_global_and_struct/007_fortran_call_c_nested_struct_simple/fortran_main003.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_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_global_and_struct/007_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_global_and_struct/007_fortran_call_c_nested_struct_simple/fortran_main004.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_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_global_and_struct/007_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_global_and_struct/007_fortran_call_c_nested_struct_simple/fortran_main005.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_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_global_and_struct/007_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_global_and_struct/007_fortran_call_c_nested_struct_simple/fortran_main006.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_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_global_and_struct/007_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_global_and_struct/007_fortran_call_c_nested_struct_simple/fortran_main007.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_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_global_and_struct/007_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_global_and_struct/007_fortran_call_c_nested_struct_simple/fortran_main008.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_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_global_and_struct/007_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_global_and_struct/007_fortran_call_c_nested_struct_simple/fortran_main009.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_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_global_and_struct/007_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_global_and_struct/007_fortran_call_c_nested_struct_simple/fortran_main010.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_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_global_and_struct/007_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_global_and_struct/007_fortran_call_c_nested_struct_simple/fortran_main011.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_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_global_and_struct/007_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_global_and_struct/007_fortran_call_c_nested_struct_simple/fortran_main012.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_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_global_and_struct/007_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_global_and_struct/007_fortran_call_c_nested_struct_simple/fortran_main013.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_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_global_and_struct/007_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_global_and_struct/007_fortran_call_c_nested_struct_simple/fortran_main014.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_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_global_and_struct/007_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_global_and_struct/007_fortran_call_c_nested_struct_simple/fortran_main015.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_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_global_and_struct/007_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_global_and_struct/007_fortran_call_c_nested_struct_simple/fortran_main016.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_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_global_and_struct/007_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_global_and_struct/007_fortran_call_c_nested_struct_simple/fortran_main017.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_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_global_and_struct/007_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_global_and_struct/007_fortran_call_c_nested_struct_simple/fortran_main018.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_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_global_and_struct/007_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_global_and_struct/007_fortran_call_c_nested_struct_simple/fortran_main019.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_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_global_and_struct/007_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_global_and_struct/007_fortran_call_c_nested_struct_simple/fortran_main020.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_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_global_and_struct/007_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_global_and_struct/007_fortran_call_c_nested_struct_simple/fortran_main021.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_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_global_and_struct/007_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_global_and_struct/007_fortran_call_c_nested_struct_simple/fortran_main022.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_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_global_and_struct/007_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_global_and_struct/007_fortran_call_c_nested_struct_simple/fortran_main023.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_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_global_and_struct/007_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_global_and_struct/007_fortran_call_c_nested_struct_simple/fortran_main024.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_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_global_and_struct/007_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_global_and_struct/007_fortran_call_c_nested_struct_simple/fortran_main025.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_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_global_and_struct/007_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_global_and_struct/007_fortran_call_c_nested_struct_simple/fortran_main026.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_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_global_and_struct/007_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_global_and_struct/007_fortran_call_c_nested_struct_simple/fortran_main027.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_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_global_and_struct/007_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_global_and_struct/007_fortran_call_c_nested_struct_simple/fortran_main028.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_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_global_and_struct/007_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_global_and_struct/007_fortran_call_c_nested_struct_simple/result.md b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/result.md +new file mode 100644 +index 0000000..810e8d4 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/result.md +@@ -0,0 +1,29 @@ ++ | test | gfortran | flang | nvfortran| ++ | 001 | PASS | PASS | PASS | ++ | 002 | PASS | PASS | PASS | ++ | 003 | PASS | PASS | PASS | ++ | 004 | PASS | PASS | PASS | ++ | 005 | PASS | PASS | PASS | ++ | 006 | PASS | PASS | PASS | ++ | 007 | PASS | PASS | PASS | ++ | 008 | PASS | PASS | PASS | ++ | 009 | PASS | PASS | PASS | ++ | 010 | PASS | PASS | PASS | ++ | 011 | PASS | PASS | PASS | ++ | 012 | PASS | PASS | PASS | ++ | 013 | PASS | PASS | PASS | ++ | 014 | PASS | PASS | PASS | ++ | 015 | PASS | PASS | PASS | ++ | 016 | PASS | PASS | PASS | ++ | 017 | PASS | PASS | PASS | ++ | 018 | PASS | PASS | PASS | ++ | 019 | PASS | PASS | PASS | ++ | 020 | PASS | PASS | PASS | ++ | 021 | PASS | PASS | PASS | ++ | 022 | PASS | PASS | PASS | ++ | 023 | PASS | PASS | ERROR | ++ | 024 | PASS | PASS | PASS | ++ | 025 | PASS | PASS | PASS | ++ | 026 | PASS | ERROR | ERROR | ++ | 027 | PASS | PASS | PASS | ++ | 028 | PASS | PASS | PASS | +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/run.sh b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/run.sh +new file mode 100644 +index 0000000..dbbd62f +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/run.sh +@@ -0,0 +1,22 @@ ++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 ++echo "----- nvfortran result : " ++clang c_func$i.c -c -o c-test.o ++nvfortran fortran_main$i.f90 -c -o fortran-test.o ++nvfortran 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_global_and_struct/008_fortran_call_c_nested_struct_complicated/c_func001.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/008_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_global_and_struct/008_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_global_and_struct/008_fortran_call_c_nested_struct_complicated/c_func002.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/008_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_global_and_struct/008_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_global_and_struct/008_fortran_call_c_nested_struct_complicated/c_func003.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/008_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_global_and_struct/008_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_global_and_struct/008_fortran_call_c_nested_struct_complicated/c_func004.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/008_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_global_and_struct/008_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_global_and_struct/008_fortran_call_c_nested_struct_complicated/c_func005.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/008_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_global_and_struct/008_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_global_and_struct/008_fortran_call_c_nested_struct_complicated/c_func006.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/008_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_global_and_struct/008_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_global_and_struct/008_fortran_call_c_nested_struct_complicated/fortran_main001.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/008_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_global_and_struct/008_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_global_and_struct/008_fortran_call_c_nested_struct_complicated/fortran_main002.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/008_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_global_and_struct/008_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_global_and_struct/008_fortran_call_c_nested_struct_complicated/fortran_main003.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/008_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_global_and_struct/008_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_global_and_struct/008_fortran_call_c_nested_struct_complicated/fortran_main004.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/008_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_global_and_struct/008_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_global_and_struct/008_fortran_call_c_nested_struct_complicated/fortran_main005.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/008_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_global_and_struct/008_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_global_and_struct/008_fortran_call_c_nested_struct_complicated/fortran_main006.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/008_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_global_and_struct/008_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_global_and_struct/008_fortran_call_c_nested_struct_complicated/result.md b/test/interoperability_with_c_fortran_call_c_global_and_struct/008_fortran_call_c_nested_struct_complicated/result.md +new file mode 100644 +index 0000000..f1fed1f +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/008_fortran_call_c_nested_struct_complicated/result.md +@@ -0,0 +1,7 @@ ++ | test | gfortran | flang | nvfortran| ++ | 001 | PASS | PASS | PASS | ++ | 002 | PASS | PASS | PASS | ++ | 003 | PASS | PASS | PASS | ++ | 004 | PASS | PASS | PASS | ++ | 005 | PASS | PASS | PASS | ++ | 006 | PASS | ERROR | ERROR | +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/008_fortran_call_c_nested_struct_complicated/run.sh b/test/interoperability_with_c_fortran_call_c_global_and_struct/008_fortran_call_c_nested_struct_complicated/run.sh +new file mode 100644 +index 0000000..2392045 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/008_fortran_call_c_nested_struct_complicated/run.sh +@@ -0,0 +1,22 @@ ++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 ++echo "----- nvfortran result : " ++clang c_func$i.c -c -o c-test.o ++nvfortran fortran_main$i.f90 -c -o fortran-test.o ++nvfortran 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_global_and_struct/009_fortran_call_c_array_in_struct/c_func001.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_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_global_and_struct/009_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_global_and_struct/009_fortran_call_c_array_in_struct/c_func002.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_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_global_and_struct/009_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_global_and_struct/009_fortran_call_c_array_in_struct/c_func003.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_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_global_and_struct/009_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_global_and_struct/009_fortran_call_c_array_in_struct/c_func004.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_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_global_and_struct/009_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_global_and_struct/009_fortran_call_c_array_in_struct/c_func005.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_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_global_and_struct/009_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_global_and_struct/009_fortran_call_c_array_in_struct/c_func006.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_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_global_and_struct/009_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_global_and_struct/009_fortran_call_c_array_in_struct/c_func007.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_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_global_and_struct/009_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_global_and_struct/009_fortran_call_c_array_in_struct/c_func008.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_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_global_and_struct/009_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_global_and_struct/009_fortran_call_c_array_in_struct/c_func009.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_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_global_and_struct/009_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_global_and_struct/009_fortran_call_c_array_in_struct/c_func010.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_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_global_and_struct/009_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_global_and_struct/009_fortran_call_c_array_in_struct/c_func011.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_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_global_and_struct/009_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_global_and_struct/009_fortran_call_c_array_in_struct/c_func012.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_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_global_and_struct/009_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_global_and_struct/009_fortran_call_c_array_in_struct/c_func013.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_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_global_and_struct/009_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_global_and_struct/009_fortran_call_c_array_in_struct/c_func014.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_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_global_and_struct/009_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_global_and_struct/009_fortran_call_c_array_in_struct/c_func015.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_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_global_and_struct/009_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_global_and_struct/009_fortran_call_c_array_in_struct/c_func016.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_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_global_and_struct/009_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_global_and_struct/009_fortran_call_c_array_in_struct/c_func017.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_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_global_and_struct/009_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_global_and_struct/009_fortran_call_c_array_in_struct/c_func018.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_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_global_and_struct/009_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_global_and_struct/009_fortran_call_c_array_in_struct/c_func019.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_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_global_and_struct/009_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_global_and_struct/009_fortran_call_c_array_in_struct/c_func020.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_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_global_and_struct/009_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_global_and_struct/009_fortran_call_c_array_in_struct/c_func021.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_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_global_and_struct/009_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_global_and_struct/009_fortran_call_c_array_in_struct/c_func022.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_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_global_and_struct/009_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_global_and_struct/009_fortran_call_c_array_in_struct/c_func023.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_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_global_and_struct/009_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_global_and_struct/009_fortran_call_c_array_in_struct/c_func024.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_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_global_and_struct/009_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_global_and_struct/009_fortran_call_c_array_in_struct/c_func025.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_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_global_and_struct/009_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_global_and_struct/009_fortran_call_c_array_in_struct/c_func026.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_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_global_and_struct/009_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_global_and_struct/009_fortran_call_c_array_in_struct/c_func027.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_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_global_and_struct/009_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_global_and_struct/009_fortran_call_c_array_in_struct/c_func028.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_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_global_and_struct/009_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_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main001.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_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_global_and_struct/009_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 ++ integer :: x(2) = 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_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main002.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main002.f90 +new file mode 100644 +index 0000000..4c9f0b9 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_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 ++ type, bind(c) :: t ++ integer(2) :: x(2) = -32768 ++ 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_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main003.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main003.f90 +new file mode 100644 +index 0000000..f8962b2 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_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 ++ type, bind(c) :: t ++ integer(8) :: x(2) = -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_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main004.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main004.f90 +new file mode 100644 +index 0000000..1bdf578 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_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 ++ type, bind(c) :: t ++ integer(8) :: x(2) = -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_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main005.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main005.f90 +new file mode 100644 +index 0000000..b8d6d20 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_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 ++ type, bind(c) :: t ++ integer(1) :: x(2) = 65 ++ 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_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main006.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main006.f90 +new file mode 100644 +index 0000000..24f4d74 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_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 ++ type, bind(c) :: t ++ integer(8) :: x(2) = 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_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main007.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main007.f90 +new file mode 100644 +index 0000000..4c868b3 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_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 ++ type, bind(c) :: t ++ integer(1) :: x(2) = -128 ++ 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_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main008.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main008.f90 +new file mode 100644 +index 0000000..0fd89db +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_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 ++ type, bind(c) :: t ++ integer(2) :: x(2) = -32768 ++ 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_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main009.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main009.f90 +new file mode 100644 +index 0000000..2dee9f6 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_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 ++ type, bind(c) :: t ++ integer(4) :: x(2) = -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_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main010.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main010.f90 +new file mode 100644 +index 0000000..60b3af9 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_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 ++ type, bind(c) :: t ++ integer(8) :: x(2) = -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_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main011.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main011.f90 +new file mode 100644 +index 0000000..2ac8242 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_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 ++ type, bind(c) :: t ++ integer(1) :: x(2) = -128 ++ 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_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main012.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main012.f90 +new file mode 100644 +index 0000000..50c6ca8 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_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 ++ type, bind(c) :: t ++ integer(2) :: x(2) = -32768 ++ 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_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main013.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main013.f90 +new file mode 100644 +index 0000000..ff3b140 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_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 ++ type, bind(c) :: t ++ integer(4) :: x(2) = -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_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main014.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main014.f90 +new file mode 100644 +index 0000000..366a7a3 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_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 ++ type, bind(c) :: t ++ integer(8) :: x(2) = -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_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main015.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main015.f90 +new file mode 100644 +index 0000000..654302d +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_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 ++ type, bind(c) :: t ++ integer(1) :: x(2) = -128 ++ 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_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main016.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main016.f90 +new file mode 100644 +index 0000000..78727d9 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_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 ++ type, bind(c) :: t ++ integer(8) :: x(2) = -32768 ++ 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_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main017.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main017.f90 +new file mode 100644 +index 0000000..122b60d +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_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 ++ type, bind(c) :: t ++ integer(8) :: x(2) = -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_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main018.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main018.f90 +new file mode 100644 +index 0000000..245cca8 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_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 ++ type, bind(c) :: t ++ integer(8) :: x(2) = -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_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main019.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main019.f90 +new file mode 100644 +index 0000000..f46b68f +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_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 ++ type, bind(c) :: t ++ integer(8) :: x(2) = -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_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main020.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main020.f90 +new file mode 100644 +index 0000000..21ec77a +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_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 ++ type, bind(c) :: t ++ integer(8) :: x(2) = -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_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main021.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main021.f90 +new file mode 100644 +index 0000000..fe827d4 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_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 ++ type, bind(c) :: t ++ real(4) :: x(2) = 3.14 ++ 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_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main022.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_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_global_and_struct/009_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 ++ type, bind(c) :: t ++ real(8) :: x(2) = 450359962737049.621345 ++ 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_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main023.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main023.f90 +new file mode 100644 +index 0000000..8f17598 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_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 ++! ++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 ++ 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_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main024.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main024.f90 +new file mode 100644 +index 0000000..635ac18 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_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 ++! ++program main ++ type, bind(c) :: t ++ complex(4) :: x(2) = (-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_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main025.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main025.f90 +new file mode 100644 +index 0000000..66ec48b +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_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 ++ type, bind(c) :: t ++ complex(8) :: x(2) = (-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_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main026.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main026.f90 +new file mode 100644 +index 0000000..304647b +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_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 ++ 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 ++ 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_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main027.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main027.f90 +new file mode 100644 +index 0000000..e454591 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_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 ++! ++ type, bind(c) :: t ++ logical(1) :: x(2) = .TRUE. ++ 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_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main028.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main028.f90 +new file mode 100644 +index 0000000..e2ee053 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_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 ++ type, bind(c) :: t ++ character :: x(2) = 'b' ++ 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_global_and_struct/009_fortran_call_c_array_in_struct/result.md b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/result.md +new file mode 100644 +index 0000000..b0681e1 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/result.md +@@ -0,0 +1,29 @@ ++ | test | gfortran | flang | nvfortran| ++ | 001 | PASS | PASS | PASS | ++ | 002 | PASS | PASS | PASS | ++ | 003 | PASS | PASS | PASS | ++ | 004 | PASS | PASS | ERROR | ++ | 005 | PASS | PASS | PASS | ++ | 006 | PASS | PASS | PASS | ++ | 007 | PASS | PASS | PASS | ++ | 008 | PASS | PASS | PASS | ++ | 009 | PASS | PASS | PASS | ++ | 010 | PASS | PASS | ERROR | ++ | 011 | PASS | PASS | PASS | ++ | 012 | PASS | PASS | PASS | ++ | 013 | PASS | PASS | PASS | ++ | 014 | PASS | PASS | ERROR | ++ | 015 | PASS | PASS | PASS | ++ | 016 | PASS | PASS | PASS | ++ | 017 | PASS | PASS | PASS | ++ | 018 | PASS | PASS | ERROR | ++ | 019 | PASS | PASS | ERROR | ++ | 020 | PASS | PASS | ERROR | ++ | 021 | PASS | PASS | PASS | ++ | 022 | PASS | PASS | PASS | ++ | 023 | PASS | ERROR | ERROR | ++ | 024 | PASS | PASS | PASS | ++ | 025 | PASS | PASS | PASS | ++ | 026 | PASS | ERROR | ERROR | ++ | 027 | PASS | PASS | PASS | ++ | 028 | PASS | PASS | PASS | +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/run.sh b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/run.sh +new file mode 100644 +index 0000000..dbbd62f +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/run.sh +@@ -0,0 +1,22 @@ ++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 ++echo "----- nvfortran result : " ++clang c_func$i.c -c -o c-test.o ++nvfortran fortran_main$i.f90 -c -o fortran-test.o ++nvfortran 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_global_and_struct/010_fortran_call_c_global/c_func001.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/c_func001.c +new file mode 100644 +index 0000000..de0139f +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/c_func001.c +@@ -0,0 +1,9 @@ ++extern struct block { ++ int num; ++}b; ++extern struct block block_; ++void c_func_() ++{ ++ block_.num = 11; ++} ++ +diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/c_func002.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/c_func002.c +new file mode 100644 +index 0000000..fa320f9 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/c_func002.c +@@ -0,0 +1,11 @@ ++extern struct block { ++ int num[4]; ++}b; ++extern struct block block_; ++void c_func_() ++{ ++ for(int i = 0; i < 4; i++) { ++ block_.num[i] = 11; ++ } ++} ++ +diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/c_func003.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/c_func003.c +new file mode 100644 +index 0000000..629a9ab +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/c_func003.c +@@ -0,0 +1,12 @@ ++#include ++extern struct block { ++ int16_t num; ++ int8_t num2; ++}b; ++extern struct block block_; ++void c_func_() ++{ ++ block_.num = 12; ++ block_.num2 = 12; ++} ++ +diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/c_func004.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/c_func004.c +new file mode 100644 +index 0000000..a681532 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/c_func004.c +@@ -0,0 +1,13 @@ ++#include ++extern struct block { ++ int32_t num; ++ int16_t num2; ++ int8_t num3; ++}b; ++extern struct block block_; ++void c_func_() ++{ ++ block_.num = 12; ++ block_.num2 = 13; ++ block_.num3 = 14; ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/c_func005.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/c_func005.c +new file mode 100644 +index 0000000..c85e66c +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/c_func005.c +@@ -0,0 +1,15 @@ ++#include ++extern struct block { ++ int64_t num; ++ int32_t num2; ++ int16_t num3; ++ int8_t num4; ++}b; ++extern struct block block_; ++void c_func_() ++{ ++ block_.num = 12; ++ block_.num2 = 13; ++ block_.num3 = 14; ++ block_.num4 = 15; ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/c_func006.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/c_func006.c +new file mode 100644 +index 0000000..acf1f0c +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/c_func006.c +@@ -0,0 +1,17 @@ ++#include ++extern struct block { ++ int64_t num[2]; ++ int64_t num2; ++ int32_t num3; ++ int16_t num4; ++ int8_t num5; ++}b; ++extern struct block block_; ++void c_func_() ++{ ++ block_.num[0] = 12; ++ block_.num2 = 13; ++ block_.num3 = 14; ++ block_.num4 = 15; ++ block_.num5 = 16; ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/c_func007.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/c_func007.c +new file mode 100644 +index 0000000..5cacb79 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/c_func007.c +@@ -0,0 +1,21 @@ ++#include ++extern struct block { ++ int64_t num[4]; ++ int64_t num2[2]; ++ int32_t num3[2]; ++ int16_t num4[3]; ++ int8_t num5[3]; ++}b; ++extern struct block block_; ++void c_func_() ++{ ++ for(int i = 0; i < 2; i++) { ++ block_.num[2 * i] = 12; ++ block_.num2[i] = 13; ++ block_.num3[i] = 14; ++ block_.num4[i] = 15; ++ block_.num5[i] = 16; ++ } ++ block_.num4[2] = 15; ++ block_.num5[2] = 16; ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/c_func008.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/c_func008.c +new file mode 100644 +index 0000000..43c2eb1 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/c_func008.c +@@ -0,0 +1,11 @@ ++struct test { ++ int x; ++}; ++extern struct block { ++ struct test a; ++}b; ++extern struct block block_; ++void c_func_() ++{ ++ block_.a.x = 1; ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/c_func009.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/c_func009.c +new file mode 100644 +index 0000000..c0908d3 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/c_func009.c +@@ -0,0 +1,14 @@ ++#include ++struct test { ++ int16_t x2; ++ int8_t x1; ++}; ++extern struct block { ++ struct test a; ++}b; ++extern struct block block_; ++void c_func_() ++{ ++ block_.a.x1 = 10; ++ block_.a.x2 = 11; ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/c_func010.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/c_func010.c +new file mode 100644 +index 0000000..d0c4d2c +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/c_func010.c +@@ -0,0 +1,16 @@ ++#include ++struct test { ++ int32_t x3; ++ int16_t x2; ++ int8_t x1; ++}; ++extern struct block { ++ struct test a; ++}b; ++extern struct block block_; ++void c_func_() ++{ ++ block_.a.x1 = 10; ++ block_.a.x2 = 11; ++ block_.a.x3 = 12; ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/c_func011.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/c_func011.c +new file mode 100644 +index 0000000..756e90e +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/c_func011.c +@@ -0,0 +1,18 @@ ++#include ++struct test { ++ int64_t x4; ++ int32_t x3; ++ int16_t x2; ++ int8_t x1; ++}; ++extern struct block { ++ struct test a; ++}b; ++extern struct block block_; ++void c_func_() ++{ ++ block_.a.x1 = 10; ++ block_.a.x2 = 11; ++ block_.a.x3 = 12; ++ block_.a.x4 = 13; ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/c_func012.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/c_func012.c +new file mode 100644 +index 0000000..850ca97 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/c_func012.c +@@ -0,0 +1,20 @@ ++#include ++struct test { ++ int64_t x5[2]; ++ int64_t x4; ++ int32_t x3; ++ int16_t x2; ++ int8_t x1; ++}; ++extern struct block { ++ struct test a; ++}b; ++extern struct block block_; ++void c_func_() ++{ ++ block_.a.x1 = 10; ++ block_.a.x2 = 11; ++ block_.a.x3 = 12; ++ block_.a.x4 = 13; ++ block_.a.x5[0] = 14; ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/c_func013.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/c_func013.c +new file mode 100644 +index 0000000..15954da +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/c_func013.c +@@ -0,0 +1,23 @@ ++#include ++struct test { ++ int64_t x5[4]; ++ int64_t x4[2]; ++ int32_t x3[2]; ++ int16_t x2[2]; ++ int8_t x1[3]; ++}; ++extern struct block { ++ struct test a; ++}b; ++extern struct block block_; ++void c_func_() ++{ ++ for(int i = 0; i < 2; i++) { ++ block_.a.x1[i] = 10; ++ block_.a.x2[i] = 11; ++ block_.a.x3[i] = 12; ++ block_.a.x4[i] = 13; ++ block_.a.x5[2 * i] = 14; ++ } ++ block_.a.x1[2] = 10; ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/c_func014.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/c_func014.c +new file mode 100644 +index 0000000..24bfd50 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/c_func014.c +@@ -0,0 +1,22 @@ ++#include ++struct test { ++ int64_t x5[2]; ++ int64_t x4; ++ int32_t x3; ++ int16_t x2; ++ int8_t x1; ++}; ++extern struct block { ++ struct test a[5]; ++}b; ++extern struct block block_; ++void c_func_() ++{ ++ for(int i = 0; i < 5; i++) { ++ block_.a[i].x1 = 10; ++ block_.a[i].x2 = 11; ++ block_.a[i].x3 = 12; ++ block_.a[i].x4 = 13; ++ block_.a[i].x5[0] = 14; ++ } ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/c_func015.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/c_func015.c +new file mode 100644 +index 0000000..fab06bc +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/c_func015.c +@@ -0,0 +1,27 @@ ++#include ++struct test1 { ++ double x; ++ float y; ++}; ++struct test { ++ int64_t x5[2]; ++ struct test1 t; ++ int64_t x4; ++ int32_t x3; ++ int16_t x2; ++ int8_t x1; ++}; ++extern struct block { ++ struct test a; ++}b; ++extern struct block block_; ++void c_func_() ++{ ++ block_.a.x1 = 10; ++ block_.a.x2 = 11; ++ block_.a.x3 = 12; ++ block_.a.x4 = 13; ++ block_.a.x5[0] = 14; ++ block_.a.t.x = 3.1415; ++ block_.a.t.y = 3.14; ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/c_func016.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/c_func016.c +new file mode 100644 +index 0000000..f84b1d6 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/c_func016.c +@@ -0,0 +1,27 @@ ++#include ++struct test1 { ++ double x; ++ float y; ++}; ++struct test { ++ int64_t x5[2]; ++ int64_t x4; ++ int32_t x3; ++ int16_t x2; ++ int8_t x1; ++}; ++extern struct block { ++ struct test1 t1; ++ struct test a; ++}b; ++extern struct block block_; ++void c_func_() ++{ ++ block_.a.x1 = 10; ++ block_.a.x2 = 11; ++ block_.a.x3 = 12; ++ block_.a.x4 = 13; ++ block_.a.x5[0] = 14; ++ block_.t1.x = 3.1415; ++ block_.t1.y = 3.14; ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/fortran_main001.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/fortran_main001.f90 +new file mode 100644 +index 0000000..679cf43 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/fortran_main001.f90 +@@ -0,0 +1,8 @@ ++! test fortran call c for global about scalar ++! ++program main ++ common /block/ num ++ integer :: num ++ call c_func() ++ print *, num ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/fortran_main002.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/fortran_main002.f90 +new file mode 100644 +index 0000000..f265c32 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/fortran_main002.f90 +@@ -0,0 +1,8 @@ ++! test fortran call c for global about array ++! ++program main ++ common /block/ num ++ integer :: num(4) ++ call c_func() ++ print *, num ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/fortran_main003.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/fortran_main003.f90 +new file mode 100644 +index 0000000..8660ac0 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/fortran_main003.f90 +@@ -0,0 +1,10 @@ ++! test fortran call c for global about data alignment ++! ++program main ++ integer(2) :: num ++ integer(1) :: num2 ++ common /block/ num, num2 ++ call c_func() ++ print *, num ++ print *, num2 ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/fortran_main004.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/fortran_main004.f90 +new file mode 100644 +index 0000000..7a64816 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/fortran_main004.f90 +@@ -0,0 +1,12 @@ ++! test fortran call c for global about data alignment ++! ++program main ++ integer(4) :: num ++ integer(2) :: num2 ++ integer(1) :: num3 ++ common /block/ num, num2, num3 ++ call c_func() ++ print *, num ++ print *, num2 ++ print *, num3 ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/fortran_main005.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/fortran_main005.f90 +new file mode 100644 +index 0000000..645daa5 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/fortran_main005.f90 +@@ -0,0 +1,14 @@ ++! test fortran call c for global about data alignment ++! ++program main ++ integer(8) :: num ++ integer(4) :: num2 ++ integer(2) :: num3 ++ integer(1) :: num4 ++ common /block/ num, num2, num3, num4 ++ call c_func() ++ print *, num ++ print *, num2 ++ print *, num3 ++ print *, num4 ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/fortran_main006.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/fortran_main006.f90 +new file mode 100644 +index 0000000..f81891c +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/fortran_main006.f90 +@@ -0,0 +1,16 @@ ++! test fortran call c for global about data alignment ++! ++program main ++ integer(16) :: num ++ integer(8) :: num2 ++ integer(4) :: num3 ++ integer(2) :: num4 ++ integer(1) :: num5 ++ common /block/ num, num2, num3, num4, num5 ++ call c_func() ++ print *, num ++ print *, num2 ++ print *, num3 ++ print *, num4 ++ print *, num5 ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/fortran_main007.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/fortran_main007.f90 +new file mode 100644 +index 0000000..623a2ee +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/fortran_main007.f90 +@@ -0,0 +1,16 @@ ++! test fortran call c for global about data alignment ++! ++program main ++ integer(16) :: num(2) ++ integer(8) :: num2(2) ++ integer(4) :: num3(2) ++ integer(2) :: num4(3) ++ integer(1) :: num5(3) ++ common /block/ num, num2, num3, num4, num5 ++ call c_func() ++ print *, num ++ print *, num2 ++ print *, num3 ++ print *, num4 ++ print *, num5 ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/fortran_main008.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/fortran_main008.f90 +new file mode 100644 +index 0000000..e1e655a +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/fortran_main008.f90 +@@ -0,0 +1,11 @@ ++! test fortran call c for global about sturct ++! ++program main ++ common /block/ a ++ type, bind(c) :: test ++ integer :: x ++ end type ++ type(test) :: a ++ call c_func() ++ print *, a%x ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/fortran_main009.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/fortran_main009.f90 +new file mode 100644 +index 0000000..b78d78b +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/fortran_main009.f90 +@@ -0,0 +1,13 @@ ++! test fortran call c for global about data alignment in struct ++! ++program main ++ common /block/ a ++ type, bind(c) :: test ++ integer(2) :: x2 ++ integer(1) :: x1 ++ end type ++ type(test) :: a ++ call c_func() ++ print *, a%x1 ++ print *, a%x2 ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/fortran_main010.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/fortran_main010.f90 +new file mode 100644 +index 0000000..8555ad2 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/fortran_main010.f90 +@@ -0,0 +1,15 @@ ++! test fortran call c for global about data alignment in struct ++! ++program main ++ common /block/ a ++ type, bind(c) :: test ++ integer(4) :: x3 ++ integer(2) :: x2 ++ integer(1) :: x1 ++ end type ++ type(test) :: a ++ call c_func() ++ print *, a%x1 ++ print *, a%x2 ++ print *, a%x3 ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/fortran_main011.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/fortran_main011.f90 +new file mode 100644 +index 0000000..0c32d6a +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/fortran_main011.f90 +@@ -0,0 +1,17 @@ ++! test fortran call c for global about data alignment in struct ++! ++program main ++ common /block/ a ++ type, bind(c) :: test ++ integer(8) :: x4 ++ integer(4) :: x3 ++ integer(2) :: x2 ++ integer(1) :: x1 ++ end type ++ type(test) :: a ++ call c_func() ++ print *, a%x1 ++ print *, a%x2 ++ print *, a%x3 ++ print *, a%x4 ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/fortran_main012.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/fortran_main012.f90 +new file mode 100644 +index 0000000..ad2f256 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/fortran_main012.f90 +@@ -0,0 +1,19 @@ ++! test fortran call c for global about data alignment in struct ++! ++program main ++ common /block/ a ++ type, bind(c) :: test ++ integer(16) :: x5 ++ integer(8) :: x4 ++ integer(4) :: x3 ++ integer(2) :: x2 ++ integer(1) :: x1 ++ end type ++ type(test) :: a ++ call c_func() ++ print *, a%x1 ++ print *, a%x2 ++ print *, a%x3 ++ print *, a%x4 ++ print *, a%x5 ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/fortran_main013.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/fortran_main013.f90 +new file mode 100644 +index 0000000..731f3e9 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/fortran_main013.f90 +@@ -0,0 +1,19 @@ ++! test fortran call c for global about data alignment in struct ++! ++program main ++ common /block/ a ++ type, bind(c) :: test ++ integer(16) :: x5(2) ++ integer(8) :: x4(2) ++ integer(4) :: x3(2) ++ integer(2) :: x2(2) ++ integer(1) :: x1(3) ++ end type ++ type(test) :: a ++ call c_func() ++ print *, a%x1 ++ print *, a%x2 ++ print *, a%x3 ++ print *, a%x4 ++ print *, a%x5 ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/fortran_main014.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/fortran_main014.f90 +new file mode 100644 +index 0000000..8445326 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/fortran_main014.f90 +@@ -0,0 +1,21 @@ ++! test fortran call c for global about data alignment in struct ++! ++program main ++ common /block/ a ++ type, bind(c) :: test ++ integer(16) :: x5 ++ integer(8) :: x4 ++ integer(4) :: x3 ++ integer(2) :: x2 ++ integer(1) :: x1 ++ end type ++ type(test) :: a(5) ++ call c_func() ++ do i = 1, 5 ++ print *, a(i)%x1 ++ print *, a(i)%x2 ++ print *, a(i)%x3 ++ print *, a(i)%x4 ++ print *, a(i)%x5 ++ end do ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/fortran_main015.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/fortran_main015.f90 +new file mode 100644 +index 0000000..78df937 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/fortran_main015.f90 +@@ -0,0 +1,26 @@ ++! test fortran call c for global about data alignment in struct ++! ++program main ++ common /block/ a ++ type, bind(c) :: t1 ++ real(8) :: d ++ real(4) :: f ++ end type ++ type, bind(c) :: test ++ integer(16) :: x5 ++ type(t1) :: t ++ integer(8) :: x4 ++ integer(4) :: x3 ++ integer(2) :: x2 ++ integer(1) :: x1 ++ end type ++ type(test) :: a ++ call c_func() ++ print *, a%x1 ++ print *, a%x2 ++ print *, a%x3 ++ print *, a%x4 ++ print *, a%x5 ++ print *, a%t%d ++ print *, a%t%f ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/fortran_main016.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/fortran_main016.f90 +new file mode 100644 +index 0000000..3fe1782 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/fortran_main016.f90 +@@ -0,0 +1,26 @@ ++! test fortran call c for global about data alignment in struct ++! ++program main ++ common /block/ b, a ++ type, bind(c) :: t1 ++ real(8) :: d ++ real(4) :: f ++ end type ++ type, bind(c) :: test ++ integer(16) :: x5 ++ integer(8) :: x4 ++ integer(4) :: x3 ++ integer(2) :: x2 ++ integer(1) :: x1 ++ end type ++ type(test) :: a ++ type(t1) :: b ++ call c_func() ++ print *, a%x1 ++ print *, a%x2 ++ print *, a%x3 ++ print *, a%x4 ++ print *, a%x5 ++ print *, b%d ++ print *, b%f ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/result.md b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/result.md +new file mode 100644 +index 0000000..177b9ad +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/result.md +@@ -0,0 +1,17 @@ ++ | test | gfortran | flang | nvfortran| ++ | 001 | PASS | PASS | PASS | ++ | 002 | PASS | PASS | PASS | ++ | 003 | PASS | PASS | PASS | ++ | 004 | PASS | PASS | PASS | ++ | 005 | PASS | PASS | PASS | ++ | 006 | PASS | PASS | ERROR | ++ | 007 | PASS | PASS | ERROR | ++ | 008 | PASS | PASS | PASS | ++ | 009 | PASS | PASS | PASS | ++ | 010 | PASS | PASS | PASS | ++ | 011 | PASS | PASS | PASS | ++ | 012 | PASS | PASS | ERROR | ++ | 013 | PASS | PASS | ERROR | ++ | 014 | PASS | PASS | ERROR | ++ | 015 | PASS | PASS | ERROR | ++ | 016 | PASS | PASS | ERROR | +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/run.sh b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/run.sh +new file mode 100644 +index 0000000..8912310 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/run.sh +@@ -0,0 +1,22 @@ ++for i in {001..016} ++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 ++echo "----- nvfortran result : " ++clang c_func$i.c -c -o c-test.o ++nvfortran fortran_main$i.f90 -c -o fortran-test.o ++nvfortran c-test.o fortran-test.o ++./a.out ++rm *.o a.out ++done +\ No newline at end of file +-- +2.25.1 + diff --git a/11-test-interoperability-with-c-c-call-fortran-array.patch b/11-test-interoperability-with-c-c-call-fortran-array.patch new file mode 100644 index 0000000..ca03a0c --- /dev/null +++ b/11-test-interoperability-with-c-c-call-fortran-array.patch @@ -0,0 +1,1906 @@ +From 328a19605b0fb7da6c5ee0e56a58a0ffdb1e7a3b Mon Sep 17 00:00:00 2001 +From: xieyihui +Date: Fri, 18 Nov 2022 13:01:06 +0800 +Subject: [PATCH] Add new test cases about array for interoperability with C + about C call fortran + +diff --git a/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main001.c b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main001.c +new file mode 100644 +index 0000000..621bebb +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main001.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for the array type and the array type is int ++// ++#include ++extern void f_func_(int *i); ++int main() { ++ int i[5]; ++ f_func_(i); ++ for(int n = 0; n < 5; n++) { ++ printf("%d\n", i[n]); ++ } ++} +diff --git a/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main002.c b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main002.c +new file mode 100644 +index 0000000..c09f25d +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main002.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for the array type and the array type is short ++// ++#include ++extern void f_func_(short *i); ++int main() { ++ short i[5]; ++ f_func_(i); ++ for(int n = 0; n < 5; n++) { ++ printf("%d\n", i[n]); ++ } ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main003.c b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main003.c +new file mode 100644 +index 0000000..661840e +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main003.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for the array type and the array type is long ++// ++#include ++extern void f_func_(long *i); ++int main() { ++ long i[5]; ++ f_func_(i); ++ for(int n = 0; n < 5; n++) { ++ printf("%ld\n", i[n]); ++ } ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main004.c b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main004.c +new file mode 100644 +index 0000000..ad4d69c +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main004.c +@@ -0,0 +1,12 @@ ++// Test c call fortran for the array type and the array type is long ++// long ++// ++#include ++extern void f_func_(long long *i); ++int main() { ++ long long i[5]; ++ f_func_(i); ++ for(int n = 0; n < 5; n++) { ++ printf("%Ld\n", i[n]); ++ } ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main005.c b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main005.c +new file mode 100644 +index 0000000..23ad3c8 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main005.c +@@ -0,0 +1,12 @@ ++// Test c call fortran for the array type and the array type is signed ++// char ++// ++#include ++extern void f_func_(signed char *i); ++int main() { ++ signed char i[5]; ++ f_func_(i); ++ for(int n = 0; n < 5; n++) { ++ printf("%hhd\n", i[n]); ++ } ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main006.c b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main006.c +new file mode 100644 +index 0000000..f474697 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main006.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for the array type and the array type is size_t ++// ++#include ++extern void f_func_(size_t *i); ++int main() { ++ size_t i[5]; ++ f_func_(i); ++ for(int n = 0; n < 5; n++) { ++ printf("%ld\n", i[n]); ++ } ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main007.c b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main007.c +new file mode 100644 +index 0000000..9d94602 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main007.c +@@ -0,0 +1,12 @@ ++// Test c call fortran for the array type and the array type is int8_t ++// ++#include ++#include ++extern void f_func_(int8_t *i); ++int main() { ++ int8_t i[5]; ++ f_func_(i); ++ for(int n = 0; n < 5; n++) { ++ printf("%hhd\n", i[n]); ++ } ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main008.c b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main008.c +new file mode 100644 +index 0000000..6854e0f +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main008.c +@@ -0,0 +1,12 @@ ++// Test c call fortran for the array type and the array type is int16_t ++// ++#include ++#include ++extern void f_func_(int16_t *i); ++int main() { ++ int16_t i[5]; ++ f_func_(i); ++ for(int n = 0; n < 5; n++) { ++ printf("%hd\n", i[n]); ++ } ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main009.c b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main009.c +new file mode 100644 +index 0000000..a9be21e +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main009.c +@@ -0,0 +1,12 @@ ++// Test c call fortran for the array type and the array type is int32_t ++// ++#include ++#include ++extern void f_func_(int32_t *i); ++int main() { ++ int32_t i[5]; ++ f_func_(i); ++ for(int n = 0; n < 5; n++) { ++ printf("%d\n", i[n]); ++ } ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main010.c b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main010.c +new file mode 100644 +index 0000000..cbdf3bb +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main010.c +@@ -0,0 +1,12 @@ ++// Test c call fortran for the array type and the array type is int64_t ++// ++#include ++#include ++extern void f_func_(int64_t *i); ++int main() { ++ int64_t i[5]; ++ f_func_(i); ++ for(int n = 0; n < 5; n++) { ++ printf("%ld\n", i[n]); ++ } ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main011.c b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main011.c +new file mode 100644 +index 0000000..690ea3a +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main011.c +@@ -0,0 +1,13 @@ ++// Test c call fortran for the array type and the array type is ++// int_least8_t ++// ++#include ++#include ++extern void f_func_(int_least8_t *i); ++int main() { ++ int_least8_t i[5]; ++ f_func_(i); ++ for(int n = 0; n < 5; n++) { ++ printf("%hhd\n", i[n]); ++ } ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main012.c b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main012.c +new file mode 100644 +index 0000000..89424aa +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main012.c +@@ -0,0 +1,13 @@ ++// Test c call fortran for the array type and the array type is ++// int_least16_t ++// ++#include ++#include ++extern void f_func_(int_least16_t *i); ++int main() { ++ int_least16_t i[5]; ++ f_func_(i); ++ for(int n = 0; n < 5; n++) { ++ printf("%hd\n", i[n]); ++ } ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main013.c b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main013.c +new file mode 100644 +index 0000000..491e593 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main013.c +@@ -0,0 +1,13 @@ ++// Test c call fortran for the array type and the array type is ++// int_least32_t ++// ++#include ++#include ++extern void f_func_(int_least32_t *i); ++int main() { ++ int_least32_t i[5]; ++ f_func_(i); ++ for(int n = 0; n < 5; n++) { ++ printf("%d\n", i[n]); ++ } ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main014.c b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main014.c +new file mode 100644 +index 0000000..8cbd80c +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main014.c +@@ -0,0 +1,13 @@ ++// Test c call fortran for the array type and the array type is ++// int_least64_t ++// ++#include ++#include ++extern void f_func_(int_least64_t *i); ++int main() { ++ int_least64_t i[5]; ++ f_func_(i); ++ for(int n = 0; n < 5; n++) { ++ printf("%ld\n", i[n]); ++ } ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main015.c b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main015.c +new file mode 100644 +index 0000000..1e63863 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main015.c +@@ -0,0 +1,13 @@ ++// Test c call fortran for the array type and the array type is ++// int_fast8_t ++// ++#include ++#include ++extern void f_func_(int_fast8_t *i); ++int main() { ++ int_fast8_t i[5]; ++ f_func_(i); ++ for(int n = 0; n < 5; n++) { ++ printf("%hhd\n", i[n]); ++ } ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main016.c b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main016.c +new file mode 100644 +index 0000000..e4fea02 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main016.c +@@ -0,0 +1,13 @@ ++// Test c call fortran for the array type and the array type is ++// int_fast16_t ++// ++#include ++#include ++extern void f_func_(int_fast16_t *i); ++int main() { ++ int_fast16_t i[5]; ++ f_func_(i); ++ for(int n = 0; n < 5; n++) { ++ printf("%ld\n", i[n]); ++ } ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main017.c b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main017.c +new file mode 100644 +index 0000000..f8cbf67 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main017.c +@@ -0,0 +1,13 @@ ++// Test c call fortran for the array type and the array type is ++// int_fast32_t ++// ++#include ++#include ++extern void f_func_(int_fast32_t *i); ++int main() { ++ int_fast32_t i[5]; ++ f_func_(i); ++ for(int n = 0; n < 5; n++) { ++ printf("%ld\n", i[n]); ++ } ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main018.c b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main018.c +new file mode 100644 +index 0000000..e9ebf24 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main018.c +@@ -0,0 +1,13 @@ ++// Test c call fortran for the array type and the array type is ++// int_fast64_t ++// ++#include ++#include ++extern void f_func_(int_fast64_t *i); ++int main() { ++ int_fast64_t i[5]; ++ f_func_(i); ++ for(int n = 0; n < 5; n++) { ++ printf("%ld\n", i[n]); ++ } ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main019.c b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main019.c +new file mode 100644 +index 0000000..d35e1eb +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main019.c +@@ -0,0 +1,13 @@ ++// Test c call fortran for the array type and the array type is ++// intmax_t ++// ++#include ++#include ++extern void f_func_(intmax_t *i); ++int main() { ++ intmax_t i[5]; ++ f_func_(i); ++ for(int n = 0; n < 5; n++) { ++ printf("%ld\n", i[n]); ++ } ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main020.c b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main020.c +new file mode 100644 +index 0000000..5bb25eb +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main020.c +@@ -0,0 +1,13 @@ ++// Test c call fortran for the array type and the array type is ++// intptr_t ++// ++#include ++#include ++extern void f_func_(intptr_t *i); ++int main() { ++ intptr_t i[5]; ++ f_func_(i); ++ for(int n = 0; n < 5; n++) { ++ printf("%ld\n", i[n]); ++ } ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main021.c b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main021.c +new file mode 100644 +index 0000000..e8d8891 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main021.c +@@ -0,0 +1,12 @@ ++// Test c call fortran for the array type and the array type is float ++// ++#include ++#include ++extern void f_func_(float *i); ++int main() { ++ float i[5]; ++ f_func_(i); ++ for(int n = 0; n < 5; n++) { ++ printf("%0.20f\n", i[n]); ++ } ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main022.c b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main022.c +new file mode 100644 +index 0000000..b284e25 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main022.c +@@ -0,0 +1,12 @@ ++// Test c call fortran for the array type and the array type is double ++// ++#include ++#include ++extern void f_func_(double *i); ++int main() { ++ double i[5]; ++ f_func_(i); ++ for(int n = 0; n < 5; n++) { ++ printf("%0.20lf\n", i[n]); ++ } ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main023.c b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main023.c +new file mode 100644 +index 0000000..be8cf39 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main023.c +@@ -0,0 +1,13 @@ ++// Test c call fortran for the array type and the array type is long ++// double ++// ++#include ++#include ++extern void f_func_(long double *i); ++int main() { ++ long double i[5]; ++ f_func_(i); ++ for(int n = 0; n < 5; n++) { ++ printf("%0.20Lf\n", i[n]); ++ } ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main024.c b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main024.c +new file mode 100644 +index 0000000..78ae53c +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main024.c +@@ -0,0 +1,13 @@ ++// Test c call fortran for the array type and the array type is float ++// _Complex ++// ++#include ++#include ++extern void f_func_(float _Complex *i); ++int main() { ++ float _Complex i[5]; ++ f_func_(i); ++ for(int n = 0; n < 5; n++) { ++ printf("%0.20f + %0.20fi\n", creal(i[n]), cimag(i[n])); ++ } ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main025.c b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main025.c +new file mode 100644 +index 0000000..8676855 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main025.c +@@ -0,0 +1,13 @@ ++// Test c call fortran for the array type and the array type is double ++// _Complex ++// ++#include ++#include ++extern void f_func_(double _Complex *i); ++int main() { ++ double _Complex i[5]; ++ f_func_(i); ++ for(int n = 0; n < 5; n++) { ++ printf("%0.20lf + %0.20lfi\n", creal(i[n]), cimag(i[n])); ++ } ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main026.c b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main026.c +new file mode 100644 +index 0000000..50221e7 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main026.c +@@ -0,0 +1,13 @@ ++// Test c call fortran for the array type and the array type is long ++// double _Complex ++// ++#include ++#include ++extern void f_func_(long double _Complex *i); ++int main() { ++ long double _Complex i[5]; ++ f_func_(i); ++ for(int n = 0; n < 5; n++) { ++ printf("%0.20lf + %0.20lfi\n", creal(i[n]), cimag(i[n])); ++ } ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main027.c b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main027.c +new file mode 100644 +index 0000000..49ef333 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main027.c +@@ -0,0 +1,12 @@ ++// Test c call fortran for the array type and the array type is _Bool ++// ++#include ++#include ++extern void f_func_(_Bool *i); ++int main() { ++ _Bool i[5]; ++ f_func_(i); ++ for(int n = 0; n < 5; n++) { ++ printf("%d\n", i[n]); ++ } ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main028.c b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main028.c +new file mode 100644 +index 0000000..6130858 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main028.c +@@ -0,0 +1,12 @@ ++// Test c call fortran for the array type and the array type is char ++// ++#include ++#include ++extern void f_func_(char *i); ++int main() { ++ char i[5]; ++ f_func_(i); ++ for(int n = 0; n < 5; n++) { ++ printf("%c\n", i[n]); ++ } ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func001.f90 b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func001.f90 +new file mode 100644 +index 0000000..f6f9163 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func001.f90 +@@ -0,0 +1,6 @@ ++subroutine f_func(i) ++ integer, dimension(*) :: i ++ do n = 1, 5 ++ i(n) = n ++ end do ++end +diff --git a/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func002.f90 b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func002.f90 +new file mode 100644 +index 0000000..67a7fac +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func002.f90 +@@ -0,0 +1,6 @@ ++subroutine f_func(i) ++ integer(2), dimension(*) :: i ++ do n = 1, 5 ++ i(n) = n ++ end do ++end +diff --git a/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func003.f90 b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func003.f90 +new file mode 100644 +index 0000000..d2b5a12 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func003.f90 +@@ -0,0 +1,6 @@ ++subroutine f_func(i) ++ integer(8), dimension(*) :: i ++ do n = 1, 5 ++ i(n) = n ++ end do ++end +diff --git a/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func004.f90 b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func004.f90 +new file mode 100644 +index 0000000..d2b5a12 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func004.f90 +@@ -0,0 +1,6 @@ ++subroutine f_func(i) ++ integer(8), dimension(*) :: i ++ do n = 1, 5 ++ i(n) = n ++ end do ++end +diff --git a/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func005.f90 b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func005.f90 +new file mode 100644 +index 0000000..a993613 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func005.f90 +@@ -0,0 +1,6 @@ ++subroutine f_func(i) ++ integer(1), dimension(*) :: i ++ do n = 1, 5 ++ i(n) = n ++ end do ++end +diff --git a/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func006.f90 b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func006.f90 +new file mode 100644 +index 0000000..d2b5a12 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func006.f90 +@@ -0,0 +1,6 @@ ++subroutine f_func(i) ++ integer(8), dimension(*) :: i ++ do n = 1, 5 ++ i(n) = n ++ end do ++end +diff --git a/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func007.f90 b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func007.f90 +new file mode 100644 +index 0000000..a993613 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func007.f90 +@@ -0,0 +1,6 @@ ++subroutine f_func(i) ++ integer(1), dimension(*) :: i ++ do n = 1, 5 ++ i(n) = n ++ end do ++end +diff --git a/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func008.f90 b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func008.f90 +new file mode 100644 +index 0000000..67a7fac +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func008.f90 +@@ -0,0 +1,6 @@ ++subroutine f_func(i) ++ integer(2), dimension(*) :: i ++ do n = 1, 5 ++ i(n) = n ++ end do ++end +diff --git a/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func009.f90 b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func009.f90 +new file mode 100644 +index 0000000..c5f780d +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func009.f90 +@@ -0,0 +1,6 @@ ++subroutine f_func(i) ++ integer(4), dimension(*) :: i ++ do n = 1, 5 ++ i(n) = n ++ end do ++end +diff --git a/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func010.f90 b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func010.f90 +new file mode 100644 +index 0000000..d2b5a12 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func010.f90 +@@ -0,0 +1,6 @@ ++subroutine f_func(i) ++ integer(8), dimension(*) :: i ++ do n = 1, 5 ++ i(n) = n ++ end do ++end +diff --git a/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func011.f90 b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func011.f90 +new file mode 100644 +index 0000000..a993613 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func011.f90 +@@ -0,0 +1,6 @@ ++subroutine f_func(i) ++ integer(1), dimension(*) :: i ++ do n = 1, 5 ++ i(n) = n ++ end do ++end +diff --git a/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func012.f90 b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func012.f90 +new file mode 100644 +index 0000000..67a7fac +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func012.f90 +@@ -0,0 +1,6 @@ ++subroutine f_func(i) ++ integer(2), dimension(*) :: i ++ do n = 1, 5 ++ i(n) = n ++ end do ++end +diff --git a/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func013.f90 b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func013.f90 +new file mode 100644 +index 0000000..c5f780d +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func013.f90 +@@ -0,0 +1,6 @@ ++subroutine f_func(i) ++ integer(4), dimension(*) :: i ++ do n = 1, 5 ++ i(n) = n ++ end do ++end +diff --git a/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func014.f90 b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func014.f90 +new file mode 100644 +index 0000000..d2b5a12 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func014.f90 +@@ -0,0 +1,6 @@ ++subroutine f_func(i) ++ integer(8), dimension(*) :: i ++ do n = 1, 5 ++ i(n) = n ++ end do ++end +diff --git a/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func015.f90 b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func015.f90 +new file mode 100644 +index 0000000..a993613 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func015.f90 +@@ -0,0 +1,6 @@ ++subroutine f_func(i) ++ integer(1), dimension(*) :: i ++ do n = 1, 5 ++ i(n) = n ++ end do ++end +diff --git a/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func016.f90 b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func016.f90 +new file mode 100644 +index 0000000..d2b5a12 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func016.f90 +@@ -0,0 +1,6 @@ ++subroutine f_func(i) ++ integer(8), dimension(*) :: i ++ do n = 1, 5 ++ i(n) = n ++ end do ++end +diff --git a/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func017.f90 b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func017.f90 +new file mode 100644 +index 0000000..d2b5a12 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func017.f90 +@@ -0,0 +1,6 @@ ++subroutine f_func(i) ++ integer(8), dimension(*) :: i ++ do n = 1, 5 ++ i(n) = n ++ end do ++end +diff --git a/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func018.f90 b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func018.f90 +new file mode 100644 +index 0000000..d2b5a12 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func018.f90 +@@ -0,0 +1,6 @@ ++subroutine f_func(i) ++ integer(8), dimension(*) :: i ++ do n = 1, 5 ++ i(n) = n ++ end do ++end +diff --git a/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func019.f90 b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func019.f90 +new file mode 100644 +index 0000000..d2b5a12 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func019.f90 +@@ -0,0 +1,6 @@ ++subroutine f_func(i) ++ integer(8), dimension(*) :: i ++ do n = 1, 5 ++ i(n) = n ++ end do ++end +diff --git a/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func020.f90 b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func020.f90 +new file mode 100644 +index 0000000..d2b5a12 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func020.f90 +@@ -0,0 +1,6 @@ ++subroutine f_func(i) ++ integer(8), dimension(*) :: i ++ do n = 1, 5 ++ i(n) = n ++ end do ++end +diff --git a/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func021.f90 b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func021.f90 +new file mode 100644 +index 0000000..3f9350c +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func021.f90 +@@ -0,0 +1,6 @@ ++subroutine f_func(i) ++ real(4), dimension(*) :: i ++ do n = 1, 5 ++ i(n) = n + 3.14159265358979 ++ end do ++end +diff --git a/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func022.f90 b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func022.f90 +new file mode 100644 +index 0000000..7f8ec30 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func022.f90 +@@ -0,0 +1,6 @@ ++subroutine f_func(i) ++ real(8), dimension(*) :: i ++ do n = 1, 5 ++ i(n) = n + 3.14159265358979 ++ end do ++end +diff --git a/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func023.f90 b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func023.f90 +new file mode 100644 +index 0000000..1ac77a3 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func023.f90 +@@ -0,0 +1,7 @@ ++subroutine f_func(i) ++ integer, parameter :: K = selected_real_kind(16) ++ real(K), dimension(*) :: i ++ do n = 1, 5 ++ i(n) = n + 3.14159265358979 ++ end do ++end +diff --git a/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func024.f90 b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func024.f90 +new file mode 100644 +index 0000000..fb4fe82 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func024.f90 +@@ -0,0 +1,6 @@ ++subroutine f_func(i) ++ complex(4), dimension(*) :: i ++ do n = 1, 5 ++ i(n) = (-12345678.7654321, 1) ++ end do ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func025.f90 b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func025.f90 +new file mode 100644 +index 0000000..a8953b9 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func025.f90 +@@ -0,0 +1,6 @@ ++subroutine f_func(i) ++ complex(8), dimension(*) :: i ++ do n = 1, 5 ++ i(n) = (-12345678.7654321, 1) ++ end do ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func026.f90 b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func026.f90 +new file mode 100644 +index 0000000..28c3971 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func026.f90 +@@ -0,0 +1,7 @@ ++subroutine f_func(i) ++ integer, parameter :: K = selected_real_kind(16) ++ complex(K), dimension(*) :: i ++ do n = 1, 5 ++ i(n) = (-12345678.7654321, 1) ++ end do ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func027.f90 b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func027.f90 +new file mode 100644 +index 0000000..3f45a9a +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func027.f90 +@@ -0,0 +1,6 @@ ++subroutine f_func(i) ++ logical(1), dimension(*) :: i ++ do n = 1, 5 ++ i(n) = .TRUE. ++ end do ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func028.f90 b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func028.f90 +new file mode 100644 +index 0000000..2153d9b +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func028.f90 +@@ -0,0 +1,6 @@ ++subroutine f_func(i) ++ character(1), dimension(*) :: i ++ do n = 1, 5 ++ i(n) = 'a' ++ end do ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/result.md b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/result.md +new file mode 100644 +index 0000000..347da21 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/result.md +@@ -0,0 +1,29 @@ ++ | test | gfortran | flang | ++ | 001 | PASS | PASS | ++ | 002 | PASS | PASS | ++ | 003 | PASS | PASS | ++ | 004 | PASS | PASS | ++ | 005 | PASS | PASS | ++ | 006 | PASS | PASS | ++ | 007 | PASS | PASS | ++ | 008 | PASS | PASS | ++ | 009 | PASS | PASS | ++ | 010 | PASS | PASS | ++ | 011 | PASS | PASS | ++ | 012 | PASS | PASS | ++ | 013 | PASS | PASS | ++ | 014 | PASS | PASS | ++ | 015 | PASS | PASS | ++ | 016 | PASS | PASS | ++ | 017 | PASS | PASS | ++ | 018 | PASS | PASS | ++ | 019 | PASS | PASS | ++ | 020 | PASS | PASS | ++ | 021 | PASS | PASS | ++ | 022 | PASS | PASS | ++ | 023 | PASS | PASS | ++ | 024 | PASS | PASS | ++ | 025 | PASS | PASS | ++ | 026 | PASS | PASS | ++ | 027 | PASS | PASS | ++ | 028 | PASS | PASS | +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/run.sh b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/run.sh +new file mode 100644 +index 0000000..5b2202e +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/run.sh +@@ -0,0 +1,16 @@ ++for i in {001..028} ++do ++echo "------- test $i ------." ++echo "----- gfortran result:" ++gcc c_main$i.c -c -o c-test.o ++gfortran fortran_func$i.f90 -fno-range-check -c -o fortran-test.o ++gfortran fortran-test.o c-test.o ++./a.out ++rm *.o a.out ++echo "----- flang-new result : " ++clang c_main$i.c -c -o c-test.o ++flang-new fortran_func$i.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o a.out ++done +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main001.c b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main001.c +new file mode 100644 +index 0000000..104f21c +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main001.c +@@ -0,0 +1,12 @@ ++// Test c call fortran for the array type and the array type is int ++// with bindc ++// ++#include ++extern void f_func_(int *i); ++int main() { ++ int i[5]; ++ f_func_(i); ++ for(int n = 0; n < 5; n++) { ++ printf("%d\n", i[n]); ++ } ++} +diff --git a/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main002.c b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main002.c +new file mode 100644 +index 0000000..1c74e75 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main002.c +@@ -0,0 +1,12 @@ ++// Test c call fortran for the array type and the array type is short ++// with bindc ++// ++#include ++extern void f_func_(short *i); ++int main() { ++ short i[5]; ++ f_func_(i); ++ for(int n = 0; n < 5; n++) { ++ printf("%d\n", i[n]); ++ } ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main003.c b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main003.c +new file mode 100644 +index 0000000..661840e +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main003.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for the array type and the array type is long ++// ++#include ++extern void f_func_(long *i); ++int main() { ++ long i[5]; ++ f_func_(i); ++ for(int n = 0; n < 5; n++) { ++ printf("%ld\n", i[n]); ++ } ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main004.c b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main004.c +new file mode 100644 +index 0000000..18788ca +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main004.c +@@ -0,0 +1,12 @@ ++// Test c call fortran for the array type and the array type is long ++// long with bindc ++// ++#include ++extern void f_func_(long long *i); ++int main() { ++ long long i[5]; ++ f_func_(i); ++ for(int n = 0; n < 5; n++) { ++ printf("%Ld\n", i[n]); ++ } ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main005.c b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main005.c +new file mode 100644 +index 0000000..af4be4b +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main005.c +@@ -0,0 +1,12 @@ ++// Test c call fortran for the array type and the array type is signed ++// char with bindc ++// ++#include ++extern void f_func_(signed char *i); ++int main() { ++ signed char i[5]; ++ f_func_(i); ++ for(int n = 0; n < 5; n++) { ++ printf("%hhd\n", i[n]); ++ } ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main006.c b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main006.c +new file mode 100644 +index 0000000..b0e7f4d +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main006.c +@@ -0,0 +1,12 @@ ++// Test c call fortran for the array type and the array type is size_t ++// with bindc ++// ++#include ++extern void f_func_(size_t *i); ++int main() { ++ size_t i[5]; ++ f_func_(i); ++ for(int n = 0; n < 5; n++) { ++ printf("%ld\n", i[n]); ++ } ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main007.c b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main007.c +new file mode 100644 +index 0000000..e1d7d12 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main007.c +@@ -0,0 +1,13 @@ ++// Test c call fortran for the array type and the array type is int8_t ++// with bindc ++// ++#include ++#include ++extern void f_func_(int8_t *i); ++int main() { ++ int8_t i[5]; ++ f_func_(i); ++ for(int n = 0; n < 5; n++) { ++ printf("%hhd\n", i[n]); ++ } ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main008.c b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main008.c +new file mode 100644 +index 0000000..99df9f9 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main008.c +@@ -0,0 +1,13 @@ ++// Test c call fortran for the array type and the array type is int16_t ++// with bindc ++// ++#include ++#include ++extern void f_func_(int16_t *i); ++int main() { ++ int16_t i[5]; ++ f_func_(i); ++ for(int n = 0; n < 5; n++) { ++ printf("%hd\n", i[n]); ++ } ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main009.c b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main009.c +new file mode 100644 +index 0000000..f5f3d76 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main009.c +@@ -0,0 +1,13 @@ ++// Test c call fortran for the array type and the array type is int32_t ++// with bindc ++// ++#include ++#include ++extern void f_func_(int32_t *i); ++int main() { ++ int32_t i[5]; ++ f_func_(i); ++ for(int n = 0; n < 5; n++) { ++ printf("%d\n", i[n]); ++ } ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main010.c b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main010.c +new file mode 100644 +index 0000000..db9c8e0 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main010.c +@@ -0,0 +1,13 @@ ++// Test c call fortran for the array type and the array type is int64_t ++// with bindc ++// ++#include ++#include ++extern void f_func_(int64_t *i); ++int main() { ++ int64_t i[5]; ++ f_func_(i); ++ for(int n = 0; n < 5; n++) { ++ printf("%ld\n", i[n]); ++ } ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main011.c b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main011.c +new file mode 100644 +index 0000000..d7a4379 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main011.c +@@ -0,0 +1,13 @@ ++// Test c call fortran for the array type and the array type is ++// int_least8_t with bindc ++// ++#include ++#include ++extern void f_func_(int_least8_t *i); ++int main() { ++ int_least8_t i[5]; ++ f_func_(i); ++ for(int n = 0; n < 5; n++) { ++ printf("%hhd\n", i[n]); ++ } ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main012.c b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main012.c +new file mode 100644 +index 0000000..5e8a295 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main012.c +@@ -0,0 +1,13 @@ ++// Test c call fortran for the array type and the array type is ++// int_least16_t with bindc ++// ++#include ++#include ++extern void f_func_(int_least16_t *i); ++int main() { ++ int_least16_t i[5]; ++ f_func_(i); ++ for(int n = 0; n < 5; n++) { ++ printf("%hd\n", i[n]); ++ } ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main013.c b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main013.c +new file mode 100644 +index 0000000..37c0e17 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main013.c +@@ -0,0 +1,13 @@ ++// Test c call fortran for the array type and the array type is ++// int_least32_t with bindc ++// ++#include ++#include ++extern void f_func_(int_least32_t *i); ++int main() { ++ int_least32_t i[5]; ++ f_func_(i); ++ for(int n = 0; n < 5; n++) { ++ printf("%d\n", i[n]); ++ } ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main014.c b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main014.c +new file mode 100644 +index 0000000..5ba4762 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main014.c +@@ -0,0 +1,13 @@ ++// Test c call fortran for the array type and the array type is ++// int_least64_t with bindc ++// ++#include ++#include ++extern void f_func_(int_least64_t *i); ++int main() { ++ int_least64_t i[5]; ++ f_func_(i); ++ for(int n = 0; n < 5; n++) { ++ printf("%ld\n", i[n]); ++ } ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main015.c b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main015.c +new file mode 100644 +index 0000000..905c80a +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main015.c +@@ -0,0 +1,13 @@ ++// Test c call fortran for the array type and the array type is ++// int_fast8_t with bindc ++// ++#include ++#include ++extern void f_func_(int_fast8_t *i); ++int main() { ++ int_fast8_t i[5]; ++ f_func_(i); ++ for(int n = 0; n < 5; n++) { ++ printf("%hhd\n", i[n]); ++ } ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main016.c b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main016.c +new file mode 100644 +index 0000000..51fe904 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main016.c +@@ -0,0 +1,13 @@ ++// Test c call fortran for the array type and the array type is ++// int_fast16_t with bindc ++// ++#include ++#include ++extern void f_func_(int_fast16_t *i); ++int main() { ++ int_fast16_t i[5]; ++ f_func_(i); ++ for(int n = 0; n < 5; n++) { ++ printf("%ld\n", i[n]); ++ } ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main017.c b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main017.c +new file mode 100644 +index 0000000..6e2b2ce +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main017.c +@@ -0,0 +1,13 @@ ++// Test c call fortran for the array type and the array type is ++// int_fast32_t with bindc ++// ++#include ++#include ++extern void f_func_(int_fast32_t *i); ++int main() { ++ int_fast32_t i[5]; ++ f_func_(i); ++ for(int n = 0; n < 5; n++) { ++ printf("%ld\n", i[n]); ++ } ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main018.c b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main018.c +new file mode 100644 +index 0000000..fbddce9 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main018.c +@@ -0,0 +1,13 @@ ++// Test c call fortran for the array type and the array type is ++// int_fast64_t with bindc ++// ++#include ++#include ++extern void f_func_(int_fast64_t *i); ++int main() { ++ int_fast64_t i[5]; ++ f_func_(i); ++ for(int n = 0; n < 5; n++) { ++ printf("%ld\n", i[n]); ++ } ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main019.c b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main019.c +new file mode 100644 +index 0000000..effe5a0 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main019.c +@@ -0,0 +1,13 @@ ++// Test c call fortran for the array type and the array type is ++// intmax_t with bindc ++// ++#include ++#include ++extern void f_func_(intmax_t *i); ++int main() { ++ intmax_t i[5]; ++ f_func_(i); ++ for(int n = 0; n < 5; n++) { ++ printf("%ld\n", i[n]); ++ } ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main020.c b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main020.c +new file mode 100644 +index 0000000..f85b7b6 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main020.c +@@ -0,0 +1,13 @@ ++// Test c call fortran for the array type and the array type is ++// intptr_t with bindc ++// ++#include ++#include ++extern void f_func_(intptr_t *i); ++int main() { ++ intptr_t i[5]; ++ f_func_(i); ++ for(int n = 0; n < 5; n++) { ++ printf("%ld\n", i[n]); ++ } ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main021.c b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main021.c +new file mode 100644 +index 0000000..57e502b +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main021.c +@@ -0,0 +1,13 @@ ++// Test c call fortran for the array type and the array type is float ++// with bindc ++// ++#include ++#include ++extern void f_func_(float *i); ++int main() { ++ float i[5]; ++ f_func_(i); ++ for(int n = 0; n < 5; n++) { ++ printf("%0.20f\n", i[n]); ++ } ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main022.c b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main022.c +new file mode 100644 +index 0000000..ef29ded +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main022.c +@@ -0,0 +1,13 @@ ++// Test c call fortran for the array type and the array type is double ++// with bindc ++// ++#include ++#include ++extern void f_func_(double *i); ++int main() { ++ double i[5]; ++ f_func_(i); ++ for(int n = 0; n < 5; n++) { ++ printf("%0.20lf\n", i[n]); ++ } ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main023.c b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main023.c +new file mode 100644 +index 0000000..54098bd +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main023.c +@@ -0,0 +1,13 @@ ++// Test c call fortran for the array type and the array type is long ++// double with bindc ++// ++#include ++#include ++extern void f_func_(long double *i); ++int main() { ++ long double i[5]; ++ f_func_(i); ++ for(int n = 0; n < 5; n++) { ++ printf("%0.20Lf\n", i[n]); ++ } ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main024.c b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main024.c +new file mode 100644 +index 0000000..1f09f05 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main024.c +@@ -0,0 +1,13 @@ ++// Test c call fortran for the array type and the array type is float ++// _Complex with bindc ++// ++#include ++#include ++extern void f_func_(float _Complex *i); ++int main() { ++ float _Complex i[5]; ++ f_func_(i); ++ for(int n = 0; n < 5; n++) { ++ printf("%0.20f + %0.20fi\n", creal(i[n]), cimag(i[n])); ++ } ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main025.c b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main025.c +new file mode 100644 +index 0000000..196e624 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main025.c +@@ -0,0 +1,13 @@ ++// Test c call fortran for the array type and the array type is double ++// _Complex with bindc ++// ++#include ++#include ++extern void f_func_(double _Complex *i); ++int main() { ++ double _Complex i[5]; ++ f_func_(i); ++ for(int n = 0; n < 5; n++) { ++ printf("%0.20lf + %0.20lfi\n", creal(i[n]), cimag(i[n])); ++ } ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main026.c b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main026.c +new file mode 100644 +index 0000000..8855d53 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main026.c +@@ -0,0 +1,13 @@ ++// Test c call fortran for the array type and the array type is long ++// double _Complex with bindc ++// ++#include ++#include ++extern void f_func_(long double _Complex *i); ++int main() { ++ long double _Complex i[5]; ++ f_func_(i); ++ for(int n = 0; n < 5; n++) { ++ printf("%0.20lf + %0.20lfi\n", creal(i[n]), cimag(i[n])); ++ } ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main027.c b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main027.c +new file mode 100644 +index 0000000..e43e643 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main027.c +@@ -0,0 +1,13 @@ ++// Test c call fortran for the array type and the array type is _Bool ++// with bindc ++// ++#include ++#include ++extern void f_func_(_Bool *i); ++int main() { ++ _Bool i[5]; ++ f_func_(i); ++ for(int n = 0; n < 5; n++) { ++ printf("%d\n", i[n]); ++ } ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main028.c b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main028.c +new file mode 100644 +index 0000000..8b449d5 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main028.c +@@ -0,0 +1,13 @@ ++// Test c call fortran for the array type and the array type is char ++// with bindc ++// ++#include ++#include ++extern void f_func_(char *i); ++int main() { ++ char i[5]; ++ f_func_(i); ++ for(int n = 0; n < 5; n++) { ++ printf("%c\n", i[n]); ++ } ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func001.f90 b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func001.f90 +new file mode 100644 +index 0000000..2b618c6 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func001.f90 +@@ -0,0 +1,6 @@ ++subroutine f_func(i) bind(c, name = "f_func_") ++ integer, dimension(*) :: i ++ do n = 1, 5 ++ i(n) = n ++ end do ++end +diff --git a/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func002.f90 b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func002.f90 +new file mode 100644 +index 0000000..88bf55a +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func002.f90 +@@ -0,0 +1,6 @@ ++subroutine f_func(i) bind(c, name = "f_func_") ++ integer(2), dimension(*) :: i ++ do n = 1, 5 ++ i(n) = n ++ end do ++end +diff --git a/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func003.f90 b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func003.f90 +new file mode 100644 +index 0000000..f7e9ec7 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func003.f90 +@@ -0,0 +1,6 @@ ++subroutine f_func(i) bind(c, name = "f_func_") ++ integer(8), dimension(*) :: i ++ do n = 1, 5 ++ i(n) = n ++ end do ++end +diff --git a/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func004.f90 b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func004.f90 +new file mode 100644 +index 0000000..f7e9ec7 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func004.f90 +@@ -0,0 +1,6 @@ ++subroutine f_func(i) bind(c, name = "f_func_") ++ integer(8), dimension(*) :: i ++ do n = 1, 5 ++ i(n) = n ++ end do ++end +diff --git a/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func005.f90 b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func005.f90 +new file mode 100644 +index 0000000..7f76df3 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func005.f90 +@@ -0,0 +1,6 @@ ++subroutine f_func(i) bind(c, name = "f_func_") ++ integer(1), dimension(*) :: i ++ do n = 1, 5 ++ i(n) = n ++ end do ++end +diff --git a/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func006.f90 b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func006.f90 +new file mode 100644 +index 0000000..f7e9ec7 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func006.f90 +@@ -0,0 +1,6 @@ ++subroutine f_func(i) bind(c, name = "f_func_") ++ integer(8), dimension(*) :: i ++ do n = 1, 5 ++ i(n) = n ++ end do ++end +diff --git a/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func007.f90 b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func007.f90 +new file mode 100644 +index 0000000..7f76df3 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func007.f90 +@@ -0,0 +1,6 @@ ++subroutine f_func(i) bind(c, name = "f_func_") ++ integer(1), dimension(*) :: i ++ do n = 1, 5 ++ i(n) = n ++ end do ++end +diff --git a/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func008.f90 b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func008.f90 +new file mode 100644 +index 0000000..88bf55a +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func008.f90 +@@ -0,0 +1,6 @@ ++subroutine f_func(i) bind(c, name = "f_func_") ++ integer(2), dimension(*) :: i ++ do n = 1, 5 ++ i(n) = n ++ end do ++end +diff --git a/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func009.f90 b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func009.f90 +new file mode 100644 +index 0000000..f1607ec +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func009.f90 +@@ -0,0 +1,6 @@ ++subroutine f_func(i) bind(c, name = "f_func_") ++ integer(4), dimension(*) :: i ++ do n = 1, 5 ++ i(n) = n ++ end do ++end +diff --git a/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func010.f90 b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func010.f90 +new file mode 100644 +index 0000000..f7e9ec7 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func010.f90 +@@ -0,0 +1,6 @@ ++subroutine f_func(i) bind(c, name = "f_func_") ++ integer(8), dimension(*) :: i ++ do n = 1, 5 ++ i(n) = n ++ end do ++end +diff --git a/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func011.f90 b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func011.f90 +new file mode 100644 +index 0000000..7f76df3 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func011.f90 +@@ -0,0 +1,6 @@ ++subroutine f_func(i) bind(c, name = "f_func_") ++ integer(1), dimension(*) :: i ++ do n = 1, 5 ++ i(n) = n ++ end do ++end +diff --git a/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func012.f90 b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func012.f90 +new file mode 100644 +index 0000000..88bf55a +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func012.f90 +@@ -0,0 +1,6 @@ ++subroutine f_func(i) bind(c, name = "f_func_") ++ integer(2), dimension(*) :: i ++ do n = 1, 5 ++ i(n) = n ++ end do ++end +diff --git a/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func013.f90 b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func013.f90 +new file mode 100644 +index 0000000..f1607ec +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func013.f90 +@@ -0,0 +1,6 @@ ++subroutine f_func(i) bind(c, name = "f_func_") ++ integer(4), dimension(*) :: i ++ do n = 1, 5 ++ i(n) = n ++ end do ++end +diff --git a/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func014.f90 b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func014.f90 +new file mode 100644 +index 0000000..f7e9ec7 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func014.f90 +@@ -0,0 +1,6 @@ ++subroutine f_func(i) bind(c, name = "f_func_") ++ integer(8), dimension(*) :: i ++ do n = 1, 5 ++ i(n) = n ++ end do ++end +diff --git a/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func015.f90 b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func015.f90 +new file mode 100644 +index 0000000..7f76df3 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func015.f90 +@@ -0,0 +1,6 @@ ++subroutine f_func(i) bind(c, name = "f_func_") ++ integer(1), dimension(*) :: i ++ do n = 1, 5 ++ i(n) = n ++ end do ++end +diff --git a/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func016.f90 b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func016.f90 +new file mode 100644 +index 0000000..f7e9ec7 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func016.f90 +@@ -0,0 +1,6 @@ ++subroutine f_func(i) bind(c, name = "f_func_") ++ integer(8), dimension(*) :: i ++ do n = 1, 5 ++ i(n) = n ++ end do ++end +diff --git a/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func017.f90 b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func017.f90 +new file mode 100644 +index 0000000..f7e9ec7 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func017.f90 +@@ -0,0 +1,6 @@ ++subroutine f_func(i) bind(c, name = "f_func_") ++ integer(8), dimension(*) :: i ++ do n = 1, 5 ++ i(n) = n ++ end do ++end +diff --git a/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func018.f90 b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func018.f90 +new file mode 100644 +index 0000000..f7e9ec7 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func018.f90 +@@ -0,0 +1,6 @@ ++subroutine f_func(i) bind(c, name = "f_func_") ++ integer(8), dimension(*) :: i ++ do n = 1, 5 ++ i(n) = n ++ end do ++end +diff --git a/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func019.f90 b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func019.f90 +new file mode 100644 +index 0000000..f7e9ec7 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func019.f90 +@@ -0,0 +1,6 @@ ++subroutine f_func(i) bind(c, name = "f_func_") ++ integer(8), dimension(*) :: i ++ do n = 1, 5 ++ i(n) = n ++ end do ++end +diff --git a/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func020.f90 b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func020.f90 +new file mode 100644 +index 0000000..f7e9ec7 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func020.f90 +@@ -0,0 +1,6 @@ ++subroutine f_func(i) bind(c, name = "f_func_") ++ integer(8), dimension(*) :: i ++ do n = 1, 5 ++ i(n) = n ++ end do ++end +diff --git a/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func021.f90 b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func021.f90 +new file mode 100644 +index 0000000..968582c +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func021.f90 +@@ -0,0 +1,6 @@ ++subroutine f_func(i) bind(c, name = "f_func_") ++ real(4), dimension(*) :: i ++ do n = 1, 5 ++ i(n) = n + 3.14159265358979 ++ end do ++end +diff --git a/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func022.f90 b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func022.f90 +new file mode 100644 +index 0000000..6dedde8 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func022.f90 +@@ -0,0 +1,6 @@ ++subroutine f_func(i) bind(c, name = "f_func_") ++ real(8), dimension(*) :: i ++ do n = 1, 5 ++ i(n) = n + 3.14159265358979 ++ end do ++end +diff --git a/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func023.f90 b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func023.f90 +new file mode 100644 +index 0000000..441062e +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func023.f90 +@@ -0,0 +1,7 @@ ++subroutine f_func(i) bind(c, name = "f_func_") ++ integer, parameter :: K = selected_real_kind(16) ++ real(K), dimension(*) :: i ++ do n = 1, 5 ++ i(n) = n + 3.14159265358979 ++ end do ++end +diff --git a/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func024.f90 b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func024.f90 +new file mode 100644 +index 0000000..1de9dc0 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func024.f90 +@@ -0,0 +1,6 @@ ++subroutine f_func(i) bind(c, name = "f_func_") ++ complex(4), dimension(*) :: i ++ do n = 1, 5 ++ i(n) = (-12345678.7654321, 1) ++ end do ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func025.f90 b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func025.f90 +new file mode 100644 +index 0000000..e7a7b5a +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func025.f90 +@@ -0,0 +1,6 @@ ++subroutine f_func(i) bind(c, name = "f_func_") ++ complex(8), dimension(*) :: i ++ do n = 1, 5 ++ i(n) = (-12345678.7654321, 1) ++ end do ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func026.f90 b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func026.f90 +new file mode 100644 +index 0000000..af23ec9 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func026.f90 +@@ -0,0 +1,7 @@ ++subroutine f_func(i) bind(c, name = "f_func_") ++ integer, parameter :: K = selected_real_kind(16) ++ complex(K), dimension(*) :: i ++ do n = 1, 5 ++ i(n) = (-12345678.7654321, 1) ++ end do ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func027.f90 b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func027.f90 +new file mode 100644 +index 0000000..1a4fc9d +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func027.f90 +@@ -0,0 +1,6 @@ ++subroutine f_func(i) bind(c, name = "f_func_") ++ logical(1), dimension(*) :: i ++ do n = 1, 5 ++ i(n) = .TRUE. ++ end do ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func028.f90 b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func028.f90 +new file mode 100644 +index 0000000..e039766 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func028.f90 +@@ -0,0 +1,6 @@ ++subroutine f_func(i) bind(c, name = "f_func_") ++ character(1), dimension(*) :: i ++ do n = 1, 5 ++ i(n) = 'a' ++ end do ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/result.md b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/result.md +new file mode 100644 +index 0000000..347da21 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/result.md +@@ -0,0 +1,29 @@ ++ | test | gfortran | flang | ++ | 001 | PASS | PASS | ++ | 002 | PASS | PASS | ++ | 003 | PASS | PASS | ++ | 004 | PASS | PASS | ++ | 005 | PASS | PASS | ++ | 006 | PASS | PASS | ++ | 007 | PASS | PASS | ++ | 008 | PASS | PASS | ++ | 009 | PASS | PASS | ++ | 010 | PASS | PASS | ++ | 011 | PASS | PASS | ++ | 012 | PASS | PASS | ++ | 013 | PASS | PASS | ++ | 014 | PASS | PASS | ++ | 015 | PASS | PASS | ++ | 016 | PASS | PASS | ++ | 017 | PASS | PASS | ++ | 018 | PASS | PASS | ++ | 019 | PASS | PASS | ++ | 020 | PASS | PASS | ++ | 021 | PASS | PASS | ++ | 022 | PASS | PASS | ++ | 023 | PASS | PASS | ++ | 024 | PASS | PASS | ++ | 025 | PASS | PASS | ++ | 026 | PASS | PASS | ++ | 027 | PASS | PASS | ++ | 028 | PASS | PASS | +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/run.sh b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/run.sh +new file mode 100644 +index 0000000..5b2202e +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/run.sh +@@ -0,0 +1,16 @@ ++for i in {001..028} ++do ++echo "------- test $i ------." ++echo "----- gfortran result:" ++gcc c_main$i.c -c -o c-test.o ++gfortran fortran_func$i.f90 -fno-range-check -c -o fortran-test.o ++gfortran fortran-test.o c-test.o ++./a.out ++rm *.o a.out ++echo "----- flang-new result : " ++clang c_main$i.c -c -o c-test.o ++flang-new fortran_func$i.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o a.out ++done +\ No newline at end of file +-- +2.25.1 + diff --git a/12-test-interoperability-with-c-c-call-fortran-function.patch b/12-test-interoperability-with-c-c-call-fortran-function.patch new file mode 100644 index 0000000..a56b470 --- /dev/null +++ b/12-test-interoperability-with-c-c-call-fortran-function.patch @@ -0,0 +1,4345 @@ +From 8fa00ecae018be771be6031c7468be3e8bed234b Mon Sep 17 00:00:00 2001 +From: xieyihui +Date: Fri, 18 Nov 2022 13:02:22 +0800 +Subject: [PATCH] Add new test cases about function for interoperability with C + about C call fortran + +diff --git a/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main001.c b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main001.c +new file mode 100644 +index 0000000..8889aba +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main001.c +@@ -0,0 +1,9 @@ ++// Test c call fortran for the return type is int ++// ++#include ++extern int f_func_(int *i); ++int main() { ++ int s1 = 5; ++ int res = f_func_(&s1); ++ printf("%d\n", res); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main002.c b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main002.c +new file mode 100644 +index 0000000..31b044f +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main002.c +@@ -0,0 +1,9 @@ ++// Test c call fortran for the return type is short ++// ++#include ++extern short f_func_(short *i); ++int main() { ++ short s1 = 5; ++ short res = f_func_(&s1); ++ printf("%hd\n", res); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main003.c b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main003.c +new file mode 100644 +index 0000000..d01bca9 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main003.c +@@ -0,0 +1,9 @@ ++// Test c call fortran for the return type is long ++// ++#include ++extern long f_func_(long *i); ++int main() { ++ long s1 = 5; ++ long res = f_func_(&s1); ++ printf("%ld\n", res); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main004.c b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main004.c +new file mode 100644 +index 0000000..7680380 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main004.c +@@ -0,0 +1,9 @@ ++// Test c call fortran for the return type is long long ++// ++#include ++extern long long f_func_(long long *i); ++int main() { ++ long long s1 = 5; ++ long long res = f_func_(&s1); ++ printf("%Ld\n", res); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main005.c b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main005.c +new file mode 100644 +index 0000000..4cf34d1 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main005.c +@@ -0,0 +1,9 @@ ++// Test c call fortran for the return type is signed char ++// ++#include ++extern signed char f_func_(signed char *i); ++int main() { ++ signed char s1 = 85; ++ signed char res = f_func_(&s1); ++ printf("%c\n", res); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main006.c b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main006.c +new file mode 100644 +index 0000000..1066139 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main006.c +@@ -0,0 +1,9 @@ ++// Test c call fortran for the return type is size_t ++// ++#include ++extern size_t f_func_(size_t *i); ++int main() { ++ size_t s1 = 5; ++ size_t res = f_func_(&s1); ++ printf("%ld\n", res); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main007.c b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main007.c +new file mode 100644 +index 0000000..547b2a1 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main007.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for the return type is int8_t ++// ++#include ++#include ++extern int8_t f_func_(int8_t *i); ++int main() { ++ int8_t s1 = 5; ++ int8_t res = f_func_(&s1); ++ printf("%hhd\n", res); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main008.c b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main008.c +new file mode 100644 +index 0000000..0a91427 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main008.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for the return type is int16_t ++// ++#include ++#include ++extern int16_t f_func_(int16_t *i); ++int main() { ++ int16_t s1 = 5; ++ int16_t res = f_func_(&s1); ++ printf("%hd\n", res); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main009.c b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main009.c +new file mode 100644 +index 0000000..ec7c9dd +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main009.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for the return type is int32_t ++// ++#include ++#include ++extern int32_t f_func_(int32_t *i); ++int main() { ++ int32_t s1 = 5; ++ int32_t res = f_func_(&s1); ++ printf("%d\n", res); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main010.c b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main010.c +new file mode 100644 +index 0000000..40aa8e9 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main010.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for the return type is int64_t ++// ++#include ++#include ++extern int64_t f_func_(int64_t *i); ++int main() { ++ int64_t s1 = 5; ++ int64_t res = f_func_(&s1); ++ printf("%ld\n", res); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main011.c b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main011.c +new file mode 100644 +index 0000000..2ff6688 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main011.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for the return type is int_least8_t ++// ++#include ++#include ++extern int_least8_t f_func_(int_least8_t *i); ++int main() { ++ int_least8_t s1 = 5; ++ int_least8_t res = f_func_(&s1); ++ printf("%hhd\n", res); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main012.c b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main012.c +new file mode 100644 +index 0000000..c332da0 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main012.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for the return type is int_least16_t ++// ++#include ++#include ++extern int_least16_t f_func_(int_least16_t *i); ++int main() { ++ int_least16_t s1 = 5; ++ int_least16_t res = f_func_(&s1); ++ printf("%hd\n", res); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main013.c b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main013.c +new file mode 100644 +index 0000000..f72441e +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main013.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for the return type is int_least32_t ++// ++#include ++#include ++extern int_least32_t f_func_(int_least32_t *i); ++int main() { ++ int_least32_t s1 = 5; ++ int_least32_t res = f_func_(&s1); ++ printf("%d\n", res); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main014.c b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main014.c +new file mode 100644 +index 0000000..4d98217 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main014.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for the return type is int_least64_t ++// ++#include ++#include ++extern int_least64_t f_func_(int_least64_t *i); ++int main() { ++ int_least64_t s1 = 5; ++ int_least64_t res = f_func_(&s1); ++ printf("%ld\n", res); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main015.c b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main015.c +new file mode 100644 +index 0000000..dd99955 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main015.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for the return type is int_fast8_t ++// ++#include ++#include ++extern int_fast8_t f_func_(int_fast8_t *i); ++int main() { ++ int_fast8_t s1 = 5; ++ int_fast8_t res = f_func_(&s1); ++ printf("%hhd\n", res); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main016.c b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main016.c +new file mode 100644 +index 0000000..c8ca6e2 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main016.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for the return type is int_fast16_t ++// ++#include ++#include ++extern int_fast16_t f_func_(int_fast16_t *i); ++int main() { ++ int_fast16_t s1 = 5; ++ int_fast16_t res = f_func_(&s1); ++ printf("%ld\n", res); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main017.c b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main017.c +new file mode 100644 +index 0000000..d5dbfa1 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main017.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for the return type is int_fast32_t ++// ++#include ++#include ++extern int_fast32_t f_func_(int_fast32_t *i); ++int main() { ++ int_fast32_t s1 = 5; ++ int_fast32_t res = f_func_(&s1); ++ printf("%ld\n", res); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main018.c b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main018.c +new file mode 100644 +index 0000000..11536d8 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main018.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for the return type is int_fast64_t ++// ++#include ++#include ++extern int_fast64_t f_func_(int_fast64_t *i); ++int main() { ++ int_fast64_t s1 = 5; ++ int_fast64_t res = f_func_(&s1); ++ printf("%ld\n", res); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main019.c b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main019.c +new file mode 100644 +index 0000000..c5c0ac0 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main019.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for the return type is intmax_t ++// ++#include ++#include ++extern intmax_t f_func_(intmax_t *i); ++int main() { ++ intmax_t s1 = 5; ++ intmax_t res = f_func_(&s1); ++ printf("%ld\n", res); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main020.c b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main020.c +new file mode 100644 +index 0000000..3985c08 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main020.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for the return type is intptr_t ++// ++#include ++#include ++extern intptr_t f_func_(intptr_t *i); ++int main() { ++ intptr_t s1 = 5; ++ intptr_t res = f_func_(&s1); ++ printf("%ld\n", res); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main021.c b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main021.c +new file mode 100644 +index 0000000..e260dd4 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main021.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for the return type is float ++// ++#include ++#include ++extern float f_func_(float *i); ++int main() { ++ float i = 0.5; ++ float res = f_func_(&i); ++ printf("%0.20f\n", res); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main022.c b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main022.c +new file mode 100644 +index 0000000..1e9fdd4 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main022.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for the return type is double ++// ++#include ++#include ++extern double f_func_(double *i); ++int main() { ++ double i = 0.5; ++ double res = f_func_(&i); ++ printf("%0.20lf\n", res); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main023.c b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main023.c +new file mode 100644 +index 0000000..8b1d692 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main023.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for the return type is long double ++// ++#include ++#include ++extern long double f_func_(long double *i); ++int main() { ++ long double i = 0.5; ++ long double res = f_func_(&i); ++ printf("%0.20Lf\n", res); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main024.c b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main024.c +new file mode 100644 +index 0000000..350055a +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main024.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for the return type is float _Complex ++// ++#include ++#include ++extern float _Complex f_func_(float _Complex *i); ++int main() { ++ float _Complex i; ++ float _Complex res = f_func_(&i); ++ printf("%0.20f + %0.20fi\n", creal(res), cimag(res)); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main025.c b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main025.c +new file mode 100644 +index 0000000..b81188d +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main025.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for the return type is double _Complex ++// ++#include ++#include ++extern double _Complex f_func_(double _Complex *i); ++int main() { ++ double _Complex i; ++ double _Complex res = f_func_(&i); ++ printf("%0.20lf + %0.20lfi\n", creal(res), cimag(res)); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main026.c b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main026.c +new file mode 100644 +index 0000000..630ab26 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main026.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for the return type is long double _Complex ++// ++#include ++#include ++extern long double _Complex f_func_(long double _Complex *i); ++int main() { ++ long double _Complex i; ++ long double _Complex res = f_func_(&i); ++ printf("%0.20lf + %0.20lfi\n", creal(res), cimag(res)); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main027.c b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main027.c +new file mode 100644 +index 0000000..dd95917 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main027.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for the return type is _Bool ++// ++#include ++#include ++extern _Bool f_func_(_Bool *i); ++int main() { ++ _Bool i = 0; ++ _Bool res = f_func_(&i); ++ printf("%d\n", res); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main028.c b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main028.c +new file mode 100644 +index 0000000..1bbb2a6 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main028.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for the return type is char ++// ++#include ++#include ++extern char f_func_(char *i); ++int main() { ++ char i; ++ char res = f_func_(&i); ++ printf("%c\n", res); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func001.f90 b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func001.f90 +new file mode 100644 +index 0000000..8809b59 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func001.f90 +@@ -0,0 +1,4 @@ ++integer function f_func(i) ++ integer :: i ++ f_func = 10 + i ++end +diff --git a/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func002.f90 b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func002.f90 +new file mode 100644 +index 0000000..91a5d95 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func002.f90 +@@ -0,0 +1,4 @@ ++integer function f_func(i) ++ integer(2) :: i ++ f_func = 10 + i ++end +diff --git a/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func003.f90 b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func003.f90 +new file mode 100644 +index 0000000..d91ed67 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func003.f90 +@@ -0,0 +1,4 @@ ++integer function f_func(i) ++ integer(8) :: i ++ f_func = 10 + i ++end +diff --git a/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func004.f90 b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func004.f90 +new file mode 100644 +index 0000000..d91ed67 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func004.f90 +@@ -0,0 +1,4 @@ ++integer function f_func(i) ++ integer(8) :: i ++ f_func = 10 + i ++end +diff --git a/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func005.f90 b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func005.f90 +new file mode 100644 +index 0000000..bd7b3fc +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func005.f90 +@@ -0,0 +1,4 @@ ++integer function f_func(i) ++ integer(1) :: i ++ f_func = 10 + i ++end +diff --git a/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func006.f90 b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func006.f90 +new file mode 100644 +index 0000000..d91ed67 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func006.f90 +@@ -0,0 +1,4 @@ ++integer function f_func(i) ++ integer(8) :: i ++ f_func = 10 + i ++end +diff --git a/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func007.f90 b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func007.f90 +new file mode 100644 +index 0000000..bd7b3fc +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func007.f90 +@@ -0,0 +1,4 @@ ++integer function f_func(i) ++ integer(1) :: i ++ f_func = 10 + i ++end +diff --git a/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func008.f90 b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func008.f90 +new file mode 100644 +index 0000000..91a5d95 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func008.f90 +@@ -0,0 +1,4 @@ ++integer function f_func(i) ++ integer(2) :: i ++ f_func = 10 + i ++end +diff --git a/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func009.f90 b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func009.f90 +new file mode 100644 +index 0000000..c386948 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func009.f90 +@@ -0,0 +1,4 @@ ++integer function f_func(i) ++ integer(4) :: i ++ f_func = 10 + i ++end +diff --git a/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func010.f90 b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func010.f90 +new file mode 100644 +index 0000000..d91ed67 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func010.f90 +@@ -0,0 +1,4 @@ ++integer function f_func(i) ++ integer(8) :: i ++ f_func = 10 + i ++end +diff --git a/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func011.f90 b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func011.f90 +new file mode 100644 +index 0000000..bd7b3fc +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func011.f90 +@@ -0,0 +1,4 @@ ++integer function f_func(i) ++ integer(1) :: i ++ f_func = 10 + i ++end +diff --git a/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func012.f90 b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func012.f90 +new file mode 100644 +index 0000000..91a5d95 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func012.f90 +@@ -0,0 +1,4 @@ ++integer function f_func(i) ++ integer(2) :: i ++ f_func = 10 + i ++end +diff --git a/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func013.f90 b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func013.f90 +new file mode 100644 +index 0000000..c386948 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func013.f90 +@@ -0,0 +1,4 @@ ++integer function f_func(i) ++ integer(4) :: i ++ f_func = 10 + i ++end +diff --git a/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func014.f90 b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func014.f90 +new file mode 100644 +index 0000000..d91ed67 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func014.f90 +@@ -0,0 +1,4 @@ ++integer function f_func(i) ++ integer(8) :: i ++ f_func = 10 + i ++end +diff --git a/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func015.f90 b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func015.f90 +new file mode 100644 +index 0000000..bd7b3fc +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func015.f90 +@@ -0,0 +1,4 @@ ++integer function f_func(i) ++ integer(1) :: i ++ f_func = 10 + i ++end +diff --git a/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func016.f90 b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func016.f90 +new file mode 100644 +index 0000000..d91ed67 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func016.f90 +@@ -0,0 +1,4 @@ ++integer function f_func(i) ++ integer(8) :: i ++ f_func = 10 + i ++end +diff --git a/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func017.f90 b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func017.f90 +new file mode 100644 +index 0000000..d91ed67 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func017.f90 +@@ -0,0 +1,4 @@ ++integer function f_func(i) ++ integer(8) :: i ++ f_func = 10 + i ++end +diff --git a/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func018.f90 b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func018.f90 +new file mode 100644 +index 0000000..d91ed67 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func018.f90 +@@ -0,0 +1,4 @@ ++integer function f_func(i) ++ integer(8) :: i ++ f_func = 10 + i ++end +diff --git a/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func019.f90 b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func019.f90 +new file mode 100644 +index 0000000..d91ed67 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func019.f90 +@@ -0,0 +1,4 @@ ++integer function f_func(i) ++ integer(8) :: i ++ f_func = 10 + i ++end +diff --git a/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func020.f90 b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func020.f90 +new file mode 100644 +index 0000000..d91ed67 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func020.f90 +@@ -0,0 +1,4 @@ ++integer function f_func(i) ++ integer(8) :: i ++ f_func = 10 + i ++end +diff --git a/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func021.f90 b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func021.f90 +new file mode 100644 +index 0000000..27c8008 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func021.f90 +@@ -0,0 +1,4 @@ ++real function f_func(i) ++ real(4) :: i ++ f_func = i + 0.1 ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func022.f90 b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func022.f90 +new file mode 100644 +index 0000000..b862910 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func022.f90 +@@ -0,0 +1,4 @@ ++real(8) function f_func(i) ++ real(8) :: i ++ f_func = i + 0.1 ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func023.f90 b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func023.f90 +new file mode 100644 +index 0000000..5a24ed7 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func023.f90 +@@ -0,0 +1,6 @@ ++function f_func(i) ++ integer, parameter :: K = selected_real_kind(16) ++ real(K) :: i ++ real(K) :: f_func ++ f_func = i + 0.1 ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func024.f90 b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func024.f90 +new file mode 100644 +index 0000000..e158cce +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func024.f90 +@@ -0,0 +1,4 @@ ++complex(4) function f_func(i) ++ complex(4) :: i ++ f_func = (-12345678.7654321, 1) ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func025.f90 b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func025.f90 +new file mode 100644 +index 0000000..3cd9e4e +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func025.f90 +@@ -0,0 +1,4 @@ ++complex(8) function f_func(i) ++ complex(8) :: i ++ f_func = (-12345678.7654321, 1) ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func026.f90 b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func026.f90 +new file mode 100644 +index 0000000..fb3c477 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func026.f90 +@@ -0,0 +1,6 @@ ++function f_func(i) ++ integer, parameter :: K = selected_real_kind(16) ++ complex(K) :: i ++ complex(K) :: f_func ++ f_func = (-12345678.7654321, 1) ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func027.f90 b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func027.f90 +new file mode 100644 +index 0000000..f331e96 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func027.f90 +@@ -0,0 +1,4 @@ ++logical function f_func(i) ++ logical(1) :: i ++ f_func = .TRUE. ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func028.f90 b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func028.f90 +new file mode 100644 +index 0000000..228b066 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func028.f90 +@@ -0,0 +1,4 @@ ++character function f_func(i) ++ character(1) :: i ++ f_func = 'b' ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/result.md b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/result.md +new file mode 100644 +index 0000000..3d13906 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/result.md +@@ -0,0 +1,29 @@ ++ | test | gfortran | flang | ++ | 001 | PASS | PASS | ++ | 002 | PASS | PASS | ++ | 003 | PASS | PASS | ++ | 004 | PASS | PASS | ++ | 005 | PASS | PASS | ++ | 006 | PASS | PASS | ++ | 007 | PASS | PASS | ++ | 008 | PASS | PASS | ++ | 009 | PASS | PASS | ++ | 010 | PASS | PASS | ++ | 011 | PASS | PASS | ++ | 012 | PASS | PASS | ++ | 013 | PASS | PASS | ++ | 014 | PASS | PASS | ++ | 015 | PASS | PASS | ++ | 016 | PASS | PASS | ++ | 017 | PASS | PASS | ++ | 018 | PASS | PASS | ++ | 019 | PASS | PASS | ++ | 020 | PASS | PASS | ++ | 021 | PASS | PASS | ++ | 022 | PASS | PASS | ++ | 023 | PASS | PASS | ++ | 024 | PASS | PASS | ++ | 025 | PASS | PASS | ++ | 026 | PASS | ERROR | ++ | 027 | PASS | PASS | ++ | 028 | PASS | ERROR | +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/run.sh b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/run.sh +new file mode 100644 +index 0000000..5b2202e +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/run.sh +@@ -0,0 +1,16 @@ ++for i in {001..028} ++do ++echo "------- test $i ------." ++echo "----- gfortran result:" ++gcc c_main$i.c -c -o c-test.o ++gfortran fortran_func$i.f90 -fno-range-check -c -o fortran-test.o ++gfortran fortran-test.o c-test.o ++./a.out ++rm *.o a.out ++echo "----- flang-new result : " ++clang c_main$i.c -c -o c-test.o ++flang-new fortran_func$i.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o a.out ++done +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main001.c b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main001.c +new file mode 100644 +index 0000000..750e07c +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main001.c +@@ -0,0 +1,9 @@ ++// Test c call fortran for the return type is int with bindc ++// ++#include ++extern int f_func_(int *i); ++int main() { ++ int s1 = 5; ++ int res = f_func_(&s1); ++ printf("%d\n", res); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main002.c b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main002.c +new file mode 100644 +index 0000000..801bbd9 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main002.c +@@ -0,0 +1,9 @@ ++// Test c call fortran for the return type is short with bindc ++// ++#include ++extern short f_func_(short *i); ++int main() { ++ short s1 = 5; ++ short res = f_func_(&s1); ++ printf("%hd\n", res); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main003.c b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main003.c +new file mode 100644 +index 0000000..d141bc0 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main003.c +@@ -0,0 +1,9 @@ ++// Test c call fortran for the return type is long with bindc ++// ++#include ++extern long f_func_(long *i); ++int main() { ++ long s1 = 5; ++ long res = f_func_(&s1); ++ printf("%ld\n", res); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main004.c b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main004.c +new file mode 100644 +index 0000000..447e373 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main004.c +@@ -0,0 +1,9 @@ ++// Test c call fortran for the return type is long long with bindc ++// ++#include ++extern long long f_func_(long long *i); ++int main() { ++ long long s1 = 5; ++ long long res = f_func_(&s1); ++ printf("%Ld\n", res); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main005.c b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main005.c +new file mode 100644 +index 0000000..2f680d5 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main005.c +@@ -0,0 +1,9 @@ ++// Test c call fortran for the return type is signed char with bindc ++// ++#include ++extern signed char f_func_(signed char *i); ++int main() { ++ signed char s1 = 85; ++ signed char res = f_func_(&s1); ++ printf("%c\n", res); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main006.c b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main006.c +new file mode 100644 +index 0000000..47eec77 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main006.c +@@ -0,0 +1,9 @@ ++// Test c call fortran for the return type is size_t with bindc ++// ++#include ++extern size_t f_func_(size_t *i); ++int main() { ++ size_t s1 = 5; ++ size_t res = f_func_(&s1); ++ printf("%ld\n", res); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main007.c b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main007.c +new file mode 100644 +index 0000000..7e39eb4 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main007.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for the return type is int8_t with bindc ++// ++#include ++#include ++extern int8_t f_func_(int8_t *i); ++int main() { ++ int8_t s1 = 5; ++ int8_t res = f_func_(&s1); ++ printf("%hhd\n", res); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main008.c b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main008.c +new file mode 100644 +index 0000000..5a96518 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main008.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for the return type is int16_t with bindc ++// ++#include ++#include ++extern int16_t f_func_(int16_t *i); ++int main() { ++ int16_t s1 = 5; ++ int16_t res = f_func_(&s1); ++ printf("%hd\n", res); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main009.c b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main009.c +new file mode 100644 +index 0000000..61b0a1c +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main009.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for the return type is int32_t with bindc ++// ++#include ++#include ++extern int32_t f_func_(int32_t *i); ++int main() { ++ int32_t s1 = 5; ++ int32_t res = f_func_(&s1); ++ printf("%d\n", res); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main010.c b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main010.c +new file mode 100644 +index 0000000..f74292e +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main010.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for the return type is int64_t with bindc ++// ++#include ++#include ++extern int64_t f_func_(int64_t *i); ++int main() { ++ int64_t s1 = 5; ++ int64_t res = f_func_(&s1); ++ printf("%ld\n", res); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main011.c b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main011.c +new file mode 100644 +index 0000000..034044f +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main011.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for the return type is int_least8_t with bindc ++// ++#include ++#include ++extern int_least8_t f_func_(int_least8_t *i); ++int main() { ++ int_least8_t s1 = 5; ++ int_least8_t res = f_func_(&s1); ++ printf("%hhd\n", res); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main012.c b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main012.c +new file mode 100644 +index 0000000..1597575 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main012.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for the return type is int_least16_t with bindc ++// ++#include ++#include ++extern int_least16_t f_func_(int_least16_t *i); ++int main() { ++ int_least16_t s1 = 5; ++ int_least16_t res = f_func_(&s1); ++ printf("%hd\n", res); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main013.c b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main013.c +new file mode 100644 +index 0000000..dc2226d +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main013.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for the return type is int_least32_t with bindc ++// ++#include ++#include ++extern int_least32_t f_func_(int_least32_t *i); ++int main() { ++ int_least32_t s1 = 5; ++ int_least32_t res = f_func_(&s1); ++ printf("%d\n", res); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main014.c b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main014.c +new file mode 100644 +index 0000000..b935d4a +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main014.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for the return type is int_least64_t with bindc ++// ++#include ++#include ++extern int_least64_t f_func_(int_least64_t *i); ++int main() { ++ int_least64_t s1 = 5; ++ int_least64_t res = f_func_(&s1); ++ printf("%ld\n", res); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main015.c b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main015.c +new file mode 100644 +index 0000000..ce49dad +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main015.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for the return type is int_fast8_t with bindc ++// ++#include ++#include ++extern int_fast8_t f_func_(int_fast8_t *i); ++int main() { ++ int_fast8_t s1 = 5; ++ int_fast8_t res = f_func_(&s1); ++ printf("%hhd\n", res); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main016.c b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main016.c +new file mode 100644 +index 0000000..9f0bef4 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main016.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for the return type is int_fast16_t with bindc ++// ++#include ++#include ++extern int_fast16_t f_func_(int_fast16_t *i); ++int main() { ++ int_fast16_t s1 = 5; ++ int_fast16_t res = f_func_(&s1); ++ printf("%ld\n", res); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main017.c b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main017.c +new file mode 100644 +index 0000000..8ab1c0a +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main017.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for the return type is int_fast32_t with bindc ++// ++#include ++#include ++extern int_fast32_t f_func_(int_fast32_t *i); ++int main() { ++ int_fast32_t s1 = 5; ++ int_fast32_t res = f_func_(&s1); ++ printf("%ld\n", res); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main018.c b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main018.c +new file mode 100644 +index 0000000..9310bfa +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main018.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for the return type is int_fast64_t with bindc ++// ++#include ++#include ++extern int_fast64_t f_func_(int_fast64_t *i); ++int main() { ++ int_fast64_t s1 = 5; ++ int_fast64_t res = f_func_(&s1); ++ printf("%ld\n", res); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main019.c b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main019.c +new file mode 100644 +index 0000000..af4c9c7 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main019.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for the return type is intmax_t with bindc ++// ++#include ++#include ++extern intmax_t f_func_(intmax_t *i); ++int main() { ++ intmax_t s1 = 5; ++ intmax_t res = f_func_(&s1); ++ printf("%ld\n", res); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main020.c b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main020.c +new file mode 100644 +index 0000000..f3fbe2f +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main020.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for the return type is intptr_t with bindc ++// ++#include ++#include ++extern intptr_t f_func_(intptr_t *i); ++int main() { ++ intptr_t s1 = 5; ++ intptr_t res = f_func_(&s1); ++ printf("%ld\n", res); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main021.c b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main021.c +new file mode 100644 +index 0000000..850d4ad +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main021.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for the return type is float with bindc ++// ++#include ++#include ++extern float f_func_(float *i); ++int main() { ++ float i = 0.5; ++ float res = f_func_(&i); ++ printf("%0.20f\n", res); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main022.c b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main022.c +new file mode 100644 +index 0000000..6340c04 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main022.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for the return type is double with bindc ++// ++#include ++#include ++extern double f_func_(double *i); ++int main() { ++ double i = 0.5; ++ double res = f_func_(&i); ++ printf("%0.20lf\n", res); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main023.c b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main023.c +new file mode 100644 +index 0000000..66a84a1 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main023.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for the return type is long double with bindc ++// ++#include ++#include ++extern long double f_func_(long double *i); ++int main() { ++ long double i = 0.5; ++ long double res = f_func_(&i); ++ printf("%0.20Lf\n", res); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main024.c b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main024.c +new file mode 100644 +index 0000000..c508d13 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main024.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for the return type is float _Complex with bindc ++// ++#include ++#include ++extern float _Complex f_func_(float _Complex *i); ++int main() { ++ float _Complex i; ++ float _Complex res = f_func_(&i); ++ printf("%0.20f + %0.20fi\n", creal(res), cimag(res)); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main025.c b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main025.c +new file mode 100644 +index 0000000..cae3878 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main025.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for the return type is double _Complex with ++// bindc ++// ++#include ++#include ++extern double _Complex f_func_(double _Complex *i); ++int main() { ++ double _Complex i; ++ double _Complex res = f_func_(&i); ++ printf("%0.20lf + %0.20lfi\n", creal(res), cimag(res)); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main026.c b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main026.c +new file mode 100644 +index 0000000..b1aabf8 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main026.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for the return type is long double _Complex with ++// bindc ++// ++#include ++#include ++extern long double _Complex f_func_(long double _Complex *i); ++int main() { ++ long double _Complex i; ++ long double _Complex res = f_func_(&i); ++ printf("%0.20lf + %0.20lfi\n", creal(res), cimag(res)); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main027.c b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main027.c +new file mode 100644 +index 0000000..e90c830 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main027.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for the return type is _Bool with bindc ++// ++#include ++#include ++extern _Bool f_func_(_Bool *i); ++int main() { ++ _Bool i = 0; ++ _Bool res = f_func_(&i); ++ printf("%d\n", res); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main028.c b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main028.c +new file mode 100644 +index 0000000..7885475 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main028.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for the return type is char with bindc ++// ++#include ++#include ++extern char f_func_(char *i); ++int main() { ++ char i; ++ char res = f_func_(&i); ++ printf("%c\n", res); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func001.f90 b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func001.f90 +new file mode 100644 +index 0000000..97fc0ff +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func001.f90 +@@ -0,0 +1,4 @@ ++integer function f_func(i) bind(c, name = "f_func_") ++ integer :: i ++ f_func = 10 + i ++end +diff --git a/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func002.f90 b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func002.f90 +new file mode 100644 +index 0000000..a92967c +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func002.f90 +@@ -0,0 +1,4 @@ ++integer function f_func(i) bind(c, name = "f_func_") ++ integer(2) :: i ++ f_func = 10 + i ++end +diff --git a/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func003.f90 b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func003.f90 +new file mode 100644 +index 0000000..0003034 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func003.f90 +@@ -0,0 +1,4 @@ ++integer function f_func(i) bind(c, name = "f_func_") ++ integer(8) :: i ++ f_func = 10 + i ++end +diff --git a/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func004.f90 b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func004.f90 +new file mode 100644 +index 0000000..0003034 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func004.f90 +@@ -0,0 +1,4 @@ ++integer function f_func(i) bind(c, name = "f_func_") ++ integer(8) :: i ++ f_func = 10 + i ++end +diff --git a/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func005.f90 b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func005.f90 +new file mode 100644 +index 0000000..4a50645 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func005.f90 +@@ -0,0 +1,4 @@ ++integer function f_func(i) bind(c, name = "f_func_") ++ integer(1) :: i ++ f_func = 10 + i ++end +diff --git a/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func006.f90 b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func006.f90 +new file mode 100644 +index 0000000..0003034 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func006.f90 +@@ -0,0 +1,4 @@ ++integer function f_func(i) bind(c, name = "f_func_") ++ integer(8) :: i ++ f_func = 10 + i ++end +diff --git a/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func007.f90 b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func007.f90 +new file mode 100644 +index 0000000..4a50645 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func007.f90 +@@ -0,0 +1,4 @@ ++integer function f_func(i) bind(c, name = "f_func_") ++ integer(1) :: i ++ f_func = 10 + i ++end +diff --git a/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func008.f90 b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func008.f90 +new file mode 100644 +index 0000000..a92967c +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func008.f90 +@@ -0,0 +1,4 @@ ++integer function f_func(i) bind(c, name = "f_func_") ++ integer(2) :: i ++ f_func = 10 + i ++end +diff --git a/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func009.f90 b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func009.f90 +new file mode 100644 +index 0000000..fbe023b +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func009.f90 +@@ -0,0 +1,4 @@ ++integer function f_func(i) bind(c, name = "f_func_") ++ integer(4) :: i ++ f_func = 10 + i ++end +diff --git a/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func010.f90 b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func010.f90 +new file mode 100644 +index 0000000..0003034 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func010.f90 +@@ -0,0 +1,4 @@ ++integer function f_func(i) bind(c, name = "f_func_") ++ integer(8) :: i ++ f_func = 10 + i ++end +diff --git a/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func011.f90 b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func011.f90 +new file mode 100644 +index 0000000..4a50645 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func011.f90 +@@ -0,0 +1,4 @@ ++integer function f_func(i) bind(c, name = "f_func_") ++ integer(1) :: i ++ f_func = 10 + i ++end +diff --git a/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func012.f90 b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func012.f90 +new file mode 100644 +index 0000000..a92967c +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func012.f90 +@@ -0,0 +1,4 @@ ++integer function f_func(i) bind(c, name = "f_func_") ++ integer(2) :: i ++ f_func = 10 + i ++end +diff --git a/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func013.f90 b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func013.f90 +new file mode 100644 +index 0000000..fbe023b +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func013.f90 +@@ -0,0 +1,4 @@ ++integer function f_func(i) bind(c, name = "f_func_") ++ integer(4) :: i ++ f_func = 10 + i ++end +diff --git a/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func014.f90 b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func014.f90 +new file mode 100644 +index 0000000..0003034 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func014.f90 +@@ -0,0 +1,4 @@ ++integer function f_func(i) bind(c, name = "f_func_") ++ integer(8) :: i ++ f_func = 10 + i ++end +diff --git a/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func015.f90 b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func015.f90 +new file mode 100644 +index 0000000..4a50645 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func015.f90 +@@ -0,0 +1,4 @@ ++integer function f_func(i) bind(c, name = "f_func_") ++ integer(1) :: i ++ f_func = 10 + i ++end +diff --git a/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func016.f90 b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func016.f90 +new file mode 100644 +index 0000000..0003034 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func016.f90 +@@ -0,0 +1,4 @@ ++integer function f_func(i) bind(c, name = "f_func_") ++ integer(8) :: i ++ f_func = 10 + i ++end +diff --git a/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func017.f90 b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func017.f90 +new file mode 100644 +index 0000000..0003034 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func017.f90 +@@ -0,0 +1,4 @@ ++integer function f_func(i) bind(c, name = "f_func_") ++ integer(8) :: i ++ f_func = 10 + i ++end +diff --git a/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func018.f90 b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func018.f90 +new file mode 100644 +index 0000000..0003034 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func018.f90 +@@ -0,0 +1,4 @@ ++integer function f_func(i) bind(c, name = "f_func_") ++ integer(8) :: i ++ f_func = 10 + i ++end +diff --git a/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func019.f90 b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func019.f90 +new file mode 100644 +index 0000000..0003034 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func019.f90 +@@ -0,0 +1,4 @@ ++integer function f_func(i) bind(c, name = "f_func_") ++ integer(8) :: i ++ f_func = 10 + i ++end +diff --git a/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func020.f90 b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func020.f90 +new file mode 100644 +index 0000000..0003034 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func020.f90 +@@ -0,0 +1,4 @@ ++integer function f_func(i) bind(c, name = "f_func_") ++ integer(8) :: i ++ f_func = 10 + i ++end +diff --git a/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func021.f90 b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func021.f90 +new file mode 100644 +index 0000000..830bae6 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func021.f90 +@@ -0,0 +1,4 @@ ++real function f_func(i) bind(c, name = "f_func_") ++ real(4) :: i ++ f_func = i + 0.1 ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func022.f90 b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func022.f90 +new file mode 100644 +index 0000000..5e78483 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func022.f90 +@@ -0,0 +1,4 @@ ++real(8) function f_func(i) bind(c, name = "f_func_") ++ real(8) :: i ++ f_func = i + 0.1 ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func023.f90 b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func023.f90 +new file mode 100644 +index 0000000..af3887a +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func023.f90 +@@ -0,0 +1,6 @@ ++function f_func(i) bind(c, name = "f_func_") ++ integer, parameter :: K = selected_real_kind(16) ++ real(K) :: i ++ real(K) :: f_func ++ f_func = i + 0.1 ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func024.f90 b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func024.f90 +new file mode 100644 +index 0000000..62de96e +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func024.f90 +@@ -0,0 +1,4 @@ ++complex(4) function f_func(i) bind(c, name = "f_func_") ++ complex(4) :: i ++ f_func = (-12345678.7654321, 1) ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func025.f90 b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func025.f90 +new file mode 100644 +index 0000000..9474d00 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func025.f90 +@@ -0,0 +1,4 @@ ++complex(8) function f_func(i) bind(c, name = "f_func_") ++ complex(8) :: i ++ f_func = (-12345678.7654321, 1) ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func026.f90 b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func026.f90 +new file mode 100644 +index 0000000..4221aff +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func026.f90 +@@ -0,0 +1,6 @@ ++function f_func(i) bind(c, name = "f_func_") ++ integer, parameter :: K = selected_real_kind(16) ++ complex(K) :: i ++ complex(K) :: f_func ++ f_func = (-12345678.7654321, 1) ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func027.f90 b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func027.f90 +new file mode 100644 +index 0000000..d6a9631 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func027.f90 +@@ -0,0 +1,4 @@ ++logical function f_func(i) bind(c, name = "f_func_") ++ logical(1) :: i ++ f_func = .TRUE. ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func028.f90 b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func028.f90 +new file mode 100644 +index 0000000..ae4df1e +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func028.f90 +@@ -0,0 +1,4 @@ ++character function f_func(i) bind(c, name = "f_func_") ++ character :: i ++ f_func = 'a' ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/result.md b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/result.md +new file mode 100644 +index 0000000..3d13906 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/result.md +@@ -0,0 +1,29 @@ ++ | test | gfortran | flang | ++ | 001 | PASS | PASS | ++ | 002 | PASS | PASS | ++ | 003 | PASS | PASS | ++ | 004 | PASS | PASS | ++ | 005 | PASS | PASS | ++ | 006 | PASS | PASS | ++ | 007 | PASS | PASS | ++ | 008 | PASS | PASS | ++ | 009 | PASS | PASS | ++ | 010 | PASS | PASS | ++ | 011 | PASS | PASS | ++ | 012 | PASS | PASS | ++ | 013 | PASS | PASS | ++ | 014 | PASS | PASS | ++ | 015 | PASS | PASS | ++ | 016 | PASS | PASS | ++ | 017 | PASS | PASS | ++ | 018 | PASS | PASS | ++ | 019 | PASS | PASS | ++ | 020 | PASS | PASS | ++ | 021 | PASS | PASS | ++ | 022 | PASS | PASS | ++ | 023 | PASS | PASS | ++ | 024 | PASS | PASS | ++ | 025 | PASS | PASS | ++ | 026 | PASS | ERROR | ++ | 027 | PASS | PASS | ++ | 028 | PASS | ERROR | +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/run.sh b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/run.sh +new file mode 100644 +index 0000000..5b2202e +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/run.sh +@@ -0,0 +1,16 @@ ++for i in {001..028} ++do ++echo "------- test $i ------." ++echo "----- gfortran result:" ++gcc c_main$i.c -c -o c-test.o ++gfortran fortran_func$i.f90 -fno-range-check -c -o fortran-test.o ++gfortran fortran-test.o c-test.o ++./a.out ++rm *.o a.out ++echo "----- flang-new result : " ++clang c_main$i.c -c -o c-test.o ++flang-new fortran_func$i.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o a.out ++done +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main001.c b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main001.c +new file mode 100644 +index 0000000..8eb1204 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main001.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for the return type is ptr of type int ++// ++#include ++extern int* f_func_(int *i); ++int main() { ++ int s1 = 5; ++ int *res = f_func_(&s1); ++ printf("%d\n", *res); ++} ++ +diff --git a/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main002.c b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main002.c +new file mode 100644 +index 0000000..325438b +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main002.c +@@ -0,0 +1,9 @@ ++// Test c call fortran for the return type is ptr of type short ++// ++#include ++extern short* f_func_(short *i); ++int main() { ++ short s1 = 5; ++ short *res = f_func_(&s1); ++ printf("%hd\n", *res); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main003.c b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main003.c +new file mode 100644 +index 0000000..3afb3b2 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main003.c +@@ -0,0 +1,9 @@ ++// Test c call fortran for the return type is ptr of type long ++// ++#include ++extern long* f_func_(long *i); ++int main() { ++ long s1 = 5; ++ long *res = f_func_(&s1); ++ printf("%ld\n", *res); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main004.c b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main004.c +new file mode 100644 +index 0000000..d1031ab +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main004.c +@@ -0,0 +1,9 @@ ++// Test c call fortran for the return type is ptr of type long long ++// ++#include ++extern long long* f_func_(long long *i); ++int main() { ++ long long s1 = 5; ++ long long *res = f_func_(&s1); ++ printf("%Ld\n", *res); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main005.c b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main005.c +new file mode 100644 +index 0000000..51b51d4 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main005.c +@@ -0,0 +1,9 @@ ++// Test c call fortran for the return type is ptr of type signed char ++// ++#include ++extern signed char* f_func_(signed char *i); ++int main() { ++ signed char s1 = 85; ++ signed char *res = f_func_(&s1); ++ printf("%c\n", *res); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main006.c b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main006.c +new file mode 100644 +index 0000000..cd3e8bb +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main006.c +@@ -0,0 +1,9 @@ ++// Test c call fortran for the return type is ptr of type size_t ++// ++#include ++extern size_t* f_func_(size_t *i); ++int main() { ++ size_t s1 = 5; ++ size_t *res = f_func_(&s1); ++ printf("%ld\n", *res); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main007.c b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main007.c +new file mode 100644 +index 0000000..aff24d6 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main007.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for the return type is ptr of type int8_t ++// ++#include ++#include ++extern int8_t* f_func_(int8_t *i); ++int main() { ++ int8_t s1 = 5; ++ int8_t *res = f_func_(&s1); ++ printf("%hhd\n", *res); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main008.c b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main008.c +new file mode 100644 +index 0000000..fa388de +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main008.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for the return type is ptr of type int16_t ++// ++#include ++#include ++extern int16_t* f_func_(int16_t *i); ++int main() { ++ int16_t s1 = 5; ++ int16_t *res = f_func_(&s1); ++ printf("%hd\n", *res); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main009.c b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main009.c +new file mode 100644 +index 0000000..12fc747 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main009.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for the return type is ptr of type int32_t ++// ++#include ++#include ++extern int32_t* f_func_(int32_t *i); ++int main() { ++ int32_t s1 = 5; ++ int32_t *res = f_func_(&s1); ++ printf("%d\n", *res); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main010.c b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main010.c +new file mode 100644 +index 0000000..0154808 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main010.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for the return type is ptr of type int64_t ++// ++#include ++#include ++extern int64_t* f_func_(int64_t *i); ++int main() { ++ int64_t s1 = 5; ++ int64_t *res = f_func_(&s1); ++ printf("%ld\n", *res); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main011.c b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main011.c +new file mode 100644 +index 0000000..8ea7c30 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main011.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for the return type is ptr of type int_least8_t ++// ++#include ++#include ++extern int_least8_t* f_func_(int_least8_t *i); ++int main() { ++ int_least8_t s1 = 5; ++ int_least8_t *res = f_func_(&s1); ++ printf("%hhd\n", *res); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main012.c b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main012.c +new file mode 100644 +index 0000000..aac8267 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main012.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for the return type is ptr of type int_least16_t ++// ++#include ++#include ++extern int_least16_t* f_func_(int_least16_t *i); ++int main() { ++ int_least16_t s1 = 5; ++ int_least16_t *res = f_func_(&s1); ++ printf("%hd\n", *res); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main013.c b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main013.c +new file mode 100644 +index 0000000..679a0b0 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main013.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for the return type is ptr of type int_least32_t ++// ++#include ++#include ++extern int_least32_t* f_func_(int_least32_t *i); ++int main() { ++ int_least32_t s1 = 5; ++ int_least32_t *res = f_func_(&s1); ++ printf("%d\n", *res); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main014.c b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main014.c +new file mode 100644 +index 0000000..451e0af +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main014.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for the return type is ptr of type int_least64_t ++// ++#include ++#include ++extern int_least64_t* f_func_(int_least64_t *i); ++int main() { ++ int_least64_t s1 = 5; ++ int_least64_t *res = f_func_(&s1); ++ printf("%ld\n", *res); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main015.c b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main015.c +new file mode 100644 +index 0000000..c71eb46 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main015.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for the return type is ptr of type int_fast8_t ++// ++#include ++#include ++extern int_fast8_t* f_func_(int_fast8_t *i); ++int main() { ++ int_fast8_t s1 = 5; ++ int_fast8_t *res = f_func_(&s1); ++ printf("%hhd\n", *res); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main016.c b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main016.c +new file mode 100644 +index 0000000..14ef2eb +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main016.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for the return type is ptr of type int_fast16_t ++// ++#include ++#include ++extern int_fast16_t* f_func_(int_fast16_t *i); ++int main() { ++ int_fast16_t s1 = 5; ++ int_fast16_t *res = f_func_(&s1); ++ printf("%ld\n", *res); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main017.c b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main017.c +new file mode 100644 +index 0000000..7539524 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main017.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for the return type is ptr of type int_fast32_t ++// ++#include ++#include ++extern int_fast32_t* f_func_(int_fast32_t *i); ++int main() { ++ int_fast32_t s1 = 5; ++ int_fast32_t *res = f_func_(&s1); ++ printf("%ld\n", *res); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main018.c b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main018.c +new file mode 100644 +index 0000000..fa74746 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main018.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for the return type is ptr of type int_fast64_t ++// ++#include ++#include ++extern int_fast64_t* f_func_(int_fast64_t *i); ++int main() { ++ int_fast64_t s1 = 5; ++ int_fast64_t *res = f_func_(&s1); ++ printf("%ld\n", *res); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main019.c b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main019.c +new file mode 100644 +index 0000000..88b466c +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main019.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for the return type is ptr of type intmax_t ++// ++#include ++#include ++extern intmax_t* f_func_(intmax_t *i); ++int main() { ++ intmax_t s1 = 5; ++ intmax_t *res = f_func_(&s1); ++ printf("%ld\n", *res); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main020.c b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main020.c +new file mode 100644 +index 0000000..198ff81 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main020.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for the return type is ptr of type intptr_t ++// ++#include ++#include ++extern intptr_t* f_func_(intptr_t *i); ++int main() { ++ intptr_t s1 = 5; ++ intptr_t *res = f_func_(&s1); ++ printf("%ld\n", *res); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main021.c b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main021.c +new file mode 100644 +index 0000000..381859e +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main021.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for the return type is ptr of type float ++// ++#include ++#include ++extern float* f_func_(float *i); ++int main() { ++ float i = 0.5; ++ float *res = f_func_(&i); ++ printf("%0.20f\n", *res); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main022.c b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main022.c +new file mode 100644 +index 0000000..082273e +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main022.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for the return type is ptr of type double ++// ++#include ++#include ++extern double* f_func_(double *i); ++int main() { ++ double i = 0.5; ++ double *res = f_func_(&i); ++ printf("%0.20lf\n", *res); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main023.c b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main023.c +new file mode 100644 +index 0000000..1e4934d +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main023.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for the return type is ptr of type long double ++// ++#include ++#include ++extern long double* f_func_(long double *i); ++int main() { ++ long double i = 0.5; ++ long double *res = f_func_(&i); ++ printf("%0.20Lf\n", *res); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main024.c b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main024.c +new file mode 100644 +index 0000000..e34d02b +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main024.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for the return type is ptr of type float ++// _Complex ++// ++#include ++#include ++extern float _Complex* f_func_(float _Complex *i); ++int main() { ++ float _Complex i; ++ float _Complex *res = f_func_(&i); ++ printf("%0.20f + %0.20fi\n", creal(*res), cimag(*res)); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main025.c b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main025.c +new file mode 100644 +index 0000000..fc3dd26 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main025.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for the return type is ptr of type double ++// _Complex ++// ++#include ++#include ++extern double _Complex* f_func_(double _Complex *i); ++int main() { ++ double _Complex i; ++ double _Complex *res = f_func_(&i); ++ printf("%0.20lf + %0.20lfi\n", creal(*res), cimag(*res)); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main026.c b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main026.c +new file mode 100644 +index 0000000..b2f0dc3 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main026.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for the return type is ptr of type long double ++// _Complex ++// ++#include ++#include ++extern long double _Complex* f_func_(long double _Complex *i); ++int main() { ++ long double _Complex i; ++ long double _Complex *res = f_func_(&i); ++ printf("%0.20lf + %0.20lfi\n", creal(*res), cimag(*res)); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main027.c b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main027.c +new file mode 100644 +index 0000000..081b376 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main027.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for the return type is ptr of type _Bool ++// ++#include ++#include ++extern _Bool* f_func_(_Bool *i); ++int main() { ++ _Bool i = 0; ++ _Bool *res = f_func_(&i); ++ printf("%d\n", *res); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main028.c b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main028.c +new file mode 100644 +index 0000000..a12499d +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main028.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for the return type is ptr of type char ++// ++#include ++#include ++extern char* f_func_(char *i); ++int main() { ++ char i; ++ char *res = f_func_(&i); ++ printf("%c\n", *res); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func001.f90 b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func001.f90 +new file mode 100644 +index 0000000..d8cce54 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func001.f90 +@@ -0,0 +1,6 @@ ++function f_func(b) result(res) ++ integer, target :: b ++ integer, pointer :: res ++ b = b + 1 ++ res => b ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func002.f90 b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func002.f90 +new file mode 100644 +index 0000000..393d5dc +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func002.f90 +@@ -0,0 +1,6 @@ ++function f_func(b) result(res) ++ integer(2), target :: b ++ integer(2), pointer :: res ++ b = b + 1 ++ res => b ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func003.f90 b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func003.f90 +new file mode 100644 +index 0000000..3080e86 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func003.f90 +@@ -0,0 +1,6 @@ ++function f_func(b) result(res) ++ integer(8), target :: b ++ integer(8), pointer :: res ++ b = b + 1 ++ res => b ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func004.f90 b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func004.f90 +new file mode 100644 +index 0000000..3080e86 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func004.f90 +@@ -0,0 +1,6 @@ ++function f_func(b) result(res) ++ integer(8), target :: b ++ integer(8), pointer :: res ++ b = b + 1 ++ res => b ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func005.f90 b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func005.f90 +new file mode 100644 +index 0000000..6b52903 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func005.f90 +@@ -0,0 +1,6 @@ ++function f_func(b) result(res) ++ integer(1), target :: b ++ integer(1), pointer :: res ++ b = b + 1 ++ res => b ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func006.f90 b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func006.f90 +new file mode 100644 +index 0000000..3080e86 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func006.f90 +@@ -0,0 +1,6 @@ ++function f_func(b) result(res) ++ integer(8), target :: b ++ integer(8), pointer :: res ++ b = b + 1 ++ res => b ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func007.f90 b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func007.f90 +new file mode 100644 +index 0000000..6b52903 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func007.f90 +@@ -0,0 +1,6 @@ ++function f_func(b) result(res) ++ integer(1), target :: b ++ integer(1), pointer :: res ++ b = b + 1 ++ res => b ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func008.f90 b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func008.f90 +new file mode 100644 +index 0000000..393d5dc +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func008.f90 +@@ -0,0 +1,6 @@ ++function f_func(b) result(res) ++ integer(2), target :: b ++ integer(2), pointer :: res ++ b = b + 1 ++ res => b ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func009.f90 b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func009.f90 +new file mode 100644 +index 0000000..50d1fb2 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func009.f90 +@@ -0,0 +1,6 @@ ++function f_func(b) result(res) ++ integer(4), target :: b ++ integer(4), pointer :: res ++ b = b + 1 ++ res => b ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func010.f90 b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func010.f90 +new file mode 100644 +index 0000000..3080e86 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func010.f90 +@@ -0,0 +1,6 @@ ++function f_func(b) result(res) ++ integer(8), target :: b ++ integer(8), pointer :: res ++ b = b + 1 ++ res => b ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func011.f90 b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func011.f90 +new file mode 100644 +index 0000000..6b52903 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func011.f90 +@@ -0,0 +1,6 @@ ++function f_func(b) result(res) ++ integer(1), target :: b ++ integer(1), pointer :: res ++ b = b + 1 ++ res => b ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func012.f90 b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func012.f90 +new file mode 100644 +index 0000000..393d5dc +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func012.f90 +@@ -0,0 +1,6 @@ ++function f_func(b) result(res) ++ integer(2), target :: b ++ integer(2), pointer :: res ++ b = b + 1 ++ res => b ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func013.f90 b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func013.f90 +new file mode 100644 +index 0000000..50d1fb2 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func013.f90 +@@ -0,0 +1,6 @@ ++function f_func(b) result(res) ++ integer(4), target :: b ++ integer(4), pointer :: res ++ b = b + 1 ++ res => b ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func014.f90 b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func014.f90 +new file mode 100644 +index 0000000..3080e86 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func014.f90 +@@ -0,0 +1,6 @@ ++function f_func(b) result(res) ++ integer(8), target :: b ++ integer(8), pointer :: res ++ b = b + 1 ++ res => b ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func015.f90 b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func015.f90 +new file mode 100644 +index 0000000..6b52903 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func015.f90 +@@ -0,0 +1,6 @@ ++function f_func(b) result(res) ++ integer(1), target :: b ++ integer(1), pointer :: res ++ b = b + 1 ++ res => b ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func016.f90 b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func016.f90 +new file mode 100644 +index 0000000..3080e86 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func016.f90 +@@ -0,0 +1,6 @@ ++function f_func(b) result(res) ++ integer(8), target :: b ++ integer(8), pointer :: res ++ b = b + 1 ++ res => b ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func017.f90 b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func017.f90 +new file mode 100644 +index 0000000..3080e86 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func017.f90 +@@ -0,0 +1,6 @@ ++function f_func(b) result(res) ++ integer(8), target :: b ++ integer(8), pointer :: res ++ b = b + 1 ++ res => b ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func018.f90 b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func018.f90 +new file mode 100644 +index 0000000..3080e86 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func018.f90 +@@ -0,0 +1,6 @@ ++function f_func(b) result(res) ++ integer(8), target :: b ++ integer(8), pointer :: res ++ b = b + 1 ++ res => b ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func019.f90 b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func019.f90 +new file mode 100644 +index 0000000..3080e86 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func019.f90 +@@ -0,0 +1,6 @@ ++function f_func(b) result(res) ++ integer(8), target :: b ++ integer(8), pointer :: res ++ b = b + 1 ++ res => b ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func020.f90 b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func020.f90 +new file mode 100644 +index 0000000..3080e86 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func020.f90 +@@ -0,0 +1,6 @@ ++function f_func(b) result(res) ++ integer(8), target :: b ++ integer(8), pointer :: res ++ b = b + 1 ++ res => b ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func021.f90 b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func021.f90 +new file mode 100644 +index 0000000..72c883d +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func021.f90 +@@ -0,0 +1,6 @@ ++function f_func(i) result(res) ++ real(4), target :: i ++ real(4), pointer :: res ++ i = i + 0.1 ++ res => i ++end +diff --git a/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func022.f90 b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func022.f90 +new file mode 100644 +index 0000000..9c29036 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func022.f90 +@@ -0,0 +1,6 @@ ++function f_func(i) result(res) ++ real(8), target :: i ++ real(8), pointer :: res ++ i = i + 0.1 ++ res => i ++end +diff --git a/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func023.f90 b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func023.f90 +new file mode 100644 +index 0000000..2304e96 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func023.f90 +@@ -0,0 +1,7 @@ ++function f_func(i) result(res) ++ integer, parameter :: K = selected_real_kind(16) ++ real(K), target :: i ++ real(K), pointer :: res ++ i = i + 0.1 ++ res => i ++end +diff --git a/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func024.f90 b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func024.f90 +new file mode 100644 +index 0000000..bd11ffd +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func024.f90 +@@ -0,0 +1,6 @@ ++function f_func(i) result(res) ++ complex(4), target :: i ++ complex(4), pointer :: res ++ i = (-12345678.7654321, 1) ++ res => i ++end +diff --git a/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func025.f90 b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func025.f90 +new file mode 100644 +index 0000000..b67ac5d +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func025.f90 +@@ -0,0 +1,6 @@ ++function f_func(i) result(res) ++ complex(8), target :: i ++ complex(8), pointer :: res ++ i = (-12345678.7654321, 1) ++ res => i ++end +diff --git a/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func026.f90 b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func026.f90 +new file mode 100644 +index 0000000..aaad4f2 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func026.f90 +@@ -0,0 +1,7 @@ ++function f_func(i) result(res) ++ integer, parameter :: K = selected_real_kind(16) ++ complex(K), target :: i ++ complex(K), pointer :: res ++ i = (-12345678.7654321, 1) ++ res => i ++end +diff --git a/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func027.f90 b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func027.f90 +new file mode 100644 +index 0000000..51a5ae5 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func027.f90 +@@ -0,0 +1,6 @@ ++function f_func(b) result(res) ++ logical(1), target :: b ++ logical(1), pointer :: res ++ b = .TRUE. ++ res => b ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func028.f90 b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func028.f90 +new file mode 100644 +index 0000000..6487ee2 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func028.f90 +@@ -0,0 +1,6 @@ ++function f_func(b) result(res) ++ character(1), target :: b ++ character(1), pointer :: res ++ b = 'a' ++ res => b ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/result.md b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/result.md +new file mode 100644 +index 0000000..1f6658e +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/result.md +@@ -0,0 +1,29 @@ ++ | test | gfortran | flang | ++ | 001 | PASS | ERROR | ++ | 002 | PASS | ERROR | ++ | 003 | PASS | ERROR | ++ | 004 | PASS | ERROR | ++ | 005 | PASS | ERROR | ++ | 006 | PASS | ERROR | ++ | 007 | PASS | ERROR | ++ | 008 | PASS | ERROR | ++ | 009 | PASS | ERROR | ++ | 010 | PASS | ERROR | ++ | 011 | PASS | ERROR | ++ | 012 | PASS | ERROR | ++ | 013 | PASS | ERROR | ++ | 014 | PASS | ERROR | ++ | 015 | PASS | ERROR | ++ | 016 | PASS | ERROR | ++ | 017 | PASS | ERROR | ++ | 018 | PASS | ERROR | ++ | 019 | PASS | ERROR | ++ | 020 | PASS | ERROR | ++ | 021 | PASS | ERROR | ++ | 022 | PASS | ERROR | ++ | 023 | PASS | ERROR | ++ | 024 | PASS | ERROR | ++ | 025 | PASS | PASS | ++ | 026 | PASS | PASS | ++ | 027 | PASS | ERROR | ++ | 028 | ERROR | ERROR | +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/run.sh b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/run.sh +new file mode 100644 +index 0000000..5b2202e +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/run.sh +@@ -0,0 +1,16 @@ ++for i in {001..028} ++do ++echo "------- test $i ------." ++echo "----- gfortran result:" ++gcc c_main$i.c -c -o c-test.o ++gfortran fortran_func$i.f90 -fno-range-check -c -o fortran-test.o ++gfortran fortran-test.o c-test.o ++./a.out ++rm *.o a.out ++echo "----- flang-new result : " ++clang c_main$i.c -c -o c-test.o ++flang-new fortran_func$i.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o a.out ++done +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main001.c b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main001.c +new file mode 100644 +index 0000000..b615d87 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main001.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for the return type is ptr of type int with ++// bindc ++// ++#include ++extern int* f_func_(int *i); ++int main() { ++ int s1 = 5; ++ int *res = f_func_(&s1); ++ printf("%d\n", *res); ++} ++ +diff --git a/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main002.c b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main002.c +new file mode 100644 +index 0000000..6012316 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main002.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for the return type is ptr of type short with ++// bindc ++// ++#include ++extern short* f_func_(short *i); ++int main() { ++ short s1 = 5; ++ short *res = f_func_(&s1); ++ printf("%hd\n", *res); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main003.c b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main003.c +new file mode 100644 +index 0000000..a6aef18 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main003.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for the return type is ptr of type long with ++// bindc ++// ++#include ++extern long* f_func_(long *i); ++int main() { ++ long s1 = 5; ++ long *res = f_func_(&s1); ++ printf("%ld\n", *res); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main004.c b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main004.c +new file mode 100644 +index 0000000..342c438 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main004.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for the return type is ptr of type long long ++// with bindc ++// ++#include ++extern long long* f_func_(long long *i); ++int main() { ++ long long s1 = 5; ++ long long *res = f_func_(&s1); ++ printf("%Ld\n", *res); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main005.c b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main005.c +new file mode 100644 +index 0000000..d4e4f55 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main005.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for the return type is ptr of type signed char ++// with bindc ++// ++#include ++extern signed char* f_func_(signed char *i); ++int main() { ++ signed char s1 = 85; ++ signed char *res = f_func_(&s1); ++ printf("%c\n", *res); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main006.c b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main006.c +new file mode 100644 +index 0000000..5f0663e +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main006.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for the return type is ptr of type size_t with ++// bindc ++// ++#include ++extern size_t* f_func_(size_t *i); ++int main() { ++ size_t s1 = 5; ++ size_t *res = f_func_(&s1); ++ printf("%ld\n", *res); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main007.c b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main007.c +new file mode 100644 +index 0000000..dd19a2c +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main007.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for the return type is ptr of type int8_t with ++// bindc ++// ++#include ++#include ++extern int8_t* f_func_(int8_t *i); ++int main() { ++ int8_t s1 = 5; ++ int8_t *res = f_func_(&s1); ++ printf("%hhd\n", *res); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main008.c b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main008.c +new file mode 100644 +index 0000000..c8a62df +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main008.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for the return type is ptr of type int16_t with ++// bindc ++// ++#include ++#include ++extern int16_t* f_func_(int16_t *i); ++int main() { ++ int16_t s1 = 5; ++ int16_t *res = f_func_(&s1); ++ printf("%hd\n", *res); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main009.c b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main009.c +new file mode 100644 +index 0000000..992c05d +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main009.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for the return type is ptr of type int32_t with ++// bindc ++// ++#include ++#include ++extern int32_t* f_func_(int32_t *i); ++int main() { ++ int32_t s1 = 5; ++ int32_t *res = f_func_(&s1); ++ printf("%d\n", *res); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main010.c b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main010.c +new file mode 100644 +index 0000000..44843b1 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main010.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for the return type is ptr of type int64_t with ++// bindc ++// ++#include ++#include ++extern int64_t* f_func_(int64_t *i); ++int main() { ++ int64_t s1 = 5; ++ int64_t *res = f_func_(&s1); ++ printf("%ld\n", *res); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main011.c b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main011.c +new file mode 100644 +index 0000000..5fc5115 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main011.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for the return type is ptr of type int_least8_t ++// with bindc ++// ++#include ++#include ++extern int_least8_t* f_func_(int_least8_t *i); ++int main() { ++ int_least8_t s1 = 5; ++ int_least8_t *res = f_func_(&s1); ++ printf("%hhd\n", *res); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main012.c b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main012.c +new file mode 100644 +index 0000000..2a51a21 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main012.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for the return type is ptr of type int_least16_t ++// with bindc ++// ++#include ++#include ++extern int_least16_t* f_func_(int_least16_t *i); ++int main() { ++ int_least16_t s1 = 5; ++ int_least16_t *res = f_func_(&s1); ++ printf("%hd\n", *res); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main013.c b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main013.c +new file mode 100644 +index 0000000..ab81bab +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main013.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for the return type is ptr of type int_least32_t ++// with bindc ++// ++#include ++#include ++extern int_least32_t* f_func_(int_least32_t *i); ++int main() { ++ int_least32_t s1 = 5; ++ int_least32_t *res = f_func_(&s1); ++ printf("%d\n", *res); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main014.c b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main014.c +new file mode 100644 +index 0000000..9576f05 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main014.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for the return type is ptr of type int_least64_t ++// with bindc ++// ++#include ++#include ++extern int_least64_t* f_func_(int_least64_t *i); ++int main() { ++ int_least64_t s1 = 5; ++ int_least64_t *res = f_func_(&s1); ++ printf("%ld\n", *res); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main015.c b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main015.c +new file mode 100644 +index 0000000..c23aeca +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main015.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for the return type is ptr of type int_fast8_t ++// with bindc ++// ++#include ++#include ++extern int_fast8_t* f_func_(int_fast8_t *i); ++int main() { ++ int_fast8_t s1 = 5; ++ int_fast8_t *res = f_func_(&s1); ++ printf("%hhd\n", *res); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main016.c b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main016.c +new file mode 100644 +index 0000000..dfa53bf +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main016.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for the return type is ptr of type int_fast16_t ++// with bindc ++// ++#include ++#include ++extern int_fast16_t* f_func_(int_fast16_t *i); ++int main() { ++ int_fast16_t s1 = 5; ++ int_fast16_t *res = f_func_(&s1); ++ printf("%ld\n", *res); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main017.c b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main017.c +new file mode 100644 +index 0000000..e9414da +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main017.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for the return type is ptr of type int_fast32_t ++// with bindc ++// ++#include ++#include ++extern int_fast32_t* f_func_(int_fast32_t *i); ++int main() { ++ int_fast32_t s1 = 5; ++ int_fast32_t *res = f_func_(&s1); ++ printf("%ld\n", *res); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main018.c b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main018.c +new file mode 100644 +index 0000000..7b84fdf +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main018.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for the return type is ptr of type int_fast64_t ++// with bindc ++// ++#include ++#include ++extern int_fast64_t* f_func_(int_fast64_t *i); ++int main() { ++ int_fast64_t s1 = 5; ++ int_fast64_t *res = f_func_(&s1); ++ printf("%ld\n", *res); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main019.c b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main019.c +new file mode 100644 +index 0000000..9a74d6c +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main019.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for the return type is ptr of type intmax_t with ++// bindc ++// ++#include ++#include ++extern intmax_t* f_func_(intmax_t *i); ++int main() { ++ intmax_t s1 = 5; ++ intmax_t *res = f_func_(&s1); ++ printf("%ld\n", *res); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main020.c b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main020.c +new file mode 100644 +index 0000000..7f073be +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main020.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for the return type is ptr of type intptr_t with ++// bindc ++// ++#include ++#include ++extern intptr_t* f_func_(intptr_t *i); ++int main() { ++ intptr_t s1 = 5; ++ intptr_t *res = f_func_(&s1); ++ printf("%ld\n", *res); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main021.c b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main021.c +new file mode 100644 +index 0000000..ab108c2 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main021.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for the return type is ptr of type float with ++// bindc ++// ++#include ++#include ++extern float* f_func_(float *i); ++int main() { ++ float i = 0.5; ++ float *res = f_func_(&i); ++ printf("%0.20f\n", *res); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main022.c b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main022.c +new file mode 100644 +index 0000000..c814ef4 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main022.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for the return type is ptr of type double with ++// bindc ++// ++#include ++#include ++extern double* f_func_(double *i); ++int main() { ++ double i = 0.5; ++ double *res = f_func_(&i); ++ printf("%0.20lf\n", *res); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main023.c b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main023.c +new file mode 100644 +index 0000000..707b692 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main023.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for the return type is ptr of type long double ++// with bindc ++// ++#include ++#include ++extern long double* f_func_(long double *i); ++int main() { ++ long double i = 0.5; ++ long double *res = f_func_(&i); ++ printf("%0.20Lf\n", *res); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main024.c b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main024.c +new file mode 100644 +index 0000000..ff6af62 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main024.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for the return type is ptr of type float ++// _Complex with bindc ++// ++#include ++#include ++extern float _Complex* f_func_(float _Complex *i); ++int main() { ++ float _Complex i; ++ float _Complex *res = f_func_(&i); ++ printf("%0.20f + %0.20fi\n", creal(*res), cimag(*res)); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main025.c b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main025.c +new file mode 100644 +index 0000000..9d0e8b3 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main025.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for the return type is ptr of type double ++// _Complex with bindc ++// ++#include ++#include ++extern double _Complex* f_func_(double _Complex *i); ++int main() { ++ double _Complex i; ++ double _Complex *res = f_func_(&i); ++ printf("%0.20lf + %0.20lfi\n", creal(*res), cimag(*res)); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main026.c b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main026.c +new file mode 100644 +index 0000000..7751d18 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main026.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for the return type is ptr of type long double ++// _Complex with bindc ++// ++#include ++#include ++extern long double _Complex* f_func_(long double _Complex *i); ++int main() { ++ long double _Complex i; ++ long double _Complex *res = f_func_(&i); ++ printf("%0.20lf + %0.20lfi\n", creal(*res), cimag(*res)); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main027.c b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main027.c +new file mode 100644 +index 0000000..3a8a3de +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main027.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for the return type is ptr of type _Bool with ++// bindc ++// ++#include ++#include ++extern _Bool* f_func_(_Bool *i); ++int main() { ++ _Bool i = 0; ++ _Bool *res = f_func_(&i); ++ printf("%d\n", *res); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main028.c b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main028.c +new file mode 100644 +index 0000000..1184003 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main028.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for the return type is ptr of type char with ++// bindc ++// ++#include ++#include ++extern char* f_func_(char *i); ++int main() { ++ char i; ++ char *res = f_func_(&i); ++ printf("%c\n", *res); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func001.f90 b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func001.f90 +new file mode 100644 +index 0000000..c36beda +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func001.f90 +@@ -0,0 +1,6 @@ ++function f_func(b) result(res) bind(c, name = "f_func_") ++ integer, target :: b ++ integer, pointer :: res ++ b = b + 1 ++ res => b ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func002.f90 b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func002.f90 +new file mode 100644 +index 0000000..e3e115d +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func002.f90 +@@ -0,0 +1,6 @@ ++function f_func(b) result(res) bind(c, name = "f_func_") ++ integer(2), target :: b ++ integer(2), pointer :: res ++ b = b + 1 ++ res => b ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func003.f90 b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func003.f90 +new file mode 100644 +index 0000000..98b5ce1 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func003.f90 +@@ -0,0 +1,6 @@ ++function f_func(b) result(res) bind(c, name = "f_func_") ++ integer(8), target :: b ++ integer(8), pointer :: res ++ b = b + 1 ++ res => b ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func004.f90 b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func004.f90 +new file mode 100644 +index 0000000..98b5ce1 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func004.f90 +@@ -0,0 +1,6 @@ ++function f_func(b) result(res) bind(c, name = "f_func_") ++ integer(8), target :: b ++ integer(8), pointer :: res ++ b = b + 1 ++ res => b ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func005.f90 b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func005.f90 +new file mode 100644 +index 0000000..a86b428 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func005.f90 +@@ -0,0 +1,6 @@ ++function f_func(b) result(res) bind(c, name = "f_func_") ++ integer(1), target :: b ++ integer(1), pointer :: res ++ b = b + 1 ++ res => b ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func006.f90 b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func006.f90 +new file mode 100644 +index 0000000..98b5ce1 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func006.f90 +@@ -0,0 +1,6 @@ ++function f_func(b) result(res) bind(c, name = "f_func_") ++ integer(8), target :: b ++ integer(8), pointer :: res ++ b = b + 1 ++ res => b ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func007.f90 b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func007.f90 +new file mode 100644 +index 0000000..a86b428 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func007.f90 +@@ -0,0 +1,6 @@ ++function f_func(b) result(res) bind(c, name = "f_func_") ++ integer(1), target :: b ++ integer(1), pointer :: res ++ b = b + 1 ++ res => b ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func008.f90 b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func008.f90 +new file mode 100644 +index 0000000..e3e115d +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func008.f90 +@@ -0,0 +1,6 @@ ++function f_func(b) result(res) bind(c, name = "f_func_") ++ integer(2), target :: b ++ integer(2), pointer :: res ++ b = b + 1 ++ res => b ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func009.f90 b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func009.f90 +new file mode 100644 +index 0000000..c5e3ff3 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func009.f90 +@@ -0,0 +1,6 @@ ++function f_func(b) result(res) bind(c, name = "f_func_") ++ integer(4), target :: b ++ integer(4), pointer :: res ++ b = b + 1 ++ res => b ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func010.f90 b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func010.f90 +new file mode 100644 +index 0000000..98b5ce1 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func010.f90 +@@ -0,0 +1,6 @@ ++function f_func(b) result(res) bind(c, name = "f_func_") ++ integer(8), target :: b ++ integer(8), pointer :: res ++ b = b + 1 ++ res => b ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func011.f90 b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func011.f90 +new file mode 100644 +index 0000000..a86b428 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func011.f90 +@@ -0,0 +1,6 @@ ++function f_func(b) result(res) bind(c, name = "f_func_") ++ integer(1), target :: b ++ integer(1), pointer :: res ++ b = b + 1 ++ res => b ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func012.f90 b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func012.f90 +new file mode 100644 +index 0000000..e3e115d +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func012.f90 +@@ -0,0 +1,6 @@ ++function f_func(b) result(res) bind(c, name = "f_func_") ++ integer(2), target :: b ++ integer(2), pointer :: res ++ b = b + 1 ++ res => b ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func013.f90 b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func013.f90 +new file mode 100644 +index 0000000..c5e3ff3 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func013.f90 +@@ -0,0 +1,6 @@ ++function f_func(b) result(res) bind(c, name = "f_func_") ++ integer(4), target :: b ++ integer(4), pointer :: res ++ b = b + 1 ++ res => b ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func014.f90 b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func014.f90 +new file mode 100644 +index 0000000..98b5ce1 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func014.f90 +@@ -0,0 +1,6 @@ ++function f_func(b) result(res) bind(c, name = "f_func_") ++ integer(8), target :: b ++ integer(8), pointer :: res ++ b = b + 1 ++ res => b ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func015.f90 b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func015.f90 +new file mode 100644 +index 0000000..a86b428 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func015.f90 +@@ -0,0 +1,6 @@ ++function f_func(b) result(res) bind(c, name = "f_func_") ++ integer(1), target :: b ++ integer(1), pointer :: res ++ b = b + 1 ++ res => b ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func016.f90 b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func016.f90 +new file mode 100644 +index 0000000..98b5ce1 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func016.f90 +@@ -0,0 +1,6 @@ ++function f_func(b) result(res) bind(c, name = "f_func_") ++ integer(8), target :: b ++ integer(8), pointer :: res ++ b = b + 1 ++ res => b ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func017.f90 b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func017.f90 +new file mode 100644 +index 0000000..98b5ce1 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func017.f90 +@@ -0,0 +1,6 @@ ++function f_func(b) result(res) bind(c, name = "f_func_") ++ integer(8), target :: b ++ integer(8), pointer :: res ++ b = b + 1 ++ res => b ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func018.f90 b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func018.f90 +new file mode 100644 +index 0000000..98b5ce1 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func018.f90 +@@ -0,0 +1,6 @@ ++function f_func(b) result(res) bind(c, name = "f_func_") ++ integer(8), target :: b ++ integer(8), pointer :: res ++ b = b + 1 ++ res => b ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func019.f90 b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func019.f90 +new file mode 100644 +index 0000000..98b5ce1 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func019.f90 +@@ -0,0 +1,6 @@ ++function f_func(b) result(res) bind(c, name = "f_func_") ++ integer(8), target :: b ++ integer(8), pointer :: res ++ b = b + 1 ++ res => b ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func020.f90 b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func020.f90 +new file mode 100644 +index 0000000..98b5ce1 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func020.f90 +@@ -0,0 +1,6 @@ ++function f_func(b) result(res) bind(c, name = "f_func_") ++ integer(8), target :: b ++ integer(8), pointer :: res ++ b = b + 1 ++ res => b ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func021.f90 b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func021.f90 +new file mode 100644 +index 0000000..e58e139 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func021.f90 +@@ -0,0 +1,6 @@ ++function f_func(i) result(res) bind(c, name = "f_func_") ++ real(4), target :: i ++ real(4), pointer :: res ++ i = i + 0.1 ++ res => i ++end +diff --git a/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func022.f90 b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func022.f90 +new file mode 100644 +index 0000000..340d2f2 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func022.f90 +@@ -0,0 +1,6 @@ ++function f_func(i) result(res) bind(c, name = "f_func_") ++ real(8), target :: i ++ real(8), pointer :: res ++ i = i + 0.1 ++ res => i ++end +diff --git a/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func023.f90 b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func023.f90 +new file mode 100644 +index 0000000..7863881 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func023.f90 +@@ -0,0 +1,7 @@ ++function f_func(i) result(res) bind(c, name = "f_func_") ++ integer, parameter :: K = selected_real_kind(16) ++ real(K), target :: i ++ real(K), pointer :: res ++ i = i + 0.1 ++ res => i ++end +diff --git a/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func024.f90 b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func024.f90 +new file mode 100644 +index 0000000..cb093eb +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func024.f90 +@@ -0,0 +1,6 @@ ++function f_func(i) result(res) bind(c, name = "f_func_") ++ complex(4), target :: i ++ complex(4), pointer :: res ++ i = (-12345678.7654321, 1) ++ res => i ++end +diff --git a/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func025.f90 b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func025.f90 +new file mode 100644 +index 0000000..0ec6812 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func025.f90 +@@ -0,0 +1,6 @@ ++function f_func(i) result(res) bind(c, name = "f_func_") ++ complex(8), target :: i ++ complex(8), pointer :: res ++ i = (-12345678.7654321, 1) ++ res => i ++end +diff --git a/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func026.f90 b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func026.f90 +new file mode 100644 +index 0000000..97df80a +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func026.f90 +@@ -0,0 +1,7 @@ ++function f_func(i) result(res) bind(c, name = "f_func_") ++ integer, parameter :: K = selected_real_kind(16) ++ complex(K), target :: i ++ complex(K), pointer :: res ++ i = (-12345678.7654321, 1) ++ res => i ++end +diff --git a/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func027.f90 b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func027.f90 +new file mode 100644 +index 0000000..f8f22bd +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func027.f90 +@@ -0,0 +1,6 @@ ++function f_func(b) result(res) bind(c, name = "f_func_") ++ logical(1), target :: b ++ logical(1), pointer :: res ++ b = .TRUE. ++ res => b ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func028.f90 b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func028.f90 +new file mode 100644 +index 0000000..69cff1e +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func028.f90 +@@ -0,0 +1,6 @@ ++function f_func(b) result(res) bind(c, name = "f_func_") ++ character(1), target :: b ++ character(1), pointer :: res ++ b = 'a' ++ res => b ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/result.md b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/result.md +new file mode 100644 +index 0000000..1f6658e +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/result.md +@@ -0,0 +1,29 @@ ++ | test | gfortran | flang | ++ | 001 | PASS | ERROR | ++ | 002 | PASS | ERROR | ++ | 003 | PASS | ERROR | ++ | 004 | PASS | ERROR | ++ | 005 | PASS | ERROR | ++ | 006 | PASS | ERROR | ++ | 007 | PASS | ERROR | ++ | 008 | PASS | ERROR | ++ | 009 | PASS | ERROR | ++ | 010 | PASS | ERROR | ++ | 011 | PASS | ERROR | ++ | 012 | PASS | ERROR | ++ | 013 | PASS | ERROR | ++ | 014 | PASS | ERROR | ++ | 015 | PASS | ERROR | ++ | 016 | PASS | ERROR | ++ | 017 | PASS | ERROR | ++ | 018 | PASS | ERROR | ++ | 019 | PASS | ERROR | ++ | 020 | PASS | ERROR | ++ | 021 | PASS | ERROR | ++ | 022 | PASS | ERROR | ++ | 023 | PASS | ERROR | ++ | 024 | PASS | ERROR | ++ | 025 | PASS | PASS | ++ | 026 | PASS | PASS | ++ | 027 | PASS | ERROR | ++ | 028 | ERROR | ERROR | +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/run.sh b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/run.sh +new file mode 100644 +index 0000000..5b2202e +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/run.sh +@@ -0,0 +1,16 @@ ++for i in {001..028} ++do ++echo "------- test $i ------." ++echo "----- gfortran result:" ++gcc c_main$i.c -c -o c-test.o ++gfortran fortran_func$i.f90 -fno-range-check -c -o fortran-test.o ++gfortran fortran-test.o c-test.o ++./a.out ++rm *.o a.out ++echo "----- flang-new result : " ++clang c_main$i.c -c -o c-test.o ++flang-new fortran_func$i.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o a.out ++done +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/005_c_call_fortran_function_array/c_main001.c b/test/interoperability_with_c_c_call_fortran_function/005_c_call_fortran_function_array/c_main001.c +new file mode 100644 +index 0000000..1f5133c +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/005_c_call_fortran_function_array/c_main001.c +@@ -0,0 +1,15 @@ ++// Test c call fortran for return array of integer about different ++// length ++// ++#include ++#include ++#include ++extern int* f_func_(int *); ++int main() { ++ int x[4]; ++ int *p; ++ p = f_func_(x); ++ for(int i = 0; i < 4; i++) { ++ printf("%d\n", p[i]); ++ } ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/005_c_call_fortran_function_array/c_main002.c b/test/interoperability_with_c_c_call_fortran_function/005_c_call_fortran_function_array/c_main002.c +new file mode 100644 +index 0000000..d247ebe +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/005_c_call_fortran_function_array/c_main002.c +@@ -0,0 +1,15 @@ ++// Test c call fortran for return array of integer about different ++// length ++// ++#include ++#include ++#include ++extern int* f_func_(int *); ++int main() { ++ int *p, x[5]; ++ p = (int*) malloc(5 * sizeof(int)); ++ p = f_func_(x); ++ for(int i = 0; i < 5; i++) { ++ printf("%d\n", p[i]); ++ } ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/005_c_call_fortran_function_array/c_main003.c b/test/interoperability_with_c_c_call_fortran_function/005_c_call_fortran_function_array/c_main003.c +new file mode 100644 +index 0000000..e2a44a6 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/005_c_call_fortran_function_array/c_main003.c +@@ -0,0 +1,15 @@ ++// Test c call fortran for return array of integer about different ++// length ++// ++#include ++#include ++#include ++extern int* f_func_(int *); ++int main() { ++ int *p, x[8]; ++ p = (int*) malloc(8 * sizeof(int)); ++ p = f_func_(x); ++ for(int i = 0; i < 8; i++) { ++ printf("%d\n", p[i]); ++ } ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/005_c_call_fortran_function_array/c_main004.c b/test/interoperability_with_c_c_call_fortran_function/005_c_call_fortran_function_array/c_main004.c +new file mode 100644 +index 0000000..5113295 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/005_c_call_fortran_function_array/c_main004.c +@@ -0,0 +1,15 @@ ++// Test c call fortran for return array of integer about different ++// length ++// ++#include ++#include ++#include ++extern int* f_func_(int *); ++int main() { ++ int *p, x[9]; ++ p = (int*) malloc(9 * sizeof(int)); ++ p = f_func_(x); ++ for(int i = 0; i < 9; i++) { ++ printf("%d\n", p[i]); ++ } ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/005_c_call_fortran_function_array/c_main005.c b/test/interoperability_with_c_c_call_fortran_function/005_c_call_fortran_function_array/c_main005.c +new file mode 100644 +index 0000000..6ae6a5c +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/005_c_call_fortran_function_array/c_main005.c +@@ -0,0 +1,15 @@ ++// Test c call fortran for return array of integer about different ++// length ++// ++#include ++#include ++#include ++extern int* f_func_(int *); ++int main() { ++ int *p, x[26]; ++ p = (int*) malloc(26 * sizeof(int)); ++ p = f_func_(x); ++ for(int i = 0; i < 26; i++) { ++ printf("%d\n", p[i]); ++ } ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/005_c_call_fortran_function_array/c_main006.c b/test/interoperability_with_c_c_call_fortran_function/005_c_call_fortran_function_array/c_main006.c +new file mode 100644 +index 0000000..c201c2d +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/005_c_call_fortran_function_array/c_main006.c +@@ -0,0 +1,15 @@ ++// Test c call fortran for return array of integer about different ++// length ++// ++#include ++#include ++#include ++extern int* f_func_(int *); ++int main() { ++ int *p, x[100]; ++ p = (int*) malloc(100 * sizeof(int)); ++ p = f_func_(x); ++ for(int i = 0; i < 100; i++) { ++ printf("%d\n", p[i]); ++ } ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/005_c_call_fortran_function_array/c_main007.c b/test/interoperability_with_c_c_call_fortran_function/005_c_call_fortran_function_array/c_main007.c +new file mode 100644 +index 0000000..1f5133c +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/005_c_call_fortran_function_array/c_main007.c +@@ -0,0 +1,15 @@ ++// Test c call fortran for return array of integer about different ++// length ++// ++#include ++#include ++#include ++extern int* f_func_(int *); ++int main() { ++ int x[4]; ++ int *p; ++ p = f_func_(x); ++ for(int i = 0; i < 4; i++) { ++ printf("%d\n", p[i]); ++ } ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/005_c_call_fortran_function_array/c_main008.c b/test/interoperability_with_c_c_call_fortran_function/005_c_call_fortran_function_array/c_main008.c +new file mode 100644 +index 0000000..1f5133c +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/005_c_call_fortran_function_array/c_main008.c +@@ -0,0 +1,15 @@ ++// Test c call fortran for return array of integer about different ++// length ++// ++#include ++#include ++#include ++extern int* f_func_(int *); ++int main() { ++ int x[4]; ++ int *p; ++ p = f_func_(x); ++ for(int i = 0; i < 4; i++) { ++ printf("%d\n", p[i]); ++ } ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/005_c_call_fortran_function_array/fortran_func001.f90 b/test/interoperability_with_c_c_call_fortran_function/005_c_call_fortran_function_array/fortran_func001.f90 +new file mode 100644 +index 0000000..de2c1dc +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/005_c_call_fortran_function_array/fortran_func001.f90 +@@ -0,0 +1,8 @@ ++function f_func(x) ++ integer, target :: x(4) ++ integer, pointer :: res(:) ++ do i = 1, 4 ++ x(i) = i ++ end do ++ res => x ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/005_c_call_fortran_function_array/fortran_func002.f90 b/test/interoperability_with_c_c_call_fortran_function/005_c_call_fortran_function_array/fortran_func002.f90 +new file mode 100644 +index 0000000..08c2f10 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/005_c_call_fortran_function_array/fortran_func002.f90 +@@ -0,0 +1,8 @@ ++function f_func(x) ++ integer, target :: x(5) ++ integer, pointer :: res(:) ++ do i = 1, 5 ++ x(i) = i ++ end do ++ res => x ++end +diff --git a/test/interoperability_with_c_c_call_fortran_function/005_c_call_fortran_function_array/fortran_func003.f90 b/test/interoperability_with_c_c_call_fortran_function/005_c_call_fortran_function_array/fortran_func003.f90 +new file mode 100644 +index 0000000..dcfb26d +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/005_c_call_fortran_function_array/fortran_func003.f90 +@@ -0,0 +1,8 @@ ++function f_func(x) ++ integer, target :: x(8) ++ integer, pointer :: res(:) ++ do i = 1, 8 ++ x(i) = i ++ end do ++ res => x ++end +diff --git a/test/interoperability_with_c_c_call_fortran_function/005_c_call_fortran_function_array/fortran_func004.f90 b/test/interoperability_with_c_c_call_fortran_function/005_c_call_fortran_function_array/fortran_func004.f90 +new file mode 100644 +index 0000000..46d82f9 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/005_c_call_fortran_function_array/fortran_func004.f90 +@@ -0,0 +1,8 @@ ++function f_func(x) ++ integer, target :: x(9) ++ integer, pointer :: res(:) ++ do i = 1, 9 ++ x(i) = i ++ end do ++ res => x ++end +diff --git a/test/interoperability_with_c_c_call_fortran_function/005_c_call_fortran_function_array/fortran_func005.f90 b/test/interoperability_with_c_c_call_fortran_function/005_c_call_fortran_function_array/fortran_func005.f90 +new file mode 100644 +index 0000000..32c24fc +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/005_c_call_fortran_function_array/fortran_func005.f90 +@@ -0,0 +1,8 @@ ++function f_func(x) ++ integer, target :: x(26) ++ integer, pointer :: res(:) ++ do i = 1, 26 ++ x(i) = i ++ end do ++ res => x ++end +diff --git a/test/interoperability_with_c_c_call_fortran_function/005_c_call_fortran_function_array/fortran_func006.f90 b/test/interoperability_with_c_c_call_fortran_function/005_c_call_fortran_function_array/fortran_func006.f90 +new file mode 100644 +index 0000000..b2fe720 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/005_c_call_fortran_function_array/fortran_func006.f90 +@@ -0,0 +1,8 @@ ++function f_func(x) ++ integer, target :: x(100) ++ integer, pointer :: res(:) ++ do i = 1, 100 ++ x(i) = i ++ end do ++ res => x ++end +diff --git a/test/interoperability_with_c_c_call_fortran_function/005_c_call_fortran_function_array/fortran_func007.f90 b/test/interoperability_with_c_c_call_fortran_function/005_c_call_fortran_function_array/fortran_func007.f90 +new file mode 100644 +index 0000000..fda07ba +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/005_c_call_fortran_function_array/fortran_func007.f90 +@@ -0,0 +1,8 @@ ++function f_func(x) ++ integer, target :: x(5) ++ integer, pointer :: f_func(:) ++ do i = 1, 5 ++ x(i) = i ++ end do ++ f_func => x ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/005_c_call_fortran_function_array/fortran_func008.f90 b/test/interoperability_with_c_c_call_fortran_function/005_c_call_fortran_function_array/fortran_func008.f90 +new file mode 100644 +index 0000000..d18a92e +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/005_c_call_fortran_function_array/fortran_func008.f90 +@@ -0,0 +1,8 @@ ++function f_func(x) ++ integer :: x(5) ++ integer :: f_func(5) ++ do i = 1, 5 ++ x(i) = i ++ end do ++ f_func = x ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/005_c_call_fortran_function_array/result.md b/test/interoperability_with_c_c_call_fortran_function/005_c_call_fortran_function_array/result.md +new file mode 100644 +index 0000000..29f6af4 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/005_c_call_fortran_function_array/result.md +@@ -0,0 +1,9 @@ ++ | test | gfortran | flang | ++ | 001 | PASS | PASS | ++ | 002 | PASS | PASS | ++ | 003 | PASS | PASS | ++ | 004 | PASS | PASS | ++ | 005 | PASS | PASS | ++ | 006 | PASS | PASS | ++ | 007 | ERROR | ERROR | ++ | 008 | ERROR | ERROR | +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/005_c_call_fortran_function_array/run.sh b/test/interoperability_with_c_c_call_fortran_function/005_c_call_fortran_function_array/run.sh +new file mode 100644 +index 0000000..e2a8cbf +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/005_c_call_fortran_function_array/run.sh +@@ -0,0 +1,16 @@ ++for i in {001..008} ++do ++echo "------- test $i ------." ++echo "----- gfortran result:" ++gcc c_main$i.c -c -o c-test.o ++gfortran fortran_func$i.f90 -fno-range-check -c -o fortran-test.o ++gfortran fortran-test.o c-test.o ++./a.out ++rm *.o a.out ++echo "----- flang-new result : " ++clang c_main$i.c -c -o c-test.o ++flang-new fortran_func$i.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o a.out ++done +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/006_c_call_fortran_function_array_bindc/c_main001.c b/test/interoperability_with_c_c_call_fortran_function/006_c_call_fortran_function_array_bindc/c_main001.c +new file mode 100644 +index 0000000..b3fd45f +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/006_c_call_fortran_function_array_bindc/c_main001.c +@@ -0,0 +1,15 @@ ++// Test c call fortran for return array of integer about different ++// length with bindc ++// ++#include ++#include ++#include ++extern int* f_func_(int *); ++int main() { ++ int x[4]; ++ int *p; ++ p = f_func_(x); ++ for(int i = 0; i < 4; i++) { ++ printf("%d\n", p[i]); ++ } ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/006_c_call_fortran_function_array_bindc/c_main002.c b/test/interoperability_with_c_c_call_fortran_function/006_c_call_fortran_function_array_bindc/c_main002.c +new file mode 100644 +index 0000000..03a8d40 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/006_c_call_fortran_function_array_bindc/c_main002.c +@@ -0,0 +1,15 @@ ++// Test c call fortran for return array of integer about different ++// length with bindc ++// ++#include ++#include ++#include ++extern int* f_func_(int *); ++int main() { ++ int *p, x[5]; ++ p = (int*) malloc(5 * sizeof(int)); ++ p = f_func_(x); ++ for(int i = 0; i < 5; i++) { ++ printf("%d\n", p[i]); ++ } ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/006_c_call_fortran_function_array_bindc/c_main003.c b/test/interoperability_with_c_c_call_fortran_function/006_c_call_fortran_function_array_bindc/c_main003.c +new file mode 100644 +index 0000000..dc3cdea +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/006_c_call_fortran_function_array_bindc/c_main003.c +@@ -0,0 +1,15 @@ ++// Test c call fortran for return array of integer about different ++// length with bindc ++// ++#include ++#include ++#include ++extern int* f_func_(int *); ++int main() { ++ int *p, x[8]; ++ p = (int*) malloc(8 * sizeof(int)); ++ p = f_func_(x); ++ for(int i = 0; i < 8; i++) { ++ printf("%d\n", p[i]); ++ } ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/006_c_call_fortran_function_array_bindc/c_main004.c b/test/interoperability_with_c_c_call_fortran_function/006_c_call_fortran_function_array_bindc/c_main004.c +new file mode 100644 +index 0000000..fb5d02d +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/006_c_call_fortran_function_array_bindc/c_main004.c +@@ -0,0 +1,15 @@ ++// Test c call fortran for return array of integer about different ++// length with bindc ++// ++#include ++#include ++#include ++extern int* f_func_(int *); ++int main() { ++ int *p, x[9]; ++ p = (int*) malloc(9 * sizeof(int)); ++ p = f_func_(x); ++ for(int i = 0; i < 9; i++) { ++ printf("%d\n", p[i]); ++ } ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/006_c_call_fortran_function_array_bindc/c_main005.c b/test/interoperability_with_c_c_call_fortran_function/006_c_call_fortran_function_array_bindc/c_main005.c +new file mode 100644 +index 0000000..0769299 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/006_c_call_fortran_function_array_bindc/c_main005.c +@@ -0,0 +1,15 @@ ++// Test c call fortran for return array of integer about different ++// length with bindc ++// ++#include ++#include ++#include ++extern int* f_func_(int *); ++int main() { ++ int *p, x[26]; ++ p = (int*) malloc(26 * sizeof(int)); ++ p = f_func_(x); ++ for(int i = 0; i < 26; i++) { ++ printf("%d\n", p[i]); ++ } ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/006_c_call_fortran_function_array_bindc/c_main006.c b/test/interoperability_with_c_c_call_fortran_function/006_c_call_fortran_function_array_bindc/c_main006.c +new file mode 100644 +index 0000000..7d4f4bb +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/006_c_call_fortran_function_array_bindc/c_main006.c +@@ -0,0 +1,15 @@ ++// Test c call fortran for return array of integer about different ++// length with bindc ++// ++#include ++#include ++#include ++extern int* f_func_(int *); ++int main() { ++ int *p, x[100]; ++ p = (int*) malloc(100 * sizeof(int)); ++ p = f_func_(x); ++ for(int i = 0; i < 100; i++) { ++ printf("%d\n", p[i]); ++ } ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/006_c_call_fortran_function_array_bindc/c_main007.c b/test/interoperability_with_c_c_call_fortran_function/006_c_call_fortran_function_array_bindc/c_main007.c +new file mode 100644 +index 0000000..b3fd45f +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/006_c_call_fortran_function_array_bindc/c_main007.c +@@ -0,0 +1,15 @@ ++// Test c call fortran for return array of integer about different ++// length with bindc ++// ++#include ++#include ++#include ++extern int* f_func_(int *); ++int main() { ++ int x[4]; ++ int *p; ++ p = f_func_(x); ++ for(int i = 0; i < 4; i++) { ++ printf("%d\n", p[i]); ++ } ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/006_c_call_fortran_function_array_bindc/c_main008.c b/test/interoperability_with_c_c_call_fortran_function/006_c_call_fortran_function_array_bindc/c_main008.c +new file mode 100644 +index 0000000..b3fd45f +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/006_c_call_fortran_function_array_bindc/c_main008.c +@@ -0,0 +1,15 @@ ++// Test c call fortran for return array of integer about different ++// length with bindc ++// ++#include ++#include ++#include ++extern int* f_func_(int *); ++int main() { ++ int x[4]; ++ int *p; ++ p = f_func_(x); ++ for(int i = 0; i < 4; i++) { ++ printf("%d\n", p[i]); ++ } ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/006_c_call_fortran_function_array_bindc/fortran_func001.f90 b/test/interoperability_with_c_c_call_fortran_function/006_c_call_fortran_function_array_bindc/fortran_func001.f90 +new file mode 100644 +index 0000000..a956589 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/006_c_call_fortran_function_array_bindc/fortran_func001.f90 +@@ -0,0 +1,8 @@ ++function f_func(x) bind(c, name = "f_func_") ++ integer, target :: x(4) ++ integer, pointer :: res(:) ++ do i = 1, 4 ++ x(i) = i ++ end do ++ res => x ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/006_c_call_fortran_function_array_bindc/fortran_func002.f90 b/test/interoperability_with_c_c_call_fortran_function/006_c_call_fortran_function_array_bindc/fortran_func002.f90 +new file mode 100644 +index 0000000..c7cb1ad +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/006_c_call_fortran_function_array_bindc/fortran_func002.f90 +@@ -0,0 +1,8 @@ ++function f_func(x) bind(c, name = "f_func_") ++ integer, target :: x(5) ++ integer, pointer :: res(:) ++ do i = 1, 5 ++ x(i) = i ++ end do ++ res => x ++end +diff --git a/test/interoperability_with_c_c_call_fortran_function/006_c_call_fortran_function_array_bindc/fortran_func003.f90 b/test/interoperability_with_c_c_call_fortran_function/006_c_call_fortran_function_array_bindc/fortran_func003.f90 +new file mode 100644 +index 0000000..149f6e9 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/006_c_call_fortran_function_array_bindc/fortran_func003.f90 +@@ -0,0 +1,8 @@ ++function f_func(x) bind(c, name = "f_func_") ++ integer, target :: x(8) ++ integer, pointer :: res(:) ++ do i = 1, 8 ++ x(i) = i ++ end do ++ res => x ++end +diff --git a/test/interoperability_with_c_c_call_fortran_function/006_c_call_fortran_function_array_bindc/fortran_func004.f90 b/test/interoperability_with_c_c_call_fortran_function/006_c_call_fortran_function_array_bindc/fortran_func004.f90 +new file mode 100644 +index 0000000..2e44601 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/006_c_call_fortran_function_array_bindc/fortran_func004.f90 +@@ -0,0 +1,8 @@ ++function f_func(x) bind(c, name = "f_func_") ++ integer, target :: x(9) ++ integer, pointer :: res(:) ++ do i = 1, 9 ++ x(i) = i ++ end do ++ res => x ++end +diff --git a/test/interoperability_with_c_c_call_fortran_function/006_c_call_fortran_function_array_bindc/fortran_func005.f90 b/test/interoperability_with_c_c_call_fortran_function/006_c_call_fortran_function_array_bindc/fortran_func005.f90 +new file mode 100644 +index 0000000..930903f +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/006_c_call_fortran_function_array_bindc/fortran_func005.f90 +@@ -0,0 +1,8 @@ ++function f_func(x) bind(c, name = "f_func_") ++ integer, target :: x(26) ++ integer, pointer :: res(:) ++ do i = 1, 26 ++ x(i) = i ++ end do ++ res => x ++end +diff --git a/test/interoperability_with_c_c_call_fortran_function/006_c_call_fortran_function_array_bindc/fortran_func006.f90 b/test/interoperability_with_c_c_call_fortran_function/006_c_call_fortran_function_array_bindc/fortran_func006.f90 +new file mode 100644 +index 0000000..e8c6b2f +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/006_c_call_fortran_function_array_bindc/fortran_func006.f90 +@@ -0,0 +1,8 @@ ++function f_func(x) bind(c, name = "f_func_") ++ integer, target :: x(100) ++ integer, pointer :: res(:) ++ do i = 1, 100 ++ x(i) = i ++ end do ++ res => x ++end +diff --git a/test/interoperability_with_c_c_call_fortran_function/006_c_call_fortran_function_array_bindc/fortran_func007.f90 b/test/interoperability_with_c_c_call_fortran_function/006_c_call_fortran_function_array_bindc/fortran_func007.f90 +new file mode 100644 +index 0000000..3d3f09a +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/006_c_call_fortran_function_array_bindc/fortran_func007.f90 +@@ -0,0 +1,8 @@ ++function f_func(x) bind(c, name = "f_func_") ++ integer, target :: x(5) ++ integer, pointer :: f_func(:) ++ do i = 1, 5 ++ x(i) = i ++ end do ++ f_func => x ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/006_c_call_fortran_function_array_bindc/fortran_func008.f90 b/test/interoperability_with_c_c_call_fortran_function/006_c_call_fortran_function_array_bindc/fortran_func008.f90 +new file mode 100644 +index 0000000..699d71c +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/006_c_call_fortran_function_array_bindc/fortran_func008.f90 +@@ -0,0 +1,8 @@ ++function f_func(x) bind(c, name = "f_func_") ++ integer :: x(5) ++ integer :: f_func(5) ++ do i = 1, 5 ++ x(i) = i ++ end do ++ f_func = x ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/006_c_call_fortran_function_array_bindc/result.md b/test/interoperability_with_c_c_call_fortran_function/006_c_call_fortran_function_array_bindc/result.md +new file mode 100644 +index 0000000..29f6af4 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/006_c_call_fortran_function_array_bindc/result.md +@@ -0,0 +1,9 @@ ++ | test | gfortran | flang | ++ | 001 | PASS | PASS | ++ | 002 | PASS | PASS | ++ | 003 | PASS | PASS | ++ | 004 | PASS | PASS | ++ | 005 | PASS | PASS | ++ | 006 | PASS | PASS | ++ | 007 | ERROR | ERROR | ++ | 008 | ERROR | ERROR | +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/006_c_call_fortran_function_array_bindc/run.sh b/test/interoperability_with_c_c_call_fortran_function/006_c_call_fortran_function_array_bindc/run.sh +new file mode 100644 +index 0000000..e2a8cbf +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/006_c_call_fortran_function_array_bindc/run.sh +@@ -0,0 +1,16 @@ ++for i in {001..008} ++do ++echo "------- test $i ------." ++echo "----- gfortran result:" ++gcc c_main$i.c -c -o c-test.o ++gfortran fortran_func$i.f90 -fno-range-check -c -o fortran-test.o ++gfortran fortran-test.o c-test.o ++./a.out ++rm *.o a.out ++echo "----- flang-new result : " ++clang c_main$i.c -c -o c-test.o ++flang-new fortran_func$i.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o a.out ++done +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/007_c_call_fortran_function_struct/c_main001.c b/test/interoperability_with_c_c_call_fortran_function/007_c_call_fortran_function_struct/c_main001.c +new file mode 100644 +index 0000000..9dbfe03 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/007_c_call_fortran_function_struct/c_main001.c +@@ -0,0 +1,14 @@ ++// Test c call fortran for return struct type ++// ++#include ++#include ++#include ++struct t1 { ++ int x; ++}; ++extern struct t1 f_func_(); ++int main() { ++ struct t1 res; ++ res = f_func_(); ++ printf("%d\n", res.x); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/007_c_call_fortran_function_struct/c_main002.c b/test/interoperability_with_c_c_call_fortran_function/007_c_call_fortran_function_struct/c_main002.c +new file mode 100644 +index 0000000..1467c39 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/007_c_call_fortran_function_struct/c_main002.c +@@ -0,0 +1,16 @@ ++// Test c call fortran for return struct type and data alignment ++// ++#include ++#include ++#include ++struct t1 { ++ int16_t x2; ++ int8_t x; ++}; ++extern struct t1 f_func_(); ++int main() { ++ struct t1 res; ++ res = f_func_(); ++ printf("%hhd\n", res.x); ++ printf("%hd\n", res.x2); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/007_c_call_fortran_function_struct/c_main003.c b/test/interoperability_with_c_c_call_fortran_function/007_c_call_fortran_function_struct/c_main003.c +new file mode 100644 +index 0000000..9d038ff +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/007_c_call_fortran_function_struct/c_main003.c +@@ -0,0 +1,18 @@ ++// Test c call fortran for return struct type and data alignment ++// ++#include ++#include ++#include ++struct t1 { ++ int32_t x3; ++ int16_t x2; ++ int8_t x; ++}; ++extern struct t1 f_func_(); ++int main() { ++ struct t1 res; ++ res = f_func_(); ++ printf("%hhd\n", res.x); ++ printf("%hd\n", res.x2); ++ printf("%d\n", res.x3); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/007_c_call_fortran_function_struct/c_main004.c b/test/interoperability_with_c_c_call_fortran_function/007_c_call_fortran_function_struct/c_main004.c +new file mode 100644 +index 0000000..cebab37 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/007_c_call_fortran_function_struct/c_main004.c +@@ -0,0 +1,20 @@ ++// Test c call fortran for return struct type and data alignment ++// ++#include ++#include ++#include ++struct t1 { ++ int64_t x4; ++ int32_t x3; ++ int16_t x2; ++ int8_t x; ++}; ++extern struct t1 f_func_(); ++int main() { ++ struct t1 res; ++ res = f_func_(); ++ printf("%hhd\n", res.x); ++ printf("%hd\n", res.x2); ++ printf("%d\n", res.x3); ++ printf("%ld\n", res.x4); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/007_c_call_fortran_function_struct/c_main005.c b/test/interoperability_with_c_c_call_fortran_function/007_c_call_fortran_function_struct/c_main005.c +new file mode 100644 +index 0000000..3004cab +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/007_c_call_fortran_function_struct/c_main005.c +@@ -0,0 +1,22 @@ ++// Test c call fortran for return struct type and data alignment ++// ++#include ++#include ++#include ++struct t1 { ++ int64_t x5[2]; ++ int64_t x4; ++ int32_t x3; ++ int16_t x2; ++ int8_t x; ++}; ++extern struct t1 f_func_(); ++int main() { ++ struct t1 res; ++ res = f_func_(); ++ printf("%hhd\n", res.x); ++ printf("%hd\n", res.x2); ++ printf("%d\n", res.x3); ++ printf("%ld\n", res.x4); ++ printf("%ld\n", res.x5[0]); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/007_c_call_fortran_function_struct/c_main006.c b/test/interoperability_with_c_c_call_fortran_function/007_c_call_fortran_function_struct/c_main006.c +new file mode 100644 +index 0000000..1258dd7 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/007_c_call_fortran_function_struct/c_main006.c +@@ -0,0 +1,24 @@ ++// Test c call fortran for return struct type and data alignment ++// ++#include ++#include ++#include ++struct t1 { ++ int64_t x5[4]; ++ int64_t x4[2]; ++ int32_t x3[2]; ++ int16_t x2[2]; ++ int8_t x[2]; ++}; ++extern struct t1 f_func_(); ++int main() { ++ struct t1 res; ++ res = f_func_(); ++ for(int i = 0; i < 2; i++) { ++ printf("%hhd\n", res.x[i]); ++ printf("%hd\n", res.x2[i]); ++ printf("%d\n", res.x3[i]); ++ printf("%ld\n", res.x4[i]); ++ printf("%ld\n", res.x5[i * 2]); ++ } ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/007_c_call_fortran_function_struct/fortran_func001.f90 b/test/interoperability_with_c_c_call_fortran_function/007_c_call_fortran_function_struct/fortran_func001.f90 +new file mode 100644 +index 0000000..4fb08e3 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/007_c_call_fortran_function_struct/fortran_func001.f90 +@@ -0,0 +1,7 @@ ++function f_func() ++ type t1 ++ integer :: x ++ end type ++ type(t1) :: f_func ++ f_func%x = 2 ++end +diff --git a/test/interoperability_with_c_c_call_fortran_function/007_c_call_fortran_function_struct/fortran_func002.f90 b/test/interoperability_with_c_c_call_fortran_function/007_c_call_fortran_function_struct/fortran_func002.f90 +new file mode 100644 +index 0000000..14c8d83 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/007_c_call_fortran_function_struct/fortran_func002.f90 +@@ -0,0 +1,9 @@ ++function f_func() ++ type t1 ++ integer(2) :: x2 ++ integer(1) :: x ++ end type ++ type(t1) :: f_func ++ f_func%x = 2 ++ f_func%x2 = 3 ++end +diff --git a/test/interoperability_with_c_c_call_fortran_function/007_c_call_fortran_function_struct/fortran_func003.f90 b/test/interoperability_with_c_c_call_fortran_function/007_c_call_fortran_function_struct/fortran_func003.f90 +new file mode 100644 +index 0000000..1766d2d +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/007_c_call_fortran_function_struct/fortran_func003.f90 +@@ -0,0 +1,11 @@ ++function f_func() ++ type t1 ++ integer(4) :: x3 ++ integer(2) :: x2 ++ integer(1) :: x ++ end type ++ type(t1) :: f_func ++ f_func%x = 2 ++ f_func%x2 = 3 ++ f_func%x3 = 4 ++end +diff --git a/test/interoperability_with_c_c_call_fortran_function/007_c_call_fortran_function_struct/fortran_func004.f90 b/test/interoperability_with_c_c_call_fortran_function/007_c_call_fortran_function_struct/fortran_func004.f90 +new file mode 100644 +index 0000000..352aa76 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/007_c_call_fortran_function_struct/fortran_func004.f90 +@@ -0,0 +1,13 @@ ++function f_func() ++ type t1 ++ integer(8) :: x4 ++ integer(4) :: x3 ++ integer(2) :: x2 ++ integer(1) :: x ++ end type ++ type(t1) :: f_func ++ f_func%x = 2 ++ f_func%x2 = 3 ++ f_func%x3 = 4 ++ f_func%x4 = 5 ++end +diff --git a/test/interoperability_with_c_c_call_fortran_function/007_c_call_fortran_function_struct/fortran_func005.f90 b/test/interoperability_with_c_c_call_fortran_function/007_c_call_fortran_function_struct/fortran_func005.f90 +new file mode 100644 +index 0000000..c02a6ea +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/007_c_call_fortran_function_struct/fortran_func005.f90 +@@ -0,0 +1,15 @@ ++function f_func() ++ type t1 ++ integer(16) :: x5 ++ integer(8) :: x4 ++ integer(4) :: x3 ++ integer(2) :: x2 ++ integer(1) :: x ++ end type ++ type(t1) :: f_func ++ f_func%x = 2 ++ f_func%x2 = 3 ++ f_func%x3 = 4 ++ f_func%x4 = 5 ++ f_func%x5 = 6 ++end +diff --git a/test/interoperability_with_c_c_call_fortran_function/007_c_call_fortran_function_struct/fortran_func006.f90 b/test/interoperability_with_c_c_call_fortran_function/007_c_call_fortran_function_struct/fortran_func006.f90 +new file mode 100644 +index 0000000..654d751 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/007_c_call_fortran_function_struct/fortran_func006.f90 +@@ -0,0 +1,17 @@ ++function f_func() ++ type t1 ++ integer(16) :: x5(2) ++ integer(8) :: x4(2) ++ integer(4) :: x3(2) ++ integer(2) :: x2(2) ++ integer(1) :: x(2) ++ end type ++ type(t1) :: f_func ++ do i = 1, 2 ++ f_func%x(i) = 2 ++ f_func%x2(i) = 3 ++ f_func%x3(i) = 4 ++ f_func%x4(i) = 5 ++ f_func%x5(i) = 6 ++ end do ++end +diff --git a/test/interoperability_with_c_c_call_fortran_function/007_c_call_fortran_function_struct/result.md b/test/interoperability_with_c_c_call_fortran_function/007_c_call_fortran_function_struct/result.md +new file mode 100644 +index 0000000..4c1d072 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/007_c_call_fortran_function_struct/result.md +@@ -0,0 +1,7 @@ ++ | test | gfortran | flang | ++ | 001 | PASS | ERROR | ++ | 002 | PASS | ERROR | ++ | 003 | PASS | ERROR | ++ | 004 | PASS | ERROR | ++ | 005 | PASS | PASS | ++ | 006 | PASS | PASS | +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_function/007_c_call_fortran_function_struct/run.sh b/test/interoperability_with_c_c_call_fortran_function/007_c_call_fortran_function_struct/run.sh +new file mode 100644 +index 0000000..cd0e873 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_function/007_c_call_fortran_function_struct/run.sh +@@ -0,0 +1,16 @@ ++for i in {001..006} ++do ++echo "------- test $i ------." ++echo "----- gfortran result:" ++gcc c_main$i.c -c -o c-test.o ++gfortran fortran_func$i.f90 -fno-range-check -c -o fortran-test.o ++gfortran fortran-test.o c-test.o ++./a.out ++rm *.o a.out ++echo "----- flang-new result : " ++clang c_main$i.c -c -o c-test.o ++flang-new fortran_func$i.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o a.out ++done +\ No newline at end of file +-- +2.25.1 + diff --git a/13-test-interoperability-with-c-c-call-fortran-global-and-struct.patch b/13-test-interoperability-with-c-c-call-fortran-global-and-struct.patch new file mode 100644 index 0000000..7ee200b --- /dev/null +++ b/13-test-interoperability-with-c-c-call-fortran-global-and-struct.patch @@ -0,0 +1,3583 @@ +From 3c229bccd4260a5af3be41c1be953c9c021e980b Mon Sep 17 00:00:00 2001 +From: xieyihui +Date: Fri, 18 Nov 2022 13:02:54 +0800 +Subject: [PATCH] Add new test cases about global and struct for + interoperability with C about C call fortran + +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main001.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main001.c +new file mode 100644 +index 0000000..11d0136 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main001.c +@@ -0,0 +1,13 @@ ++// Test c call fortran for the derived type and the component of the ++// derived type is scalar of type int ++// ++#include ++struct test { ++ int t; ++}; ++extern void f_func_(struct test *s); ++int main() { ++ struct test a; ++ f_func_(&a); ++ printf("%d\n", a.t); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main002.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main002.c +new file mode 100644 +index 0000000..c44d440 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main002.c +@@ -0,0 +1,13 @@ ++// Test c call fortran for the derived type and the component of the ++// derived type is scalar of type short ++// ++#include ++struct test { ++ short t; ++}; ++extern void f_func_(struct test *s); ++int main() { ++ struct test a; ++ f_func_(&a); ++ printf("%hd\n", a.t); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main003.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main003.c +new file mode 100644 +index 0000000..76739dc +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main003.c +@@ -0,0 +1,13 @@ ++// Test c call fortran for the derived type and the component of the ++// derived type is scalar of type long ++// ++#include ++struct test { ++ long t; ++}; ++extern void f_func_(struct test *s); ++int main() { ++ struct test a; ++ f_func_(&a); ++ printf("%ld\n", a.t); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main004.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main004.c +new file mode 100644 +index 0000000..d696b17 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main004.c +@@ -0,0 +1,13 @@ ++// Test c call fortran for the derived type and the component of the ++// derived type is scalar of type long long ++// ++#include ++struct test { ++ long long t; ++}; ++extern void f_func_(struct test *s); ++int main() { ++ struct test a; ++ f_func_(&a); ++ printf("%Ld\n", a.t); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main005.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main005.c +new file mode 100644 +index 0000000..ec2abe6 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main005.c +@@ -0,0 +1,13 @@ ++// Test c call fortran for the derived type and the component of the ++// derived type is scalar of signed char ++// ++#include ++struct test { ++ signed char t; ++}; ++extern void f_func_(struct test *s); ++int main() { ++ struct test a; ++ f_func_(&a); ++ printf("%hhd\n", a.t); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main006.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main006.c +new file mode 100644 +index 0000000..a063a8a +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main006.c +@@ -0,0 +1,13 @@ ++// Test c call fortran for the derived type and the component of the ++// derived type is scalar of type size_t ++// ++#include ++struct test { ++ size_t t; ++}; ++extern void f_func_(struct test *s); ++int main() { ++ struct test a; ++ f_func_(&a); ++ printf("%ld\n", a.t); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main007.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main007.c +new file mode 100644 +index 0000000..809e893 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main007.c +@@ -0,0 +1,14 @@ ++// Test c call fortran for the derived type and the component of the ++// derived type is scalar of type int8_t ++// ++#include ++#include ++struct test { ++ int8_t t; ++}; ++extern void f_func_(struct test *s); ++int main() { ++ struct test a; ++ f_func_(&a); ++ printf("%hhd\n", a.t); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main008.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main008.c +new file mode 100644 +index 0000000..3366e85 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main008.c +@@ -0,0 +1,14 @@ ++// Test c call fortran for the derived type and the component of the ++// derived type is scalar of type int16_t ++// ++#include ++#include ++struct test { ++ int16_t t; ++}; ++extern void f_func_(struct test *s); ++int main() { ++ struct test a; ++ f_func_(&a); ++ printf("%hd\n", a.t); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main009.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main009.c +new file mode 100644 +index 0000000..edd916a +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main009.c +@@ -0,0 +1,14 @@ ++// Test c call fortran for the derived type and the component of the ++// derived type is scalar of type int32_t ++// ++#include ++#include ++struct test { ++ int32_t t; ++}; ++extern void f_func_(struct test *s); ++int main() { ++ struct test a; ++ f_func_(&a); ++ printf("%d\n", a.t); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main010.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main010.c +new file mode 100644 +index 0000000..743e4b6 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main010.c +@@ -0,0 +1,14 @@ ++// Test c call fortran for the derived type and the component of the ++// derived type is scalar of type int64_t ++// ++#include ++#include ++struct test { ++ int64_t t; ++}; ++extern void f_func_(struct test *s); ++int main() { ++ struct test a; ++ f_func_(&a); ++ printf("%ld\n", a.t); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main011.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main011.c +new file mode 100644 +index 0000000..f77bc3f +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main011.c +@@ -0,0 +1,14 @@ ++// Test c call fortran for the derived type and the component of the ++// derived type is scalar of type int_least8_t ++// ++#include ++#include ++struct test { ++ int_least8_t t; ++}; ++extern void f_func_(struct test *s); ++int main() { ++ struct test a; ++ f_func_(&a); ++ printf("%hhd\n", a.t); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main012.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main012.c +new file mode 100644 +index 0000000..39e1a52 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main012.c +@@ -0,0 +1,14 @@ ++// Test c call fortran for the derived type and the component of the ++// derived type is scalar of type int_least16_t ++// ++#include ++#include ++struct test { ++ int_least16_t t; ++}; ++extern void f_func_(struct test *s); ++int main() { ++ struct test a; ++ f_func_(&a); ++ printf("%hd\n", a.t); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main013.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main013.c +new file mode 100644 +index 0000000..296873d +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main013.c +@@ -0,0 +1,14 @@ ++// Test c call fortran for the derived type and the component of the ++// derived type is scalar of type int_least32_t ++// ++#include ++#include ++struct test { ++ int_least32_t t; ++}; ++extern void f_func_(struct test *s); ++int main() { ++ struct test a; ++ f_func_(&a); ++ printf("%d\n", a.t); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main014.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main014.c +new file mode 100644 +index 0000000..e2a48ae +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main014.c +@@ -0,0 +1,14 @@ ++// Test c call fortran for the derived type and the component of the ++// derived type is scalar of type int_least64_t ++// ++#include ++#include ++struct test { ++ int_least64_t t; ++}; ++extern void f_func_(struct test *s); ++int main() { ++ struct test a; ++ f_func_(&a); ++ printf("%ld\n", a.t); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main015.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main015.c +new file mode 100644 +index 0000000..fda3683 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main015.c +@@ -0,0 +1,14 @@ ++// Test c call fortran for the derived type and the component of the ++// derived type is scalar of type int_fast8_t ++// ++#include ++#include ++struct test { ++ int_fast8_t t; ++}; ++extern void f_func_(struct test *s); ++int main() { ++ struct test a; ++ f_func_(&a); ++ printf("%hhd\n", a.t); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main016.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main016.c +new file mode 100644 +index 0000000..c88cf3e +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main016.c +@@ -0,0 +1,14 @@ ++// Test c call fortran for the derived type and the component of the ++// derived type is scalar of type int_fast16_t ++// ++#include ++#include ++struct test { ++ int_fast16_t t; ++}; ++extern void f_func_(struct test *s); ++int main() { ++ struct test a; ++ f_func_(&a); ++ printf("%ld\n", a.t); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main017.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main017.c +new file mode 100644 +index 0000000..e7c385d +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main017.c +@@ -0,0 +1,14 @@ ++// Test c call fortran for the derived type and the component of the ++// derived type is scalar of type int_fast32_t ++// ++#include ++#include ++struct test { ++ int_fast32_t t; ++}; ++extern void f_func_(struct test *s); ++int main() { ++ struct test a; ++ f_func_(&a); ++ printf("%ld\n", a.t); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main018.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main018.c +new file mode 100644 +index 0000000..959a511 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main018.c +@@ -0,0 +1,14 @@ ++// Test c call fortran for the derived type and the component of the ++// derived type is scalar of type int_fast64_t ++// ++#include ++#include ++struct test { ++ int_fast64_t t; ++}; ++extern void f_func_(struct test *s); ++int main() { ++ struct test a; ++ f_func_(&a); ++ printf("%ld\n", a.t); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main019.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main019.c +new file mode 100644 +index 0000000..0dbf9d8 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main019.c +@@ -0,0 +1,14 @@ ++// Test c call fortran for the derived type and the component of the ++// derived type is scalar of type intmax_t ++// ++#include ++#include ++struct test { ++ intmax_t t; ++}; ++extern void f_func_(struct test *s); ++int main() { ++ struct test a; ++ f_func_(&a); ++ printf("%ld\n", a.t); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main020.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main020.c +new file mode 100644 +index 0000000..7aca7aa +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main020.c +@@ -0,0 +1,14 @@ ++// Test c call fortran for the derived type and the component of the ++// derived type is scalar of type intptr_t ++// ++#include ++#include ++struct test { ++ intptr_t t; ++}; ++extern void f_func_(struct test *s); ++int main() { ++ struct test a; ++ f_func_(&a); ++ printf("%ld\n", a.t); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main021.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main021.c +new file mode 100644 +index 0000000..d6e95af +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main021.c +@@ -0,0 +1,14 @@ ++// Test c call fortran for the derived type and the component of the ++// derived type is scalar of type float ++// ++#include ++#include ++struct test { ++ float t; ++}; ++extern void f_func_(struct test *s); ++int main() { ++ struct test a; ++ f_func_(&a); ++ printf("%0.20f\n", a.t); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main022.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main022.c +new file mode 100644 +index 0000000..153aaa0 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main022.c +@@ -0,0 +1,14 @@ ++// Test c call fortran for the derived type and the component of the ++// derived type is scalar of type double ++// ++#include ++#include ++struct test { ++ double t; ++}; ++extern void f_func_(struct test *s); ++int main() { ++ struct test a; ++ f_func_(&a); ++ printf("%0.20lf\n", a.t); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main023.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main023.c +new file mode 100644 +index 0000000..6232a85 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main023.c +@@ -0,0 +1,14 @@ ++// Test c call fortran for the derived type and the component of the ++// derived type is scalar of type long double ++// ++#include ++#include ++struct test { ++ long double t; ++}; ++extern void f_func_(struct test *s); ++int main() { ++ struct test a; ++ f_func_(&a); ++ printf("%0.20Lf\n", a.t); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main024.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main024.c +new file mode 100644 +index 0000000..d57ddfc +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main024.c +@@ -0,0 +1,14 @@ ++// Test c call fortran for the derived type and the component of the ++// derived type is scalar of type float _Complex ++// ++#include ++#include ++struct test { ++ float _Complex t; ++}; ++extern void f_func_(struct test *s); ++int main() { ++ struct test a; ++ f_func_(&a); ++ printf("%0.20f + %0.20fi\n", creal(a.t), cimag(a.t)); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main025.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main025.c +new file mode 100644 +index 0000000..c5daac4 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main025.c +@@ -0,0 +1,14 @@ ++// Test c call fortran for the derived type and the component of the ++// derived type is scalar of type double _Complex ++// ++#include ++#include ++struct test { ++ double _Complex t; ++}; ++extern void f_func_(struct test *s); ++int main() { ++ struct test a; ++ f_func_(&a); ++ printf("%0.20lf + %0.20lfi\n", creal(a.t), cimag(a.t)); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main026.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main026.c +new file mode 100644 +index 0000000..1b26750 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main026.c +@@ -0,0 +1,14 @@ ++// Test c call fortran for the derived type and the component of the ++// derived type is scalar of type long double _Complex ++// ++#include ++#include ++struct test { ++ long double _Complex t; ++}; ++extern void f_func_(struct test *s); ++int main() { ++ struct test a; ++ f_func_(&a); ++ printf("%0.20lf + %0.20lfi\n", creal(a.t), cimag(a.t)); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main027.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main027.c +new file mode 100644 +index 0000000..2a4ce6c +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main027.c +@@ -0,0 +1,14 @@ ++// Test c call fortran for the derived type and the component of the ++// derived type is scalar of type _Bool ++// ++#include ++#include ++struct test { ++ _Bool t; ++}; ++extern void f_func_(struct test *s); ++int main() { ++ struct test a; ++ f_func_(&a); ++ printf("%d\n", a.t); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main028.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main028.c +new file mode 100644 +index 0000000..4bfabde +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main028.c +@@ -0,0 +1,14 @@ ++// Test c call fortran for the derived type and the component of the ++// derived type is scalar of type char ++// ++#include ++#include ++struct test { ++ char t; ++}; ++extern void f_func_(struct test *s); ++int main() { ++ struct test a; ++ f_func_(&a); ++ printf("%c\n", a.t); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func001.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func001.f90 +new file mode 100644 +index 0000000..042bc57 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func001.f90 +@@ -0,0 +1,7 @@ ++subroutine f_func(t) ++ type test ++ integer n ++ end type ++ type(test) :: t ++ t%n = 100 ++end +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func002.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func002.f90 +new file mode 100644 +index 0000000..9ec2ac8 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func002.f90 +@@ -0,0 +1,7 @@ ++subroutine f_func(t) ++ type test ++ integer(2) n ++ end type ++ type(test) :: t ++ t%n = 100 ++end +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func003.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func003.f90 +new file mode 100644 +index 0000000..c2bffdc +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func003.f90 +@@ -0,0 +1,7 @@ ++subroutine f_func(t) ++ type test ++ integer(8) n ++ end type ++ type(test) :: t ++ t%n = 100 ++end +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func004.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func004.f90 +new file mode 100644 +index 0000000..c2bffdc +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func004.f90 +@@ -0,0 +1,7 @@ ++subroutine f_func(t) ++ type test ++ integer(8) n ++ end type ++ type(test) :: t ++ t%n = 100 ++end +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func005.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func005.f90 +new file mode 100644 +index 0000000..0f05a35 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func005.f90 +@@ -0,0 +1,7 @@ ++subroutine f_func(t) ++ type test ++ integer(1) n ++ end type ++ type(test) :: t ++ t%n = 100 ++end +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func006.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func006.f90 +new file mode 100644 +index 0000000..c2bffdc +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func006.f90 +@@ -0,0 +1,7 @@ ++subroutine f_func(t) ++ type test ++ integer(8) n ++ end type ++ type(test) :: t ++ t%n = 100 ++end +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func007.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func007.f90 +new file mode 100644 +index 0000000..0f05a35 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func007.f90 +@@ -0,0 +1,7 @@ ++subroutine f_func(t) ++ type test ++ integer(1) n ++ end type ++ type(test) :: t ++ t%n = 100 ++end +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func008.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func008.f90 +new file mode 100644 +index 0000000..9ec2ac8 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func008.f90 +@@ -0,0 +1,7 @@ ++subroutine f_func(t) ++ type test ++ integer(2) n ++ end type ++ type(test) :: t ++ t%n = 100 ++end +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func009.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func009.f90 +new file mode 100644 +index 0000000..64f54d3 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func009.f90 +@@ -0,0 +1,7 @@ ++subroutine f_func(t) ++ type test ++ integer(4) n ++ end type ++ type(test) :: t ++ t%n = 100 ++end +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func010.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func010.f90 +new file mode 100644 +index 0000000..c2bffdc +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func010.f90 +@@ -0,0 +1,7 @@ ++subroutine f_func(t) ++ type test ++ integer(8) n ++ end type ++ type(test) :: t ++ t%n = 100 ++end +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func011.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func011.f90 +new file mode 100644 +index 0000000..0f05a35 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func011.f90 +@@ -0,0 +1,7 @@ ++subroutine f_func(t) ++ type test ++ integer(1) n ++ end type ++ type(test) :: t ++ t%n = 100 ++end +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func012.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func012.f90 +new file mode 100644 +index 0000000..9ec2ac8 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func012.f90 +@@ -0,0 +1,7 @@ ++subroutine f_func(t) ++ type test ++ integer(2) n ++ end type ++ type(test) :: t ++ t%n = 100 ++end +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func013.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func013.f90 +new file mode 100644 +index 0000000..64f54d3 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func013.f90 +@@ -0,0 +1,7 @@ ++subroutine f_func(t) ++ type test ++ integer(4) n ++ end type ++ type(test) :: t ++ t%n = 100 ++end +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func014.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func014.f90 +new file mode 100644 +index 0000000..c2bffdc +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func014.f90 +@@ -0,0 +1,7 @@ ++subroutine f_func(t) ++ type test ++ integer(8) n ++ end type ++ type(test) :: t ++ t%n = 100 ++end +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func015.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func015.f90 +new file mode 100644 +index 0000000..0f05a35 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func015.f90 +@@ -0,0 +1,7 @@ ++subroutine f_func(t) ++ type test ++ integer(1) n ++ end type ++ type(test) :: t ++ t%n = 100 ++end +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func016.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func016.f90 +new file mode 100644 +index 0000000..c2bffdc +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func016.f90 +@@ -0,0 +1,7 @@ ++subroutine f_func(t) ++ type test ++ integer(8) n ++ end type ++ type(test) :: t ++ t%n = 100 ++end +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func017.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func017.f90 +new file mode 100644 +index 0000000..c2bffdc +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func017.f90 +@@ -0,0 +1,7 @@ ++subroutine f_func(t) ++ type test ++ integer(8) n ++ end type ++ type(test) :: t ++ t%n = 100 ++end +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func018.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func018.f90 +new file mode 100644 +index 0000000..c2bffdc +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func018.f90 +@@ -0,0 +1,7 @@ ++subroutine f_func(t) ++ type test ++ integer(8) n ++ end type ++ type(test) :: t ++ t%n = 100 ++end +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func019.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func019.f90 +new file mode 100644 +index 0000000..c2bffdc +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func019.f90 +@@ -0,0 +1,7 @@ ++subroutine f_func(t) ++ type test ++ integer(8) n ++ end type ++ type(test) :: t ++ t%n = 100 ++end +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func020.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func020.f90 +new file mode 100644 +index 0000000..c2bffdc +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func020.f90 +@@ -0,0 +1,7 @@ ++subroutine f_func(t) ++ type test ++ integer(8) n ++ end type ++ type(test) :: t ++ t%n = 100 ++end +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func021.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func021.f90 +new file mode 100644 +index 0000000..75d8e36 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func021.f90 +@@ -0,0 +1,7 @@ ++subroutine f_func(t) ++ type test ++ real(4) n ++ end type ++ type(test) :: t ++ t%n = 3.14 ++end +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func022.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func022.f90 +new file mode 100644 +index 0000000..b8dc58e +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func022.f90 +@@ -0,0 +1,7 @@ ++subroutine f_func(t) ++ type test ++ real(8) n ++ end type ++ type(test) :: t ++ t%n = 3.14 ++end +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func023.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func023.f90 +new file mode 100644 +index 0000000..7e7d3ab +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func023.f90 +@@ -0,0 +1,8 @@ ++subroutine f_func(t) ++ integer, parameter :: K = selected_real_kind(16) ++ type test ++ real(K) n ++ end type ++ type(test) :: t ++ t%n = 3.14 ++end +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func024.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func024.f90 +new file mode 100644 +index 0000000..2c5946d +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func024.f90 +@@ -0,0 +1,7 @@ ++subroutine f_func(t) ++ type test ++ complex(4) n ++ end type ++ type(test) :: t ++ t%n = (-12345678.7654321, 1) ++end +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func025.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func025.f90 +new file mode 100644 +index 0000000..37d5023 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func025.f90 +@@ -0,0 +1,7 @@ ++subroutine f_func(t) ++ type test ++ complex(8) n ++ end type ++ type(test) :: t ++ t%n = (-12345678.7654321, 1) ++end +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func026.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func026.f90 +new file mode 100644 +index 0000000..e5882c2 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func026.f90 +@@ -0,0 +1,8 @@ ++subroutine f_func(t) ++ integer, parameter :: K = selected_real_kind(16) ++ type test ++ complex(K) n ++ end type ++ type(test) :: t ++ t%n = (-12345678.7654321, 1) ++end +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func027.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func027.f90 +new file mode 100644 +index 0000000..3672b88 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func027.f90 +@@ -0,0 +1,7 @@ ++subroutine f_func(t) ++ type test ++ logical(1) n ++ end type ++ type(test) :: t ++ t%n = .TRUE. ++end +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func028.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func028.f90 +new file mode 100644 +index 0000000..af8daba +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func028.f90 +@@ -0,0 +1,7 @@ ++subroutine f_func(t) ++ type test ++ character(1) n ++ end type ++ type(test) :: t ++ t%n = 'a' ++end +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/result.md b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/result.md +new file mode 100644 +index 0000000..347da21 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/result.md +@@ -0,0 +1,29 @@ ++ | test | gfortran | flang | ++ | 001 | PASS | PASS | ++ | 002 | PASS | PASS | ++ | 003 | PASS | PASS | ++ | 004 | PASS | PASS | ++ | 005 | PASS | PASS | ++ | 006 | PASS | PASS | ++ | 007 | PASS | PASS | ++ | 008 | PASS | PASS | ++ | 009 | PASS | PASS | ++ | 010 | PASS | PASS | ++ | 011 | PASS | PASS | ++ | 012 | PASS | PASS | ++ | 013 | PASS | PASS | ++ | 014 | PASS | PASS | ++ | 015 | PASS | PASS | ++ | 016 | PASS | PASS | ++ | 017 | PASS | PASS | ++ | 018 | PASS | PASS | ++ | 019 | PASS | PASS | ++ | 020 | PASS | PASS | ++ | 021 | PASS | PASS | ++ | 022 | PASS | PASS | ++ | 023 | PASS | PASS | ++ | 024 | PASS | PASS | ++ | 025 | PASS | PASS | ++ | 026 | PASS | PASS | ++ | 027 | PASS | PASS | ++ | 028 | PASS | PASS | +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/run.sh b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/run.sh +new file mode 100644 +index 0000000..5b2202e +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/run.sh +@@ -0,0 +1,16 @@ ++for i in {001..028} ++do ++echo "------- test $i ------." ++echo "----- gfortran result:" ++gcc c_main$i.c -c -o c-test.o ++gfortran fortran_func$i.f90 -fno-range-check -c -o fortran-test.o ++gfortran fortran-test.o c-test.o ++./a.out ++rm *.o a.out ++echo "----- flang-new result : " ++clang c_main$i.c -c -o c-test.o ++flang-new fortran_func$i.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o a.out ++done +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main001.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main001.c +new file mode 100644 +index 0000000..82f07ce +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main001.c +@@ -0,0 +1,16 @@ ++// Test c call fortran for the derived type and the component of the ++// derived type is scalar of type int ++// ++#include ++struct t { ++ int x; ++}; ++struct test { ++ struct t w; ++}; ++extern void f_func_(struct test *s); ++int main() { ++ struct test a; ++ f_func_(&a); ++ printf("%d\n", a.w.x); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main002.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main002.c +new file mode 100644 +index 0000000..16adfde +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main002.c +@@ -0,0 +1,16 @@ ++// Test c call fortran for the derived type and the component of the ++// derived type is scalar of type short ++// ++#include ++struct t { ++ short x; ++}; ++struct test { ++ struct t w; ++}; ++extern void f_func_(struct test *s); ++int main() { ++ struct test a; ++ f_func_(&a); ++ printf("%hd\n", a.w.x); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main003.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main003.c +new file mode 100644 +index 0000000..f5e7c6f +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main003.c +@@ -0,0 +1,16 @@ ++// Test c call fortran for the derived type and the component of the ++// derived type is scalar of type long ++// ++#include ++struct t { ++ long x; ++}; ++struct test { ++ struct t w; ++}; ++extern void f_func_(struct test *s); ++int main() { ++ struct test a; ++ f_func_(&a); ++ printf("%ld\n", a.w.x); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main004.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main004.c +new file mode 100644 +index 0000000..6945b96 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main004.c +@@ -0,0 +1,16 @@ ++// Test c call fortran for the derived type and the component of the ++// derived type is scalar of type long long ++// ++#include ++struct t { ++ long long x; ++}; ++struct test { ++ struct t w; ++}; ++extern void f_func_(struct test *s); ++int main() { ++ struct test a; ++ f_func_(&a); ++ printf("%Ld\n", a.w.x); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main005.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main005.c +new file mode 100644 +index 0000000..5313969 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main005.c +@@ -0,0 +1,16 @@ ++// Test c call fortran for the derived type and the component of the ++// derived type is scalar of type signed char ++// ++#include ++struct t { ++ signed char x; ++}; ++struct test { ++ struct t w; ++}; ++extern void f_func_(struct test *s); ++int main() { ++ struct test a; ++ f_func_(&a); ++ printf("%hhd\n", a.w.x); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main006.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main006.c +new file mode 100644 +index 0000000..999d759 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main006.c +@@ -0,0 +1,16 @@ ++// Test c call fortran for the derived type and the component of the ++// derived type is scalar of type size_t ++// ++#include ++struct t { ++ size_t x; ++}; ++struct test { ++ struct t w; ++}; ++extern void f_func_(struct test *s); ++int main() { ++ struct test a; ++ f_func_(&a); ++ printf("%ld\n", a.w.x); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main007.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main007.c +new file mode 100644 +index 0000000..680992f +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main007.c +@@ -0,0 +1,17 @@ ++// Test c call fortran for the derived type and the component of the ++// derived type is scalar of type int8_t ++// ++#include ++#include ++struct t { ++ int8_t x; ++}; ++struct test { ++ struct t w; ++}; ++extern void f_func_(struct test *s); ++int main() { ++ struct test a; ++ f_func_(&a); ++ printf("%hhd\n", a.w.x); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main008.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main008.c +new file mode 100644 +index 0000000..f5b7510 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main008.c +@@ -0,0 +1,17 @@ ++// Test c call fortran for the derived type and the component of the ++// derived type is scalar of type int16_t ++// ++#include ++#include ++struct t { ++ int16_t x; ++}; ++struct test { ++ struct t w; ++}; ++extern void f_func_(struct test *s); ++int main() { ++ struct test a; ++ f_func_(&a); ++ printf("%hd\n", a.w.x); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main009.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main009.c +new file mode 100644 +index 0000000..2227047 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main009.c +@@ -0,0 +1,17 @@ ++// Test c call fortran for the derived type and the component of the ++// derived type is scalar of type int32_t ++// ++#include ++#include ++struct t { ++ int32_t x; ++}; ++struct test { ++ struct t w; ++}; ++extern void f_func_(struct test *s); ++int main() { ++ struct test a; ++ f_func_(&a); ++ printf("%d\n", a.w.x); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main010.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main010.c +new file mode 100644 +index 0000000..355b4c5 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main010.c +@@ -0,0 +1,17 @@ ++// Test c call fortran for the derived type and the component of the ++// derived type is scalar of type int64_t ++// ++#include ++#include ++struct t { ++ int64_t x; ++}; ++struct test { ++ struct t w; ++}; ++extern void f_func_(struct test *s); ++int main() { ++ struct test a; ++ f_func_(&a); ++ printf("%ld\n", a.w.x); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main011.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main011.c +new file mode 100644 +index 0000000..88754d2 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main011.c +@@ -0,0 +1,17 @@ ++// Test c call fortran for the derived type and the component of the ++// derived type is scalar of type int_least8_t ++// ++#include ++#include ++struct t { ++ int_least8_t x; ++}; ++struct test { ++ struct t w; ++}; ++extern void f_func_(struct test *s); ++int main() { ++ struct test a; ++ f_func_(&a); ++ printf("%hhd\n", a.w.x); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main012.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main012.c +new file mode 100644 +index 0000000..930d148 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main012.c +@@ -0,0 +1,17 @@ ++// Test c call fortran for the derived type and the component of the ++// derived type is scalar of type int_least16_t ++// ++#include ++#include ++struct t { ++ int_least16_t x; ++}; ++struct test { ++ struct t w; ++}; ++extern void f_func_(struct test *s); ++int main() { ++ struct test a; ++ f_func_(&a); ++ printf("%hd\n", a.w.x); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main013.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main013.c +new file mode 100644 +index 0000000..b26527a +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main013.c +@@ -0,0 +1,17 @@ ++// Test c call fortran for the derived type and the component of the ++// derived type is scalar of type int_least32_t ++// ++#include ++#include ++struct t { ++ int_least32_t x; ++}; ++struct test { ++ struct t w; ++}; ++extern void f_func_(struct test *s); ++int main() { ++ struct test a; ++ f_func_(&a); ++ printf("%d\n", a.w.x); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main014.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main014.c +new file mode 100644 +index 0000000..9effff1 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main014.c +@@ -0,0 +1,17 @@ ++// Test c call fortran for the derived type and the component of the ++// derived type is scalar of type int_least64_t ++// ++#include ++#include ++struct t { ++ int_least64_t x; ++}; ++struct test { ++ struct t w; ++}; ++extern void f_func_(struct test *s); ++int main() { ++ struct test a; ++ f_func_(&a); ++ printf("%ld\n", a.w.x); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main015.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main015.c +new file mode 100644 +index 0000000..7be24d8 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main015.c +@@ -0,0 +1,17 @@ ++// Test c call fortran for the derived type and the component of the ++// derived type is scalar of type int_fast8_t ++// ++#include ++#include ++struct t { ++ int_fast8_t x; ++}; ++struct test { ++ struct t w; ++}; ++extern void f_func_(struct test *s); ++int main() { ++ struct test a; ++ f_func_(&a); ++ printf("%hhd\n", a.w.x); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main016.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main016.c +new file mode 100644 +index 0000000..e394f92 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main016.c +@@ -0,0 +1,17 @@ ++// Test c call fortran for the derived type and the component of the ++// derived type is scalar of type int_fast16_t ++// ++#include ++#include ++struct t { ++ int_fast16_t x; ++}; ++struct test { ++ struct t w; ++}; ++extern void f_func_(struct test *s); ++int main() { ++ struct test a; ++ f_func_(&a); ++ printf("%ld\n", a.w.x); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main017.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main017.c +new file mode 100644 +index 0000000..cffa904 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main017.c +@@ -0,0 +1,17 @@ ++// Test c call fortran for the derived type and the component of the ++// derived type is scalar of type int_fast32_t ++// ++#include ++#include ++struct t { ++ int_fast32_t x; ++}; ++struct test { ++ struct t w; ++}; ++extern void f_func_(struct test *s); ++int main() { ++ struct test a; ++ f_func_(&a); ++ printf("%ld\n", a.w.x); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main018.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main018.c +new file mode 100644 +index 0000000..9a6ad4c +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main018.c +@@ -0,0 +1,17 @@ ++// Test c call fortran for the derived type and the component of the ++// derived type is scalar of type int_fast64_t ++// ++#include ++#include ++struct t { ++ int_fast64_t x; ++}; ++struct test { ++ struct t w; ++}; ++extern void f_func_(struct test *s); ++int main() { ++ struct test a; ++ f_func_(&a); ++ printf("%ld\n", a.w.x); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main019.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main019.c +new file mode 100644 +index 0000000..ed94ed7 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main019.c +@@ -0,0 +1,17 @@ ++// Test c call fortran for the derived type and the component of the ++// derived type is scalar of type intmax_t ++// ++#include ++#include ++struct t { ++ intmax_t x; ++}; ++struct test { ++ struct t w; ++}; ++extern void f_func_(struct test *s); ++int main() { ++ struct test a; ++ f_func_(&a); ++ printf("%ld\n", a.w.x); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main020.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main020.c +new file mode 100644 +index 0000000..7235d2f +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main020.c +@@ -0,0 +1,17 @@ ++// Test c call fortran for the derived type and the component of the ++// derived type is scalar of type intptr_t ++// ++#include ++#include ++struct t { ++ intptr_t x; ++}; ++struct test { ++ struct t w; ++}; ++extern void f_func_(struct test *s); ++int main() { ++ struct test a; ++ f_func_(&a); ++ printf("%ld\n", a.w.x); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main021.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main021.c +new file mode 100644 +index 0000000..7947fb4 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main021.c +@@ -0,0 +1,16 @@ ++// Test c call fortran for the derived type and the component of the ++// derived type is scalar of type float ++// ++#include ++struct t { ++ float x; ++}; ++struct test { ++ struct t w; ++}; ++extern void f_func_(struct test *s); ++int main() { ++ struct test a; ++ f_func_(&a); ++ printf("%0.20f\n", a.w.x); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main022.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main022.c +new file mode 100644 +index 0000000..39765cf +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main022.c +@@ -0,0 +1,16 @@ ++// Test c call fortran for the derived type and the component of the ++// derived type is scalar of type double ++// ++#include ++struct t { ++ double x; ++}; ++struct test { ++ struct t w; ++}; ++extern void f_func_(struct test *s); ++int main() { ++ struct test a; ++ f_func_(&a); ++ printf("%0.20lf\n", a.w.x); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main023.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main023.c +new file mode 100644 +index 0000000..b560246 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main023.c +@@ -0,0 +1,16 @@ ++// Test c call fortran for the derived type and the component of the ++// derived type is scalar of type long double ++// ++#include ++struct t { ++ long double x; ++}; ++struct test { ++ struct t w; ++}; ++extern void f_func_(struct test *s); ++int main() { ++ struct test a; ++ f_func_(&a); ++ printf("%0.20Lf\n", a.w.x); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main024.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main024.c +new file mode 100644 +index 0000000..882ac49 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main024.c +@@ -0,0 +1,18 @@ ++// Test c call fortran for the derived type and the component of the ++// derived type is scalar of type float _Complex ++// ++#include ++#include ++struct t { ++ float _Complex x; ++}; ++struct test { ++ struct t w; ++}; ++extern void f_func_(struct test *s); ++int main() { ++ struct test a; ++ f_func_(&a); ++ printf("%0.20f + %0.20fi\n", creal(a.w.x), cimag(a.w.x)); ++} ++ +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main025.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main025.c +new file mode 100644 +index 0000000..d85a610 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main025.c +@@ -0,0 +1,18 @@ ++// Test c call fortran for the derived type and the component of the ++// derived type is scalar of type double _Complex ++// ++#include ++#include ++struct t { ++ double _Complex x; ++}; ++struct test { ++ struct t w; ++}; ++extern void f_func_(struct test *s); ++int main() { ++ struct test a; ++ f_func_(&a); ++ printf("%0.20lf + %0.20lfi\n", creal(a.w.x), cimag(a.w.x)); ++} ++ +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main026.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main026.c +new file mode 100644 +index 0000000..bf45517 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main026.c +@@ -0,0 +1,18 @@ ++// Test c call fortran for the derived type and the component of the ++// derived type is scalar of type long double _Complex ++// ++#include ++#include ++struct t { ++ long double _Complex x; ++}; ++struct test { ++ struct t w; ++}; ++extern void f_func_(struct test *s); ++int main() { ++ struct test a; ++ f_func_(&a); ++ printf("%0.20lf + %0.20lfi\n", creal(a.w.x), cimag(a.w.x)); ++} ++ +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main027.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main027.c +new file mode 100644 +index 0000000..d2f28cb +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main027.c +@@ -0,0 +1,16 @@ ++// Test c call fortran for the derived type and the component of the ++// derived type is scalar of type _Bool ++// ++#include ++struct t { ++ _Bool x; ++}; ++struct test { ++ struct t w; ++}; ++extern void f_func_(struct test *s); ++int main() { ++ struct test a; ++ f_func_(&a); ++ printf("%d\n", a.w.x); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main028.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main028.c +new file mode 100644 +index 0000000..55c5de0 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main028.c +@@ -0,0 +1,16 @@ ++// Test c call fortran for the derived type and the component of the ++// derived type is scalar of type char ++// ++#include ++struct t { ++ char x; ++}; ++struct test { ++ struct t w; ++}; ++extern void f_func_(struct test *s); ++int main() { ++ struct test a; ++ f_func_(&a); ++ printf("%c\n", a.w.x); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func001.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func001.f90 +new file mode 100644 +index 0000000..293ee2a +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func001.f90 +@@ -0,0 +1,10 @@ ++subroutine f_func(i) ++ type t ++ integer n ++ end type t ++ type test ++ type(t) x ++ end type test ++ type(test) :: i ++ i%x%n = 100 ++end +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func002.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func002.f90 +new file mode 100644 +index 0000000..71f216b +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func002.f90 +@@ -0,0 +1,10 @@ ++subroutine f_func(i) ++ type t ++ integer(2) n ++ end type t ++ type test ++ type(t) x ++ end type test ++ type(test) :: i ++ i%x%n = 100 ++end +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func003.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func003.f90 +new file mode 100644 +index 0000000..4f89b40 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func003.f90 +@@ -0,0 +1,10 @@ ++subroutine f_func(i) ++ type t ++ integer(8) n ++ end type t ++ type test ++ type(t) x ++ end type test ++ type(test) :: i ++ i%x%n = 100 ++end +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func004.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func004.f90 +new file mode 100644 +index 0000000..4f89b40 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func004.f90 +@@ -0,0 +1,10 @@ ++subroutine f_func(i) ++ type t ++ integer(8) n ++ end type t ++ type test ++ type(t) x ++ end type test ++ type(test) :: i ++ i%x%n = 100 ++end +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func005.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func005.f90 +new file mode 100644 +index 0000000..b16ce20 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func005.f90 +@@ -0,0 +1,10 @@ ++subroutine f_func(i) ++ type t ++ integer(1) n ++ end type t ++ type test ++ type(t) x ++ end type test ++ type(test) :: i ++ i%x%n = 100 ++end +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func006.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func006.f90 +new file mode 100644 +index 0000000..4f89b40 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func006.f90 +@@ -0,0 +1,10 @@ ++subroutine f_func(i) ++ type t ++ integer(8) n ++ end type t ++ type test ++ type(t) x ++ end type test ++ type(test) :: i ++ i%x%n = 100 ++end +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func007.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func007.f90 +new file mode 100644 +index 0000000..b16ce20 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func007.f90 +@@ -0,0 +1,10 @@ ++subroutine f_func(i) ++ type t ++ integer(1) n ++ end type t ++ type test ++ type(t) x ++ end type test ++ type(test) :: i ++ i%x%n = 100 ++end +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func008.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func008.f90 +new file mode 100644 +index 0000000..71f216b +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func008.f90 +@@ -0,0 +1,10 @@ ++subroutine f_func(i) ++ type t ++ integer(2) n ++ end type t ++ type test ++ type(t) x ++ end type test ++ type(test) :: i ++ i%x%n = 100 ++end +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func009.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func009.f90 +new file mode 100644 +index 0000000..c53073a +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func009.f90 +@@ -0,0 +1,10 @@ ++subroutine f_func(i) ++ type t ++ integer(4) n ++ end type t ++ type test ++ type(t) x ++ end type test ++ type(test) :: i ++ i%x%n = 100 ++end +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func010.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func010.f90 +new file mode 100644 +index 0000000..4f89b40 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func010.f90 +@@ -0,0 +1,10 @@ ++subroutine f_func(i) ++ type t ++ integer(8) n ++ end type t ++ type test ++ type(t) x ++ end type test ++ type(test) :: i ++ i%x%n = 100 ++end +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func011.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func011.f90 +new file mode 100644 +index 0000000..b16ce20 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func011.f90 +@@ -0,0 +1,10 @@ ++subroutine f_func(i) ++ type t ++ integer(1) n ++ end type t ++ type test ++ type(t) x ++ end type test ++ type(test) :: i ++ i%x%n = 100 ++end +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func012.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func012.f90 +new file mode 100644 +index 0000000..71f216b +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func012.f90 +@@ -0,0 +1,10 @@ ++subroutine f_func(i) ++ type t ++ integer(2) n ++ end type t ++ type test ++ type(t) x ++ end type test ++ type(test) :: i ++ i%x%n = 100 ++end +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func013.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func013.f90 +new file mode 100644 +index 0000000..c53073a +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func013.f90 +@@ -0,0 +1,10 @@ ++subroutine f_func(i) ++ type t ++ integer(4) n ++ end type t ++ type test ++ type(t) x ++ end type test ++ type(test) :: i ++ i%x%n = 100 ++end +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func014.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func014.f90 +new file mode 100644 +index 0000000..4f89b40 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func014.f90 +@@ -0,0 +1,10 @@ ++subroutine f_func(i) ++ type t ++ integer(8) n ++ end type t ++ type test ++ type(t) x ++ end type test ++ type(test) :: i ++ i%x%n = 100 ++end +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func015.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func015.f90 +new file mode 100644 +index 0000000..b16ce20 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func015.f90 +@@ -0,0 +1,10 @@ ++subroutine f_func(i) ++ type t ++ integer(1) n ++ end type t ++ type test ++ type(t) x ++ end type test ++ type(test) :: i ++ i%x%n = 100 ++end +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func016.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func016.f90 +new file mode 100644 +index 0000000..4f89b40 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func016.f90 +@@ -0,0 +1,10 @@ ++subroutine f_func(i) ++ type t ++ integer(8) n ++ end type t ++ type test ++ type(t) x ++ end type test ++ type(test) :: i ++ i%x%n = 100 ++end +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func017.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func017.f90 +new file mode 100644 +index 0000000..4f89b40 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func017.f90 +@@ -0,0 +1,10 @@ ++subroutine f_func(i) ++ type t ++ integer(8) n ++ end type t ++ type test ++ type(t) x ++ end type test ++ type(test) :: i ++ i%x%n = 100 ++end +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func018.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func018.f90 +new file mode 100644 +index 0000000..4f89b40 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func018.f90 +@@ -0,0 +1,10 @@ ++subroutine f_func(i) ++ type t ++ integer(8) n ++ end type t ++ type test ++ type(t) x ++ end type test ++ type(test) :: i ++ i%x%n = 100 ++end +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func019.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func019.f90 +new file mode 100644 +index 0000000..4f89b40 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func019.f90 +@@ -0,0 +1,10 @@ ++subroutine f_func(i) ++ type t ++ integer(8) n ++ end type t ++ type test ++ type(t) x ++ end type test ++ type(test) :: i ++ i%x%n = 100 ++end +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func020.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func020.f90 +new file mode 100644 +index 0000000..4f89b40 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func020.f90 +@@ -0,0 +1,10 @@ ++subroutine f_func(i) ++ type t ++ integer(8) n ++ end type t ++ type test ++ type(t) x ++ end type test ++ type(test) :: i ++ i%x%n = 100 ++end +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func021.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func021.f90 +new file mode 100644 +index 0000000..0542cd2 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func021.f90 +@@ -0,0 +1,10 @@ ++subroutine f_func(i) ++ type t ++ real(4) n ++ end type t ++ type test ++ type(t) x ++ end type test ++ type(test) :: i ++ i%x%n = 123.4567898765432123456789 ++end +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func022.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func022.f90 +new file mode 100644 +index 0000000..b3463b7 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func022.f90 +@@ -0,0 +1,10 @@ ++subroutine f_func(i) ++ type t ++ real(8) n ++ end type t ++ type test ++ type(t) x ++ end type test ++ type(test) :: i ++ i%x%n = 123.4567898765432123456789 ++end +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func023.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func023.f90 +new file mode 100644 +index 0000000..6e0641b +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func023.f90 +@@ -0,0 +1,12 @@ ++subroutine f_func(i) ++ integer, parameter :: K = selected_real_kind(16) ++ type t ++ real(K) n ++ end type t ++ type test ++ type(t) x ++ end type test ++ type(test) :: i ++ i%x%n = 123.4567898765432123456789 ++end ++ +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func024.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func024.f90 +new file mode 100644 +index 0000000..e05aa79 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func024.f90 +@@ -0,0 +1,12 @@ ++subroutine f_func(i) ++ type t ++ complex(4) n ++ end type t ++ type test ++ type(t) x ++ end type test ++ type(test) :: i ++ i%x%n = (123.4567898765432123456789, 1) ++end ++ ++ +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func025.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func025.f90 +new file mode 100644 +index 0000000..835cd59 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func025.f90 +@@ -0,0 +1,12 @@ ++subroutine f_func(i) ++ type t ++ complex(8) n ++ end type t ++ type test ++ type(t) x ++ end type test ++ type(test) :: i ++ i%x%n = (123.4567898765432123456789, 1) ++end ++ ++ +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func026.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func026.f90 +new file mode 100644 +index 0000000..bb690e7 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func026.f90 +@@ -0,0 +1,14 @@ ++subroutine f_func(i) ++ integer, parameter :: K = selected_real_kind(16) ++ type t ++ complex(K) n ++ end type t ++ type test ++ type(t) x ++ end type test ++ type(test) :: i ++ i%x%n = (123.4567898765432123456789, 1) ++end ++ ++ ++ +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func027.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func027.f90 +new file mode 100644 +index 0000000..8044a61 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func027.f90 +@@ -0,0 +1,10 @@ ++subroutine f_func(i) ++ type t ++ logical(1) n ++ end type t ++ type test ++ type(t) x ++ end type test ++ type(test) :: i ++ i%x%n = .TRUE. ++end +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func028.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func028.f90 +new file mode 100644 +index 0000000..0b4f672 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func028.f90 +@@ -0,0 +1,10 @@ ++subroutine f_func(i) ++ type t ++ character(1) n ++ end type t ++ type test ++ type(t) x ++ end type test ++ type(test) :: i ++ i%x%n = 'a' ++end +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/result.md b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/result.md +new file mode 100644 +index 0000000..347da21 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/result.md +@@ -0,0 +1,29 @@ ++ | test | gfortran | flang | ++ | 001 | PASS | PASS | ++ | 002 | PASS | PASS | ++ | 003 | PASS | PASS | ++ | 004 | PASS | PASS | ++ | 005 | PASS | PASS | ++ | 006 | PASS | PASS | ++ | 007 | PASS | PASS | ++ | 008 | PASS | PASS | ++ | 009 | PASS | PASS | ++ | 010 | PASS | PASS | ++ | 011 | PASS | PASS | ++ | 012 | PASS | PASS | ++ | 013 | PASS | PASS | ++ | 014 | PASS | PASS | ++ | 015 | PASS | PASS | ++ | 016 | PASS | PASS | ++ | 017 | PASS | PASS | ++ | 018 | PASS | PASS | ++ | 019 | PASS | PASS | ++ | 020 | PASS | PASS | ++ | 021 | PASS | PASS | ++ | 022 | PASS | PASS | ++ | 023 | PASS | PASS | ++ | 024 | PASS | PASS | ++ | 025 | PASS | PASS | ++ | 026 | PASS | PASS | ++ | 027 | PASS | PASS | ++ | 028 | PASS | PASS | +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/run.sh b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/run.sh +new file mode 100644 +index 0000000..5b2202e +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/run.sh +@@ -0,0 +1,16 @@ ++for i in {001..028} ++do ++echo "------- test $i ------." ++echo "----- gfortran result:" ++gcc c_main$i.c -c -o c-test.o ++gfortran fortran_func$i.f90 -fno-range-check -c -o fortran-test.o ++gfortran fortran-test.o c-test.o ++./a.out ++rm *.o a.out ++echo "----- flang-new result : " ++clang c_main$i.c -c -o c-test.o ++flang-new fortran_func$i.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o a.out ++done +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/003_c_call_fortran_nested_struct_complicated/c_main001.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/003_c_call_fortran_nested_struct_complicated/c_main001.c +new file mode 100644 +index 0000000..c76dd0a +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/003_c_call_fortran_nested_struct_complicated/c_main001.c +@@ -0,0 +1,21 @@ ++// Test c call fortran for the derived type and the component of the ++// derived type is derived type ++// ++#include ++struct t { ++ int x; ++}; ++struct test { ++ struct t w; ++ int ww[4]; ++}; ++extern void f_func_(struct test *s); ++int main() { ++ struct test a; ++ f_func_(&a); ++ printf("%d\n", a.w.x); ++ printf("%d\n", a.ww[0]); ++ printf("%d\n", a.ww[1]); ++ printf("%d\n", a.ww[2]); ++ printf("%d\n", a.ww[3]); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/003_c_call_fortran_nested_struct_complicated/c_main002.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/003_c_call_fortran_nested_struct_complicated/c_main002.c +new file mode 100644 +index 0000000..1f77697 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/003_c_call_fortran_nested_struct_complicated/c_main002.c +@@ -0,0 +1,26 @@ ++// Test c call fortran for the array of derived type and the component ++// of the derived type is derived type ++// ++#include ++struct t { ++ int x; ++}; ++struct test { ++ struct t w; ++ int ww[4]; ++}; ++extern void f_func_(struct test s[2]); ++int main() { ++ struct test a[2]; ++ f_func_(a); ++ printf("%d\n", a[0].w.x); ++ printf("%d\n", a[0].ww[0]); ++ printf("%d\n", a[0].ww[1]); ++ printf("%d\n", a[0].ww[2]); ++ printf("%d\n", a[0].ww[3]); ++ printf("%d\n", a[1].w.x); ++ printf("%d\n", a[1].ww[0]); ++ printf("%d\n", a[1].ww[1]); ++ printf("%d\n", a[1].ww[2]); ++ printf("%d\n", a[1].ww[3]); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/003_c_call_fortran_nested_struct_complicated/c_main003.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/003_c_call_fortran_nested_struct_complicated/c_main003.c +new file mode 100644 +index 0000000..75fc179 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/003_c_call_fortran_nested_struct_complicated/c_main003.c +@@ -0,0 +1,23 @@ ++// Test c call fortran for the derived type and the component of the ++// derived type are derived types ++// ++#include ++struct t { ++ int x; ++}; ++struct t2 { ++ struct t t2w; ++ int t2x; ++}; ++struct test { ++ struct t w; ++ struct t2 ww; ++}; ++extern void f_func_(struct test *s); ++int main() { ++ struct test a; ++ f_func_(&a); ++ printf("%d\n", a.w.x); ++ printf("%d\n", a.ww.t2x); ++ printf("%d\n", a.ww.t2w.x); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/003_c_call_fortran_nested_struct_complicated/c_main004.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/003_c_call_fortran_nested_struct_complicated/c_main004.c +new file mode 100644 +index 0000000..d861d2d +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/003_c_call_fortran_nested_struct_complicated/c_main004.c +@@ -0,0 +1,30 @@ ++// Test c call fortran for the nesting of derived types ++// ++#include ++struct t { ++ int x; ++}; ++struct t1 { ++ struct t t1t; ++ int x1; ++}; ++struct t2 { ++ struct t1 t2t1; ++ int x2; ++}; ++struct t3 { ++ struct t2 t3t2; ++ int x3; ++}; ++struct test { ++ struct t3 w; ++}; ++extern void f_func_(struct test *s); ++int main() { ++ struct test a; ++ f_func_(&a); ++ printf("%d\n", a.w.x3); ++ printf("%d\n", a.w.t3t2.x2); ++ printf("%d\n", a.w.t3t2.t2t1.x1); ++ printf("%d\n", a.w.t3t2.t2t1.t1t.x); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/003_c_call_fortran_nested_struct_complicated/c_main005.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/003_c_call_fortran_nested_struct_complicated/c_main005.c +new file mode 100644 +index 0000000..e270b60 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/003_c_call_fortran_nested_struct_complicated/c_main005.c +@@ -0,0 +1,19 @@ ++// Test c call fortran for the derived type and the component of the ++// derived type is array of derived type ++// ++#include ++struct t { ++ int x; ++}; ++struct test { ++ struct t w[4]; ++}; ++extern void f_func_(struct test *s); ++int main() { ++ struct test a; ++ f_func_(&a); ++ printf("%d\n", a.w[0].x); ++ printf("%d\n", a.w[1].x); ++ printf("%d\n", a.w[2].x); ++ printf("%d\n", a.w[3].x); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/003_c_call_fortran_nested_struct_complicated/c_main006.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/003_c_call_fortran_nested_struct_complicated/c_main006.c +new file mode 100644 +index 0000000..706d40a +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/003_c_call_fortran_nested_struct_complicated/c_main006.c +@@ -0,0 +1,15 @@ ++// Test c call fortran for the derived type and the component of the ++// derived type is scalar of type int ++// ++#include ++struct t { ++ int x; ++}; ++extern struct t f_func_(struct t *s); ++int main() { ++ struct t a; ++ struct t b; ++ b = f_func_(&a); ++ printf("%d\n", a.x); ++ printf("%d\n", b.x); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/003_c_call_fortran_nested_struct_complicated/fortran_func001.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/003_c_call_fortran_nested_struct_complicated/fortran_func001.f90 +new file mode 100644 +index 0000000..eddf162 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/003_c_call_fortran_nested_struct_complicated/fortran_func001.f90 +@@ -0,0 +1,14 @@ ++subroutine f_func(i) ++ type t ++ integer n ++ end type t ++ type test ++ type(t) x ++ integer :: ww(4) ++ end type test ++ type(test) :: i ++ i%x%n = 100 ++ do j = 1, 4 ++ i%ww(j) = j ++ end do ++end +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/003_c_call_fortran_nested_struct_complicated/fortran_func002.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/003_c_call_fortran_nested_struct_complicated/fortran_func002.f90 +new file mode 100644 +index 0000000..d05af6d +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/003_c_call_fortran_nested_struct_complicated/fortran_func002.f90 +@@ -0,0 +1,18 @@ ++subroutine f_func(i) ++ type t ++ integer n ++ end type t ++ type test ++ type(t) x ++ integer :: ww(4) ++ end type test ++ type(test) :: i(2) ++ i(1)%x%n = 100 ++ do j = 1, 4 ++ i(1)%ww(j) = j ++ end do ++ i(2)%x%n = 200 ++ do j = 1, 4 ++ i(2)%ww(j) = j + 1 ++ end do ++end +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/003_c_call_fortran_nested_struct_complicated/fortran_func003.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/003_c_call_fortran_nested_struct_complicated/fortran_func003.f90 +new file mode 100644 +index 0000000..4b00f99 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/003_c_call_fortran_nested_struct_complicated/fortran_func003.f90 +@@ -0,0 +1,17 @@ ++subroutine f_func(i) ++ type t ++ integer n ++ end type t ++ type t2 ++ type(t) t2x ++ integer t2n ++ end type t2 ++ type test ++ type(t) x ++ type(t2) x2 ++ end type test ++ type(test) :: i ++ i%x%n = 100 ++ i%x2%t2n = 100 ++ i%x2%t2x%n = 100 ++end +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/003_c_call_fortran_nested_struct_complicated/fortran_func004.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/003_c_call_fortran_nested_struct_complicated/fortran_func004.f90 +new file mode 100644 +index 0000000..652f176 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/003_c_call_fortran_nested_struct_complicated/fortran_func004.f90 +@@ -0,0 +1,25 @@ ++subroutine f_func(i) ++ type t ++ integer n ++ end type t ++ type t1 ++ type(t) x1 ++ integer n1 ++ end type t1 ++ type t2 ++ type(t1) x2 ++ integer n2 ++ end type t2 ++ type t3 ++ type(t2) x3 ++ integer n3 ++ end type t3 ++ type test ++ type(t3) x ++ end type test ++ type(test) :: i ++ i%x%n3 = 100 ++ i%x%x3%n2 = 100 ++ i%x%x3%x2%n1 = 100 ++ i%x%x3%x2%x1%n = 100 ++end +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/003_c_call_fortran_nested_struct_complicated/fortran_func005.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/003_c_call_fortran_nested_struct_complicated/fortran_func005.f90 +new file mode 100644 +index 0000000..d4dc973 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/003_c_call_fortran_nested_struct_complicated/fortran_func005.f90 +@@ -0,0 +1,12 @@ ++subroutine f_func(i) ++ type t ++ integer n ++ end type t ++ type test ++ type(t) x(4) ++ end type test ++ type(test) :: i ++ do j = 1, 4 ++ i%x(j)%n = j ++ end do ++end +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/003_c_call_fortran_nested_struct_complicated/fortran_func006.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/003_c_call_fortran_nested_struct_complicated/fortran_func006.f90 +new file mode 100644 +index 0000000..95c3653 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/003_c_call_fortran_nested_struct_complicated/fortran_func006.f90 +@@ -0,0 +1,9 @@ ++function f_func(a) ++ type t ++ integer n ++ end type t ++ type(t) :: a ++ type(t) :: f_func ++ a%n = 1 ++ f_func%n = 2 ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/003_c_call_fortran_nested_struct_complicated/result.md b/test/interoperability_with_c_c_call_fortran_global_and_struct/003_c_call_fortran_nested_struct_complicated/result.md +new file mode 100644 +index 0000000..d0a737b +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/003_c_call_fortran_nested_struct_complicated/result.md +@@ -0,0 +1,7 @@ ++ | test | gfortran | flang | ++ | 001 | PASS | PASS | ++ | 002 | PASS | PASS | ++ | 003 | PASS | PASS | ++ | 004 | PASS | PASS | ++ | 005 | PASS | PASS | ++ | 006 | PASS | ERROR | +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/003_c_call_fortran_nested_struct_complicated/run.sh b/test/interoperability_with_c_c_call_fortran_global_and_struct/003_c_call_fortran_nested_struct_complicated/run.sh +new file mode 100644 +index 0000000..cd0e873 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/003_c_call_fortran_nested_struct_complicated/run.sh +@@ -0,0 +1,16 @@ ++for i in {001..006} ++do ++echo "------- test $i ------." ++echo "----- gfortran result:" ++gcc c_main$i.c -c -o c-test.o ++gfortran fortran_func$i.f90 -fno-range-check -c -o fortran-test.o ++gfortran fortran-test.o c-test.o ++./a.out ++rm *.o a.out ++echo "----- flang-new result : " ++clang c_main$i.c -c -o c-test.o ++flang-new fortran_func$i.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o a.out ++done +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/c_main001.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/c_main001.c +new file mode 100644 +index 0000000..0c74416 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/c_main001.c +@@ -0,0 +1,13 @@ ++// test c call fortran for global about scalar ++// ++#include ++extern struct block { ++ int num; ++}b; ++extern struct block block_; ++extern void f_func_(); ++int main() { ++ block_.num = 1; ++ f_func_(); ++ printf("%d\n", block_.num); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/c_main002.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/c_main002.c +new file mode 100644 +index 0000000..a54e182 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/c_main002.c +@@ -0,0 +1,15 @@ ++// test c call fortran for global about array ++// ++#include ++extern struct block { ++ int num[4]; ++}b; ++extern struct block block_; ++extern void f_func_(); ++int main() { ++ for(int i = 0; i < 4; i++) ++ block_.num[i] = 0; ++ f_func_(); ++ for(int i = 0; i < 4; i++) ++ printf("%d\n", block_.num[i]); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/c_main003.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/c_main003.c +new file mode 100644 +index 0000000..685b825 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/c_main003.c +@@ -0,0 +1,17 @@ ++// test c call fortran for global about data alignment ++// ++#include ++#include ++extern struct block { ++ int16_t num1; ++ int8_t num; ++}b; ++extern struct block block_; ++extern void f_func_(); ++int main() { ++ block_.num = 1; ++ block_.num1 = 1; ++ f_func_(); ++ printf("%d\n", block_.num); ++ printf("%d\n", block_.num1); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/c_main004.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/c_main004.c +new file mode 100644 +index 0000000..c139851 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/c_main004.c +@@ -0,0 +1,20 @@ ++// test c call fortran for global about data alignment ++// ++#include ++#include ++extern struct block { ++ int32_t num2; ++ int16_t num1; ++ int8_t num; ++}b; ++extern struct block block_; ++extern void f_func_(); ++int main() { ++ block_.num2 = 1; ++ block_.num = 1; ++ block_.num1 = 1; ++ f_func_(); ++ printf("%d\n", block_.num); ++ printf("%d\n", block_.num1); ++ printf("%d\n", block_.num2); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/c_main005.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/c_main005.c +new file mode 100644 +index 0000000..ed63583 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/c_main005.c +@@ -0,0 +1,23 @@ ++// test c call fortran for global about data alignment ++// ++#include ++#include ++extern struct block { ++ int64_t num3; ++ int32_t num2; ++ int16_t num1; ++ int8_t num; ++}b; ++extern struct block block_; ++extern void f_func_(); ++int main() { ++ block_.num3 = 1; ++ block_.num2 = 1; ++ block_.num = 1; ++ block_.num1 = 1; ++ f_func_(); ++ printf("%d\n", block_.num); ++ printf("%d\n", block_.num1); ++ printf("%d\n", block_.num2); ++ printf("%ld\n", block_.num3); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/c_main006.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/c_main006.c +new file mode 100644 +index 0000000..d26ef44 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/c_main006.c +@@ -0,0 +1,26 @@ ++// test c call fortran for global about data alignment ++// ++#include ++#include ++extern struct block { ++ int64_t num4[2]; ++ int64_t num3; ++ int32_t num2; ++ int16_t num1; ++ int8_t num; ++}b; ++extern struct block block_; ++extern void f_func_(); ++int main() { ++ block_.num4[0] = 1; ++ block_.num3 = 1; ++ block_.num2 = 1; ++ block_.num = 1; ++ block_.num1 = 1; ++ f_func_(); ++ printf("%d\n", block_.num); ++ printf("%d\n", block_.num1); ++ printf("%d\n", block_.num2); ++ printf("%ld\n", block_.num3); ++ printf("%ld\n", block_.num4[0]); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/c_main007.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/c_main007.c +new file mode 100644 +index 0000000..d508f07 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/c_main007.c +@@ -0,0 +1,24 @@ ++// test c call fortran for global about data alignment ++// ++#include ++#include ++extern struct block { ++ int64_t num4[4]; ++ int64_t num3[2]; ++ int32_t num2[2]; ++ int16_t num1[2]; ++ int8_t num[3]; ++}b; ++extern struct block block_; ++extern void f_func_(); ++int main() { ++ f_func_(); ++ for(int i = 0; i < 2; i++) { ++ printf("%d\n", block_.num[i]); ++ printf("%d\n", block_.num1[i]); ++ printf("%d\n", block_.num2[i]); ++ printf("%ld\n", block_.num3[i]); ++ printf("%ld\n", block_.num4[2 * i]); ++ } ++ printf("%d\n", block_.num[2]); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/c_main008.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/c_main008.c +new file mode 100644 +index 0000000..4848bf1 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/c_main008.c +@@ -0,0 +1,16 @@ ++// test c call fortran for global about struct ++// ++#include ++#include ++struct test { ++ int x; ++}; ++extern struct block { ++ struct test a; ++}b; ++extern struct block block_; ++extern void f_func_(); ++int main() { ++ f_func_(); ++ printf("%d\n", block_.a.x); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/c_main009.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/c_main009.c +new file mode 100644 +index 0000000..e9e432d +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/c_main009.c +@@ -0,0 +1,18 @@ ++// test c call fortran for global about struct ++// ++#include ++#include ++struct test { ++ int16_t x2; ++ int8_t x; ++}; ++extern struct block { ++ struct test a; ++}b; ++extern struct block block_; ++extern void f_func_(); ++int main() { ++ f_func_(); ++ printf("%hhd\n", block_.a.x); ++ printf("%hd\n", block_.a.x2); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/c_main010.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/c_main010.c +new file mode 100644 +index 0000000..f31b9ba +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/c_main010.c +@@ -0,0 +1,20 @@ ++// test c call fortran for global about struct ++// ++#include ++#include ++struct test { ++ int32_t x3; ++ int16_t x2; ++ int8_t x; ++}; ++extern struct block { ++ struct test a; ++}b; ++extern struct block block_; ++extern void f_func_(); ++int main() { ++ f_func_(); ++ printf("%hhd\n", block_.a.x); ++ printf("%hd\n", block_.a.x2); ++ printf("%d\n", block_.a.x3); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/c_main011.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/c_main011.c +new file mode 100644 +index 0000000..c62df4a +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/c_main011.c +@@ -0,0 +1,22 @@ ++// test c call fortran for global about struct ++// ++#include ++#include ++struct test { ++ int64_t x4; ++ int32_t x3; ++ int16_t x2; ++ int8_t x; ++}; ++extern struct block { ++ struct test a; ++}b; ++extern struct block block_; ++extern void f_func_(); ++int main() { ++ f_func_(); ++ printf("%hhd\n", block_.a.x); ++ printf("%hd\n", block_.a.x2); ++ printf("%d\n", block_.a.x3); ++ printf("%ld\n", block_.a.x4); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/c_main012.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/c_main012.c +new file mode 100644 +index 0000000..48e44ca +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/c_main012.c +@@ -0,0 +1,24 @@ ++// test c call fortran for global about struct ++// ++#include ++#include ++struct test { ++ int64_t x5[2]; ++ int64_t x4; ++ int32_t x3; ++ int16_t x2; ++ int8_t x; ++}; ++extern struct block { ++ struct test a; ++}b; ++extern struct block block_; ++extern void f_func_(); ++int main() { ++ f_func_(); ++ printf("%hhd\n", block_.a.x); ++ printf("%hd\n", block_.a.x2); ++ printf("%d\n", block_.a.x3); ++ printf("%ld\n", block_.a.x4); ++ printf("%ld\n", block_.a.x5[0]); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/c_main013.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/c_main013.c +new file mode 100644 +index 0000000..410e0ef +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/c_main013.c +@@ -0,0 +1,27 @@ ++// test c call fortran for global about struct ++// ++#include ++#include ++struct test { ++ int64_t x5[4]; ++ int64_t x4[2]; ++ int32_t x3[2]; ++ int16_t x2[2]; ++ int8_t x[3]; ++}; ++extern struct block { ++ struct test a; ++}b; ++extern struct block block_; ++extern void f_func_(); ++int main() { ++ f_func_(); ++ for (int i = 0; i < 2; i++) { ++ printf("%hhd\n", block_.a.x[i]); ++ printf("%hd\n", block_.a.x2[i]); ++ printf("%d\n", block_.a.x3[i]); ++ printf("%ld\n", block_.a.x4[i]); ++ printf("%ld\n", block_.a.x5[2 * i]); ++ } ++ printf("%hhd\n", block_.a.x[2]); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/c_main014.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/c_main014.c +new file mode 100644 +index 0000000..be41930 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/c_main014.c +@@ -0,0 +1,27 @@ ++// test c call fortran for global about struct ++// ++#include ++#include ++struct test { ++ int64_t x5[2]; ++ int64_t x4; ++ int32_t x3; ++ int16_t x2; ++ int8_t x; ++}; ++extern struct block { ++ struct test a[5]; ++}b; ++extern struct block block_; ++extern void f_func_(); ++int main() { ++ f_func_(); ++ for(int i = 0; i < 5; i++) { ++ printf("%hhd\n", block_.a[i].x); ++ printf("%hd\n", block_.a[i].x2); ++ printf("%d\n", block_.a[i].x3); ++ printf("%ld\n", block_.a[i].x4); ++ printf("%ld\n", block_.a[i].x5[0]); ++ } ++ ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/c_main015.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/c_main015.c +new file mode 100644 +index 0000000..8a84f8d +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/c_main015.c +@@ -0,0 +1,31 @@ ++// test c call fortran for global about struct ++// ++#include ++#include ++struct test1 { ++ double d; ++ float f; ++}; ++struct test { ++ int64_t x5[2]; ++ struct test1 t; ++ int64_t x4; ++ int32_t x3; ++ int16_t x2; ++ int8_t x; ++}; ++extern struct block { ++ struct test a; ++}b; ++extern struct block block_; ++extern void f_func_(); ++int main() { ++ f_func_(); ++ printf("%hhd\n", block_.a.x); ++ printf("%hd\n", block_.a.x2); ++ printf("%d\n", block_.a.x3); ++ printf("%ld\n", block_.a.x4); ++ printf("%ld\n", block_.a.x5[0]); ++ printf("%lf\n", block_.a.t.d); ++ printf("%f\n", block_.a.t.f); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/c_main016.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/c_main016.c +new file mode 100644 +index 0000000..8e083ca +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/c_main016.c +@@ -0,0 +1,31 @@ ++// test c call fortran for global about structs ++// ++#include ++#include ++struct test1 { ++ double d; ++ float f; ++}; ++struct test { ++ int64_t x5[2]; ++ int64_t x4; ++ int32_t x3; ++ int16_t x2; ++ int8_t x; ++}; ++extern struct block { ++ struct test a; ++ struct test1 t; ++}b; ++extern struct block block_; ++extern void f_func_(); ++int main() { ++ f_func_(); ++ printf("%hhd\n", block_.a.x); ++ printf("%hd\n", block_.a.x2); ++ printf("%d\n", block_.a.x3); ++ printf("%ld\n", block_.a.x4); ++ printf("%ld\n", block_.a.x5[0]); ++ printf("%lf\n", block_.t.d); ++ printf("%f\n", block_.t.f); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/fortran_func001.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/fortran_func001.f90 +new file mode 100644 +index 0000000..b897dd1 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/fortran_func001.f90 +@@ -0,0 +1,5 @@ ++subroutine f_func() ++ common /block/ num ++ integer :: num ++ num = 10 ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/fortran_func002.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/fortran_func002.f90 +new file mode 100644 +index 0000000..9abf96c +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/fortran_func002.f90 +@@ -0,0 +1,7 @@ ++subroutine f_func() ++ common /block/ num ++ integer :: num(4) ++ do i = 1, 4 ++ num(i) = 10 + i ++ end do ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/fortran_func003.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/fortran_func003.f90 +new file mode 100644 +index 0000000..9c00b6c +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/fortran_func003.f90 +@@ -0,0 +1,7 @@ ++subroutine f_func() ++ common /block/ num1, num ++ integer(2) :: num1 ++ integer(1) :: num ++ num = 10 ++ num1 = 11 ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/fortran_func004.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/fortran_func004.f90 +new file mode 100644 +index 0000000..4f38cd8 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/fortran_func004.f90 +@@ -0,0 +1,9 @@ ++subroutine f_func() ++ common /block/ num2, num1, num ++ integer(4) :: num2 ++ integer(2) :: num1 ++ integer(1) :: num ++ num2 = 12 ++ num1 = 11 ++ num = 10 ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/fortran_func005.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/fortran_func005.f90 +new file mode 100644 +index 0000000..8b4a639 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/fortran_func005.f90 +@@ -0,0 +1,11 @@ ++subroutine f_func() ++ common /block/ num3, num2, num1, num ++ integer(8) :: num3 ++ integer(4) :: num2 ++ integer(2) :: num1 ++ integer(1) :: num ++ num3 = 13 ++ num2 = 12 ++ num1 = 11 ++ num = 10 ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/fortran_func006.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/fortran_func006.f90 +new file mode 100644 +index 0000000..c5267ae +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/fortran_func006.f90 +@@ -0,0 +1,13 @@ ++subroutine f_func() ++ common /block/ num4, num3, num2, num1, num ++ integer(16) :: num4 ++ integer(8) :: num3 ++ integer(4) :: num2 ++ integer(2) :: num1 ++ integer(1) :: num ++ num4 = 14 ++ num3 = 13 ++ num2 = 12 ++ num1 = 11 ++ num = 10 ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/fortran_func007.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/fortran_func007.f90 +new file mode 100644 +index 0000000..b2e42cf +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/fortran_func007.f90 +@@ -0,0 +1,16 @@ ++subroutine f_func() ++ common /block/ num4, num3, num2, num1, num ++ integer(16) :: num4(2) ++ integer(8) :: num3(2) ++ integer(4) :: num2(2) ++ integer(2) :: num1(2) ++ integer(1) :: num(3) ++ do i = 1, 2 ++ num4(i) = 14 ++ num3(i) = 13 ++ num2(i) = 12 ++ num1(i) = 11 ++ num(i) = 10 ++ end do ++ num(3) = 1 ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/fortran_func008.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/fortran_func008.f90 +new file mode 100644 +index 0000000..024764d +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/fortran_func008.f90 +@@ -0,0 +1,8 @@ ++subroutine f_func() ++ common /block/ a ++ type, bind(c) :: t ++ integer :: x ++ end type ++ type(t) :: a ++ a%x = 1 ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/fortran_func009.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/fortran_func009.f90 +new file mode 100644 +index 0000000..bc98173 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/fortran_func009.f90 +@@ -0,0 +1,10 @@ ++subroutine f_func() ++ common /block/ a ++ type, bind(c) :: t ++ integer(2) :: x2 ++ integer(1) :: x ++ end type ++ type(t) :: a ++ a%x = 1 ++ a%x2 = 2 ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/fortran_func010.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/fortran_func010.f90 +new file mode 100644 +index 0000000..f7cfd98 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/fortran_func010.f90 +@@ -0,0 +1,12 @@ ++subroutine f_func() ++ common /block/ a ++ type, bind(c) :: t ++ integer(4) :: x3 ++ integer(2) :: x2 ++ integer(1) :: x ++ end type ++ type(t) :: a ++ a%x = 1 ++ a%x2 = 2 ++ a%x3 = 3 ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/fortran_func011.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/fortran_func011.f90 +new file mode 100644 +index 0000000..56ba0bb +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/fortran_func011.f90 +@@ -0,0 +1,14 @@ ++subroutine f_func() ++ common /block/ a ++ type, bind(c) :: t ++ integer(8) :: x4 ++ integer(4) :: x3 ++ integer(2) :: x2 ++ integer(1) :: x ++ end type ++ type(t) :: a ++ a%x = 1 ++ a%x2 = 2 ++ a%x3 = 3 ++ a%x4 = 4 ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/fortran_func012.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/fortran_func012.f90 +new file mode 100644 +index 0000000..e62d62b +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/fortran_func012.f90 +@@ -0,0 +1,16 @@ ++subroutine f_func() ++ common /block/ a ++ type, bind(c) :: t ++ integer(16) :: x5 ++ integer(8) :: x4 ++ integer(4) :: x3 ++ integer(2) :: x2 ++ integer(1) :: x ++ end type ++ type(t) :: a ++ a%x = 1 ++ a%x2 = 2 ++ a%x3 = 3 ++ a%x4 = 4 ++ a%x5 = 5 ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/fortran_func013.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/fortran_func013.f90 +new file mode 100644 +index 0000000..9ec7f34 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/fortran_func013.f90 +@@ -0,0 +1,19 @@ ++subroutine f_func() ++ common /block/ a ++ type, bind(c) :: t ++ integer(16) :: x5(2) ++ integer(8) :: x4(2) ++ integer(4) :: x3(2) ++ integer(2) :: x2(2) ++ integer(1) :: x(3) ++ end type ++ type(t) :: a ++ do i = 1, 2 ++ a%x(i) = 1 ++ a%x2(i) = 2 ++ a%x3(i) = 3 ++ a%x4(i) = 4 ++ a%x5(i) = 5 ++ end do ++ a%x(3) = 1 ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/fortran_func014.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/fortran_func014.f90 +new file mode 100644 +index 0000000..45f6fb8 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/fortran_func014.f90 +@@ -0,0 +1,18 @@ ++subroutine f_func() ++ common /block/ a ++ type, bind(c) :: t ++ integer(16) :: x5 ++ integer(8) :: x4 ++ integer(4) :: x3 ++ integer(2) :: x2 ++ integer(1) :: x ++ end type ++ type(t) :: a(5) ++ do i = 1, 5 ++ a(i)%x = 1 ++ a(i)%x2 = 2 ++ a(i)%x3 = 3 ++ a(i)%x4 = 4 ++ a(i)%x5 = 5 ++ end do ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/fortran_func015.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/fortran_func015.f90 +new file mode 100644 +index 0000000..2ef10c3 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/fortran_func015.f90 +@@ -0,0 +1,23 @@ ++subroutine f_func() ++ common /block/ a ++ type, bind(c) :: test1 ++ real(8) :: d ++ real(4) :: f ++ end type ++ type, bind(c) :: t ++ integer(16) :: x5 ++ type(test1) :: w ++ integer(8) :: x4 ++ integer(4) :: x3 ++ integer(2) :: x2 ++ integer(1) :: x ++ end type ++ type(t) :: a ++ a%x = 1 ++ a%x2 = 2 ++ a%x3 = 3 ++ a%x4 = 4 ++ a%x5 = 5 ++ a%w%d = 3.1415 ++ a%w%f = 3.14 ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/fortran_func016.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/fortran_func016.f90 +new file mode 100644 +index 0000000..14b2fef +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/fortran_func016.f90 +@@ -0,0 +1,23 @@ ++subroutine f_func() ++ common /block/ a, b ++ type, bind(c) :: test1 ++ real(8) :: d ++ real(4) :: f ++ end type ++ type, bind(c) :: t ++ integer(16) :: x5 ++ integer(8) :: x4 ++ integer(4) :: x3 ++ integer(2) :: x2 ++ integer(1) :: x ++ end type ++ type(t) :: a ++ type(test1) :: b ++ a%x = 1 ++ a%x2 = 2 ++ a%x3 = 3 ++ a%x4 = 4 ++ a%x5 = 5 ++ b%d = 3.1415 ++ b%f = 3.14 ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/result.md b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/result.md +new file mode 100644 +index 0000000..84a7b69 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/result.md +@@ -0,0 +1,17 @@ ++ | test | gfortran | flang | ++ | 001 | PASS | PASS | ++ | 002 | PASS | PASS | ++ | 003 | PASS | PASS | ++ | 004 | PASS | PASS | ++ | 005 | PASS | PASS | ++ | 006 | PASS | PASS | ++ | 007 | PASS | PASS | ++ | 008 | PASS | PASS | ++ | 009 | PASS | PASS | ++ | 010 | PASS | PASS | ++ | 011 | PASS | PASS | ++ | 012 | PASS | PASS | ++ | 013 | PASS | PASS | ++ | 014 | PASS | PASS | ++ | 015 | PASS | PASS | ++ | 016 | PASS | PASS | +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/run.sh b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/run.sh +new file mode 100644 +index 0000000..513cf9b +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/run.sh +@@ -0,0 +1,16 @@ ++for i in {001..016} ++do ++echo "------- test $i ------." ++echo "----- gfortran result:" ++gcc c_main$i.c -c -o c-test.o ++gfortran fortran_func$i.f90 -fno-range-check -c -o fortran-test.o ++gfortran fortran-test.o c-test.o ++./a.out ++rm *.o a.out ++echo "----- flang-new result : " ++clang c_main$i.c -c -o c-test.o ++flang-new fortran_func$i.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o a.out ++done +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/005_c_call_fortran_struct_value/c_main001.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/005_c_call_fortran_struct_value/c_main001.c +new file mode 100644 +index 0000000..5c0b74c +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/005_c_call_fortran_struct_value/c_main001.c +@@ -0,0 +1,13 @@ ++// Test c call fortran for the struct type with value attribute ++// ++#include ++struct t1 { ++ int t; ++}; ++extern void f_func_(struct t1); ++int main() { ++ struct t1 res; ++ res.t = 10; ++ f_func_(res); ++ printf("%hhd\n", res.t); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/005_c_call_fortran_struct_value/c_main002.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/005_c_call_fortran_struct_value/c_main002.c +new file mode 100644 +index 0000000..694736a +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/005_c_call_fortran_struct_value/c_main002.c +@@ -0,0 +1,17 @@ ++// Test c call fortran for the struct type with value attribute ++// ++#include ++#include ++struct t1 { ++ int16_t n2; ++ int8_t n; ++}; ++extern void f_func_(struct t1); ++int main() { ++ struct t1 res; ++ res.n = 10; ++ res.n2 = 11; ++ f_func_(res); ++ printf("%hhd\n", res.n); ++ printf("%hd\n", res.n2); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/005_c_call_fortran_struct_value/c_main003.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/005_c_call_fortran_struct_value/c_main003.c +new file mode 100644 +index 0000000..eb780e9 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/005_c_call_fortran_struct_value/c_main003.c +@@ -0,0 +1,20 @@ ++// Test c call fortran for the struct type with value attribute ++// ++#include ++#include ++struct t1 { ++ int32_t n3; ++ int16_t n2; ++ int8_t n; ++}; ++extern void f_func_(struct t1); ++int main() { ++ struct t1 res; ++ res.n = 10; ++ res.n2 = 11; ++ res.n3 = 12; ++ f_func_(res); ++ printf("%hhd\n", res.n); ++ printf("%hd\n", res.n2); ++ printf("%d\n", res.n3); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/005_c_call_fortran_struct_value/c_main004.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/005_c_call_fortran_struct_value/c_main004.c +new file mode 100644 +index 0000000..073fc39 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/005_c_call_fortran_struct_value/c_main004.c +@@ -0,0 +1,23 @@ ++// Test c call fortran for the struct type with value attribute ++// ++#include ++#include ++struct t1 { ++ int64_t n4; ++ int32_t n3; ++ int16_t n2; ++ int8_t n; ++}; ++extern void f_func_(struct t1); ++int main() { ++ struct t1 res; ++ res.n = 10; ++ res.n2 = 11; ++ res.n3 = 12; ++ res.n4 = 13; ++ f_func_(res); ++ printf("%hhd\n", res.n); ++ printf("%hd\n", res.n2); ++ printf("%d\n", res.n3); ++ printf("%ld\n", res.n4); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/005_c_call_fortran_struct_value/c_main005.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/005_c_call_fortran_struct_value/c_main005.c +new file mode 100644 +index 0000000..069feb3 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/005_c_call_fortran_struct_value/c_main005.c +@@ -0,0 +1,27 @@ ++// Test c call fortran for the struct type with value attribute ++// ++#include ++#include ++struct t1 { ++ int64_t n4[5]; ++ int32_t n3[5]; ++ int16_t n2[5]; ++ int8_t n[5]; ++}; ++extern void f_func_(struct t1); ++int main() { ++ struct t1 res; ++ for(int i = 0; i < 5; i++) { ++ res.n[i] = 10; ++ res.n2[i] = 11; ++ res.n3[i] = 12; ++ res.n4[i] = 13; ++ } ++ f_func_(res); ++ for(int i = 0; i < 5; i++) { ++ printf("%hhd\n", res.n[i]); ++ printf("%hd\n", res.n2[i]); ++ printf("%d\n", res.n3[i]); ++ printf("%ld\n", res.n4[i]); ++ } ++} +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/005_c_call_fortran_struct_value/fortran_func001.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/005_c_call_fortran_struct_value/fortran_func001.f90 +new file mode 100644 +index 0000000..cf4f75c +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/005_c_call_fortran_struct_value/fortran_func001.f90 +@@ -0,0 +1,8 @@ ++subroutine f_func(b) ++ type t ++ integer :: a ++ end type ++ type(t), value :: b ++ b%a = b%a + 1 ++ print *, b%a ++end +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/005_c_call_fortran_struct_value/fortran_func002.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/005_c_call_fortran_struct_value/fortran_func002.f90 +new file mode 100644 +index 0000000..a2bd744 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/005_c_call_fortran_struct_value/fortran_func002.f90 +@@ -0,0 +1,11 @@ ++subroutine f_func(b) ++ type t ++ integer(2) :: a2 ++ integer(1) :: a ++ end type ++ type(t), value :: b ++ b%a = b%a + 1 ++ b%a2 = b%a2 + 1 ++ print *, b%a ++ print *, b%a2 ++end +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/005_c_call_fortran_struct_value/fortran_func003.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/005_c_call_fortran_struct_value/fortran_func003.f90 +new file mode 100644 +index 0000000..89835ff +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/005_c_call_fortran_struct_value/fortran_func003.f90 +@@ -0,0 +1,14 @@ ++subroutine f_func(b) ++ type t ++ integer(4) :: a3 ++ integer(2) :: a2 ++ integer(1) :: a ++ end type ++ type(t), value :: b ++ b%a = b%a + 1 ++ b%a2 = b%a2 + 1 ++ b%a3 = b%a3 + 1 ++ print *, b%a ++ print *, b%a2 ++ print *, b%a3 ++end +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/005_c_call_fortran_struct_value/fortran_func004.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/005_c_call_fortran_struct_value/fortran_func004.f90 +new file mode 100644 +index 0000000..6e9c218 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/005_c_call_fortran_struct_value/fortran_func004.f90 +@@ -0,0 +1,17 @@ ++subroutine f_func(b) ++ type t ++ integer(8) :: a4 ++ integer(4) :: a3 ++ integer(2) :: a2 ++ integer(1) :: a ++ end type ++ type(t), value :: b ++ b%a = b%a + 1 ++ b%a2 = b%a2 + 1 ++ b%a3 = b%a3 + 1 ++ b%a4 = b%a4 + 1 ++ print *, b%a ++ print *, b%a2 ++ print *, b%a3 ++ print *, b%a4 ++end +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/005_c_call_fortran_struct_value/fortran_func005.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/005_c_call_fortran_struct_value/fortran_func005.f90 +new file mode 100644 +index 0000000..92b84ca +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/005_c_call_fortran_struct_value/fortran_func005.f90 +@@ -0,0 +1,21 @@ ++subroutine f_func(b) ++ type t ++ integer(8) :: a4(5) ++ integer(4) :: a3(5) ++ integer(2) :: a2(5) ++ integer(1) :: a(5) ++ end type ++ type(t), value :: b ++ do i = 1, 5 ++ b%a(i) = b%a(i) + 1 ++ b%a2(i) = b%a2(i) + 1 ++ b%a3(i) = b%a3(i) + 1 ++ b%a4(i) = b%a4(i) + 1 ++ end do ++ do i = 1, 5 ++ print *, b%a(i) ++ print *, b%a2(i) ++ print *, b%a3(i) ++ print *, b%a4(i) ++ end do ++end +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/005_c_call_fortran_struct_value/result.md b/test/interoperability_with_c_c_call_fortran_global_and_struct/005_c_call_fortran_struct_value/result.md +new file mode 100644 +index 0000000..a6a4576 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/005_c_call_fortran_struct_value/result.md +@@ -0,0 +1,6 @@ ++ | test | gfortran | flang | ++ | 001 | PASS | PASS | ++ | 002 | PASS | PASS | ++ | 003 | PASS | PASS | ++ | 004 | PASS | PASS | ++ | 005 | PASS | PASS | +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/005_c_call_fortran_struct_value/run.sh b/test/interoperability_with_c_c_call_fortran_global_and_struct/005_c_call_fortran_struct_value/run.sh +new file mode 100644 +index 0000000..d45b793 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/005_c_call_fortran_struct_value/run.sh +@@ -0,0 +1,16 @@ ++for i in {001..005} ++do ++echo "------- test $i ------." ++echo "----- gfortran result:" ++gcc c_main$i.c -c -o c-test.o ++gfortran fortran_func$i.f90 -fno-range-check -c -o fortran-test.o ++gfortran fortran-test.o c-test.o ++./a.out ++rm *.o a.out ++echo "----- flang-new result : " ++clang c_main$i.c -c -o c-test.o ++flang-new fortran_func$i.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o a.out ++done +\ No newline at end of file +-- +2.25.1 + diff --git a/3-test-for-interoperability-with-c-fortran-call-c.patch b/3-test-for-interoperability-with-c-fortran-call-c.patch deleted file mode 100644 index bcd7b06..0000000 --- a/3-test-for-interoperability-with-c-fortran-call-c.patch +++ /dev/null @@ -1,19629 +0,0 @@ -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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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 -+! -+program main -+ integer(4) :: my_x = 1 -+ interface -+ subroutine c_func(b) -+ integer(4) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -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_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 -+! -+program main -+ integer(2) :: my_x = 1 -+ interface -+ subroutine c_func(b) -+ integer(2) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -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_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 -+! -+program main -+ integer(8) :: my_x = 1 -+ interface -+ subroutine c_func(b) -+ integer(8) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -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_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 -+! -+program main -+ integer(8) :: my_x = 1 -+ interface -+ subroutine c_func(b) -+ integer(8) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -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_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 -+! -+program main -+ integer(1) :: my_x = 65 -+ interface -+ subroutine c_func(b) -+ integer(1) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -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_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 -+! -+program main -+ integer(8) :: my_x = 1 -+ interface -+ subroutine c_func(b) -+ integer(8) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -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_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 -+! -+program main -+ integer(1) :: my_x = 1 -+ interface -+ subroutine c_func(b) -+ integer(1) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -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_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 -+! -+program main -+ integer(2) :: my_x = 1 -+ interface -+ subroutine c_func(b) -+ integer(2) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -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_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 -+! -+program main -+ integer(4) :: my_x = 1 -+ interface -+ subroutine c_func(b) -+ integer(4) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -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_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 -+! -+program main -+ integer(8) :: my_x = 1 -+ interface -+ subroutine c_func(b) -+ integer(8) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -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_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 -+! -+program main -+ integer(1) :: my_x = 1 -+ interface -+ subroutine c_func(b) -+ integer(1) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -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_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 -+! -+program main -+ integer(2) :: my_x = 1 -+ interface -+ subroutine c_func(b) -+ integer(2) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -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_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 -+! -+program main -+ integer(4) :: my_x = 1 -+ interface -+ subroutine c_func(b) -+ integer(4) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -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_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 -+! -+program main -+ integer(8) :: my_x = 1 -+ interface -+ subroutine c_func(b) -+ integer(8) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -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_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 -+! -+program main -+ integer(1) :: my_x = 1 -+ interface -+ subroutine c_func(b) -+ integer(1) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -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_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 -+! -+program main -+ integer(8) :: my_x = 1 -+ interface -+ subroutine c_func(b) -+ integer(8) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -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_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 -+! -+program main -+ integer(8) :: my_x = 1 -+ interface -+ subroutine c_func(b) -+ integer(8) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -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_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 -+! -+program main -+ integer(8) :: my_x = 1 -+ interface -+ subroutine c_func(b) -+ integer(8) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -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_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 -+! -+program main -+ integer(8) :: my_x = 1 -+ interface -+ subroutine c_func(b) -+ integer(8) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -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_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 -+! -+program main -+ integer(8) :: my_x = 1 -+ interface -+ subroutine c_func(b) -+ integer(8) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -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_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 -+! -+program main -+ real(4) :: my_x = 3.1415926535 -+ interface -+ subroutine c_func(b) -+ real(4) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -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_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 -+! -+program main -+ real(8) :: my_x = 3.14159265358979 -+ interface -+ subroutine c_func(b) -+ real(8) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -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_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 -+! -+program main -+ integer, parameter :: K = selected_real_kind(16) -+ real(K) :: my_x = 3.14159265358979 -+ interface -+ subroutine c_func(b) -+ integer, parameter :: K = selected_real_kind(16) -+ real(K) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -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_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 -+! -+program main -+ complex(4) :: my_x = (-12345678.7654321, 1) -+ interface -+ subroutine c_func(b) -+ complex(4) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -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_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 -+! -+program main -+ complex(8) :: my_x = (-3.14159265358979, 1) -+ interface -+ subroutine c_func(b) -+ complex(8) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -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_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 -+! -+program main -+ integer, parameter :: K = selected_real_kind(16) -+ complex(K) :: my_x = (-3.14159265358979, 1) -+ interface -+ subroutine c_func(b) -+ integer, parameter :: K = selected_real_kind(16) -+ complex(K) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -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_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 -+! -+program main -+ logical(1) :: my_x = .FALSE. -+ interface -+ subroutine c_func(b) -+ logical(1) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -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_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 -+! -+program main -+ character(1) :: my_x = 'a' -+ interface -+ subroutine c_func(b) -+ character(1) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -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..b865403 ---- /dev/null -+++ 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 ------." -+#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/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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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 -+! -+program main -+ use iso_c_binding -+ integer(C_INT) :: my_x = 1 -+ interface -+ subroutine c_func(b) -+ use iso_c_binding -+ integer(C_INT) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -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_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 -+! -+program main -+ use iso_c_binding -+ integer(C_SHORT) :: my_x = 1 -+ interface -+ subroutine c_func(b) -+ use iso_c_binding -+ integer(C_SHORT) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -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_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 -+! -+program main -+ use iso_c_binding -+ integer(C_LONG) :: my_x = 1 -+ interface -+ subroutine c_func(b) -+ use iso_c_binding -+ integer(C_LONG) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -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_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 -+! -+program main -+ use iso_c_binding -+ integer(C_LONG_LONG) :: my_x = 1 -+ interface -+ subroutine c_func(b) -+ use iso_c_binding -+ integer(C_LONG_LONG) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -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_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 -+! -+program main -+ use iso_c_binding -+ integer(C_SIGNED_CHAR) :: my_x = 65 -+ interface -+ subroutine c_func(b) -+ use iso_c_binding -+ integer(C_SIGNED_CHAR) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -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_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 -+! -+program main -+ use iso_c_binding -+ integer(C_SIZE_T) :: my_x = 3 -+ interface -+ subroutine c_func(b) -+ use iso_c_binding -+ integer(C_SIZE_T) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -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_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 -+! -+program main -+ use iso_c_binding -+ integer(C_INT8_T) :: my_x = 1 -+ interface -+ subroutine c_func(b) -+ use iso_c_binding -+ integer(C_INT8_T) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -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_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 -+! -+program main -+ use iso_c_binding -+ integer(C_INT16_T) :: my_x = 1 -+ interface -+ subroutine c_func(b) -+ use iso_c_binding -+ integer(C_INT16_T) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -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_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 -+! -+program main -+ use iso_c_binding -+ integer(C_INT32_T) :: my_x = 1 -+ interface -+ subroutine c_func(b) -+ use iso_c_binding -+ integer(C_INT32_T) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -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_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 -+! -+program main -+ use iso_c_binding -+ integer(C_INT64_T) :: my_x = 1 -+ interface -+ subroutine c_func(b) -+ use iso_c_binding -+ integer(C_INT64_T) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -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_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 -+! -+program main -+ use iso_c_binding -+ integer(C_INT_LEAST8_T) :: my_x = 1 -+ interface -+ subroutine c_func(b) -+ use iso_c_binding -+ integer(C_INT_LEAST8_T) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -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_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 -+! -+program main -+ use iso_c_binding -+ integer(C_INT_LEAST16_T) :: my_x = 1 -+ interface -+ subroutine c_func(b) -+ use iso_c_binding -+ integer(C_INT_LEAST16_T) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -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_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 -+! -+program main -+ use iso_c_binding -+ integer(C_INT_LEAST32_T) :: my_x = 1 -+ interface -+ subroutine c_func(b) -+ use iso_c_binding -+ integer(C_INT_LEAST32_T) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -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_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 -+! -+program main -+ use iso_c_binding -+ integer(C_INT_LEAST64_T) :: my_x = 1 -+ interface -+ subroutine c_func(b) -+ use iso_c_binding -+ integer(C_INT_LEAST64_T) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -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_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 -+! -+program main -+ use iso_c_binding -+ integer(C_INT_FAST8_T) :: my_x = 1 -+ interface -+ subroutine c_func(b) -+ use iso_c_binding -+ integer(C_INT_FAST8_T) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -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_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 -+! -+program main -+ use iso_c_binding -+ integer(C_INT_FAST16_T) :: my_x = 1 -+ interface -+ subroutine c_func(b) -+ use iso_c_binding -+ integer(C_INT_FAST16_T) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -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_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 -+! -+program main -+ use iso_c_binding -+ integer(C_INT_FAST32_T) :: my_x = 1 -+ interface -+ subroutine c_func(b) -+ use iso_c_binding -+ integer(C_INT_FAST32_T) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -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_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 -+! -+program main -+ use iso_c_binding -+ integer(C_INT_FAST64_T) :: my_x = 1 -+ interface -+ subroutine c_func(b) -+ use iso_c_binding -+ integer(C_INT_FAST64_T) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -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_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 -+! -+program main -+ use iso_c_binding -+ integer(C_INTMAX_T) :: my_x = 1 -+ interface -+ subroutine c_func(b) -+ use iso_c_binding -+ integer(C_INTMAX_T) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -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_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 -+! -+program main -+ use iso_c_binding -+ integer(C_INTPTR_T) :: my_x = 1 -+ interface -+ subroutine c_func(b) -+ use iso_c_binding -+ integer(C_INTPTR_T) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -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_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 -+! -+program main -+ use iso_c_binding -+ real(C_FLOAT) :: my_x = 12345678.7654321 -+ interface -+ subroutine c_func(b) -+ use iso_c_binding -+ real(C_FLOAT) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -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_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 -+! -+program main -+ use iso_c_binding -+ real(C_DOUBLE) :: my_x = 3.14159265358979 -+ interface -+ subroutine c_func(b) -+ use iso_c_binding -+ real(C_DOUBLE) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -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_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 -+! -+program main -+ use iso_c_binding -+ real(C_LONG_DOUBLE) :: my_x = 3.14159265358979 -+ interface -+ subroutine c_func(b) -+ use iso_c_binding -+ real(C_LONG_DOUBLE) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -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_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 -+! -+program main -+ use iso_c_binding -+ complex(C_FLOAT_COMPLEX) :: my_x = (-12345678.7654321, 1) -+ interface -+ subroutine c_func(b) -+ use iso_c_binding -+ complex(C_FLOAT_COMPLEX) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -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_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 -+! -+program main -+ use iso_c_binding -+ complex(C_DOUBLE_COMPLEX) :: my_x = (-3.14159265358979, 1) -+ interface -+ subroutine c_func(b) -+ use iso_c_binding -+ complex(C_DOUBLE_COMPLEX) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -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_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 -+! -+program main -+ use iso_c_binding -+ complex(C_LONG_DOUBLE_COMPLEX) :: my_x = (-3.14159265358979, 1) -+ interface -+ subroutine c_func(b) -+ use iso_c_binding -+ complex(C_LONG_DOUBLE_COMPLEX) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -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_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 -+! -+program main -+ use iso_c_binding -+ logical(C_BOOL) :: my_x = .FALSE. -+ interface -+ subroutine c_func(b) -+ use iso_c_binding -+ logical(C_BOOL) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -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_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 -+! -+program main -+ use iso_c_binding -+ character(C_CHAR) :: my_x = 'a' -+ interface -+ subroutine c_func(b) -+ use iso_c_binding -+ character(C_CHAR) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -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..b865403 ---- /dev/null -+++ 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 ------." -+#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/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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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 -+! -+program main -+ integer :: my_x = 1 -+ interface -+ subroutine c_func(b) -+ integer, value :: b -+ end -+ end interface -+ call c_func(my_x) -+end -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_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 -+! -+program main -+ integer(2) :: my_x = 1 -+ interface -+ subroutine c_func(b) -+ integer(2), value :: b -+ end -+ end interface -+ call c_func(my_x) -+end -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_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 -+! -+program main -+ integer(8) :: my_x = 1 -+ interface -+ subroutine c_func(b) -+ integer(8), value :: b -+ end -+ end interface -+ call c_func(my_x) -+end -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_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 -+! -+program main -+ integer(8) :: my_x = 1 -+ interface -+ subroutine c_func(b) -+ integer(8), value :: b -+ end -+ end interface -+ call c_func(my_x) -+end -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_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 -+! -+program main -+ integer(1) :: my_x = 65 -+ interface -+ subroutine c_func(b) -+ integer(1), value :: b -+ end -+ end interface -+ call c_func(my_x) -+end -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_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 -+! -+program main -+ integer(8) :: my_x = 3 -+ interface -+ subroutine c_func(b) -+ integer(8), value :: b -+ end -+ end interface -+ call c_func(my_x) -+end -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_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 -+! -+program main -+ integer(1) :: my_x = 1 -+ interface -+ subroutine c_func(b) -+ integer(1), value :: b -+ end -+ end interface -+ call c_func(my_x) -+end -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_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 -+! -+program main -+ integer(2) :: my_x = 1 -+ interface -+ subroutine c_func(b) -+ integer(2), value :: b -+ end -+ end interface -+ call c_func(my_x) -+end -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_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 -+! -+program main -+ integer(4) :: my_x = 1 -+ interface -+ subroutine c_func(b) -+ integer(4), value :: b -+ end -+ end interface -+ call c_func(my_x) -+end -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_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 -+! -+program main -+ integer(8) :: my_x = 1 -+ interface -+ subroutine c_func(b) -+ integer(8), value :: b -+ end -+ end interface -+ call c_func(my_x) -+end -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_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 -+! -+program main -+ integer(1) :: my_x = 1 -+ interface -+ subroutine c_func(b) -+ integer(1), value :: b -+ end -+ end interface -+ call c_func(my_x) -+end -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_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 -+! -+program main -+ integer(2) :: my_x = 1 -+ interface -+ subroutine c_func(b) -+ integer(2), value :: b -+ end -+ end interface -+ call c_func(my_x) -+end -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_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 -+! -+program main -+ integer(4) :: my_x = 1 -+ interface -+ subroutine c_func(b) -+ integer(4), value :: b -+ end -+ end interface -+ call c_func(my_x) -+end -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_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 -+! -+program main -+ integer(8) :: my_x = 1 -+ interface -+ subroutine c_func(b) -+ integer(8), value :: b -+ end -+ end interface -+ call c_func(my_x) -+end -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_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 -+! -+program main -+ integer(1) :: my_x = 1 -+ interface -+ subroutine c_func(b) -+ integer(1), value :: b -+ end -+ end interface -+ call c_func(my_x) -+end -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_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 -+! -+program main -+ integer(8) :: my_x = 1 -+ interface -+ subroutine c_func(b) -+ integer(8), value :: b -+ end -+ end interface -+ call c_func(my_x) -+end -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_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 -+! -+program main -+ integer(8) :: my_x = 1 -+ interface -+ subroutine c_func(b) -+ integer(8), value :: b -+ end -+ end interface -+ call c_func(my_x) -+end -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_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 -+! -+program main -+ integer(8) :: my_x = 1 -+ interface -+ subroutine c_func(b) -+ integer(8), value :: b -+ end -+ end interface -+ call c_func(my_x) -+end -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_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 -+! -+program main -+ integer(8) :: my_x = 3 -+ interface -+ subroutine c_func(b) -+ integer(8), value :: b -+ end -+ end interface -+ call c_func(my_x) -+end -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_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 -+! -+program main -+ integer(8) :: my_x = 3 -+ interface -+ subroutine c_func(b) -+ integer(8), value :: b -+ end -+ end interface -+ call c_func(my_x) -+end -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_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 -+! -+program main -+ real(4) :: my_x = 12345678.7654321 -+ interface -+ subroutine c_func(b) -+ real(4), value :: b -+ end -+ end interface -+ call c_func(my_x) -+end -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_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 -+! -+program main -+ real(8) :: my_x = 3.14159265358979 -+ interface -+ subroutine c_func(b) -+ real(8), value :: b -+ end -+ end interface -+ call c_func(my_x) -+end -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_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 -+! -+program main -+ integer, parameter :: K = selected_real_kind(16) -+ real(K) :: my_x = 3.14159265358979 -+ interface -+ subroutine c_func(b) -+ integer, parameter :: K = selected_real_kind(16) -+ real(K), value :: b -+ end -+ end interface -+ call c_func(my_x) -+end -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_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 -+! -+program main -+ complex(4) :: my_x = (-3.14159265358979, 1) -+ interface -+ subroutine c_func(b) -+ complex(4), value :: b -+ end -+ end interface -+ call c_func(my_x) -+end -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_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 -+! -+program main -+ complex(8) :: my_x = (-3.14159265358979, 1) -+ interface -+ subroutine c_func(b) -+ complex(8), value :: b -+ end -+ end interface -+ call c_func(my_x) -+end -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_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 -+! -+program main -+ integer, parameter :: K = selected_real_kind(16) -+ complex(K) :: my_x = (-3.14159265358979, 1) -+ interface -+ subroutine c_func(b) -+ integer, parameter :: K = selected_real_kind(16) -+ complex(K), value :: b -+ end -+ end interface -+ call c_func(my_x) -+end -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_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 -+! -+program main -+ logical(1) :: my_x = .FALSE. -+ interface -+ subroutine c_func(b) -+ logical(1), value :: b -+ end -+ end interface -+ call c_func(my_x) -+end -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..e0269d5 ---- /dev/null -+++ 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 -+! -+program main -+ character(1) :: my_x = 'a' -+ interface -+ subroutine c_func(b) -+ character(1), value :: b -+ end -+ end interface -+ call c_func(my_x) -+end -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..b865403 ---- /dev/null -+++ 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 ------." -+#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/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_fortran_call_c/004_fortran_call_c_scalar_bindc/c_func001.c -@@ -0,0 +1,4 @@ -+#include -+void c_func_(int *a) { -+ printf("%d\n", *a); -+} -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_fortran_call_c/004_fortran_call_c_scalar_bindc/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_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_fortran_call_c/004_fortran_call_c_scalar_bindc/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_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_fortran_call_c/004_fortran_call_c_scalar_bindc/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_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_fortran_call_c/004_fortran_call_c_scalar_bindc/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_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_fortran_call_c/004_fortran_call_c_scalar_bindc/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_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_fortran_call_c/004_fortran_call_c_scalar_bindc/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_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_fortran_call_c/004_fortran_call_c_scalar_bindc/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_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_fortran_call_c/004_fortran_call_c_scalar_bindc/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_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_fortran_call_c/004_fortran_call_c_scalar_bindc/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_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_fortran_call_c/004_fortran_call_c_scalar_bindc/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_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_fortran_call_c/004_fortran_call_c_scalar_bindc/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_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_fortran_call_c/004_fortran_call_c_scalar_bindc/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_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_fortran_call_c/004_fortran_call_c_scalar_bindc/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_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_fortran_call_c/004_fortran_call_c_scalar_bindc/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_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_fortran_call_c/004_fortran_call_c_scalar_bindc/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_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_fortran_call_c/004_fortran_call_c_scalar_bindc/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_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_fortran_call_c/004_fortran_call_c_scalar_bindc/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_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_fortran_call_c/004_fortran_call_c_scalar_bindc/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_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_fortran_call_c/004_fortran_call_c_scalar_bindc/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_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_fortran_call_c/004_fortran_call_c_scalar_bindc/c_func021.c -@@ -0,0 +1,4 @@ -+#include -+void c_func_(float *a) { -+ printf("%f\n", *a); -+} -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_fortran_call_c/004_fortran_call_c_scalar_bindc/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_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_fortran_call_c/004_fortran_call_c_scalar_bindc/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_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_fortran_call_c/004_fortran_call_c_scalar_bindc/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_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_fortran_call_c/004_fortran_call_c_scalar_bindc/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_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_fortran_call_c/004_fortran_call_c_scalar_bindc/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_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_fortran_call_c/004_fortran_call_c_scalar_bindc/c_func027.c -@@ -0,0 +1,4 @@ -+#include -+void c_func_(_Bool *a) { -+ printf("%d\n", *a); -+} -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_fortran_call_c/004_fortran_call_c_scalar_bindc/c_func028.c -@@ -0,0 +1,4 @@ -+#include -+void c_func_(char *a) { -+ printf("%c\n", *a); -+} -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_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 -+ integer(4) :: my_x = 1 -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ integer(4) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -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_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 -+ integer(2) :: my_x = 1 -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ integer(2) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -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_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 -+ integer(8) :: my_x = 1 -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ integer(8) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -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_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 -+ integer(8) :: my_x = 1 -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ integer(8) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -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_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 -+ integer(1) :: my_x = 65 -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ integer(1) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -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_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 -+ integer(8) :: my_x = 1 -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ integer(8) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -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_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 -+ integer(1) :: my_x = 1 -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ integer(1) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -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_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 -+ integer(2) :: my_x = 1 -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ integer(2) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -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_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 -+ integer(4) :: my_x = 1 -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ integer(4) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -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_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 -+ integer(8) :: my_x = 1 -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ integer(8) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -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_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 -+ integer(1) :: my_x = 1 -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ integer(1) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -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_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 -+ integer(2) :: my_x = 1 -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ integer(2) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -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_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 -+ integer(4) :: my_x = 1 -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ integer(4) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -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_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 -+ integer(8) :: my_x = 1 -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ integer(8) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -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_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 -+ integer(1) :: my_x = 1 -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ integer(1) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -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_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 -+ integer(8) :: my_x = 1 -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ integer(8) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -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_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 -+ integer(8) :: my_x = 1 -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ integer(8) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -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_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 -+ integer(8) :: my_x = 1 -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ integer(8) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -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_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 -+ integer(8) :: my_x = 1 -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ integer(8) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -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_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 -+ integer(8) :: my_x = 1 -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ integer(8) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -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_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 -+ real(4) :: my_x = 3.1415926535 -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ real(4) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -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_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 -+ real(8) :: my_x = 3.14159265358979 -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ real(8) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -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_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) -+ real(K) :: my_x = 3.14159265358979 -+ interface -+ 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_x) -+end -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_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 -+ complex(4) :: my_x = (-12345678.7654321, 1) -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ complex(4) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -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_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 -+ complex(8) :: my_x = (-3.14159265358979, 1) -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ complex(8) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -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_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) -+ complex(K) :: my_x = (-3.14159265358979, 1) -+ interface -+ 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_x) -+end -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_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 -+ logical(1) :: my_x = .FALSE. -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ logical(1) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -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_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 -+ character(1) :: my_x = 'a' -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ character(1) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -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..b865403 ---- /dev/null -+++ 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 ------." -+#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/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..6b34fe7 ---- /dev/null -+++ 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); -+} -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..0a82fd6 ---- /dev/null -+++ 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); -+} -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..e945b70 ---- /dev/null -+++ 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); -+} -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..6d5f734 ---- /dev/null -+++ 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); -+} -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..aa46418 ---- /dev/null -+++ 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); -+} -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..d78d3d5 ---- /dev/null -+++ 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); -+} -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..2e08462 ---- /dev/null -+++ 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); -+} -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..9b10264 ---- /dev/null -+++ 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); -+} -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..7ed8d51 ---- /dev/null -+++ 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); -+} -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..426f6ae ---- /dev/null -+++ 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); -+} -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..660f33e ---- /dev/null -+++ 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); -+} -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..abf7d13 ---- /dev/null -+++ 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); -+} -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..638f7d0 ---- /dev/null -+++ 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); -+} -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..c0401de ---- /dev/null -+++ 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); -+} -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..f7b7caa ---- /dev/null -+++ 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); -+} -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..ef70772 ---- /dev/null -+++ 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); -+} -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..86e6cd6 ---- /dev/null -+++ 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); -+} -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..c8ae092 ---- /dev/null -+++ 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); -+} -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..0b0fa15 ---- /dev/null -+++ 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); -+} -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..bde599d ---- /dev/null -+++ 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); -+} -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..ae5bf11 ---- /dev/null -+++ 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); -+} -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..b3bdc55 ---- /dev/null -+++ 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("%0.20lf\n", a); -+} -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..af99efc ---- /dev/null -+++ 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("%0.20Lf\n", a); -+} -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..af69eac ---- /dev/null -+++ 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), cimag(t)); -+} -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..55a85e9 ---- /dev/null -+++ 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("%0.20lf + %0.20lfi\n", creal(t), cimag(t)); -+} -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..5b7017a ---- /dev/null -+++ 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("%0.20f + %0.20fi\n", creal(t), cimag(t)); -+} -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..ff95fd7 ---- /dev/null -+++ 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); -+} -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..b92caf7 ---- /dev/null -+++ 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); -+} -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..9b2b33f ---- /dev/null -+++ 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 = 1 -+ interface -+ 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_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..48736e1 ---- /dev/null -+++ 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 = 1 -+ interface -+ 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_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..feca432 ---- /dev/null -+++ 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 = 1 -+ interface -+ 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_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..0926bd3 ---- /dev/null -+++ 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 scalar type with value attribute and the -+! scalar type is long long with bindc -+! -+program main -+ integer(8) :: my_x = 1 -+ interface -+ 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_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..8308cf7 ---- /dev/null -+++ 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 scalar type with value attribute and the -+! scalar type is signed char with bindc -+! -+program main -+ integer(1) :: my_x = 65 -+ interface -+ 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_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..ac3bda1 ---- /dev/null -+++ 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 = 3 -+ interface -+ 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_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..e70a093 ---- /dev/null -+++ 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 = 1 -+ interface -+ 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_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..4e9554e ---- /dev/null -+++ 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 = 1 -+ interface -+ 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_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..f1084a6 ---- /dev/null -+++ 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 = 1 -+ interface -+ 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_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..8d2ece3 ---- /dev/null -+++ 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 = 1 -+ interface -+ 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_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..cd82f35 ---- /dev/null -+++ 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 with value attribute and the -+! scalar type is int_least8_t with bindc -+! -+program main -+ integer(1) :: my_x = 1 -+ interface -+ 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_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..00da761 ---- /dev/null -+++ 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 with value attribute and the -+! scalar type is int_least16_t with bindc -+! -+program main -+ integer(2) :: my_x = 1 -+ interface -+ 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_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..28b7535 ---- /dev/null -+++ 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 with value attribute and the -+! scalar type is int_least32_t with bindc -+! -+program main -+ integer(4) :: my_x = 1 -+ interface -+ 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_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..6336001 ---- /dev/null -+++ 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 with value attribute and the -+! scalar type is int_least64_t with bindc -+! -+program main -+ integer(8) :: my_x = 1 -+ interface -+ 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_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..bcf23f1 ---- /dev/null -+++ 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 with value attribute and the -+! scalar type is int_fast8_t with bindc -+! -+program main -+ integer(1) :: my_x = 1 -+ interface -+ 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_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..09b77c7 ---- /dev/null -+++ 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 with value attribute and the -+! scalar type is int_fast16_t with bindc -+! -+program main -+ integer(8) :: my_x = 1 -+ interface -+ 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_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..26c67eb ---- /dev/null -+++ 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 with value attribute and the -+! scalar type is int_fast32_t with bindc -+! -+program main -+ integer(8) :: my_x = 1 -+ interface -+ 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_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..7d94f50 ---- /dev/null -+++ 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 with value attribute and the -+! scalar type is int_fast64_t with bindc -+! -+program main -+ integer(8) :: my_x = 1 -+ interface -+ 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_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..d77ae94 ---- /dev/null -+++ 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 with value attribute and the -+! scalar type is intmax_t with bindc -+! -+program main -+ integer(8) :: my_x = 3 -+ interface -+ 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_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..d4b887d ---- /dev/null -+++ 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 with value attribute and the -+! scalar type is intptr_t with bindc -+! -+program main -+ integer(8) :: my_x = 3 -+ interface -+ 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_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..7c17ff0 ---- /dev/null -+++ 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 = 12345678.7654321 -+ interface -+ 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_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..713cc1a ---- /dev/null -+++ 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 = 3.14159265358979 -+ interface -+ 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_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..48633c1 ---- /dev/null -+++ 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 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 = 3.14159265358979 -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ integer, parameter :: K = selected_real_kind(16) -+ real(K), value :: b -+ end -+ end interface -+ call c_func(my_x) -+end -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..545bfed ---- /dev/null -+++ 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 scalar type with value attribute and the -+! scalar type is float _Complex with bindc -+! -+program main -+ complex(4) :: my_x = (-3.14159265358979, 1) -+ interface -+ 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_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..b32f5af ---- /dev/null -+++ 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 scalar type with value attribute and the -+! scalar type is double _Complex with bindc -+! -+program main -+ complex(8) :: my_x = (-3.14159265358979, 1) -+ interface -+ 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_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..e04bf6d ---- /dev/null -+++ 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 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 = (-3.14159265358979, 1) -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ integer, parameter :: K = selected_real_kind(16) -+ complex(K), value :: b -+ end -+ end interface -+ call c_func(my_x) -+end -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..300b8fa ---- /dev/null -+++ 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 = .FALSE. -+ interface -+ 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_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..0a53f44 ---- /dev/null -+++ 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 = 'a' -+ interface -+ 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_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..b865403 ---- /dev/null -+++ 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 ------." -+#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/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_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_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_fortran_call_c/006_fortran_call_c_array/c_func002.c -@@ -0,0 +1,6 @@ -+#include -+#include -+void c_func_(short *a) { -+ printf("%hd\n", a[0]); -+ printf("%hd\n", a[1]); -+} -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_fortran_call_c/006_fortran_call_c_array/c_func003.c -@@ -0,0 +1,6 @@ -+#include -+#include -+void c_func_(long *a) { -+ printf("%ld\n", a[0]); -+ printf("%ld\n", a[1]); -+} -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_fortran_call_c/006_fortran_call_c_array/c_func004.c -@@ -0,0 +1,6 @@ -+#include -+#include -+void c_func_(long long *a) { -+ printf("%lld\n", a[0]); -+ printf("%lld\n", a[1]); -+} -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_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_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_fortran_call_c/006_fortran_call_c_array/c_func006.c -@@ -0,0 +1,6 @@ -+#include -+#include -+void c_func_(size_t *a) { -+ printf("%ld\n", a[0]); -+ printf("%ld\n", a[1]); -+} -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_fortran_call_c/006_fortran_call_c_array/c_func007.c -@@ -0,0 +1,6 @@ -+#include -+#include -+void c_func_(int8_t *a) { -+ printf("%hhd\n", a[0]); -+ printf("%hhd\n", a[1]); -+} -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_fortran_call_c/006_fortran_call_c_array/c_func008.c -@@ -0,0 +1,6 @@ -+#include -+#include -+void c_func_(int16_t *a) { -+ printf("%hd\n", a[0]); -+ printf("%hd\n", a[1]); -+} -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_fortran_call_c/006_fortran_call_c_array/c_func009.c -@@ -0,0 +1,6 @@ -+#include -+#include -+void c_func_(int32_t *a) { -+ printf("%d\n", a[0]); -+ printf("%d\n", a[1]); -+} -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_fortran_call_c/006_fortran_call_c_array/c_func010.c -@@ -0,0 +1,6 @@ -+#include -+#include -+void c_func_(int64_t *a) { -+ printf("%ld\n", a[0]); -+ printf("%ld\n", a[1]); -+} -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_fortran_call_c/006_fortran_call_c_array/c_func011.c -@@ -0,0 +1,6 @@ -+#include -+#include -+void c_func_(int_least8_t *a) { -+ printf("%hhd\n", a[0]); -+ printf("%hhd\n", a[1]); -+} -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_fortran_call_c/006_fortran_call_c_array/c_func012.c -@@ -0,0 +1,6 @@ -+#include -+#include -+void c_func_(int_least16_t *a) { -+ printf("%hd\n", a[0]); -+ printf("%hd\n", a[1]); -+} -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_fortran_call_c/006_fortran_call_c_array/c_func013.c -@@ -0,0 +1,6 @@ -+#include -+#include -+void c_func_(int_least32_t *a) { -+ printf("%d\n", a[0]); -+ printf("%d\n", a[1]); -+} -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_fortran_call_c/006_fortran_call_c_array/c_func014.c -@@ -0,0 +1,6 @@ -+#include -+#include -+void c_func_(int_least64_t *a) { -+ printf("%ld\n", a[0]); -+ printf("%ld\n", a[1]); -+} -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_fortran_call_c/006_fortran_call_c_array/c_func015.c -@@ -0,0 +1,6 @@ -+#include -+#include -+void c_func_(int_fast8_t *a) { -+ printf("%hhd\n", a[0]); -+ printf("%hhd\n", a[1]); -+} -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_fortran_call_c/006_fortran_call_c_array/c_func016.c -@@ -0,0 +1,6 @@ -+#include -+#include -+void c_func_(int_fast16_t *a) { -+ printf("%ld\n", a[0]); -+ printf("%ld\n", a[1]); -+} -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_fortran_call_c/006_fortran_call_c_array/c_func017.c -@@ -0,0 +1,6 @@ -+#include -+#include -+void c_func_(int_fast32_t *a) { -+ printf("%ld\n", a[0]); -+ printf("%ld\n", a[1]); -+} -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_fortran_call_c/006_fortran_call_c_array/c_func018.c -@@ -0,0 +1,6 @@ -+#include -+#include -+void c_func_(int_fast64_t *a) { -+ printf("%ld\n", a[0]); -+ printf("%ld\n", a[1]); -+} -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_fortran_call_c/006_fortran_call_c_array/c_func019.c -@@ -0,0 +1,6 @@ -+#include -+#include -+void c_func_(intmax_t *a) { -+ printf("%ld\n", a[0]); -+ printf("%ld\n", a[1]); -+} -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_fortran_call_c/006_fortran_call_c_array/c_func020.c -@@ -0,0 +1,6 @@ -+#include -+#include -+void c_func_(intptr_t *a) { -+ printf("%ld\n", a[0]); -+ printf("%ld\n", a[1]); -+} -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_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_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..688f3c0 ---- /dev/null -+++ 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("%20lf\n", a[0]); -+ printf("%20lf\n", a[1]); -+} -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..af86ba3 ---- /dev/null -+++ 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]); -+} -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_fortran_call_c/006_fortran_call_c_array/c_func024.c -@@ -0,0 +1,6 @@ -+#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])); -+} -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..12b9abb ---- /dev/null -+++ 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("%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_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..78011d4 ---- /dev/null -+++ 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("%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_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_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_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_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_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..6e1f16f ---- /dev/null -+++ 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 -+ integer :: my_x(2) = 1 -+ interface -+ subroutine c_func(b) -+ integer :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -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..50f36f6 ---- /dev/null -+++ 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 -+ integer(2) :: my_x(2) = 1 -+ interface -+ subroutine c_func(b) -+ integer(2) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -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..5109bc3 ---- /dev/null -+++ 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 -+ integer(8) :: my_x(2) = 1 -+ interface -+ subroutine c_func(b) -+ integer(8) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -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..a4e1bc6 ---- /dev/null -+++ 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 -+ integer(8) :: my_x(2) = 1 -+ interface -+ subroutine c_func(b) -+ integer(8) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -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..6f52cca ---- /dev/null -+++ 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 -+ integer(1) :: my_x(2) = 65 -+ interface -+ subroutine c_func(b) -+ integer(1) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -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..3505849 ---- /dev/null -+++ 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 -+ integer(8) :: my_x(2) = 3 -+ interface -+ subroutine c_func(b) -+ integer(8) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -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..3ce82ad ---- /dev/null -+++ 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 -+ integer(1) :: my_x(2) = 1 -+ interface -+ subroutine c_func(b) -+ integer(1) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -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..12a52ee ---- /dev/null -+++ 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 -+ integer(2) :: my_x(2) = 1 -+ interface -+ subroutine c_func(b) -+ integer(2) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -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..139d7f9 ---- /dev/null -+++ 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 -+ integer(4) :: my_x(2) = 1 -+ interface -+ subroutine c_func(b) -+ integer(4) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -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..81859b7 ---- /dev/null -+++ 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 -+ integer(8) :: my_x(2) = 1 -+ interface -+ subroutine c_func(b) -+ integer(8) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -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..cee5bab ---- /dev/null -+++ 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_least8_t -+! -+program main -+ integer(1) :: my_x(2) = 1 -+ interface -+ subroutine c_func(b) -+ integer(1) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -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..fd005f2 ---- /dev/null -+++ 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 -+! -+program main -+ integer(2) :: my_x(2) = 1 -+ interface -+ subroutine c_func(b) -+ integer(2) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -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..1fe884b ---- /dev/null -+++ 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 -+! -+program main -+ integer(4) :: my_x(2) = 1 -+ interface -+ subroutine c_func(b) -+ integer(4) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -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..ada1c56 ---- /dev/null -+++ 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 -+! -+program main -+ integer(8) :: my_x(2) = 1 -+ interface -+ subroutine c_func(b) -+ integer(8) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -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..a025c8a ---- /dev/null -+++ 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 -+! -+program main -+ integer(1) :: my_x(2) = 1 -+ interface -+ subroutine c_func(b) -+ integer(1) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -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..d6d3f63 ---- /dev/null -+++ 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 -+! -+program main -+ integer(8) :: my_x(2) = 1 -+ interface -+ subroutine c_func(b) -+ integer(8) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -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..851d06d ---- /dev/null -+++ 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 -+! -+program main -+ integer(8) :: my_x(2) = 1 -+ interface -+ subroutine c_func(b) -+ integer(8) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -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..9b62610 ---- /dev/null -+++ 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 -+! -+program main -+ integer(8) :: my_x(2) = 1 -+ interface -+ subroutine c_func(b) -+ integer(8) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -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..41f77aa ---- /dev/null -+++ 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 -+! -+program main -+ integer(8) :: my_x(2) = 1 -+ interface -+ subroutine c_func(b) -+ integer(8) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -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..3a48805 ---- /dev/null -+++ 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 -+! -+program main -+ integer(8) :: my_x(2) = 1 -+ interface -+ subroutine c_func(b) -+ integer(8) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -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..86a9cf5 ---- /dev/null -+++ 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 -+ real(4) :: my_x(2) = 12345678.7654321 -+ interface -+ subroutine c_func(b) -+ real(4) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -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..ad70ca5 ---- /dev/null -+++ 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 -+ real(8) :: my_x(2) = 12345678.7654321 -+ interface -+ subroutine c_func(b) -+ real(8) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -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..e44608b ---- /dev/null -+++ 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 array type and the array type is -+! long double -+! -+program main -+ integer, parameter :: K = selected_real_kind(16) -+ real(K) :: my_x(2) = 12345678.7654321 -+ interface -+ subroutine c_func(b) -+ 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_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..19df422 ---- /dev/null -+++ 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 -+ complex(4) :: my_x(2) = (-3.14159265358979, 1) -+ interface -+ subroutine c_func(b) -+ complex(4) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -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..b335a51 ---- /dev/null -+++ 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 -+ complex(8) :: my_x(2) = (-3.14159265358979, 1) -+ interface -+ subroutine c_func(b) -+ complex(8) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -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..7482ce8 ---- /dev/null -+++ 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 array type and the array type is -+! long double _Complex -+! -+program main -+ integer, parameter :: K = selected_real_kind(16) -+ complex(K) :: my_x(2) = (-3.14159265358979, 1) -+ interface -+ subroutine c_func(b) -+ 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_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..d3249d1 ---- /dev/null -+++ 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 -+ logical(1) :: my_x(2) = .TRUE. -+ interface -+ subroutine c_func(b) -+ logical(1) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -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..a854e09 ---- /dev/null -+++ 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 -+ character(1) :: my_x(2) = 'a' -+ interface -+ subroutine c_func(b) -+ character(1) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -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..b865403 ---- /dev/null -+++ 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 ------." -+#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/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..c7cf73f ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/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_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..010cdf7 ---- /dev/null -+++ 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 -+void c_func_(short *a) { -+ printf("%hd\n", a[0]); -+ printf("%hd\n", a[1]); -+} -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..5e69081 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/c_func003.c -@@ -0,0 +1,6 @@ -+#include -+#include -+void c_func_(long *a) { -+ printf("%ld\n", a[0]); -+ printf("%ld\n", a[1]); -+} -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..3f74c8e ---- /dev/null -+++ 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 -+void c_func_(long long *a) { -+ printf("%lld\n", a[0]); -+ printf("%lld\n", a[1]); -+} -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..77794d4 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/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_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..27c475f ---- /dev/null -+++ 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 -+void c_func_(size_t *a) { -+ printf("%ld\n", a[0]); -+ printf("%ld\n", a[1]); -+} -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..f7c4384 ---- /dev/null -+++ 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 -+void c_func_(int8_t *a) { -+ printf("%hhd\n", a[0]); -+ printf("%hhd\n", a[1]); -+} -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..e29971f ---- /dev/null -+++ 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 -+void c_func_(int16_t *a) { -+ printf("%hd\n", a[0]); -+ printf("%hd\n", a[1]); -+} -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..3b84c1a ---- /dev/null -+++ 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 -+void c_func_(int32_t *a) { -+ printf("%d\n", a[0]); -+ printf("%d\n", a[1]); -+} -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..11ca3e1 ---- /dev/null -+++ 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 -+void c_func_(int64_t *a) { -+ printf("%ld\n", a[0]); -+ printf("%ld\n", a[1]); -+} -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..f830d74 ---- /dev/null -+++ 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 -+void c_func_(int_least8_t *a) { -+ printf("%hhd\n", a[0]); -+ printf("%hhd\n", a[1]); -+} -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..6ffd7e3 ---- /dev/null -+++ 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 -+void c_func_(int_least16_t *a) { -+ printf("%hd\n", a[0]); -+ printf("%hd\n", a[1]); -+} -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..4b367cb ---- /dev/null -+++ 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 -+void c_func_(int_least32_t *a) { -+ printf("%d\n", a[0]); -+ printf("%d\n", a[1]); -+} -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..6b2d5b3 ---- /dev/null -+++ 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 -+void c_func_(int_least64_t *a) { -+ printf("%ld\n", a[0]); -+ printf("%ld\n", a[1]); -+} -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..81d223a ---- /dev/null -+++ 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 -+void c_func_(int_fast8_t *a) { -+ printf("%hhd\n", a[0]); -+ printf("%hhd\n", a[1]); -+} -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..297be3a ---- /dev/null -+++ 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 -+void c_func_(int_fast16_t *a) { -+ printf("%ld\n", a[0]); -+ printf("%ld\n", a[1]); -+} -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..8eb5818 ---- /dev/null -+++ 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 -+void c_func_(int_fast32_t *a) { -+ printf("%ld\n", a[0]); -+ printf("%ld\n", a[1]); -+} -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..030b1f7 ---- /dev/null -+++ 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 -+void c_func_(int_fast64_t *a) { -+ printf("%ld\n", a[0]); -+ printf("%ld\n", a[1]); -+} -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..babfc75 ---- /dev/null -+++ 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 -+void c_func_(intmax_t *a) { -+ printf("%ld\n", a[0]); -+ printf("%ld\n", a[1]); -+} -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..26c7726 ---- /dev/null -+++ 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 -+void c_func_(intptr_t *a) { -+ printf("%ld\n", a[0]); -+ printf("%ld\n", a[1]); -+} -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..a73f11b ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/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_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..b600f94 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/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]); -+} -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..b34c388 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/c_func023.c -@@ -0,0 +1,5 @@ -+#include -+void c_func_(long double *a) { -+ printf("%.20Lf\n", a[0]); -+ printf("%.20Lf\n", a[1]); -+} -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..1d34f02 ---- /dev/null -+++ 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 -+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_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..582096e ---- /dev/null -+++ 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 -+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_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..b665220 ---- /dev/null -+++ 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 -+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_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..91a49b5 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/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_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..9335307 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c/007_fortran_call_c_array_iso_c_binding/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_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..c1c866f ---- /dev/null -+++ 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 -+ use iso_c_binding -+ integer(C_INT) :: my_x(2) = 1 -+ interface -+ subroutine c_func(b) -+ use iso_c_binding -+ integer(C_INT) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -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..cb9976e ---- /dev/null -+++ 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 -+ use iso_c_binding -+ integer(C_SHORT) :: my_x(2) = 1 -+ interface -+ subroutine c_func(b) -+ use iso_c_binding -+ integer(C_SHORT) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -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..fd935af ---- /dev/null -+++ 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 -+ use iso_c_binding -+ integer(C_LONG) :: my_x(2) = 1 -+ interface -+ subroutine c_func(b) -+ use iso_c_binding -+ integer(C_LONG) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -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..fd72ea7 ---- /dev/null -+++ 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 -+ use iso_c_binding -+ integer(C_LONG_LONG) :: my_x(2) = 1 -+ interface -+ subroutine c_func(b) -+ use iso_c_binding -+ integer(C_LONG_LONG) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -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..f6e923d ---- /dev/null -+++ 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 -+ use iso_c_binding -+ integer(C_SIGNED_CHAR) :: my_x(2) = 65 -+ interface -+ subroutine c_func(b) -+ use iso_c_binding -+ integer(C_SIGNED_CHAR) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -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..421534d ---- /dev/null -+++ 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 -+ use iso_c_binding -+ integer(C_SIZE_T) :: my_x(2) = 3 -+ interface -+ subroutine c_func(b) -+ use iso_c_binding -+ integer(C_SIZE_T) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -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..d7b5b93 ---- /dev/null -+++ 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 -+ use iso_c_binding -+ integer(C_INT8_T) :: my_x(2) = 1 -+ interface -+ subroutine c_func(b) -+ use iso_c_binding -+ integer(C_INT8_T) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -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..d7f7492 ---- /dev/null -+++ 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 -+ use iso_c_binding -+ integer(C_INT16_T) :: my_x(2) = 1 -+ interface -+ subroutine c_func(b) -+ use iso_c_binding -+ integer(C_INT16_T) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -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..35233f5 ---- /dev/null -+++ 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 -+ use iso_c_binding -+ integer(C_INT32_T) :: my_x(2) = 1 -+ interface -+ subroutine c_func(b) -+ use iso_c_binding -+ integer(C_INT32_T) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -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..f0c5cb2 ---- /dev/null -+++ 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 -+ use iso_c_binding -+ integer(C_INT64_T) :: my_x(2) = 1 -+ interface -+ subroutine c_func(b) -+ use iso_c_binding -+ integer(C_INT64_T) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -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..9b6e534 ---- /dev/null -+++ 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 -+ use iso_c_binding -+ integer(C_INT_LEAST8_T) :: my_x(2) = 1 -+ interface -+ subroutine c_func(b) -+ use iso_c_binding -+ integer(C_INT_LEAST8_T) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -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..d0b4d29 ---- /dev/null -+++ 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 -+ use iso_c_binding -+ integer(C_INT_LEAST16_T) :: my_x(2) = 1 -+ interface -+ subroutine c_func(b) -+ use iso_c_binding -+ integer(C_INT_LEAST16_T) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -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..74e2a82 ---- /dev/null -+++ 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 -+ use iso_c_binding -+ integer(C_INT_LEAST32_T) :: my_x(2) = 1 -+ interface -+ subroutine c_func(b) -+ use iso_c_binding -+ integer(C_INT_LEAST32_T) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -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..09830a3 ---- /dev/null -+++ 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 -+ use iso_c_binding -+ integer(C_INT_LEAST64_T) :: my_x(2) = 1 -+ interface -+ subroutine c_func(b) -+ use iso_c_binding -+ integer(C_INT_LEAST64_T) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -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..0663936 ---- /dev/null -+++ 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 -+ use iso_c_binding -+ integer(C_INT_FAST8_T) :: my_x(2) = 1 -+ interface -+ subroutine c_func(b) -+ use iso_c_binding -+ integer(C_INT_FAST8_T) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -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..3ed798b ---- /dev/null -+++ 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 -+ use iso_c_binding -+ integer(C_INT_FAST16_T) :: my_x(2) = 1 -+ interface -+ subroutine c_func(b) -+ use iso_c_binding -+ integer(C_INT_FAST16_T) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -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..ad04f7a ---- /dev/null -+++ 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 -+ use iso_c_binding -+ integer(C_INT_FAST32_T) :: my_x(2) = 1 -+ interface -+ subroutine c_func(b) -+ use iso_c_binding -+ integer(C_INT_FAST32_T) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -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..21bccab ---- /dev/null -+++ 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 -+ use iso_c_binding -+ integer(C_INT_FAST64_T) :: my_x(2) = 1 -+ interface -+ subroutine c_func(b) -+ use iso_c_binding -+ integer(C_INT_FAST64_T) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -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..0ec82b6 ---- /dev/null -+++ 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 -+ use iso_c_binding -+ integer(C_INTMAX_T) :: my_x(2) = 1 -+ interface -+ subroutine c_func(b) -+ use iso_c_binding -+ integer(C_INTMAX_T) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -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..dabd45d ---- /dev/null -+++ 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 -+ use iso_c_binding -+ integer(C_INTPTR_T) :: my_x(2) = 1 -+ interface -+ subroutine c_func(b) -+ use iso_c_binding -+ integer(C_INTPTR_T) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -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..e0b4407 ---- /dev/null -+++ 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 -+ use iso_c_binding -+ real(C_FLOAT) :: my_x(2) = 12345678.7654321 -+ interface -+ subroutine c_func(b) -+ use iso_c_binding -+ real(C_FLOAT) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -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..453383e ---- /dev/null -+++ 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 -+ use iso_c_binding -+ real(C_DOUBLE) :: my_x(2) = 3.14159265358979 -+ interface -+ subroutine c_func(b) -+ use iso_c_binding -+ real(C_DOUBLE) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -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..527cb8a ---- /dev/null -+++ 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 -+ use iso_c_binding -+ real(C_LONG_DOUBLE) :: my_x(2) = 3.14159265358979 -+ interface -+ subroutine c_func(b) -+ use iso_c_binding -+ real(C_LONG_DOUBLE) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -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..a1d726f ---- /dev/null -+++ 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 -+ use iso_c_binding -+ complex(C_FLOAT_COMPLEX) :: my_x(2) = (-12345678.7654321, 1) -+ interface -+ subroutine c_func(b) -+ use iso_c_binding -+ complex(C_FLOAT_COMPLEX) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -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..d8e8d58 ---- /dev/null -+++ 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 -+ use iso_c_binding -+ complex(C_DOUBLE_COMPLEX) :: my_x(2) = (-3.14159265358979, 1) -+ interface -+ subroutine c_func(b) -+ use iso_c_binding -+ complex(C_DOUBLE_COMPLEX) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -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..b90c2ce ---- /dev/null -+++ 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 -+ use iso_c_binding -+ complex(C_LONG_DOUBLE_COMPLEX) :: my_x(2) = (-3.14159265358979, 1) -+ interface -+ subroutine c_func(b) -+ use iso_c_binding -+ complex(C_LONG_DOUBLE_COMPLEX) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -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..ad4ac52 ---- /dev/null -+++ 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 -+! -+program main -+ use iso_c_binding -+ logical(C_BOOL) :: my_x(2) = .FALSE. -+ interface -+ subroutine c_func(b) -+ use iso_c_binding -+ logical(C_BOOL) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -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..d7a220b ---- /dev/null -+++ 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 -+ use iso_c_binding -+ character(C_CHAR) :: my_x(2) = 'a' -+ interface -+ subroutine c_func(b) -+ use iso_c_binding -+ character(C_CHAR) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -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..b865403 ---- /dev/null -+++ 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 ------." -+#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/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..c7cf73f ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/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_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..010cdf7 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/c_func002.c -@@ -0,0 +1,6 @@ -+#include -+#include -+void c_func_(short *a) { -+ printf("%hd\n", a[0]); -+ printf("%hd\n", a[1]); -+} -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..5e69081 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/c_func003.c -@@ -0,0 +1,6 @@ -+#include -+#include -+void c_func_(long *a) { -+ printf("%ld\n", a[0]); -+ printf("%ld\n", a[1]); -+} -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..3f74c8e ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/c_func004.c -@@ -0,0 +1,6 @@ -+#include -+#include -+void c_func_(long long *a) { -+ printf("%lld\n", a[0]); -+ printf("%lld\n", a[1]); -+} -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..77794d4 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/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_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..27c475f ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/c_func006.c -@@ -0,0 +1,6 @@ -+#include -+#include -+void c_func_(size_t *a) { -+ printf("%ld\n", a[0]); -+ printf("%ld\n", a[1]); -+} -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..f7c4384 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/c_func007.c -@@ -0,0 +1,6 @@ -+#include -+#include -+void c_func_(int8_t *a) { -+ printf("%hhd\n", a[0]); -+ printf("%hhd\n", a[1]); -+} -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..e29971f ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/c_func008.c -@@ -0,0 +1,6 @@ -+#include -+#include -+void c_func_(int16_t *a) { -+ printf("%hd\n", a[0]); -+ printf("%hd\n", a[1]); -+} -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..3b84c1a ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/c_func009.c -@@ -0,0 +1,6 @@ -+#include -+#include -+void c_func_(int32_t *a) { -+ printf("%d\n", a[0]); -+ printf("%d\n", a[1]); -+} -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..11ca3e1 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/c_func010.c -@@ -0,0 +1,6 @@ -+#include -+#include -+void c_func_(int64_t *a) { -+ printf("%ld\n", a[0]); -+ printf("%ld\n", a[1]); -+} -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..f830d74 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/c_func011.c -@@ -0,0 +1,6 @@ -+#include -+#include -+void c_func_(int_least8_t *a) { -+ printf("%hhd\n", a[0]); -+ printf("%hhd\n", a[1]); -+} -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..6ffd7e3 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/c_func012.c -@@ -0,0 +1,6 @@ -+#include -+#include -+void c_func_(int_least16_t *a) { -+ printf("%hd\n", a[0]); -+ printf("%hd\n", a[1]); -+} -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..4b367cb ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/c_func013.c -@@ -0,0 +1,6 @@ -+#include -+#include -+void c_func_(int_least32_t *a) { -+ printf("%d\n", a[0]); -+ printf("%d\n", a[1]); -+} -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..6b2d5b3 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/c_func014.c -@@ -0,0 +1,6 @@ -+#include -+#include -+void c_func_(int_least64_t *a) { -+ printf("%ld\n", a[0]); -+ printf("%ld\n", a[1]); -+} -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..81d223a ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/c_func015.c -@@ -0,0 +1,6 @@ -+#include -+#include -+void c_func_(int_fast8_t *a) { -+ printf("%hhd\n", a[0]); -+ printf("%hhd\n", a[1]); -+} -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..297be3a ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/c_func016.c -@@ -0,0 +1,6 @@ -+#include -+#include -+void c_func_(int_fast16_t *a) { -+ printf("%ld\n", a[0]); -+ printf("%ld\n", a[1]); -+} -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..8eb5818 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/c_func017.c -@@ -0,0 +1,6 @@ -+#include -+#include -+void c_func_(int_fast32_t *a) { -+ printf("%ld\n", a[0]); -+ printf("%ld\n", a[1]); -+} -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..030b1f7 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/c_func018.c -@@ -0,0 +1,6 @@ -+#include -+#include -+void c_func_(int_fast64_t *a) { -+ printf("%ld\n", a[0]); -+ printf("%ld\n", a[1]); -+} -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..babfc75 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/c_func019.c -@@ -0,0 +1,6 @@ -+#include -+#include -+void c_func_(intmax_t *a) { -+ printf("%ld\n", a[0]); -+ printf("%ld\n", a[1]); -+} -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..26c7726 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/c_func020.c -@@ -0,0 +1,6 @@ -+#include -+#include -+void c_func_(intptr_t *a) { -+ printf("%ld\n", a[0]); -+ printf("%ld\n", a[1]); -+} -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..a73f11b ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/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_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..688f3c0 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/c_func022.c -@@ -0,0 +1,5 @@ -+#include -+void c_func_(double *a) { -+ printf("%20lf\n", a[0]); -+ printf("%20lf\n", a[1]); -+} -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..af86ba3 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/c_func023.c -@@ -0,0 +1,5 @@ -+#include -+void c_func_(long double *a) { -+ printf("%20Lf\n", a[0]); -+ printf("%20Lf\n", a[1]); -+} -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..1d34f02 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/c_func024.c -@@ -0,0 +1,6 @@ -+#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])); -+} -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..12b9abb ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/c_func025.c -@@ -0,0 +1,6 @@ -+#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])); -+} -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..78011d4 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/c_func026.c -@@ -0,0 +1,6 @@ -+#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])); -+} -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..91a49b5 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/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_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..9335307 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c/008_fortran_call_c_array_bindc/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_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..de41e30 ---- /dev/null -+++ 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 -+ integer :: my_x(2) = 1 -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ integer :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -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..5cbfa78 ---- /dev/null -+++ 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 -+ integer(2) :: my_x(2) = 1 -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ integer(2) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -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..d7c5825 ---- /dev/null -+++ 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 -+ integer(8) :: my_x(2) = 1 -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ integer(8) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -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..6f54746 ---- /dev/null -+++ 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 -+ integer(8) :: my_x(2) = 1 -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ integer(8) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -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..14607e5 ---- /dev/null -+++ 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 -+ integer(1) :: my_x(2) = 65 -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ integer(1) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -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..56d0f08 ---- /dev/null -+++ 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 -+ integer(8) :: my_x(2) = 3 -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ integer(8) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -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..73dd12f ---- /dev/null -+++ 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 -+ integer(1) :: my_x(2) = 1 -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ integer(1) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -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..c496284 ---- /dev/null -+++ 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 -+ integer(2) :: my_x(2) = 1 -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ integer(2) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -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..aad0c4a ---- /dev/null -+++ 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 -+ integer(4) :: my_x(2) = 1 -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ integer(4) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -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..495b43a ---- /dev/null -+++ 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 -+ integer(8) :: my_x(2) = 1 -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ integer(8) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -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..dcde21c ---- /dev/null -+++ 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 -+ integer(1) :: my_x(2) = 1 -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ integer(1) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -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..6399871 ---- /dev/null -+++ 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 -+ integer(2) :: my_x(2) = 1 -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ integer(2) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -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..b49842e ---- /dev/null -+++ 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 -+ integer(4) :: my_x(2) = 1 -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ integer(4) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -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..66fe325 ---- /dev/null -+++ 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 -+ integer(8) :: my_x(2) = 1 -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ integer(8) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -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..bfcf6a3 ---- /dev/null -+++ 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 -+ integer(1) :: my_x(2) = 1 -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ integer(1) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -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..f9eef1c ---- /dev/null -+++ 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 -+ integer(8) :: my_x(2) = 1 -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ integer(8) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -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..8f293c1 ---- /dev/null -+++ 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 -+ integer(8) :: my_x(2) = 1 -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ integer(8) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -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..8f01271 ---- /dev/null -+++ 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 -+ integer(8) :: my_x(2) = 1 -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ integer(8) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -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..1102216 ---- /dev/null -+++ 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 -+ integer(8) :: my_x(2) = 1 -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ integer(8) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -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..8976d63 ---- /dev/null -+++ 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 -+ integer(8) :: my_x(2) = 1 -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ integer(8) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -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..ae733f9 ---- /dev/null -+++ 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 -+ real(4) :: my_x(2) = 12345678.7654321 -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ real(4) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -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..319d83a ---- /dev/null -+++ 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 -+ real(8) :: my_x(2) = 12345678.7654321 -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ real(8) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -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..9aad10e ---- /dev/null -+++ 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) -+ real(K) :: my_x(2) = 12345678.7654321 -+ interface -+ 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_x) -+end -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..47bdc29 ---- /dev/null -+++ 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 -+ complex(4) :: my_x(2) = (-3.14159265358979, 1) -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ complex(4) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -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..9390897 ---- /dev/null -+++ 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 -+ complex(8) :: my_x(2) = (-3.14159265358979, 1) -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ complex(8) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -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..e07c0ae ---- /dev/null -+++ 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) -+ complex(K) :: my_x(2) = (-3.14159265358979, 1) -+ interface -+ 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_x) -+end -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..7a89da0 ---- /dev/null -+++ 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 -+ logical(1) :: my_x(2) = .TRUE. -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ logical(1) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -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..b4fd1ba ---- /dev/null -+++ 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 -+ character(1) :: my_x(2) = 'a' -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ character(1) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -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..b865403 ---- /dev/null -+++ 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 ------." -+#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/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..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_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 -+int* c_func_(int *a) { -+ printf("%5d\n", *a); -+ return a; -+} -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..6c172b6 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/c_func002.c -@@ -0,0 +1,5 @@ -+#include -+short* c_func_(short *a) { -+ printf("%5d\n", *a); -+ return a; -+} -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..b1b4838 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/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_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..90896f0 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/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_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..91e7d0d ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/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_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..13ec31a ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/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_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..e883fd3 ---- /dev/null -+++ 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..a8a3209 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/c_func008.c -@@ -0,0 +1,6 @@ -+#include -+#include -+int16_t* c_func_(int16_t *a) { -+ printf("%5hd\n", *a); -+ return a; -+} -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_fortran_call_c/010_fortran_call_c_function_ptr/c_func009.c -@@ -0,0 +1,6 @@ -+#include -+#include -+int32_t* c_func_(int32_t *a) { -+ printf("%5d\n", *a); -+ return a; -+} -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_fortran_call_c/010_fortran_call_c_function_ptr/c_func010.c -@@ -0,0 +1,6 @@ -+#include -+#include -+int64_t* c_func_(int64_t *a) { -+ printf("%5ld\n", *a); -+ return a; -+} -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_fortran_call_c/010_fortran_call_c_function_ptr/c_func011.c -@@ -0,0 +1,6 @@ -+#include -+#include -+int_least8_t* c_func_(int_least8_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_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_fortran_call_c/010_fortran_call_c_function_ptr/c_func012.c -@@ -0,0 +1,6 @@ -+#include -+#include -+int_least16_t* c_func_(int_least16_t *a) { -+ printf("%5hd\n", *a); -+ return a; -+} -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_fortran_call_c/010_fortran_call_c_function_ptr/c_func013.c -@@ -0,0 +1,6 @@ -+#include -+#include -+int_least32_t* c_func_(int_least32_t *a) { -+ printf("%d\n", *a); -+ return a; -+} -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_fortran_call_c/010_fortran_call_c_function_ptr/c_func014.c -@@ -0,0 +1,6 @@ -+#include -+#include -+int_least64_t* c_func_(int_least64_t *a) { -+ printf("%5ld\n", *a); -+ return a; -+} -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_fortran_call_c/010_fortran_call_c_function_ptr/c_func015.c -@@ -0,0 +1,6 @@ -+#include -+#include -+int_fast8_t* c_func_(int_fast8_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_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_fortran_call_c/010_fortran_call_c_function_ptr/c_func016.c -@@ -0,0 +1,6 @@ -+#include -+#include -+int_fast16_t* c_func_(int_fast16_t *a) { -+ printf("%5ld\n", *a); -+ return a; -+} -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_fortran_call_c/010_fortran_call_c_function_ptr/c_func017.c -@@ -0,0 +1,6 @@ -+#include -+#include -+int_fast32_t* c_func_(int_fast32_t *a) { -+ printf("%ld\n", *a); -+ return a; -+} -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_fortran_call_c/010_fortran_call_c_function_ptr/c_func018.c -@@ -0,0 +1,6 @@ -+#include -+#include -+int_fast64_t* c_func_(int_fast64_t *a) { -+ printf("%5ld\n", *a); -+ return a; -+} -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_fortran_call_c/010_fortran_call_c_function_ptr/c_func019.c -@@ -0,0 +1,6 @@ -+#include -+#include -+intmax_t* c_func_(intmax_t *a) { -+ printf("%5ld\n", *a); -+ return a; -+} -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_fortran_call_c/010_fortran_call_c_function_ptr/c_func020.c -@@ -0,0 +1,6 @@ -+#include -+#include -+intptr_t* c_func_(intptr_t *a) { -+ printf("%5ld\n", *a); -+ return a; -+} -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_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_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_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_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_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_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_fortran_call_c/010_fortran_call_c_function_ptr/c_func024.c -@@ -0,0 +1,6 @@ -+#include -+#include -+float _Complex* c_func_(float _Complex *t) { -+ printf("%0.20f + %0.20fi\n", creal(*t), cimag(*t)); -+ return t; -+} -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_fortran_call_c/010_fortran_call_c_function_ptr/c_func025.c -@@ -0,0 +1,6 @@ -+#include -+#include -+double _Complex* c_func_(double _Complex *t) { -+ printf("%0.20lf + %0.20lfi\n", creal(*t), cimag(*t)); -+ return t; -+} -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_fortran_call_c/010_fortran_call_c_function_ptr/c_func026.c -@@ -0,0 +1,6 @@ -+#include -+#include -+long double _Complex* c_func_(long double _Complex *t) { -+ printf("%0.20f + %0.20fi\n", creal(*t), cimag(*t)); -+ return t; -+} -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_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_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..6024629 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c/010_fortran_call_c_function_ptr/c_func028.c -@@ -0,0 +1,5 @@ -+#include -+char* c_func_(char *t) { -+ printf("%c\n", *t); -+ return t; -+} -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..0162f22 ---- /dev/null -+++ 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 -+! -+program main -+ integer :: my_x = 1 -+ interface -+ 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_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..9398800 ---- /dev/null -+++ 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) -+ integer(2) :: b -+ integer(2), pointer :: res -+ end -+ end interface -+ print '(I5)', c_func(my_x) -+end -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..8905eab ---- /dev/null -+++ 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) -+ integer(8) :: b -+ integer(8), pointer :: res -+ end -+ end interface -+ print '(I5)', c_func(my_x) -+end -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..6ce9768 ---- /dev/null -+++ 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) -+ integer(8) :: b -+ integer(8), pointer :: res -+ end -+ end interface -+ print '(I5)', c_func(my_x) -+end -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..9445938 ---- /dev/null -+++ 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 -+! -+program main -+ integer(1) :: my_x = 65 -+ interface -+ 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_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..7ead44f ---- /dev/null -+++ 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) -+ integer(8) :: b -+ integer(8), pointer :: res -+ end -+ end interface -+ print '(I5)', c_func(my_x) -+end -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..4a80499 ---- /dev/null -+++ 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) -+ integer(1) :: b -+ integer(1), pointer :: res -+ end -+ end interface -+ print '(I5)', c_func(my_x) -+end -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..d85e1bb ---- /dev/null -+++ 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) -+ integer(2) :: b -+ integer(2), pointer :: res -+ end -+ end interface -+ print '(I5)', c_func(my_x) -+end -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..a613e46 ---- /dev/null -+++ 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) -+ integer(4) :: b -+ integer(4), pointer :: res -+ end -+ end interface -+ print '(I5)', c_func(my_x) -+end -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..c300630 ---- /dev/null -+++ 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) -+ integer(8) :: b -+ integer(8), pointer :: res -+ end -+ end interface -+ print '(I5)', c_func(my_x) -+end -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..c5b3ec4 ---- /dev/null -+++ 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 -+! -+program main -+ integer(1) :: my_x = 1 -+ interface -+ 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_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..50d736a ---- /dev/null -+++ 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 -+! -+program main -+ integer(2) :: my_x = 1 -+ interface -+ 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_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..f1ed742 ---- /dev/null -+++ 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 -+! -+program main -+ integer(4) :: my_x = 1 -+ interface -+ 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_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..d508d97 ---- /dev/null -+++ 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 -+! -+program main -+ integer(8) :: my_x = 1 -+ interface -+ 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_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..626f02a ---- /dev/null -+++ 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 -+! -+program main -+ integer(1) :: my_x = 1 -+ interface -+ 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_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..2a41aa9 ---- /dev/null -+++ 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 -+! -+program main -+ integer(8) :: my_x = 1 -+ interface -+ 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_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..1f4ae6a ---- /dev/null -+++ 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 -+! -+program main -+ integer(8) :: my_x = 1 -+ interface -+ 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_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..9c99b13 ---- /dev/null -+++ 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 -+! -+program main -+ integer(8) :: my_x = 1 -+ interface -+ 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_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..4bdcd0c ---- /dev/null -+++ 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) -+ integer(8) :: b -+ integer(8), pointer :: res -+ end -+ end interface -+ print *, c_func(my_x) -+end -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..80b302e ---- /dev/null -+++ 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) -+ integer(8) :: b -+ integer(8), pointer :: res -+ end -+ end interface -+ print '(I5)', c_func(my_x) -+end -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..3760036 ---- /dev/null -+++ 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) -+ 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_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..491887f ---- /dev/null -+++ 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) -+ 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_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..a8861c9 ---- /dev/null -+++ 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 -+! -+program main -+ integer, parameter :: K = selected_real_kind(16) -+ real(K) :: my_x = 3.1415926535 -+ interface -+ function c_func(b) result(res) -+ integer, parameter :: K = selected_real_kind(16) -+ real(K) :: b -+ real(K), pointer :: res -+ end -+ end interface -+ print '(F20.10)', c_func(my_x) -+end -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..2a49f2a ---- /dev/null -+++ 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 -+! -+program main -+ complex(4) :: my_x = (3.1415926535, 1) -+ interface -+ 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_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..e329c2a ---- /dev/null -+++ 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 -+! -+program main -+ complex(8) :: my_x = (3.1415926535, 1) -+ interface -+ 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_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..6b2b0a2 ---- /dev/null -+++ 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 -+! -+program main -+ integer, parameter :: K = selected_real_kind(16) -+ complex(K) :: my_x = (3.1415926535, 1) -+ interface -+ function c_func(b) result(res) -+ integer, parameter :: K = selected_real_kind(16) -+ complex(K) :: b -+ complex(K), pointer :: res -+ end -+ end interface -+ print '(F20.10)', c_func(my_x) -+end -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..28efc8d ---- /dev/null -+++ 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) -+ logical(1) :: b -+ logical(1), pointer :: res -+ end -+ end interface -+ print *, c_func(my_x) -+end -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..37a0198 ---- /dev/null -+++ 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) -+ character(1) :: b -+ character(1), pointer :: res -+ end -+ end interface -+ print *, c_func(my_x) -+end -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..b865403 ---- /dev/null -+++ 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 ------." -+#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/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_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_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..6c172b6 ---- /dev/null -+++ 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("%5d\n", *a); -+ return a; -+} -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_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_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_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_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_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_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_fortran_call_c/011_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_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_fortran_call_c/011_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_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_fortran_call_c/011_fortran_call_c_function_ptr_bindc/c_func008.c -@@ -0,0 +1,6 @@ -+#include -+#include -+int16_t* c_func_(int16_t *a) { -+ printf("%5hd\n", *a); -+ return a; -+} -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_fortran_call_c/011_fortran_call_c_function_ptr_bindc/c_func009.c -@@ -0,0 +1,6 @@ -+#include -+#include -+int32_t* c_func_(int32_t *a) { -+ printf("%5d\n", *a); -+ return a; -+} -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_fortran_call_c/011_fortran_call_c_function_ptr_bindc/c_func010.c -@@ -0,0 +1,6 @@ -+#include -+#include -+int64_t* c_func_(int64_t *a) { -+ printf("%5ld\n", *a); -+ return a; -+} -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_fortran_call_c/011_fortran_call_c_function_ptr_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; -+} -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_fortran_call_c/011_fortran_call_c_function_ptr_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; -+} -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_fortran_call_c/011_fortran_call_c_function_ptr_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; -+} -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_fortran_call_c/011_fortran_call_c_function_ptr_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; -+} -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_fortran_call_c/011_fortran_call_c_function_ptr_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; -+} -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_fortran_call_c/011_fortran_call_c_function_ptr_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; -+} -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_fortran_call_c/011_fortran_call_c_function_ptr_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; -+} -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_fortran_call_c/011_fortran_call_c_function_ptr_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; -+} -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_fortran_call_c/011_fortran_call_c_function_ptr_bindc/c_func019.c -@@ -0,0 +1,6 @@ -+#include -+#include -+intmax_t* c_func_(intmax_t *a) { -+ printf("%5ld\n", *a); -+ return a; -+} -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_fortran_call_c/011_fortran_call_c_function_ptr_bindc/c_func020.c -@@ -0,0 +1,6 @@ -+#include -+#include -+intptr_t* c_func_(intptr_t *a) { -+ printf("%5ld\n", *a); -+ return a; -+} -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_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_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_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_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_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_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_fortran_call_c/011_fortran_call_c_function_ptr_bindc/c_func024.c -@@ -0,0 +1,6 @@ -+#include -+#include -+float _Complex* c_func_(float _Complex *t) { -+ printf("%0.20f + %0.20fi\n", creal(*t), cimag(*t)); -+ return t; -+} -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_fortran_call_c/011_fortran_call_c_function_ptr_bindc/c_func025.c -@@ -0,0 +1,6 @@ -+#include -+#include -+double _Complex* c_func_(double _Complex *t) { -+ printf("%0.20lf + %0.20lfi\n", creal(*t), cimag(*t)); -+ return t; -+} -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_fortran_call_c/011_fortran_call_c_function_ptr_bindc/c_func026.c -@@ -0,0 +1,6 @@ -+#include -+#include -+long double _Complex* c_func_(long double _Complex *t) { -+ printf("%0.20f + %0.20fi\n", creal(*t), cimag(*t)); -+ return t; -+} -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_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_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..6024629 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c/011_fortran_call_c_function_ptr_bindc/c_func028.c -@@ -0,0 +1,5 @@ -+#include -+char* c_func_(char *t) { -+ printf("%c\n", *t); -+ return t; -+} -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..eea8ab6 ---- /dev/null -+++ 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 with bindc -+! -+program main -+ integer :: my_x = 1 -+ interface -+ 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_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..75ae05d ---- /dev/null -+++ 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) 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_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..0ddcedf ---- /dev/null -+++ 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) 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_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..7383644 ---- /dev/null -+++ 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) 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_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..641ec2f ---- /dev/null -+++ 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) 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_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..f5776ff ---- /dev/null -+++ 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) 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_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..9c8f25b ---- /dev/null -+++ 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) 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_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..e057058 ---- /dev/null -+++ 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) 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_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..e9c35c1 ---- /dev/null -+++ 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) 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_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..d52b3f0 ---- /dev/null -+++ 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) 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_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..8427950 ---- /dev/null -+++ 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) 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_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..123a9b1 ---- /dev/null -+++ 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) 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_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..a8586ed ---- /dev/null -+++ 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) 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_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..6634cd9 ---- /dev/null -+++ 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) 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_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..007d56d ---- /dev/null -+++ 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) 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_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..58c20b5 ---- /dev/null -+++ 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) 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_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..64ed1d0 ---- /dev/null -+++ 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) 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_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..b7ad882 ---- /dev/null -+++ 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) 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_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..1197ccb ---- /dev/null -+++ 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) 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_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..9bf210b ---- /dev/null -+++ 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) 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_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..debcb13 ---- /dev/null -+++ 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) 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_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..20c50dc ---- /dev/null -+++ 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) 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_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..db15fba ---- /dev/null -+++ 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) bind(c, name = "c_func_") -+ integer, parameter :: K = selected_real_kind(16) -+ real(K) :: b -+ real(K), pointer :: res -+ end -+ end interface -+ print '(F20.10)', c_func(my_x) -+end -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..418f3ef ---- /dev/null -+++ 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) 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_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..d895ead ---- /dev/null -+++ 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 with bindc -+! -+program main -+ complex(8) :: my_x = (3.1415926535, 1) -+ interface -+ 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_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..4a70cfe ---- /dev/null -+++ 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 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) bind(c, name = "c_func_") -+ integer, parameter :: K = selected_real_kind(16) -+ complex(K) :: b -+ complex(K), pointer :: res -+ end -+ end interface -+ print '(F20.10)', c_func(my_x) -+end -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..7a59b51 ---- /dev/null -+++ 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) 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_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..c76780f ---- /dev/null -+++ 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) 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_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..b865403 ---- /dev/null -+++ 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 ------." -+#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/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..92427a4 ---- /dev/null -+++ 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; -+} -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..54747f2 ---- /dev/null -+++ 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; -+} -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..a9fde92 ---- /dev/null -+++ 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; -+} -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..2131b04 ---- /dev/null -+++ 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; -+} -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..309b9d0 ---- /dev/null -+++ 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; -+} -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..73982d0 ---- /dev/null -+++ 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; -+} -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..efaee56 ---- /dev/null -+++ 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; -+} -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..5a57718 ---- /dev/null -+++ 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; -+} -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..e076c57 ---- /dev/null -+++ 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; -+} -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..197e12b ---- /dev/null -+++ 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; -+} -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..cc67a34 ---- /dev/null -+++ 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; -+} -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..484de62 ---- /dev/null -+++ 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; -+} -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..7a1973e ---- /dev/null -+++ 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; -+} -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..d535c60 ---- /dev/null -+++ 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; -+} -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..cb1989f ---- /dev/null -+++ 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; -+} -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..df1b16b ---- /dev/null -+++ 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; -+} -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..6070d3e ---- /dev/null -+++ 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; -+} -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..18b6494 ---- /dev/null -+++ 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; -+} -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..b0a0b6f ---- /dev/null -+++ 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; -+} -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..071f5c5 ---- /dev/null -+++ 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; -+} -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..2dee5f2 ---- /dev/null -+++ 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; -+} -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..a2a9843 ---- /dev/null -+++ 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; -+} -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..c762a0a ---- /dev/null -+++ 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; -+} -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_fortran_call_c/012_fortran_call_c_function_value/c_func024.c -@@ -0,0 +1,6 @@ -+#include -+#include -+float _Complex c_func_(float _Complex *t) { -+ printf("%0.20f + %0.20fi\n", creal(*t), cimag(*t)); -+ return *t; -+} -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_fortran_call_c/012_fortran_call_c_function_value/c_func025.c -@@ -0,0 +1,6 @@ -+#include -+#include -+double _Complex c_func_(double _Complex *t) { -+ printf("%0.20lf + %0.20lfi\n", creal(*t), cimag(*t)); -+ return *t; -+} -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_fortran_call_c/012_fortran_call_c_function_value/c_func026.c -@@ -0,0 +1,6 @@ -+#include -+#include -+long double _Complex c_func_(long double _Complex *t) { -+ printf("%0.20f + %0.20fi\n", creal(*t), cimag(*t)); -+ return *t; -+} -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_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_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..197c9b6 ---- /dev/null -+++ 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("%c\n", *t); -+ return *t; -+} -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..833d15b ---- /dev/null -+++ 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) result(res) -+ integer :: b -+ integer :: res -+ end -+ end interface -+ print '(I5)', c_func(my_x) -+end -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..f3bf45c ---- /dev/null -+++ 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) result(res) -+ integer(2) :: b -+ integer(2) :: res -+ end -+ end interface -+ print '(I5)', c_func(my_x) -+end -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..be25937 ---- /dev/null -+++ 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) result(res) -+ integer(8) :: b -+ integer(8) :: res -+ end -+ end interface -+ print '(I5)', c_func(my_x) -+end -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..f5a5c25 ---- /dev/null -+++ 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) result(res) -+ integer(8) :: b -+ integer(8) :: res -+ end -+ end interface -+ print '(I5)', c_func(my_x) -+end -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..ce67996 ---- /dev/null -+++ 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) result(res) -+ integer(1) :: b -+ integer(1) :: res -+ end -+ end interface -+ print '(I5)', c_func(my_x) -+end -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..a334489 ---- /dev/null -+++ 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) result(res) -+ integer(8) :: b -+ integer(8) :: res -+ end -+ end interface -+ print '(I5)', c_func(my_x) -+end -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..11b1e27 ---- /dev/null -+++ 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) result(res) -+ integer(1) :: b -+ integer(1) :: res -+ end -+ end interface -+ print '(I5)', c_func(my_x) -+end -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..6addc84 ---- /dev/null -+++ 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) result(res) -+ integer(2) :: b -+ integer(2) :: res -+ end -+ end interface -+ print '(I5)', c_func(my_x) -+end -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..20d49b4 ---- /dev/null -+++ 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) result(res) -+ integer(4) :: b -+ integer(4) :: res -+ end -+ end interface -+ print '(I5)', c_func(my_x) -+end -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..363fa19 ---- /dev/null -+++ 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) result(res) -+ integer(8) :: b -+ integer(8) :: res -+ end -+ end interface -+ print '(I5)', c_func(my_x) -+end -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..6e95d17 ---- /dev/null -+++ 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) result(res) -+ integer(1) :: b -+ integer(1) :: res -+ end -+ end interface -+ print '(I5)', c_func(my_x) -+end -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..b8b3c12 ---- /dev/null -+++ 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) result(res) -+ integer(2) :: b -+ integer(2) :: res -+ end -+ end interface -+ print '(I5)', c_func(my_x) -+end -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..1eb9429 ---- /dev/null -+++ 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 value of type -+! int_least32_t -+! -+program main -+ integer(4) :: my_x = 1 -+ interface -+ function c_func(b) result(res) -+ integer(4) :: b -+ integer(4) :: res -+ end -+ end interface -+ print '(I5)', c_func(my_x) -+end -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..0d6fba6 ---- /dev/null -+++ 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 value of type -+! int_least64_t -+! -+program main -+ integer(8) :: my_x = 1 -+ interface -+ function c_func(b) result(res) -+ integer(8) :: b -+ integer(8) :: res -+ end -+ end interface -+ print '(I5)', c_func(my_x) -+end -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..78dd147 ---- /dev/null -+++ 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) result(res) -+ integer(1) :: b -+ integer(1) :: res -+ end -+ end interface -+ print '(I5)', c_func(my_x) -+end -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..a12f03e ---- /dev/null -+++ 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) result(res) -+ integer(8) :: b -+ integer(8) :: res -+ end -+ end interface -+ print '(I5)', c_func(my_x) -+end -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..392a401 ---- /dev/null -+++ 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) result(res) -+ integer(8) :: b -+ integer(8) :: res -+ end -+ end interface -+ print '(I5)', c_func(my_x) -+end -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..c24ad39 ---- /dev/null -+++ 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) result(res) -+ integer(8) :: b -+ integer(8) :: res -+ end -+ end interface -+ print '(I5)', c_func(my_x) -+end -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..db38e53 ---- /dev/null -+++ 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) result(res) -+ integer(8) :: b -+ integer(8) :: res -+ end -+ end interface -+ print *, c_func(my_x) -+end -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..d99e3d0 ---- /dev/null -+++ 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) result(res) -+ integer(8) :: b -+ integer(8) :: res -+ end -+ end interface -+ print '(I5)', c_func(my_x) -+end -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..c61c8f1 ---- /dev/null -+++ 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) result(res) -+ real(4) :: b -+ real(4) :: res -+ end -+ end interface -+ print '(F20.10)', c_func(my_x) -+end -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..b5f5dd9 ---- /dev/null -+++ 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) result(res) -+ real(8) :: b -+ real(8) :: res -+ end -+ end interface -+ print '(F20.10)', c_func(my_x) -+end -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..0dd6d35 ---- /dev/null -+++ 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) result(res) -+ integer, parameter :: K = selected_real_kind(16) -+ real(K) :: b -+ real(K) :: res -+ end -+ end interface -+ print '(F20.10)', c_func(my_x) -+end -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..6af3f75 ---- /dev/null -+++ 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 value of type float -+! _Complex -+! -+program main -+ complex(4) :: my_x = (3.1415926535, 1) -+ interface -+ function c_func(b) result(res) -+ complex(4) :: b -+ complex(4) :: res -+ end -+ end interface -+ print '(F20.10)', c_func(my_x) -+end -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..5c7a953 ---- /dev/null -+++ 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 value of type double -+! _Complex -+! -+program main -+ complex(8) :: my_x = (3.1415926535, 1) -+ interface -+ function c_func(b) result(res) -+ complex(8) :: b -+ complex(8) :: res -+ end -+ end interface -+ print '(F20.10)', c_func(my_x) -+end -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..14ec793 ---- /dev/null -+++ 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 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) result(res) -+ integer, parameter :: K = selected_real_kind(16) -+ complex(K) :: b -+ complex(K) :: res -+ end -+ end interface -+ print '(F20.10)', c_func(my_x) -+end -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..203901c ---- /dev/null -+++ 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) result(res) -+ logical(1) :: b -+ logical(1) :: res -+ end -+ end interface -+ print *, c_func(my_x) -+end -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..537c6cb ---- /dev/null -+++ 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) result(res) -+ character(1) :: b -+ character(1) :: res -+ end -+ end interface -+ print *, c_func(my_x) -+end -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..b865403 ---- /dev/null -+++ 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 ------." -+#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/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..92427a4 ---- /dev/null -+++ 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; -+} -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..54747f2 ---- /dev/null -+++ 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; -+} -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..a9fde92 ---- /dev/null -+++ 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; -+} -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..2131b04 ---- /dev/null -+++ 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; -+} -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..309b9d0 ---- /dev/null -+++ 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; -+} -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..73982d0 ---- /dev/null -+++ 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; -+} -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..efaee56 ---- /dev/null -+++ 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; -+} -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..5a57718 ---- /dev/null -+++ 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; -+} -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..e076c57 ---- /dev/null -+++ 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; -+} -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..197e12b ---- /dev/null -+++ 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; -+} -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..cc67a34 ---- /dev/null -+++ 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; -+} -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..484de62 ---- /dev/null -+++ 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; -+} -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..7a1973e ---- /dev/null -+++ 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; -+} -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..d535c60 ---- /dev/null -+++ 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; -+} -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..cb1989f ---- /dev/null -+++ 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; -+} -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..df1b16b ---- /dev/null -+++ 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; -+} -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..6070d3e ---- /dev/null -+++ 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; -+} -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..18b6494 ---- /dev/null -+++ 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; -+} -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..b0a0b6f ---- /dev/null -+++ 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; -+} -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..071f5c5 ---- /dev/null -+++ 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; -+} -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..2dee5f2 ---- /dev/null -+++ 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; -+} -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..a2a9843 ---- /dev/null -+++ 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; -+} -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..c762a0a ---- /dev/null -+++ 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; -+} -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_fortran_call_c/013_fortran_call_c_function_value_bindc/c_func024.c -@@ -0,0 +1,6 @@ -+#include -+#include -+float _Complex c_func_(float _Complex *t) { -+ printf("%0.20f + %0.20fi\n", creal(*t), cimag(*t)); -+ return *t; -+} -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_fortran_call_c/013_fortran_call_c_function_value_bindc/c_func025.c -@@ -0,0 +1,6 @@ -+#include -+#include -+double _Complex c_func_(double _Complex *t) { -+ printf("%0.20lf + %0.20lfi\n", creal(*t), cimag(*t)); -+ return *t; -+} -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_fortran_call_c/013_fortran_call_c_function_value_bindc/c_func026.c -@@ -0,0 +1,6 @@ -+#include -+#include -+long double _Complex c_func_(long double _Complex *t) { -+ printf("%0.20f + %0.20fi\n", creal(*t), cimag(*t)); -+ return *t; -+} -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_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_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..197c9b6 ---- /dev/null -+++ 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("%c\n", *t); -+ return *t; -+} -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..f7e19f7 ---- /dev/null -+++ 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) result(res) bind(c, name = "c_func_") -+ integer :: b -+ integer :: res -+ end -+ end interface -+ print '(I5)', c_func(my_x) -+end -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..b7b2ab4 ---- /dev/null -+++ 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) result(res) bind(c, name = "c_func_") -+ integer(2) :: b -+ integer(2) :: res -+ end -+ end interface -+ print '(I5)', c_func(my_x) -+end -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..7fea817 ---- /dev/null -+++ 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) result(res) bind(c, name = "c_func_") -+ integer(8) :: b -+ integer(8) :: res -+ end -+ end interface -+ print '(I5)', c_func(my_x) -+end -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..c62ea01 ---- /dev/null -+++ 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) result(res) bind(c, name = "c_func_") -+ integer(8) :: b -+ integer(8) :: res -+ end -+ end interface -+ print '(I5)', c_func(my_x) -+end -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..6c3185c ---- /dev/null -+++ 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) result(res) bind(c, name = "c_func_") -+ integer(1) :: b -+ integer(1) :: res -+ end -+ end interface -+ print '(I5)', c_func(my_x) -+end -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..8be1fe5 ---- /dev/null -+++ 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) result(res) bind(c, name = "c_func_") -+ integer(8) :: b -+ integer(8) :: res -+ end -+ end interface -+ print '(I5)', c_func(my_x) -+end -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..5d909b1 ---- /dev/null -+++ 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) result(res) bind(c, name = "c_func_") -+ integer(1) :: b -+ integer(1) :: res -+ end -+ end interface -+ print '(I5)', c_func(my_x) -+end -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..fbbfc82 ---- /dev/null -+++ 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) result(res) bind(c, name = "c_func_") -+ integer(2) :: b -+ integer(2) :: res -+ end -+ end interface -+ print '(I5)', c_func(my_x) -+end -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..9cd04c3 ---- /dev/null -+++ 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) result(res) bind(c, name = "c_func_") -+ integer(4) :: b -+ integer(4) :: res -+ end -+ end interface -+ print '(I5)', c_func(my_x) -+end -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..620d195 ---- /dev/null -+++ 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) result(res) bind(c, name = "c_func_") -+ integer(8) :: b -+ integer(8) :: res -+ end -+ end interface -+ print '(I5)', c_func(my_x) -+end -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..c933b43 ---- /dev/null -+++ 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 value 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_") -+ integer(1) :: b -+ integer(1) :: res -+ end -+ end interface -+ print '(I5)', c_func(my_x) -+end -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..35da307 ---- /dev/null -+++ 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 value 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_") -+ integer(2) :: b -+ integer(2) :: res -+ end -+ end interface -+ print '(I5)', c_func(my_x) -+end -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..38eb044 ---- /dev/null -+++ 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 value 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_") -+ integer(4) :: b -+ integer(4) :: res -+ end -+ end interface -+ print '(I5)', c_func(my_x) -+end -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..e7a3281 ---- /dev/null -+++ 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 value 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_") -+ integer(8) :: b -+ integer(8) :: res -+ end -+ end interface -+ print '(I5)', c_func(my_x) -+end -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..6f41989 ---- /dev/null -+++ 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 value 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_") -+ integer(1) :: b -+ integer(1) :: res -+ end -+ end interface -+ print '(I5)', c_func(my_x) -+end -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..8776c5f ---- /dev/null -+++ 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 value 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_") -+ integer(8) :: b -+ integer(8) :: res -+ end -+ end interface -+ print '(I5)', c_func(my_x) -+end -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..1e153ae ---- /dev/null -+++ 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 value 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_") -+ integer(8) :: b -+ integer(8) :: res -+ end -+ end interface -+ print '(I5)', c_func(my_x) -+end -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..210678d ---- /dev/null -+++ 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 value 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_") -+ integer(8) :: b -+ integer(8) :: res -+ end -+ end interface -+ print '(I5)', c_func(my_x) -+end -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..46677d3 ---- /dev/null -+++ 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) result(res) bind(c, name = "c_func_") -+ integer(8) :: b -+ integer(8) :: res -+ end -+ end interface -+ print *, c_func(my_x) -+end -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..e5044e4 ---- /dev/null -+++ 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) result(res) bind(c, name = "c_func_") -+ integer(8) :: b -+ integer(8) :: res -+ end -+ end interface -+ print '(I5)', c_func(my_x) -+end -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..0e2a2c5 ---- /dev/null -+++ 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) result(res) bind(c, name = "c_func_") -+ real(4) :: b -+ real(4) :: res -+ end -+ end interface -+ print '(F20.10)', c_func(my_x) -+end -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..5ba9920 ---- /dev/null -+++ 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) result(res) bind(c, name = "c_func_") -+ real(8) :: b -+ real(8) :: res -+ end -+ end interface -+ print '(F20.10)', c_func(my_x) -+end -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..cd87fb6 ---- /dev/null -+++ 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) result(res) bind(c, name = "c_func_") -+ integer, parameter :: K = selected_real_kind(16) -+ real(K) :: b -+ real(K) :: res -+ end -+ end interface -+ print '(F20.10)', c_func(my_x) -+end -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..890bd95 ---- /dev/null -+++ 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 value 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_") -+ complex(4) :: b -+ complex(4) :: res -+ end -+ end interface -+ print '(F20.10)', c_func(my_x) -+end -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..39ba319 ---- /dev/null -+++ 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 value of type double -+! _Complex with bindc -+! -+program main -+ complex(8) :: my_x = (3.1415926535, 1) -+ interface -+ function c_func(b) result(res) bind(c, name = "c_func_") -+ complex(8) :: b -+ complex(8) :: res -+ end -+ end interface -+ print '(F20.10)', c_func(my_x) -+end -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..5e7b4c5 ---- /dev/null -+++ 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 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) result(res) bind(c, name = "c_func_") -+ integer, parameter :: K = selected_real_kind(16) -+ complex(K) :: b -+ complex(K) :: res -+ end -+ end interface -+ print '(F20.10)', c_func(my_x) -+end -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..08b2d11 ---- /dev/null -+++ 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) result(res) bind(c, name = "c_func_") -+ logical(1) :: b -+ logical(1) :: res -+ end -+ end interface -+ print *, c_func(my_x) -+end -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..8174ac5 ---- /dev/null -+++ 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) result(res) bind(c, name = "c_func_") -+ character(1) :: b -+ character(1) :: res -+ end -+ end interface -+ print *, c_func(my_x) -+end -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..b865403 ---- /dev/null -+++ 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 ------." -+#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/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_fortran_call_c/014_fortran_call_c_mix/c_func001.c -@@ -0,0 +1,15 @@ -+#include -+struct BaseTy { -+ int j[2]; -+}; -+struct Ty { -+ struct BaseTy bt; -+ int x, y; -+}; -+void c_func_(struct Ty *t, int *a) { -+ printf("%d\t", t->bt.j[0]); -+ printf("%d\t", t->bt.j[1]); -+ printf("%d\t", t->x); -+ printf("%d\t", t->y); -+ printf("%d\n", *a); -+} -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_fortran_call_c/014_fortran_call_c_mix/c_func002.c -@@ -0,0 +1,15 @@ -+#include -+struct BaseTy { -+ short j[2]; -+}; -+struct Ty { -+ struct BaseTy bt; -+ short x, y; -+}; -+void c_func_(struct Ty *t, short *a) { -+ printf("%hd\t", t->bt.j[0]); -+ printf("%hd\t", t->bt.j[1]); -+ printf("%hd\t", t->x); -+ printf("%hd\t", t->y); -+ printf("%hd\n", *a); -+} -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_fortran_call_c/014_fortran_call_c_mix/c_func003.c -@@ -0,0 +1,15 @@ -+#include -+struct BaseTy { -+ long j[2]; -+}; -+struct Ty { -+ struct BaseTy bt; -+ long x, y; -+}; -+void c_func_(struct Ty *t, long *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/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_fortran_call_c/014_fortran_call_c_mix/c_func004.c -@@ -0,0 +1,15 @@ -+#include -+struct BaseTy { -+ long long int j[2]; -+}; -+struct Ty { -+ struct BaseTy bt; -+ long long int x, y; -+}; -+void c_func_(struct Ty *t, long long int *a) { -+ printf("%lld\t", t->bt.j[0]); -+ printf("%lld\t", t->bt.j[1]); -+ printf("%lld\t", t->x); -+ printf("%lld\t", t->y); -+ printf("%lld\n", *a); -+} -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_fortran_call_c/014_fortran_call_c_mix/c_func005.c -@@ -0,0 +1,15 @@ -+#include -+struct BaseTy { -+ signed char j[2]; -+}; -+struct Ty { -+ struct BaseTy bt; -+ signed char x, y; -+}; -+void c_func_(struct Ty *t, signed char *a) { -+ printf("%c\t", t->bt.j[0]); -+ printf("%c\t", t->bt.j[1]); -+ printf("%c\t", t->x); -+ printf("%c\t", t->y); -+ printf("%c\n", *a); -+} -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_fortran_call_c/014_fortran_call_c_mix/c_func006.c -@@ -0,0 +1,15 @@ -+#include -+struct BaseTy { -+ size_t j[2]; -+}; -+struct Ty { -+ struct BaseTy bt; -+ size_t x, y; -+}; -+void c_func_(struct Ty *t, size_t *a) { -+ printf("%lu\t", t->bt.j[0]); -+ printf("%lu\t", t->bt.j[1]); -+ printf("%lu\t", t->x); -+ printf("%lu\t", t->y); -+ printf("%lu\n", *a); -+} -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_fortran_call_c/014_fortran_call_c_mix/c_func007.c -@@ -0,0 +1,16 @@ -+#include -+#include -+struct BaseTy { -+ int8_t j[2]; -+}; -+struct Ty { -+ struct BaseTy bt; -+ int8_t x, y; -+}; -+void c_func_(struct Ty *t, int8_t *a) { -+ printf("%hhd\t", t->bt.j[0]); -+ printf("%hhd\t", t->bt.j[1]); -+ printf("%hhd\t", t->x); -+ printf("%hhd\t", t->y); -+ printf("%hhd\n", *a); -+} -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_fortran_call_c/014_fortran_call_c_mix/c_func008.c -@@ -0,0 +1,16 @@ -+#include -+#include -+struct BaseTy { -+ int16_t j[2]; -+}; -+struct Ty { -+ struct BaseTy bt; -+ int16_t x, y; -+}; -+void c_func_(struct Ty *t, int16_t *a) { -+ printf("%hd\t", t->bt.j[0]); -+ printf("%hd\t", t->bt.j[1]); -+ printf("%hd\t", t->x); -+ printf("%hd\t", t->y); -+ printf("%hd\n", *a); -+} -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_fortran_call_c/014_fortran_call_c_mix/c_func009.c -@@ -0,0 +1,16 @@ -+#include -+#include -+struct BaseTy { -+ int32_t j[2]; -+}; -+struct Ty { -+ struct BaseTy bt; -+ int32_t x, y; -+}; -+void c_func_(struct Ty *t, int32_t *a) { -+ printf("%d\t", t->bt.j[0]); -+ printf("%d\t", t->bt.j[1]); -+ printf("%d\t", t->x); -+ printf("%d\t", t->y); -+ printf("%d\n", *a); -+} -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_fortran_call_c/014_fortran_call_c_mix/c_func010.c -@@ -0,0 +1,16 @@ -+#include -+#include -+struct BaseTy { -+ int64_t j[2]; -+}; -+struct Ty { -+ struct BaseTy bt; -+ int64_t x, y; -+}; -+void c_func_(struct Ty *t, int64_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/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_fortran_call_c/014_fortran_call_c_mix/c_func011.c -@@ -0,0 +1,16 @@ -+#include -+#include -+struct BaseTy { -+ int_least8_t j[2]; -+}; -+struct Ty { -+ struct BaseTy bt; -+ int_least8_t x, y; -+}; -+void c_func_(struct Ty *t, int_least8_t *a) { -+ printf("%hhd\t", t->bt.j[0]); -+ printf("%hhd\t", t->bt.j[1]); -+ printf("%hhd\t", t->x); -+ printf("%hhd\t", t->y); -+ printf("%hhd\n", *a); -+} -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_fortran_call_c/014_fortran_call_c_mix/c_func012.c -@@ -0,0 +1,16 @@ -+#include -+#include -+struct BaseTy { -+ int_least16_t j[2]; -+}; -+struct Ty { -+ struct BaseTy bt; -+ int_least16_t x, y; -+}; -+void c_func_(struct Ty *t, int_least16_t *a) { -+ printf("%hd\t", t->bt.j[0]); -+ printf("%hd\t", t->bt.j[1]); -+ printf("%hd\t", t->x); -+ printf("%hd\t", t->y); -+ printf("%hd\n", *a); -+} -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_fortran_call_c/014_fortran_call_c_mix/c_func013.c -@@ -0,0 +1,16 @@ -+#include -+#include -+struct BaseTy { -+ int_least32_t j[2]; -+}; -+struct Ty { -+ struct BaseTy bt; -+ int_least32_t x, y; -+}; -+void c_func_(struct Ty *t, int_least32_t *a) { -+ printf("%d\t", t->bt.j[0]); -+ printf("%d\t", t->bt.j[1]); -+ printf("%d\t", t->x); -+ printf("%d\t", t->y); -+ printf("%d\n", *a); -+} -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_fortran_call_c/014_fortran_call_c_mix/c_func014.c -@@ -0,0 +1,16 @@ -+#include -+#include -+struct BaseTy { -+ int_least64_t j[2]; -+}; -+struct Ty { -+ struct BaseTy bt; -+ int_least64_t x, y; -+}; -+void c_func_(struct Ty *t, int_least64_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/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_fortran_call_c/014_fortran_call_c_mix/c_func015.c -@@ -0,0 +1,16 @@ -+#include -+#include -+struct BaseTy { -+ int_fast8_t j[2]; -+}; -+struct Ty { -+ struct BaseTy bt; -+ int_fast8_t x, y; -+}; -+void c_func_(struct Ty *t, int_fast8_t *a) { -+ printf("%hhd\t", t->bt.j[0]); -+ printf("%hhd\t", t->bt.j[1]); -+ printf("%hhd\t", t->x); -+ printf("%hhd\t", t->y); -+ printf("%hhd\n", *a); -+} -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_fortran_call_c/014_fortran_call_c_mix/c_func016.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/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_fortran_call_c/014_fortran_call_c_mix/c_func017.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/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_fortran_call_c/014_fortran_call_c_mix/c_func018.c -@@ -0,0 +1,16 @@ -+#include -+#include -+struct BaseTy { -+ int_fast64_t j[2]; -+}; -+struct Ty { -+ struct BaseTy bt; -+ int_fast64_t x, y; -+}; -+void c_func_(struct Ty *t, int_fast64_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/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_fortran_call_c/014_fortran_call_c_mix/c_func019.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/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_fortran_call_c/014_fortran_call_c_mix/c_func020.c -@@ -0,0 +1,16 @@ -+#include -+#include -+struct BaseTy { -+ intptr_t j[2]; -+}; -+struct Ty { -+ struct BaseTy bt; -+ intptr_t x, y; -+}; -+void c_func_(struct Ty *t, intptr_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/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_fortran_call_c/014_fortran_call_c_mix/c_func021.c -@@ -0,0 +1,15 @@ -+#include -+#include -+struct BaseTy { -+ float j[2]; -+}; -+struct Ty { -+ struct BaseTy bt; -+ float x, y; -+}; -+void c_func_(struct Ty *t) { -+ printf("%.2f\t", t->bt.j[0]); -+ printf("%.2f\t", t->bt.j[1]); -+ printf("%.2f\t", t->x); -+ printf("%.2f\n", t->y); -+} -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_fortran_call_c/014_fortran_call_c_mix/c_func022.c -@@ -0,0 +1,15 @@ -+#include -+#include -+struct BaseTy { -+ double j[2]; -+}; -+struct Ty { -+ struct BaseTy bt; -+ double x, y; -+}; -+void c_func_(struct Ty *t) { -+ printf("%.6lf\t", t->bt.j[0]); -+ printf("%.6lf\t", t->bt.j[1]); -+ printf("%.6lf\t", t->x); -+ printf("%.6lf\n", t->y); -+} -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_fortran_call_c/014_fortran_call_c_mix/c_func023.c -@@ -0,0 +1,15 @@ -+#include -+#include -+struct BaseTy { -+ long double j[2]; -+}; -+struct Ty { -+ struct BaseTy bt; -+ long double x, y; -+}; -+void c_func_(struct Ty *t) { -+ printf("%.6Lf\t", t->bt.j[0]); -+ printf("%.6Lf\t", t->bt.j[1]); -+ printf("%.6Lf\t", t->x); -+ printf("%.6Lf\n", t->y); -+} -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_fortran_call_c/014_fortran_call_c_mix/c_func024.c -@@ -0,0 +1,15 @@ -+#include -+#include -+struct BaseTy { -+ float _Complex j[2]; -+}; -+struct Ty { -+ struct BaseTy bt; -+ float _Complex x, y; -+}; -+void c_func_(struct Ty *t) { -+ printf("%f + %fi\n", creal(t->bt.j[0]), cimag(t->bt.j[0])); -+ printf("%f + %fi\n", creal(t->bt.j[1]), cimag(t->bt.j[1])); -+ 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/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_fortran_call_c/014_fortran_call_c_mix/c_func025.c -@@ -0,0 +1,15 @@ -+#include -+#include -+struct BaseTy { -+ double _Complex j[2]; -+}; -+struct Ty { -+ struct BaseTy bt; -+ double _Complex x, y; -+}; -+void c_func_(struct Ty *t) { -+ printf("%lf + %lfi\n", creal(t->bt.j[0]), cimag(t->bt.j[0])); -+ printf("%lf + %lfi\n", creal(t->bt.j[1]), cimag(t->bt.j[1])); -+ 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/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_fortran_call_c/014_fortran_call_c_mix/c_func026.c -@@ -0,0 +1,15 @@ -+#include -+#include -+struct BaseTy { -+ long double _Complex j[2]; -+}; -+struct Ty { -+ struct BaseTy bt; -+ long double _Complex x, y; -+}; -+void c_func_(struct Ty *t) { -+ printf("%f + %fi\n", creal(t->bt.j[0]), cimag(t->bt.j[0])); -+ printf("%f + %fi\n", creal(t->bt.j[1]), cimag(t->bt.j[1])); -+ 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/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_fortran_call_c/014_fortran_call_c_mix/c_func027.c -@@ -0,0 +1,15 @@ -+#include -+struct BaseTy { -+ _Bool j[2]; -+}; -+struct Ty { -+ struct BaseTy bt; -+ _Bool x, y; -+}; -+void c_func_(struct Ty *t, _Bool *a) { -+ printf("%d\t", t->bt.j[0]); -+ printf("%d\t", t->bt.j[1]); -+ printf("%d\t", t->x); -+ printf("%d\t", t->y); -+ printf("%d\n", *a); -+} -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_fortran_call_c/014_fortran_call_c_mix/c_func028.c -@@ -0,0 +1,15 @@ -+#include -+struct BaseTy { -+ char j[2]; -+}; -+struct Ty { -+ struct BaseTy bt; -+ char x, y; -+}; -+void c_func_(struct Ty *t, int *a) { -+ printf("%c\t", t->bt.j[0]); -+ printf("%c\t", t->bt.j[1]); -+ printf("%c\t", t->x); -+ printf("%c\t", t->y); -+ printf("%c\n", *a); -+} -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_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 -+! components are mixed type int_t -+! -+program main -+ use iso_c_binding -+ type, bind(c) :: base -+ integer(C_INT) :: j(2) = -2 -+ end type base -+ type, bind(c) :: t -+ type(base) :: bt -+ integer(C_INT) :: x = -2147483647 -+ integer(4) :: 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/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_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 -+! components are mixed type short -+! -+program main -+ use iso_c_binding -+ type, bind(c) :: base -+ integer(C_SHORT) :: j(2) = -2 -+ end type base -+ type, bind(c) :: t -+ type(base) :: bt -+ integer(C_SHORT) :: x = -32768 -+ integer(2) :: y = 32767 -+ end type t -+ type(t) :: my_t -+ integer(C_SHORT) :: my_x = 3 -+ interface -+ subroutine c_func(a, b) -+ use iso_c_binding -+ import :: t -+ type(t) :: a -+ integer(C_SHORT) :: 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_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_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 -+! components are mixed type long -+! -+program main -+ use iso_c_binding -+ type, bind(c) :: base -+ integer(C_LONG) :: j(2) = -2 -+ end type base -+ type, bind(c) :: t -+ type(base) :: bt -+ integer(C_LONG) :: x = -2147483647 -+ integer(8) :: y = 2147483647 -+ end type t -+ type(t) :: my_t -+ integer(C_LONG) :: my_x = 3 -+ interface -+ subroutine c_func(a, b) -+ use iso_c_binding -+ import :: t -+ type(t) :: a -+ integer(C_LONG) :: 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_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_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 -+! components are mixed type long long -+! -+program main -+ use iso_c_binding -+ type, bind(c) :: base -+ integer(C_LONG_LONG) :: j(2) = -2 -+ end type base -+ type, bind(c) :: t -+ type(base) :: bt -+ integer(C_LONG_LONG) :: x = -9223372036854775807 -+ integer(8) :: y = 9223372036854775807 -+ end type t -+ type(t) :: my_t -+ integer(C_LONG_LONG) :: my_x = 3 -+ interface -+ subroutine c_func(a, b) -+ use iso_c_binding -+ import :: t -+ type(t) :: a -+ integer(C_LONG_LONG) :: 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_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_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 -+! components are mixed type signed char -+! -+program main -+ use iso_c_binding -+ type, bind(c) :: base -+ integer(C_SIGNED_CHAR) :: j(2) = 65 -+ end type base -+ type, bind(c) :: t -+ type(base) :: bt -+ integer(C_SIGNED_CHAR) :: x = 66 -+ integer(1) :: y = 67 -+ end type t -+ type(t) :: my_t -+ integer(C_SIGNED_CHAR) :: my_x = 68 -+ interface -+ subroutine c_func(a, b) -+ use iso_c_binding -+ import :: t -+ type(t) :: a -+ integer(C_SIGNED_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/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_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 -+! components are mixed type size_t -+! -+program main -+ use iso_c_binding -+ type, bind(c) :: base -+ integer(C_SIZE_T) :: j(2) = 2 -+ end type base -+ type, bind(c) :: t -+ type(base) :: bt -+ integer(C_SIZE_T) :: x = 9223372036854775807 -+ integer(8) :: y = 0 -+ end type t -+ type(t) :: my_t -+ integer(C_SIZE_T) :: my_x = 3 -+ interface -+ subroutine c_func(a, b) -+ use iso_c_binding -+ import :: t -+ type(t) :: a -+ integer(C_SIZE_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_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_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 -+ 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 -+ integer :: x(2) = 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/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_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 -+ type, bind(c) :: t -+ integer(2) :: x(2) = -32768 -+ 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/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_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 -+ type, bind(c) :: t -+ integer(8) :: x(2) = -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/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_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 -+ type, bind(c) :: t -+ integer(8) :: x(2) = -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/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_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 -+ type, bind(c) :: t -+ integer(1) :: x(2) = 65 -+ 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/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_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 -+ type, bind(c) :: t -+ integer(8) :: x(2) = 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/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_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 -+ type, bind(c) :: t -+ integer(1) :: x(2) = -128 -+ 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/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_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 -+ type, bind(c) :: t -+ integer(2) :: x(2) = -32768 -+ 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/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_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 -+ type, bind(c) :: t -+ integer(4) :: x(2) = -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/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_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 -+ type, bind(c) :: t -+ integer(8) :: x(2) = -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/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_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 -+ type, bind(c) :: t -+ integer(1) :: x(2) = -128 -+ 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/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_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 -+ type, bind(c) :: t -+ integer(2) :: x(2) = -32768 -+ 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/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_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 -+ type, bind(c) :: t -+ integer(4) :: x(2) = -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/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_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 -+ type, bind(c) :: t -+ integer(8) :: x(2) = -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/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_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 -+ type, bind(c) :: t -+ integer(1) :: x(2) = -128 -+ 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/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_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 -+ type, bind(c) :: t -+ integer(8) :: x(2) = -32768 -+ 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/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_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 -+ type, bind(c) :: t -+ integer(8) :: x(2) = -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/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_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 -+ type, bind(c) :: t -+ integer(8) :: x(2) = -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/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_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 -+ type, bind(c) :: t -+ integer(8) :: x(2) = -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/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_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 -+ type, bind(c) :: t -+ integer(8) :: x(2) = -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/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_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 -+ type, bind(c) :: t -+ real(4) :: x(2) = 3.14 -+ 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/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 -+ type, bind(c) :: t -+ real(8) :: x(2) = 450359962737049.621345 -+ 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/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..8f17598 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c/024_fortran_call_c_array_in_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 -+! -+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 -+ 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/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..635ac18 ---- /dev/null -+++ 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 the component of the -+! derived type is array of type float _Complex without iso_c_binding -+! -+program main -+ type, bind(c) :: t -+ complex(4) :: x(2) = (-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/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..66ec48b ---- /dev/null -+++ 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 -+ type, bind(c) :: t -+ complex(8) :: x(2) = (-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/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..304647b ---- /dev/null -+++ 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 -+ 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 -+ 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/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..e454591 ---- /dev/null -+++ 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 -+! -+ type, bind(c) :: t -+ logical(1) :: x(2) = .TRUE. -+ 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/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..e2ee053 ---- /dev/null -+++ 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 -+ type, bind(c) :: t -+ character :: x(2) = 'b' -+ 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/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..b865403 ---- /dev/null -+++ 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:" -+#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 --- -2.25.1 - diff --git a/3-test-interoperability-with-c-fortran-call-c-scalar.patch b/3-test-interoperability-with-c-fortran-call-c-scalar.patch new file mode 100644 index 0000000..7bd058a --- /dev/null +++ b/3-test-interoperability-with-c-fortran-call-c-scalar.patch @@ -0,0 +1,5011 @@ +From 84ab53f956cfdc7d3529b22203c15da098249cee Mon Sep 17 00:00:00 2001 +From: xieyihui +Date: Fri, 18 Nov 2022 12:36:52 +0800 +Subject: [PATCH] Add new test cases about scalar for interoperability with C + about fortran call C + +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func001.c b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func001.c +new file mode 100644 +index 0000000..5acb3c0 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func002.c b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func002.c +new file mode 100644 +index 0000000..a695d21 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func003.c b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func003.c +new file mode 100644 +index 0000000..c3e2b1b +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func004.c b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func004.c +new file mode 100644 +index 0000000..c83f515 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func005.c b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func005.c +new file mode 100644 +index 0000000..df53145 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func006.c b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func006.c +new file mode 100644 +index 0000000..bf8fe98 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func007.c b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func007.c +new file mode 100644 +index 0000000..1ccc2d3 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func008.c b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func008.c +new file mode 100644 +index 0000000..5b4a477 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func009.c b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func009.c +new file mode 100644 +index 0000000..ef5dbab +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func010.c b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func010.c +new file mode 100644 +index 0000000..ff0c5b2 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func011.c b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func011.c +new file mode 100644 +index 0000000..648e234 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func012.c b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func012.c +new file mode 100644 +index 0000000..175d427 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func013.c b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func013.c +new file mode 100644 +index 0000000..3e63c13 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func014.c b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func014.c +new file mode 100644 +index 0000000..ac6a62b +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func015.c b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func015.c +new file mode 100644 +index 0000000..85b98cc +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func016.c b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func016.c +new file mode 100644 +index 0000000..ce358c3 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func017.c b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func017.c +new file mode 100644 +index 0000000..9576185 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func018.c b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func018.c +new file mode 100644 +index 0000000..84469ba +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func019.c b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func019.c +new file mode 100644 +index 0000000..acd8949 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func020.c b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func020.c +new file mode 100644 +index 0000000..43c01a7 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func021.c b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func021.c +new file mode 100644 +index 0000000..af99025 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func022.c b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func022.c +new file mode 100644 +index 0000000..7ae046f +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func023.c b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func023.c +new file mode 100644 +index 0000000..be8b2b1 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func024.c b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func024.c +new file mode 100644 +index 0000000..1e65f36 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func025.c b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func025.c +new file mode 100644 +index 0000000..b3f9944 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func026.c b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func026.c +new file mode 100644 +index 0000000..c049c6f +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func027.c b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func027.c +new file mode 100644 +index 0000000..a3a8596 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func028.c b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func028.c +new file mode 100644 +index 0000000..0abbf89 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main001.f90 b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main001.f90 +new file mode 100644 +index 0000000..67065b5 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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 ++! ++program main ++ integer(4) :: my_x = 1 ++ interface ++ subroutine c_func(b) ++ integer(4) :: b ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main002.f90 b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main002.f90 +new file mode 100644 +index 0000000..be8e4a6 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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 ++! ++program main ++ integer(2) :: my_x = 1 ++ interface ++ subroutine c_func(b) ++ integer(2) :: b ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main003.f90 b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main003.f90 +new file mode 100644 +index 0000000..32fe301 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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 ++! ++program main ++ integer(8) :: my_x = 1 ++ interface ++ subroutine c_func(b) ++ integer(8) :: b ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main004.f90 b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main004.f90 +new file mode 100644 +index 0000000..fec8bc8 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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 ++! ++program main ++ integer(8) :: my_x = 1 ++ interface ++ subroutine c_func(b) ++ integer(8) :: b ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main005.f90 b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main005.f90 +new file mode 100644 +index 0000000..1c70d24 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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 ++! ++program main ++ integer(1) :: my_x = 65 ++ interface ++ subroutine c_func(b) ++ integer(1) :: b ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main006.f90 b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main006.f90 +new file mode 100644 +index 0000000..1c51bf7 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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 ++! ++program main ++ integer(8) :: my_x = 1 ++ interface ++ subroutine c_func(b) ++ integer(8) :: b ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main007.f90 b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main007.f90 +new file mode 100644 +index 0000000..1905558 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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 ++! ++program main ++ integer(1) :: my_x = 1 ++ interface ++ subroutine c_func(b) ++ integer(1) :: b ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main008.f90 b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main008.f90 +new file mode 100644 +index 0000000..ad502f7 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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 ++! ++program main ++ integer(2) :: my_x = 1 ++ interface ++ subroutine c_func(b) ++ integer(2) :: b ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main009.f90 b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main009.f90 +new file mode 100644 +index 0000000..ff8e413 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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 ++! ++program main ++ integer(4) :: my_x = 1 ++ interface ++ subroutine c_func(b) ++ integer(4) :: b ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main010.f90 b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main010.f90 +new file mode 100644 +index 0000000..b2bb503 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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 ++! ++program main ++ integer(8) :: my_x = 1 ++ interface ++ subroutine c_func(b) ++ integer(8) :: b ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main011.f90 b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main011.f90 +new file mode 100644 +index 0000000..b63979f +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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 ++! ++program main ++ integer(1) :: my_x = 1 ++ interface ++ subroutine c_func(b) ++ integer(1) :: b ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main012.f90 b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main012.f90 +new file mode 100644 +index 0000000..4b57843 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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 ++! ++program main ++ integer(2) :: my_x = 1 ++ interface ++ subroutine c_func(b) ++ integer(2) :: b ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main013.f90 b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main013.f90 +new file mode 100644 +index 0000000..38f4dbf +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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 ++! ++program main ++ integer(4) :: my_x = 1 ++ interface ++ subroutine c_func(b) ++ integer(4) :: b ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main014.f90 b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main014.f90 +new file mode 100644 +index 0000000..76db856 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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 ++! ++program main ++ integer(8) :: my_x = 1 ++ interface ++ subroutine c_func(b) ++ integer(8) :: b ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main015.f90 b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main015.f90 +new file mode 100644 +index 0000000..22edd3a +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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 ++! ++program main ++ integer(1) :: my_x = 1 ++ interface ++ subroutine c_func(b) ++ integer(1) :: b ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main016.f90 b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main016.f90 +new file mode 100644 +index 0000000..16194de +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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 ++! ++program main ++ integer(8) :: my_x = 1 ++ interface ++ subroutine c_func(b) ++ integer(8) :: b ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main017.f90 b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main017.f90 +new file mode 100644 +index 0000000..d26c6f2 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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 ++! ++program main ++ integer(8) :: my_x = 1 ++ interface ++ subroutine c_func(b) ++ integer(8) :: b ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main018.f90 b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main018.f90 +new file mode 100644 +index 0000000..1fa0b83 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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 ++! ++program main ++ integer(8) :: my_x = 1 ++ interface ++ subroutine c_func(b) ++ integer(8) :: b ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main019.f90 b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main019.f90 +new file mode 100644 +index 0000000..5e4dd89 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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 ++! ++program main ++ integer(8) :: my_x = 1 ++ interface ++ subroutine c_func(b) ++ integer(8) :: b ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main020.f90 b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main020.f90 +new file mode 100644 +index 0000000..12e4c74 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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 ++! ++program main ++ integer(8) :: my_x = 1 ++ interface ++ subroutine c_func(b) ++ integer(8) :: b ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main021.f90 b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main021.f90 +new file mode 100644 +index 0000000..d702c52 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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 ++! ++program main ++ real(4) :: my_x = 3.1415926535 ++ interface ++ subroutine c_func(b) ++ real(4) :: b ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main022.f90 b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main022.f90 +new file mode 100644 +index 0000000..fb9895b +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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 ++! ++program main ++ real(8) :: my_x = 3.14159265358979 ++ interface ++ subroutine c_func(b) ++ real(8) :: b ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main023.f90 b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main023.f90 +new file mode 100644 +index 0000000..bc2c2b7 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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 ++! ++program main ++ integer, parameter :: K = selected_real_kind(16) ++ real(K) :: my_x = 3.14159265358979 ++ interface ++ subroutine c_func(b) ++ integer, parameter :: K = selected_real_kind(16) ++ real(K) :: b ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main024.f90 b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main024.f90 +new file mode 100644 +index 0000000..3b9f2d4 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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 ++! ++program main ++ complex(4) :: my_x = (-12345678.7654321, 1) ++ interface ++ subroutine c_func(b) ++ complex(4) :: b ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main025.f90 b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main025.f90 +new file mode 100644 +index 0000000..f4f3f9f +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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 ++! ++program main ++ complex(8) :: my_x = (-3.14159265358979, 1) ++ interface ++ subroutine c_func(b) ++ complex(8) :: b ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main026.f90 b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main026.f90 +new file mode 100644 +index 0000000..b02bca6 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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 ++! ++program main ++ integer, parameter :: K = selected_real_kind(16) ++ complex(K) :: my_x = (-3.14159265358979, 1) ++ interface ++ subroutine c_func(b) ++ integer, parameter :: K = selected_real_kind(16) ++ complex(K) :: b ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main027.f90 b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main027.f90 +new file mode 100644 +index 0000000..e9aaf8e +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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 ++! ++program main ++ logical(1) :: my_x = .FALSE. ++ interface ++ subroutine c_func(b) ++ logical(1) :: b ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main028.f90 b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main028.f90 +new file mode 100644 +index 0000000..6fab824 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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 ++! ++program main ++ character(1) :: my_x = 'a' ++ interface ++ subroutine c_func(b) ++ character(1) :: b ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/result.md b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/result.md +new file mode 100644 +index 0000000..f15fe53 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/result.md +@@ -0,0 +1,29 @@ ++ | test | gfortran | flang | nvfortran| ++ | 001 | PASS | PASS | PASS | ++ | 002 | PASS | PASS | PASS | ++ | 003 | PASS | PASS | PASS | ++ | 004 | PASS | PASS | PASS | ++ | 005 | PASS | PASS | PASS | ++ | 006 | PASS | PASS | PASS | ++ | 007 | PASS | PASS | PASS | ++ | 008 | PASS | PASS | PASS | ++ | 009 | PASS | PASS | PASS | ++ | 010 | PASS | PASS | PASS | ++ | 011 | PASS | PASS | PASS | ++ | 012 | PASS | PASS | PASS | ++ | 013 | PASS | PASS | PASS | ++ | 014 | PASS | PASS | PASS | ++ | 015 | PASS | PASS | PASS | ++ | 016 | PASS | PASS | PASS | ++ | 017 | PASS | PASS | PASS | ++ | 018 | PASS | PASS | PASS | ++ | 019 | PASS | PASS | PASS | ++ | 020 | PASS | PASS | PASS | ++ | 021 | PASS | PASS | PASS | ++ | 022 | PASS | PASS | PASS | ++ | 023 | PASS | PASS | ERROR | ++ | 024 | PASS | PASS | PASS | ++ | 025 | PASS | PASS | PASS | ++ | 026 | PASS | PASS | ERROR | ++ | 027 | PASS | PASS | PASS | ++ | 028 | PASS | PASS | PASS | +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/run.sh b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/run.sh +new file mode 100644 +index 0000000..dbbd62f +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/run.sh +@@ -0,0 +1,22 @@ ++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 ++echo "----- nvfortran result : " ++clang c_func$i.c -c -o c-test.o ++nvfortran fortran_main$i.f90 -c -o fortran-test.o ++nvfortran 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_scalar/002_fortran_call_c_scalar_iso_c_binding/c_func001.c b/test/interoperability_with_c_fortran_call_c_scalar/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_fortran_call_c_scalar/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_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/c_func002.c b/test/interoperability_with_c_fortran_call_c_scalar/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_fortran_call_c_scalar/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_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/c_func003.c b/test/interoperability_with_c_fortran_call_c_scalar/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_fortran_call_c_scalar/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_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/c_func004.c b/test/interoperability_with_c_fortran_call_c_scalar/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_fortran_call_c_scalar/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_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/c_func005.c b/test/interoperability_with_c_fortran_call_c_scalar/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_fortran_call_c_scalar/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_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/c_func006.c b/test/interoperability_with_c_fortran_call_c_scalar/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_fortran_call_c_scalar/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_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/c_func007.c b/test/interoperability_with_c_fortran_call_c_scalar/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_fortran_call_c_scalar/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_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/c_func008.c b/test/interoperability_with_c_fortran_call_c_scalar/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_fortran_call_c_scalar/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_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/c_func009.c b/test/interoperability_with_c_fortran_call_c_scalar/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_fortran_call_c_scalar/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_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/c_func010.c b/test/interoperability_with_c_fortran_call_c_scalar/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_fortran_call_c_scalar/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_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/c_func011.c b/test/interoperability_with_c_fortran_call_c_scalar/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_fortran_call_c_scalar/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_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/c_func012.c b/test/interoperability_with_c_fortran_call_c_scalar/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_fortran_call_c_scalar/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_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/c_func013.c b/test/interoperability_with_c_fortran_call_c_scalar/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_fortran_call_c_scalar/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_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/c_func014.c b/test/interoperability_with_c_fortran_call_c_scalar/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_fortran_call_c_scalar/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_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/c_func015.c b/test/interoperability_with_c_fortran_call_c_scalar/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_fortran_call_c_scalar/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_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/c_func016.c b/test/interoperability_with_c_fortran_call_c_scalar/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_fortran_call_c_scalar/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_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/c_func017.c b/test/interoperability_with_c_fortran_call_c_scalar/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_fortran_call_c_scalar/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_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/c_func018.c b/test/interoperability_with_c_fortran_call_c_scalar/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_fortran_call_c_scalar/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_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/c_func019.c b/test/interoperability_with_c_fortran_call_c_scalar/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_fortran_call_c_scalar/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_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/c_func020.c b/test/interoperability_with_c_fortran_call_c_scalar/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_fortran_call_c_scalar/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_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/c_func021.c b/test/interoperability_with_c_fortran_call_c_scalar/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_fortran_call_c_scalar/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_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/c_func022.c b/test/interoperability_with_c_fortran_call_c_scalar/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_fortran_call_c_scalar/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_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/c_func023.c b/test/interoperability_with_c_fortran_call_c_scalar/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_fortran_call_c_scalar/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_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/c_func024.c b/test/interoperability_with_c_fortran_call_c_scalar/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_fortran_call_c_scalar/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_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/c_func025.c b/test/interoperability_with_c_fortran_call_c_scalar/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_fortran_call_c_scalar/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_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/c_func026.c b/test/interoperability_with_c_fortran_call_c_scalar/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_fortran_call_c_scalar/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_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/c_func027.c b/test/interoperability_with_c_fortran_call_c_scalar/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_fortran_call_c_scalar/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_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/c_func028.c b/test/interoperability_with_c_fortran_call_c_scalar/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_fortran_call_c_scalar/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_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/fortran_main001.f90 b/test/interoperability_with_c_fortran_call_c_scalar/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_fortran_call_c_scalar/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 ++! ++program main ++ use iso_c_binding ++ integer(C_INT) :: my_x = 1 ++ interface ++ subroutine c_func(b) ++ use iso_c_binding ++ integer(C_INT) :: b ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/fortran_main002.f90 b/test/interoperability_with_c_fortran_call_c_scalar/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_fortran_call_c_scalar/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 ++! ++program main ++ use iso_c_binding ++ integer(C_SHORT) :: my_x = 1 ++ interface ++ subroutine c_func(b) ++ use iso_c_binding ++ integer(C_SHORT) :: b ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/fortran_main003.f90 b/test/interoperability_with_c_fortran_call_c_scalar/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_fortran_call_c_scalar/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 ++! ++program main ++ use iso_c_binding ++ integer(C_LONG) :: my_x = 1 ++ interface ++ subroutine c_func(b) ++ use iso_c_binding ++ integer(C_LONG) :: b ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/fortran_main004.f90 b/test/interoperability_with_c_fortran_call_c_scalar/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_fortran_call_c_scalar/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 ++! ++program main ++ use iso_c_binding ++ integer(C_LONG_LONG) :: my_x = 1 ++ interface ++ subroutine c_func(b) ++ use iso_c_binding ++ integer(C_LONG_LONG) :: b ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/fortran_main005.f90 b/test/interoperability_with_c_fortran_call_c_scalar/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_fortran_call_c_scalar/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 ++! ++program main ++ use iso_c_binding ++ integer(C_SIGNED_CHAR) :: my_x = 65 ++ interface ++ subroutine c_func(b) ++ use iso_c_binding ++ integer(C_SIGNED_CHAR) :: b ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/fortran_main006.f90 b/test/interoperability_with_c_fortran_call_c_scalar/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_fortran_call_c_scalar/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 ++! ++program main ++ use iso_c_binding ++ integer(C_SIZE_T) :: my_x = 3 ++ interface ++ subroutine c_func(b) ++ use iso_c_binding ++ integer(C_SIZE_T) :: b ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/fortran_main007.f90 b/test/interoperability_with_c_fortran_call_c_scalar/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_fortran_call_c_scalar/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 ++! ++program main ++ use iso_c_binding ++ integer(C_INT8_T) :: my_x = 1 ++ interface ++ subroutine c_func(b) ++ use iso_c_binding ++ integer(C_INT8_T) :: b ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/fortran_main008.f90 b/test/interoperability_with_c_fortran_call_c_scalar/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_fortran_call_c_scalar/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 ++! ++program main ++ use iso_c_binding ++ integer(C_INT16_T) :: my_x = 1 ++ interface ++ subroutine c_func(b) ++ use iso_c_binding ++ integer(C_INT16_T) :: b ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/fortran_main009.f90 b/test/interoperability_with_c_fortran_call_c_scalar/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_fortran_call_c_scalar/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 ++! ++program main ++ use iso_c_binding ++ integer(C_INT32_T) :: my_x = 1 ++ interface ++ subroutine c_func(b) ++ use iso_c_binding ++ integer(C_INT32_T) :: b ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/fortran_main010.f90 b/test/interoperability_with_c_fortran_call_c_scalar/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_fortran_call_c_scalar/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 ++! ++program main ++ use iso_c_binding ++ integer(C_INT64_T) :: my_x = 1 ++ interface ++ subroutine c_func(b) ++ use iso_c_binding ++ integer(C_INT64_T) :: b ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/fortran_main011.f90 b/test/interoperability_with_c_fortran_call_c_scalar/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_fortran_call_c_scalar/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 ++! ++program main ++ use iso_c_binding ++ integer(C_INT_LEAST8_T) :: my_x = 1 ++ interface ++ subroutine c_func(b) ++ use iso_c_binding ++ integer(C_INT_LEAST8_T) :: b ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/fortran_main012.f90 b/test/interoperability_with_c_fortran_call_c_scalar/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_fortran_call_c_scalar/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 ++! ++program main ++ use iso_c_binding ++ integer(C_INT_LEAST16_T) :: my_x = 1 ++ interface ++ subroutine c_func(b) ++ use iso_c_binding ++ integer(C_INT_LEAST16_T) :: b ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/fortran_main013.f90 b/test/interoperability_with_c_fortran_call_c_scalar/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_fortran_call_c_scalar/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 ++! ++program main ++ use iso_c_binding ++ integer(C_INT_LEAST32_T) :: my_x = 1 ++ interface ++ subroutine c_func(b) ++ use iso_c_binding ++ integer(C_INT_LEAST32_T) :: b ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/fortran_main014.f90 b/test/interoperability_with_c_fortran_call_c_scalar/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_fortran_call_c_scalar/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 ++! ++program main ++ use iso_c_binding ++ integer(C_INT_LEAST64_T) :: my_x = 1 ++ interface ++ subroutine c_func(b) ++ use iso_c_binding ++ integer(C_INT_LEAST64_T) :: b ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/fortran_main015.f90 b/test/interoperability_with_c_fortran_call_c_scalar/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_fortran_call_c_scalar/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 ++! ++program main ++ use iso_c_binding ++ integer(C_INT_FAST8_T) :: my_x = 1 ++ interface ++ subroutine c_func(b) ++ use iso_c_binding ++ integer(C_INT_FAST8_T) :: b ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/fortran_main016.f90 b/test/interoperability_with_c_fortran_call_c_scalar/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_fortran_call_c_scalar/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 ++! ++program main ++ use iso_c_binding ++ integer(C_INT_FAST16_T) :: my_x = 1 ++ interface ++ subroutine c_func(b) ++ use iso_c_binding ++ integer(C_INT_FAST16_T) :: b ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/fortran_main017.f90 b/test/interoperability_with_c_fortran_call_c_scalar/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_fortran_call_c_scalar/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 ++! ++program main ++ use iso_c_binding ++ integer(C_INT_FAST32_T) :: my_x = 1 ++ interface ++ subroutine c_func(b) ++ use iso_c_binding ++ integer(C_INT_FAST32_T) :: b ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/fortran_main018.f90 b/test/interoperability_with_c_fortran_call_c_scalar/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_fortran_call_c_scalar/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 ++! ++program main ++ use iso_c_binding ++ integer(C_INT_FAST64_T) :: my_x = 1 ++ interface ++ subroutine c_func(b) ++ use iso_c_binding ++ integer(C_INT_FAST64_T) :: b ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/fortran_main019.f90 b/test/interoperability_with_c_fortran_call_c_scalar/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_fortran_call_c_scalar/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 ++! ++program main ++ use iso_c_binding ++ integer(C_INTMAX_T) :: my_x = 1 ++ interface ++ subroutine c_func(b) ++ use iso_c_binding ++ integer(C_INTMAX_T) :: b ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/fortran_main020.f90 b/test/interoperability_with_c_fortran_call_c_scalar/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_fortran_call_c_scalar/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 ++! ++program main ++ use iso_c_binding ++ integer(C_INTPTR_T) :: my_x = 1 ++ interface ++ subroutine c_func(b) ++ use iso_c_binding ++ integer(C_INTPTR_T) :: b ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/fortran_main021.f90 b/test/interoperability_with_c_fortran_call_c_scalar/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_fortran_call_c_scalar/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 ++! ++program main ++ use iso_c_binding ++ real(C_FLOAT) :: my_x = 12345678.7654321 ++ interface ++ subroutine c_func(b) ++ use iso_c_binding ++ real(C_FLOAT) :: b ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/fortran_main022.f90 b/test/interoperability_with_c_fortran_call_c_scalar/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_fortran_call_c_scalar/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 ++! ++program main ++ use iso_c_binding ++ real(C_DOUBLE) :: my_x = 3.14159265358979 ++ interface ++ subroutine c_func(b) ++ use iso_c_binding ++ real(C_DOUBLE) :: b ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/fortran_main023.f90 b/test/interoperability_with_c_fortran_call_c_scalar/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_fortran_call_c_scalar/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 ++! ++program main ++ use iso_c_binding ++ real(C_LONG_DOUBLE) :: my_x = 3.14159265358979 ++ interface ++ subroutine c_func(b) ++ use iso_c_binding ++ real(C_LONG_DOUBLE) :: b ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/fortran_main024.f90 b/test/interoperability_with_c_fortran_call_c_scalar/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_fortran_call_c_scalar/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 ++! ++program main ++ use iso_c_binding ++ complex(C_FLOAT_COMPLEX) :: my_x = (-12345678.7654321, 1) ++ interface ++ subroutine c_func(b) ++ use iso_c_binding ++ complex(C_FLOAT_COMPLEX) :: b ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/fortran_main025.f90 b/test/interoperability_with_c_fortran_call_c_scalar/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_fortran_call_c_scalar/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 ++! ++program main ++ use iso_c_binding ++ complex(C_DOUBLE_COMPLEX) :: my_x = (-3.14159265358979, 1) ++ interface ++ subroutine c_func(b) ++ use iso_c_binding ++ complex(C_DOUBLE_COMPLEX) :: b ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/fortran_main026.f90 b/test/interoperability_with_c_fortran_call_c_scalar/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_fortran_call_c_scalar/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 ++! ++program main ++ use iso_c_binding ++ complex(C_LONG_DOUBLE_COMPLEX) :: my_x = (-3.14159265358979, 1) ++ interface ++ subroutine c_func(b) ++ use iso_c_binding ++ complex(C_LONG_DOUBLE_COMPLEX) :: b ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/fortran_main027.f90 b/test/interoperability_with_c_fortran_call_c_scalar/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_fortran_call_c_scalar/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 ++! ++program main ++ use iso_c_binding ++ logical(C_BOOL) :: my_x = .FALSE. ++ interface ++ subroutine c_func(b) ++ use iso_c_binding ++ logical(C_BOOL) :: b ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/fortran_main028.f90 b/test/interoperability_with_c_fortran_call_c_scalar/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_fortran_call_c_scalar/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 ++! ++program main ++ use iso_c_binding ++ character(C_CHAR) :: my_x = 'a' ++ interface ++ subroutine c_func(b) ++ use iso_c_binding ++ character(C_CHAR) :: b ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/result.md b/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/result.md +new file mode 100644 +index 0000000..858a59c +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/result.md +@@ -0,0 +1,29 @@ ++ | test | gfortran | flang | nvfortran| ++ | 001 | PASS | PASS | PASS | ++ | 002 | PASS | PASS | PASS | ++ | 003 | PASS | PASS | PASS | ++ | 004 | PASS | PASS | PASS | ++ | 005 | PASS | PASS | PASS | ++ | 006 | PASS | PASS | PASS | ++ | 007 | PASS | PASS | PASS | ++ | 008 | PASS | PASS | PASS | ++ | 009 | PASS | PASS | PASS | ++ | 010 | PASS | PASS | PASS | ++ | 011 | PASS | PASS | PASS | ++ | 012 | PASS | PASS | PASS | ++ | 013 | PASS | PASS | PASS | ++ | 014 | PASS | PASS | PASS | ++ | 015 | PASS | PASS | PASS | ++ | 016 | PASS | PASS | PASS | ++ | 017 | PASS | PASS | PASS | ++ | 018 | PASS | PASS | PASS | ++ | 019 | PASS | PASS | PASS | ++ | 020 | PASS | PASS | PASS | ++ | 021 | PASS | PASS | PASS | ++ | 022 | PASS | PASS | PASS | ++ | 023 | PASS | ERROR | ERROR | ++ | 024 | PASS | PASS | PASS | ++ | 025 | PASS | PASS | PASS | ++ | 026 | PASS | ERROR | ERROR | ++ | 027 | PASS | PASS | PASS | ++ | 028 | PASS | PASS | PASS | +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/run.sh b/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/run.sh +new file mode 100644 +index 0000000..dbbd62f +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/run.sh +@@ -0,0 +1,22 @@ ++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 ++echo "----- nvfortran result : " ++clang c_func$i.c -c -o c-test.o ++nvfortran fortran_main$i.f90 -c -o fortran-test.o ++nvfortran 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_scalar/003_fortran_call_c_scalar_value/c_func001.c b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func001.c +new file mode 100644 +index 0000000..6b34fe7 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func002.c b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func002.c +new file mode 100644 +index 0000000..0a82fd6 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func003.c b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func003.c +new file mode 100644 +index 0000000..e945b70 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func004.c b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func004.c +new file mode 100644 +index 0000000..6d5f734 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func005.c b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func005.c +new file mode 100644 +index 0000000..aa46418 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func006.c b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func006.c +new file mode 100644 +index 0000000..d78d3d5 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func007.c b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func007.c +new file mode 100644 +index 0000000..2e08462 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func008.c b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func008.c +new file mode 100644 +index 0000000..9b10264 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func009.c b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func009.c +new file mode 100644 +index 0000000..7ed8d51 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func010.c b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func010.c +new file mode 100644 +index 0000000..426f6ae +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func011.c b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func011.c +new file mode 100644 +index 0000000..660f33e +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func012.c b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func012.c +new file mode 100644 +index 0000000..abf7d13 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func013.c b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func013.c +new file mode 100644 +index 0000000..638f7d0 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func014.c b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func014.c +new file mode 100644 +index 0000000..c0401de +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func015.c b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func015.c +new file mode 100644 +index 0000000..f7b7caa +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func016.c b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func016.c +new file mode 100644 +index 0000000..ef70772 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func017.c b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func017.c +new file mode 100644 +index 0000000..86e6cd6 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func018.c b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func018.c +new file mode 100644 +index 0000000..c8ae092 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func019.c b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func019.c +new file mode 100644 +index 0000000..0b0fa15 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func020.c b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func020.c +new file mode 100644 +index 0000000..bde599d +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func021.c b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func021.c +new file mode 100644 +index 0000000..ae5bf11 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func022.c b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func022.c +new file mode 100644 +index 0000000..b3bdc55 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func023.c b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func023.c +new file mode 100644 +index 0000000..af99efc +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func024.c b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func024.c +new file mode 100644 +index 0000000..af69eac +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func025.c b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func025.c +new file mode 100644 +index 0000000..55a85e9 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func026.c b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func026.c +new file mode 100644 +index 0000000..5b7017a +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func027.c b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func027.c +new file mode 100644 +index 0000000..ff95fd7 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func028.c b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func028.c +new file mode 100644 +index 0000000..b92caf7 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main001.f90 b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main001.f90 +new file mode 100644 +index 0000000..68a4e65 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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 ++! ++program main ++ integer :: my_x = 1 ++ interface ++ subroutine c_func(b) ++ integer, value :: b ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main002.f90 b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main002.f90 +new file mode 100644 +index 0000000..f98661e +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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 ++! ++program main ++ integer(2) :: my_x = 1 ++ interface ++ subroutine c_func(b) ++ integer(2), value :: b ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main003.f90 b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main003.f90 +new file mode 100644 +index 0000000..56d73bb +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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 ++! ++program main ++ integer(8) :: my_x = 1 ++ interface ++ subroutine c_func(b) ++ integer(8), value :: b ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main004.f90 b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main004.f90 +new file mode 100644 +index 0000000..bd26e3d +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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 ++! ++program main ++ integer(8) :: my_x = 1 ++ interface ++ subroutine c_func(b) ++ integer(8), value :: b ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main005.f90 b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main005.f90 +new file mode 100644 +index 0000000..c603a40 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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 ++! ++program main ++ integer(1) :: my_x = 65 ++ interface ++ subroutine c_func(b) ++ integer(1), value :: b ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main006.f90 b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main006.f90 +new file mode 100644 +index 0000000..08e4cab +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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 ++! ++program main ++ integer(8) :: my_x = 3 ++ interface ++ subroutine c_func(b) ++ integer(8), value :: b ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main007.f90 b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main007.f90 +new file mode 100644 +index 0000000..6fbc4f1 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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 ++! ++program main ++ integer(1) :: my_x = 1 ++ interface ++ subroutine c_func(b) ++ integer(1), value :: b ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main008.f90 b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main008.f90 +new file mode 100644 +index 0000000..dadfeb3 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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 ++! ++program main ++ integer(2) :: my_x = 1 ++ interface ++ subroutine c_func(b) ++ integer(2), value :: b ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main009.f90 b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main009.f90 +new file mode 100644 +index 0000000..b9589e6 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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 ++! ++program main ++ integer(4) :: my_x = 1 ++ interface ++ subroutine c_func(b) ++ integer(4), value :: b ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main010.f90 b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main010.f90 +new file mode 100644 +index 0000000..a756881 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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 ++! ++program main ++ integer(8) :: my_x = 1 ++ interface ++ subroutine c_func(b) ++ integer(8), value :: b ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main011.f90 b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main011.f90 +new file mode 100644 +index 0000000..58a7483 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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 ++! ++program main ++ integer(1) :: my_x = 1 ++ interface ++ subroutine c_func(b) ++ integer(1), value :: b ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main012.f90 b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main012.f90 +new file mode 100644 +index 0000000..a5c8e34 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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 ++! ++program main ++ integer(2) :: my_x = 1 ++ interface ++ subroutine c_func(b) ++ integer(2), value :: b ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main013.f90 b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main013.f90 +new file mode 100644 +index 0000000..8705110 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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 ++! ++program main ++ integer(4) :: my_x = 1 ++ interface ++ subroutine c_func(b) ++ integer(4), value :: b ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main014.f90 b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main014.f90 +new file mode 100644 +index 0000000..327434e +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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 ++! ++program main ++ integer(8) :: my_x = 1 ++ interface ++ subroutine c_func(b) ++ integer(8), value :: b ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main015.f90 b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main015.f90 +new file mode 100644 +index 0000000..b911744 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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 ++! ++program main ++ integer(1) :: my_x = 1 ++ interface ++ subroutine c_func(b) ++ integer(1), value :: b ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main016.f90 b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main016.f90 +new file mode 100644 +index 0000000..43c1d3f +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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 ++! ++program main ++ integer(8) :: my_x = 1 ++ interface ++ subroutine c_func(b) ++ integer(8), value :: b ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main017.f90 b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main017.f90 +new file mode 100644 +index 0000000..dd03c20 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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 ++! ++program main ++ integer(8) :: my_x = 1 ++ interface ++ subroutine c_func(b) ++ integer(8), value :: b ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main018.f90 b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main018.f90 +new file mode 100644 +index 0000000..aed4502 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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 ++! ++program main ++ integer(8) :: my_x = 1 ++ interface ++ subroutine c_func(b) ++ integer(8), value :: b ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main019.f90 b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main019.f90 +new file mode 100644 +index 0000000..47f84e9 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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 ++! ++program main ++ integer(8) :: my_x = 3 ++ interface ++ subroutine c_func(b) ++ integer(8), value :: b ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main020.f90 b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main020.f90 +new file mode 100644 +index 0000000..2d3d9fa +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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 ++! ++program main ++ integer(8) :: my_x = 3 ++ interface ++ subroutine c_func(b) ++ integer(8), value :: b ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main021.f90 b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main021.f90 +new file mode 100644 +index 0000000..4bb2e37 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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 ++! ++program main ++ real(4) :: my_x = 12345678.7654321 ++ interface ++ subroutine c_func(b) ++ real(4), value :: b ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main022.f90 b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main022.f90 +new file mode 100644 +index 0000000..33d79e5 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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 ++! ++program main ++ real(8) :: my_x = 3.14159265358979 ++ interface ++ subroutine c_func(b) ++ real(8), value :: b ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main023.f90 b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main023.f90 +new file mode 100644 +index 0000000..9d090e9 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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 ++! ++program main ++ integer, parameter :: K = selected_real_kind(16) ++ real(K) :: my_x = 3.14159265358979 ++ interface ++ subroutine c_func(b) ++ integer, parameter :: K = selected_real_kind(16) ++ real(K), value :: b ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main024.f90 b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main024.f90 +new file mode 100644 +index 0000000..7a6d9e4 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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 ++! ++program main ++ complex(4) :: my_x = (-3.14159265358979, 1) ++ interface ++ subroutine c_func(b) ++ complex(4), value :: b ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main025.f90 b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main025.f90 +new file mode 100644 +index 0000000..cf1ae5c +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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 ++! ++program main ++ complex(8) :: my_x = (-3.14159265358979, 1) ++ interface ++ subroutine c_func(b) ++ complex(8), value :: b ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main026.f90 b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main026.f90 +new file mode 100644 +index 0000000..e46d83c +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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 ++! ++program main ++ integer, parameter :: K = selected_real_kind(16) ++ complex(K) :: my_x = (-3.14159265358979, 1) ++ interface ++ subroutine c_func(b) ++ integer, parameter :: K = selected_real_kind(16) ++ complex(K), value :: b ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main027.f90 b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main027.f90 +new file mode 100644 +index 0000000..fc3103e +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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 ++! ++program main ++ logical(1) :: my_x = .FALSE. ++ interface ++ subroutine c_func(b) ++ logical(1), value :: b ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main028.f90 b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main028.f90 +new file mode 100644 +index 0000000..e0269d5 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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 ++! ++program main ++ character(1) :: my_x = 'a' ++ interface ++ subroutine c_func(b) ++ character(1), value :: b ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/result.md b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/result.md +new file mode 100644 +index 0000000..5a8fd6c +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/result.md +@@ -0,0 +1,29 @@ ++ | test | gfortran | flang | nvfortran| ++ | 001 | PASS | ERROR | PASS | ++ | 002 | PASS | ERROR | PASS | ++ | 003 | PASS | ERROR | PASS | ++ | 004 | PASS | ERROR | PASS | ++ | 005 | PASS | ERROR | PASS | ++ | 006 | PASS | ERROR | PASS | ++ | 007 | PASS | ERROR | PASS | ++ | 008 | PASS | ERROR | PASS | ++ | 009 | PASS | ERROR | PASS | ++ | 010 | PASS | ERROR | PASS | ++ | 011 | PASS | ERROR | PASS | ++ | 012 | PASS | ERROR | PASS | ++ | 013 | PASS | ERROR | PASS | ++ | 014 | PASS | ERROR | PASS | ++ | 015 | PASS | ERROR | PASS | ++ | 016 | PASS | ERROR | PASS | ++ | 017 | PASS | ERROR | PASS | ++ | 018 | PASS | ERROR | PASS | ++ | 019 | PASS | ERROR | PASS | ++ | 020 | PASS | ERROR | PASS | ++ | 021 | PASS | PASS | PASS | ++ | 022 | PASS | PASS | PASS | ++ | 023 | PASS | ERROR | ERROR | ++ | 024 | PASS | PASS | PASS | ++ | 025 | PASS | PASS | PASS | ++ | 026 | PASS | PASS | ERROR | ++ | 027 | PASS | ERROR | PASS | ++ | 028 | PASS | ERROR | PASS | +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/run.sh b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/run.sh +new file mode 100644 +index 0000000..dbbd62f +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/run.sh +@@ -0,0 +1,22 @@ ++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 ++echo "----- nvfortran result : " ++clang c_func$i.c -c -o c-test.o ++nvfortran fortran_main$i.f90 -c -o fortran-test.o ++nvfortran 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_scalar/004_fortran_call_c_scalar_bindc/c_func001.c b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func001.c +new file mode 100644 +index 0000000..5acb3c0 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func001.c +@@ -0,0 +1,4 @@ ++#include ++void c_func_(int *a) { ++ printf("%d\n", *a); ++} +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func002.c b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func002.c +new file mode 100644 +index 0000000..a695d21 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/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_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func003.c b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func003.c +new file mode 100644 +index 0000000..c3e2b1b +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/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_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func004.c b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func004.c +new file mode 100644 +index 0000000..c83f515 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/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_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func005.c b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func005.c +new file mode 100644 +index 0000000..df53145 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/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_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func006.c b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func006.c +new file mode 100644 +index 0000000..bf8fe98 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/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_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func007.c b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func007.c +new file mode 100644 +index 0000000..1ccc2d3 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/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_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func008.c b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func008.c +new file mode 100644 +index 0000000..5b4a477 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/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_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func009.c b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func009.c +new file mode 100644 +index 0000000..ef5dbab +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/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_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func010.c b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func010.c +new file mode 100644 +index 0000000..ff0c5b2 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/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_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func011.c b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func011.c +new file mode 100644 +index 0000000..648e234 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/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_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func012.c b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func012.c +new file mode 100644 +index 0000000..175d427 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/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_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func013.c b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func013.c +new file mode 100644 +index 0000000..3e63c13 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/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_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func014.c b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func014.c +new file mode 100644 +index 0000000..ac6a62b +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/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_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func015.c b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func015.c +new file mode 100644 +index 0000000..85b98cc +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/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_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func016.c b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func016.c +new file mode 100644 +index 0000000..ce358c3 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/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_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func017.c b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func017.c +new file mode 100644 +index 0000000..9576185 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/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_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func018.c b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func018.c +new file mode 100644 +index 0000000..84469ba +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/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_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func019.c b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func019.c +new file mode 100644 +index 0000000..acd8949 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/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_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func020.c b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func020.c +new file mode 100644 +index 0000000..43c01a7 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/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_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func021.c b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func021.c +new file mode 100644 +index 0000000..af99025 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func021.c +@@ -0,0 +1,4 @@ ++#include ++void c_func_(float *a) { ++ printf("%f\n", *a); ++} +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func022.c b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func022.c +new file mode 100644 +index 0000000..7ae046f +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/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_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func023.c b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func023.c +new file mode 100644 +index 0000000..be8b2b1 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/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_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func024.c b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func024.c +new file mode 100644 +index 0000000..1e65f36 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/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_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func025.c b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func025.c +new file mode 100644 +index 0000000..b3f9944 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/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_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func026.c b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func026.c +new file mode 100644 +index 0000000..c049c6f +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/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_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func027.c b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func027.c +new file mode 100644 +index 0000000..a3a8596 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func027.c +@@ -0,0 +1,4 @@ ++#include ++void c_func_(_Bool *a) { ++ printf("%d\n", *a); ++} +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func028.c b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func028.c +new file mode 100644 +index 0000000..0abbf89 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func028.c +@@ -0,0 +1,4 @@ ++#include ++void c_func_(char *a) { ++ printf("%c\n", *a); ++} +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main001.f90 b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main001.f90 +new file mode 100644 +index 0000000..9255a56 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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 ++ integer(4) :: my_x = 1 ++ interface ++ subroutine c_func(b) bind(c, name = "c_func_") ++ integer(4) :: b ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main002.f90 b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main002.f90 +new file mode 100644 +index 0000000..a265d80 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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 ++ integer(2) :: my_x = 1 ++ interface ++ subroutine c_func(b) bind(c, name = "c_func_") ++ integer(2) :: b ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main003.f90 b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main003.f90 +new file mode 100644 +index 0000000..5ea0bb8 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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 ++ integer(8) :: my_x = 1 ++ interface ++ subroutine c_func(b) bind(c, name = "c_func_") ++ integer(8) :: b ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main004.f90 b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main004.f90 +new file mode 100644 +index 0000000..355c37a +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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 ++ integer(8) :: my_x = 1 ++ interface ++ subroutine c_func(b) bind(c, name = "c_func_") ++ integer(8) :: b ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main005.f90 b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main005.f90 +new file mode 100644 +index 0000000..b3f965b +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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 ++ integer(1) :: my_x = 65 ++ interface ++ subroutine c_func(b) bind(c, name = "c_func_") ++ integer(1) :: b ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main006.f90 b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main006.f90 +new file mode 100644 +index 0000000..0ff532d +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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 ++ integer(8) :: my_x = 1 ++ interface ++ subroutine c_func(b) bind(c, name = "c_func_") ++ integer(8) :: b ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main007.f90 b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main007.f90 +new file mode 100644 +index 0000000..3fa2acf +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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 ++ integer(1) :: my_x = 1 ++ interface ++ subroutine c_func(b) bind(c, name = "c_func_") ++ integer(1) :: b ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main008.f90 b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main008.f90 +new file mode 100644 +index 0000000..28febbd +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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 ++ integer(2) :: my_x = 1 ++ interface ++ subroutine c_func(b) bind(c, name = "c_func_") ++ integer(2) :: b ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main009.f90 b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main009.f90 +new file mode 100644 +index 0000000..a25eb5b +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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 ++ integer(4) :: my_x = 1 ++ interface ++ subroutine c_func(b) bind(c, name = "c_func_") ++ integer(4) :: b ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main010.f90 b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main010.f90 +new file mode 100644 +index 0000000..89d324d +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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 ++ integer(8) :: my_x = 1 ++ interface ++ subroutine c_func(b) bind(c, name = "c_func_") ++ integer(8) :: b ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main011.f90 b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main011.f90 +new file mode 100644 +index 0000000..451ef1e +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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 ++ integer(1) :: my_x = 1 ++ interface ++ subroutine c_func(b) bind(c, name = "c_func_") ++ integer(1) :: b ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main012.f90 b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main012.f90 +new file mode 100644 +index 0000000..df2f5fd +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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 ++ integer(2) :: my_x = 1 ++ interface ++ subroutine c_func(b) bind(c, name = "c_func_") ++ integer(2) :: b ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main013.f90 b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main013.f90 +new file mode 100644 +index 0000000..f333dda +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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 ++ integer(4) :: my_x = 1 ++ interface ++ subroutine c_func(b) bind(c, name = "c_func_") ++ integer(4) :: b ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main014.f90 b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main014.f90 +new file mode 100644 +index 0000000..9af1234 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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 ++ integer(8) :: my_x = 1 ++ interface ++ subroutine c_func(b) bind(c, name = "c_func_") ++ integer(8) :: b ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main015.f90 b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main015.f90 +new file mode 100644 +index 0000000..84d3954 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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 ++ integer(1) :: my_x = 1 ++ interface ++ subroutine c_func(b) bind(c, name = "c_func_") ++ integer(1) :: b ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main016.f90 b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main016.f90 +new file mode 100644 +index 0000000..8d848d3 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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 ++ integer(8) :: my_x = 1 ++ interface ++ subroutine c_func(b) bind(c, name = "c_func_") ++ integer(8) :: b ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main017.f90 b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main017.f90 +new file mode 100644 +index 0000000..b62653c +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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 ++ integer(8) :: my_x = 1 ++ interface ++ subroutine c_func(b) bind(c, name = "c_func_") ++ integer(8) :: b ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main018.f90 b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main018.f90 +new file mode 100644 +index 0000000..5343c78 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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 ++ integer(8) :: my_x = 1 ++ interface ++ subroutine c_func(b) bind(c, name = "c_func_") ++ integer(8) :: b ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main019.f90 b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main019.f90 +new file mode 100644 +index 0000000..ace3d4e +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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 ++ integer(8) :: my_x = 1 ++ interface ++ subroutine c_func(b) bind(c, name = "c_func_") ++ integer(8) :: b ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main020.f90 b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main020.f90 +new file mode 100644 +index 0000000..9c936f7 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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 ++ integer(8) :: my_x = 1 ++ interface ++ subroutine c_func(b) bind(c, name = "c_func_") ++ integer(8) :: b ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main021.f90 b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main021.f90 +new file mode 100644 +index 0000000..30f8860 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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 ++ real(4) :: my_x = 3.1415926535 ++ interface ++ subroutine c_func(b) bind(c, name = "c_func_") ++ real(4) :: b ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main022.f90 b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main022.f90 +new file mode 100644 +index 0000000..bb30edf +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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 ++ real(8) :: my_x = 3.14159265358979 ++ interface ++ subroutine c_func(b) bind(c, name = "c_func_") ++ real(8) :: b ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main023.f90 b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main023.f90 +new file mode 100644 +index 0000000..ddc85c4 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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) ++ real(K) :: my_x = 3.14159265358979 ++ interface ++ 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_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main024.f90 b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main024.f90 +new file mode 100644 +index 0000000..298dc40 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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 ++ complex(4) :: my_x = (-12345678.7654321, 1) ++ interface ++ subroutine c_func(b) bind(c, name = "c_func_") ++ complex(4) :: b ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main025.f90 b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main025.f90 +new file mode 100644 +index 0000000..270a89b +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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 ++ complex(8) :: my_x = (-3.14159265358979, 1) ++ interface ++ subroutine c_func(b) bind(c, name = "c_func_") ++ complex(8) :: b ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main026.f90 b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main026.f90 +new file mode 100644 +index 0000000..23755fe +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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) ++ complex(K) :: my_x = (-3.14159265358979, 1) ++ interface ++ 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_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main027.f90 b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main027.f90 +new file mode 100644 +index 0000000..207f386 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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 ++ logical(1) :: my_x = .FALSE. ++ interface ++ subroutine c_func(b) bind(c, name = "c_func_") ++ logical(1) :: b ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main028.f90 b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main028.f90 +new file mode 100644 +index 0000000..19ab3a6 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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 ++ character(1) :: my_x = 'a' ++ interface ++ subroutine c_func(b) bind(c, name = "c_func_") ++ character(1) :: b ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/result.md b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/result.md +new file mode 100644 +index 0000000..f15fe53 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/result.md +@@ -0,0 +1,29 @@ ++ | test | gfortran | flang | nvfortran| ++ | 001 | PASS | PASS | PASS | ++ | 002 | PASS | PASS | PASS | ++ | 003 | PASS | PASS | PASS | ++ | 004 | PASS | PASS | PASS | ++ | 005 | PASS | PASS | PASS | ++ | 006 | PASS | PASS | PASS | ++ | 007 | PASS | PASS | PASS | ++ | 008 | PASS | PASS | PASS | ++ | 009 | PASS | PASS | PASS | ++ | 010 | PASS | PASS | PASS | ++ | 011 | PASS | PASS | PASS | ++ | 012 | PASS | PASS | PASS | ++ | 013 | PASS | PASS | PASS | ++ | 014 | PASS | PASS | PASS | ++ | 015 | PASS | PASS | PASS | ++ | 016 | PASS | PASS | PASS | ++ | 017 | PASS | PASS | PASS | ++ | 018 | PASS | PASS | PASS | ++ | 019 | PASS | PASS | PASS | ++ | 020 | PASS | PASS | PASS | ++ | 021 | PASS | PASS | PASS | ++ | 022 | PASS | PASS | PASS | ++ | 023 | PASS | PASS | ERROR | ++ | 024 | PASS | PASS | PASS | ++ | 025 | PASS | PASS | PASS | ++ | 026 | PASS | PASS | ERROR | ++ | 027 | PASS | PASS | PASS | ++ | 028 | PASS | PASS | PASS | +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/run.sh b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/run.sh +new file mode 100644 +index 0000000..dbbd62f +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/run.sh +@@ -0,0 +1,22 @@ ++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 ++echo "----- nvfortran result : " ++clang c_func$i.c -c -o c-test.o ++nvfortran fortran_main$i.f90 -c -o fortran-test.o ++nvfortran 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_scalar/005_fortran_call_c_scalar_bindc_value/c_func001.c b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func001.c +new file mode 100644 +index 0000000..6b34fe7 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_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_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func002.c b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func002.c +new file mode 100644 +index 0000000..0a82fd6 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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); ++} +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func003.c b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func003.c +new file mode 100644 +index 0000000..e945b70 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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); ++} +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func004.c b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func004.c +new file mode 100644 +index 0000000..6d5f734 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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); ++} +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func005.c b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func005.c +new file mode 100644 +index 0000000..aa46418 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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); ++} +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func006.c b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func006.c +new file mode 100644 +index 0000000..d78d3d5 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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); ++} +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func007.c b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func007.c +new file mode 100644 +index 0000000..2e08462 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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); ++} +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func008.c b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func008.c +new file mode 100644 +index 0000000..9b10264 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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); ++} +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func009.c b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func009.c +new file mode 100644 +index 0000000..7ed8d51 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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); ++} +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func010.c b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func010.c +new file mode 100644 +index 0000000..426f6ae +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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); ++} +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func011.c b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func011.c +new file mode 100644 +index 0000000..660f33e +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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); ++} +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func012.c b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func012.c +new file mode 100644 +index 0000000..abf7d13 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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); ++} +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func013.c b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func013.c +new file mode 100644 +index 0000000..638f7d0 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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); ++} +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func014.c b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func014.c +new file mode 100644 +index 0000000..c0401de +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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); ++} +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func015.c b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func015.c +new file mode 100644 +index 0000000..f7b7caa +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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); ++} +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func016.c b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func016.c +new file mode 100644 +index 0000000..ef70772 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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); ++} +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func017.c b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func017.c +new file mode 100644 +index 0000000..86e6cd6 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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); ++} +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func018.c b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func018.c +new file mode 100644 +index 0000000..c8ae092 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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); ++} +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func019.c b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func019.c +new file mode 100644 +index 0000000..0b0fa15 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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); ++} +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func020.c b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func020.c +new file mode 100644 +index 0000000..bde599d +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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); ++} +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func021.c b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func021.c +new file mode 100644 +index 0000000..ae5bf11 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_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_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func022.c b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func022.c +new file mode 100644 +index 0000000..b3bdc55 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_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_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func023.c b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func023.c +new file mode 100644 +index 0000000..af99efc +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_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_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func024.c b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func024.c +new file mode 100644 +index 0000000..af69eac +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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), cimag(t)); ++} +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func025.c b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func025.c +new file mode 100644 +index 0000000..55a85e9 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_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_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func026.c b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func026.c +new file mode 100644 +index 0000000..5b7017a +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_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_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func027.c b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func027.c +new file mode 100644 +index 0000000..ff95fd7 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_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_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func028.c b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func028.c +new file mode 100644 +index 0000000..b92caf7 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_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_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main001.f90 b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main001.f90 +new file mode 100644 +index 0000000..9b2b33f +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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 = 1 ++ interface ++ 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_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main002.f90 b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main002.f90 +new file mode 100644 +index 0000000..48736e1 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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 = 1 ++ interface ++ 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_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main003.f90 b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main003.f90 +new file mode 100644 +index 0000000..feca432 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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 = 1 ++ interface ++ 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_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main004.f90 b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main004.f90 +new file mode 100644 +index 0000000..0926bd3 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_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 with bindc ++! ++program main ++ integer(8) :: my_x = 1 ++ interface ++ 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_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main005.f90 b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main005.f90 +new file mode 100644 +index 0000000..8308cf7 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_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 with bindc ++! ++program main ++ integer(1) :: my_x = 65 ++ interface ++ 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_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main006.f90 b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main006.f90 +new file mode 100644 +index 0000000..ac3bda1 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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 = 3 ++ interface ++ 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_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main007.f90 b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main007.f90 +new file mode 100644 +index 0000000..e70a093 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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 = 1 ++ interface ++ 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_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main008.f90 b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main008.f90 +new file mode 100644 +index 0000000..4e9554e +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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 = 1 ++ interface ++ 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_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main009.f90 b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main009.f90 +new file mode 100644 +index 0000000..f1084a6 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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 = 1 ++ interface ++ 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_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main010.f90 b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main010.f90 +new file mode 100644 +index 0000000..8d2ece3 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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 = 1 ++ interface ++ 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_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main011.f90 b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main011.f90 +new file mode 100644 +index 0000000..cd82f35 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_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 with bindc ++! ++program main ++ integer(1) :: my_x = 1 ++ interface ++ 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_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main012.f90 b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main012.f90 +new file mode 100644 +index 0000000..00da761 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_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 with bindc ++! ++program main ++ integer(2) :: my_x = 1 ++ interface ++ 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_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main013.f90 b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main013.f90 +new file mode 100644 +index 0000000..28b7535 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_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 with bindc ++! ++program main ++ integer(4) :: my_x = 1 ++ interface ++ 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_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main014.f90 b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main014.f90 +new file mode 100644 +index 0000000..6336001 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_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 with bindc ++! ++program main ++ integer(8) :: my_x = 1 ++ interface ++ 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_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main015.f90 b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main015.f90 +new file mode 100644 +index 0000000..bcf23f1 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_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 with bindc ++! ++program main ++ integer(1) :: my_x = 1 ++ interface ++ 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_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main016.f90 b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main016.f90 +new file mode 100644 +index 0000000..09b77c7 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_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 with bindc ++! ++program main ++ integer(8) :: my_x = 1 ++ interface ++ 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_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main017.f90 b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main017.f90 +new file mode 100644 +index 0000000..26c67eb +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_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 with bindc ++! ++program main ++ integer(8) :: my_x = 1 ++ interface ++ 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_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main018.f90 b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main018.f90 +new file mode 100644 +index 0000000..7d94f50 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_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 with bindc ++! ++program main ++ integer(8) :: my_x = 1 ++ interface ++ 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_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main019.f90 b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main019.f90 +new file mode 100644 +index 0000000..d77ae94 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_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 with bindc ++! ++program main ++ integer(8) :: my_x = 3 ++ interface ++ 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_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main020.f90 b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main020.f90 +new file mode 100644 +index 0000000..d4b887d +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_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 with bindc ++! ++program main ++ integer(8) :: my_x = 3 ++ interface ++ 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_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main021.f90 b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main021.f90 +new file mode 100644 +index 0000000..7c17ff0 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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 = 12345678.7654321 ++ interface ++ 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_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main022.f90 b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main022.f90 +new file mode 100644 +index 0000000..713cc1a +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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 = 3.14159265358979 ++ interface ++ 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_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main023.f90 b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main023.f90 +new file mode 100644 +index 0000000..48633c1 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_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 with bindc ++! ++program main ++ integer, parameter :: K = selected_real_kind(16) ++ real(K) :: my_x = 3.14159265358979 ++ interface ++ subroutine c_func(b) bind(c, name = "c_func_") ++ integer, parameter :: K = selected_real_kind(16) ++ real(K), value :: b ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main024.f90 b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main024.f90 +new file mode 100644 +index 0000000..545bfed +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_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 with bindc ++! ++program main ++ complex(4) :: my_x = (-3.14159265358979, 1) ++ interface ++ 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_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main025.f90 b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main025.f90 +new file mode 100644 +index 0000000..b32f5af +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_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 with bindc ++! ++program main ++ complex(8) :: my_x = (-3.14159265358979, 1) ++ interface ++ 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_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main026.f90 b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main026.f90 +new file mode 100644 +index 0000000..e04bf6d +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_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 with bindc ++! ++program main ++ integer, parameter :: K = selected_real_kind(16) ++ complex(K) :: my_x = (-3.14159265358979, 1) ++ interface ++ subroutine c_func(b) bind(c, name = "c_func_") ++ integer, parameter :: K = selected_real_kind(16) ++ complex(K), value :: b ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main027.f90 b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main027.f90 +new file mode 100644 +index 0000000..300b8fa +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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 = .FALSE. ++ interface ++ 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_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main028.f90 b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main028.f90 +new file mode 100644 +index 0000000..0a53f44 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/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 = 'a' ++ interface ++ 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_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/result.md b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/result.md +new file mode 100644 +index 0000000..70d83d4 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/result.md +@@ -0,0 +1,29 @@ ++ | test | gfortran | flang | nvfortran| ++ | 001 | PASS | PASS | PASS | ++ | 002 | PASS | PASS | PASS | ++ | 003 | PASS | PASS | PASS | ++ | 004 | PASS | PASS | PASS | ++ | 005 | PASS | PASS | PASS | ++ | 006 | PASS | PASS | PASS | ++ | 007 | PASS | PASS | PASS | ++ | 008 | PASS | PASS | PASS | ++ | 009 | PASS | PASS | PASS | ++ | 010 | PASS | PASS | PASS | ++ | 011 | PASS | PASS | PASS | ++ | 012 | PASS | PASS | PASS | ++ | 013 | PASS | PASS | PASS | ++ | 014 | PASS | PASS | PASS | ++ | 015 | PASS | PASS | PASS | ++ | 016 | PASS | PASS | PASS | ++ | 017 | PASS | PASS | PASS | ++ | 018 | PASS | PASS | PASS | ++ | 019 | PASS | PASS | PASS | ++ | 020 | PASS | PASS | PASS | ++ | 021 | PASS | PASS | PASS | ++ | 022 | PASS | PASS | PASS | ++ | 023 | PASS | PASS | ERROR | ++ | 024 | PASS | PASS | PASS | ++ | 025 | PASS | PASS | PASS | ++ | 026 | PASS | ERROR | ERROR | ++ | 027 | PASS | PASS | PASS | ++ | 028 | PASS | ERROR | PASS | +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/run.sh b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/run.sh +new file mode 100644 +index 0000000..dbbd62f +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/run.sh +@@ -0,0 +1,22 @@ ++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 ++echo "----- nvfortran result : " ++clang c_func$i.c -c -o c-test.o ++nvfortran fortran_main$i.f90 -c -o fortran-test.o ++nvfortran 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_scalar/006_fortran_call_c_pointer/c_func001.c b/test/interoperability_with_c_fortran_call_c_scalar/006_fortran_call_c_pointer/c_func001.c +new file mode 100644 +index 0000000..f8cbea0 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/006_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_scalar/006_fortran_call_c_pointer/c_func002.c b/test/interoperability_with_c_fortran_call_c_scalar/006_fortran_call_c_pointer/c_func002.c +new file mode 100644 +index 0000000..f8cbea0 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/006_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_scalar/006_fortran_call_c_pointer/c_func003.c b/test/interoperability_with_c_fortran_call_c_scalar/006_fortran_call_c_pointer/c_func003.c +new file mode 100644 +index 0000000..1964fe8 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/006_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_scalar/006_fortran_call_c_pointer/c_func004.c b/test/interoperability_with_c_fortran_call_c_scalar/006_fortran_call_c_pointer/c_func004.c +new file mode 100644 +index 0000000..4822ea9 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/006_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_scalar/006_fortran_call_c_pointer/fortran_main001.f90 b/test/interoperability_with_c_fortran_call_c_scalar/006_fortran_call_c_pointer/fortran_main001.f90 +new file mode 100644 +index 0000000..87908b1 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/006_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_scalar/006_fortran_call_c_pointer/fortran_main002.f90 b/test/interoperability_with_c_fortran_call_c_scalar/006_fortran_call_c_pointer/fortran_main002.f90 +new file mode 100644 +index 0000000..78f8a20 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/006_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_scalar/006_fortran_call_c_pointer/fortran_main003.f90 b/test/interoperability_with_c_fortran_call_c_scalar/006_fortran_call_c_pointer/fortran_main003.f90 +new file mode 100644 +index 0000000..99c2ca4 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/006_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_scalar/006_fortran_call_c_pointer/fortran_main004.f90 b/test/interoperability_with_c_fortran_call_c_scalar/006_fortran_call_c_pointer/fortran_main004.f90 +new file mode 100644 +index 0000000..149c338 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/006_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_scalar/006_fortran_call_c_pointer/result.md b/test/interoperability_with_c_fortran_call_c_scalar/006_fortran_call_c_pointer/result.md +new file mode 100644 +index 0000000..cdbdc8c +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/006_fortran_call_c_pointer/result.md +@@ -0,0 +1,5 @@ ++ | test | gfortran | flang | nvfortran| ++ | 001 | PASS | PASS | PASS | ++ | 002 | PASS | PASS | PASS | ++ | 003 | PASS | PASS | PASS | ++ | 004 | PASS | ERROR | PASS | +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/006_fortran_call_c_pointer/run.sh b/test/interoperability_with_c_fortran_call_c_scalar/006_fortran_call_c_pointer/run.sh +new file mode 100644 +index 0000000..45c6bb0 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/006_fortran_call_c_pointer/run.sh +@@ -0,0 +1,22 @@ ++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 ++echo "----- nvfortran result : " ++clang c_func$i.c -c -o c-test.o ++nvfortran fortran_main$i.f90 -c -o fortran-test.o ++nvfortran 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_scalar/007_fortran_call_c_procedure_pointer/c_func001.c b/test/interoperability_with_c_fortran_call_c_scalar/007_fortran_call_c_procedure_pointer/c_func001.c +new file mode 100644 +index 0000000..2ce3091 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/007_fortran_call_c_procedure_pointer/c_func001.c +@@ -0,0 +1,5 @@ ++void func_(void (*foo)(int *)) { ++ int *x, y = 1; ++ x = &y; ++ foo(x); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/007_fortran_call_c_procedure_pointer/c_func002.c b/test/interoperability_with_c_fortran_call_c_scalar/007_fortran_call_c_procedure_pointer/c_func002.c +new file mode 100644 +index 0000000..130b5fa +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/007_fortran_call_c_procedure_pointer/c_func002.c +@@ -0,0 +1,5 @@ ++void func_(void (**foo)(int *)) { ++ int *x, y = 1; ++ x = &y; ++ (*foo)(x); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/007_fortran_call_c_procedure_pointer/c_func003.c b/test/interoperability_with_c_fortran_call_c_scalar/007_fortran_call_c_procedure_pointer/c_func003.c +new file mode 100644 +index 0000000..cf688f2 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/007_fortran_call_c_procedure_pointer/c_func003.c +@@ -0,0 +1,7 @@ ++#include ++void func_(int (**foo)(int *)) { ++ int *x, y = 1; ++ x = &y; ++ int w = (*foo)(x); ++ printf("%d\n", w); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/007_fortran_call_c_procedure_pointer/c_func004.c b/test/interoperability_with_c_fortran_call_c_scalar/007_fortran_call_c_procedure_pointer/c_func004.c +new file mode 100644 +index 0000000..1540ee1 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/007_fortran_call_c_procedure_pointer/c_func004.c +@@ -0,0 +1,7 @@ ++#include ++void func_(int (*foo)(int *)) { ++ int *x, y = 1; ++ x = &y; ++ int w = foo(x); ++ printf("%d\n", w); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/007_fortran_call_c_procedure_pointer/c_func005.c b/test/interoperability_with_c_fortran_call_c_scalar/007_fortran_call_c_procedure_pointer/c_func005.c +new file mode 100644 +index 0000000..04172df +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/007_fortran_call_c_procedure_pointer/c_func005.c +@@ -0,0 +1,6 @@ ++void func_(void (**foo)(int *), void (**foo2)(int *)) { ++ int *x, y = 1; ++ x = &y; ++ (*foo)(x); ++ (*foo2)(x); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/007_fortran_call_c_procedure_pointer/c_func006.c b/test/interoperability_with_c_fortran_call_c_scalar/007_fortran_call_c_procedure_pointer/c_func006.c +new file mode 100644 +index 0000000..a0c6df1 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/007_fortran_call_c_procedure_pointer/c_func006.c +@@ -0,0 +1,7 @@ ++#include ++void func_(void (**foo)(float *)) { ++ printf("ref\n"); ++ float *x, y = 1.1; ++ x = &y; ++ (*foo)(x); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/007_fortran_call_c_procedure_pointer/c_func007.c b/test/interoperability_with_c_fortran_call_c_scalar/007_fortran_call_c_procedure_pointer/c_func007.c +new file mode 100644 +index 0000000..7c11812 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/007_fortran_call_c_procedure_pointer/c_func007.c +@@ -0,0 +1,4 @@ ++#include ++void func_(int *x) { ++ printf("%d\n", *x); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/007_fortran_call_c_procedure_pointer/c_func008.c b/test/interoperability_with_c_fortran_call_c_scalar/007_fortran_call_c_procedure_pointer/c_func008.c +new file mode 100644 +index 0000000..787c4be +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/007_fortran_call_c_procedure_pointer/c_func008.c +@@ -0,0 +1,4 @@ ++#include ++int func_(int *x) { ++ return *x + 1; ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/007_fortran_call_c_procedure_pointer/c_func009.c b/test/interoperability_with_c_fortran_call_c_scalar/007_fortran_call_c_procedure_pointer/c_func009.c +new file mode 100644 +index 0000000..a821381 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/007_fortran_call_c_procedure_pointer/c_func009.c +@@ -0,0 +1,11 @@ ++#include ++void print_x(); ++void (**func_(void (**)()))(); ++void print_x() { ++ printf("ook\n"); ++} ++void (**func_(void (**fx)()))() { ++ printf("ok\n"); ++ fx[0] = print_x; ++ return fx; ++}; +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/007_fortran_call_c_procedure_pointer/fortran_main001.f90 b/test/interoperability_with_c_fortran_call_c_scalar/007_fortran_call_c_procedure_pointer/fortran_main001.f90 +new file mode 100644 +index 0000000..9e2bc92 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/007_fortran_call_c_procedure_pointer/fortran_main001.f90 +@@ -0,0 +1,17 @@ ++! test fortran call c for procedure about callback subroutine ++! ++program main ++ procedure(), pointer :: pp ++ interface ++ subroutine func(p) ++ procedure() :: p ++ end ++ end interface ++ pp=>print_x ++ call func(pp) ++contains ++ subroutine print_x(x) ++ integer :: x ++ print *, x ++ end ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/007_fortran_call_c_procedure_pointer/fortran_main002.f90 b/test/interoperability_with_c_fortran_call_c_scalar/007_fortran_call_c_procedure_pointer/fortran_main002.f90 +new file mode 100644 +index 0000000..25fe4ec +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/007_fortran_call_c_procedure_pointer/fortran_main002.f90 +@@ -0,0 +1,17 @@ ++! test fortran call c for procedure pointer about callback subroutine ++! ++program main ++ interface ++ subroutine func(p) ++ procedure(), pointer :: p ++ end ++ end interface ++ procedure(), pointer :: pp ++ pp=>print_x ++ call func(pp) ++contains ++ subroutine print_x(x) ++ integer :: x ++ print *, x ++ end ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/007_fortran_call_c_procedure_pointer/fortran_main003.f90 b/test/interoperability_with_c_fortran_call_c_scalar/007_fortran_call_c_procedure_pointer/fortran_main003.f90 +new file mode 100644 +index 0000000..4905453 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/007_fortran_call_c_procedure_pointer/fortran_main003.f90 +@@ -0,0 +1,18 @@ ++! test fortran call c for procedure pointer about callback function ++! ++program main ++ interface ++ subroutine func(p) ++ procedure(), pointer :: p ++ end ++ end interface ++ procedure(), pointer :: pp ++ pp=>return_x ++ call func(pp) ++contains ++ function return_x(x) ++ integer :: x ++ integer :: return_x ++ return_x = x ++ end ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/007_fortran_call_c_procedure_pointer/fortran_main004.f90 b/test/interoperability_with_c_fortran_call_c_scalar/007_fortran_call_c_procedure_pointer/fortran_main004.f90 +new file mode 100644 +index 0000000..e29fcff +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/007_fortran_call_c_procedure_pointer/fortran_main004.f90 +@@ -0,0 +1,18 @@ ++! test fortran call c for procedure about callback function ++! ++program main ++ interface ++ subroutine func(p) ++ procedure() :: p ++ end ++ end interface ++ procedure(), pointer :: pp ++ pp=>return_x ++ call func(pp) ++contains ++ function return_x(x) ++ integer :: x ++ integer :: return_x ++ return_x = x ++ end ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/007_fortran_call_c_procedure_pointer/fortran_main005.f90 b/test/interoperability_with_c_fortran_call_c_scalar/007_fortran_call_c_procedure_pointer/fortran_main005.f90 +new file mode 100644 +index 0000000..38b4596 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/007_fortran_call_c_procedure_pointer/fortran_main005.f90 +@@ -0,0 +1,24 @@ ++! test fortran call c for procedure pointers about callback subroutine ++! ++program main ++ interface ++ subroutine func(p, p2) ++ procedure(), pointer :: p ++ procedure(), pointer :: p2 ++ end ++ end interface ++ procedure(), pointer :: pp, pp2 ++ pp=>print_x ++ pp2=>print_negx ++ call func(pp, pp2) ++contains ++ subroutine print_x(x) ++ integer :: x ++ print *, x ++ end ++ subroutine print_negx(x) ++ integer :: x ++ x = -1 * x ++ print *, x ++ end ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/007_fortran_call_c_procedure_pointer/fortran_main006.f90 b/test/interoperability_with_c_fortran_call_c_scalar/007_fortran_call_c_procedure_pointer/fortran_main006.f90 +new file mode 100644 +index 0000000..600e9b7 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/007_fortran_call_c_procedure_pointer/fortran_main006.f90 +@@ -0,0 +1,19 @@ ++! test fortran call c for procedure pointer about callback lib function ++! ++program main ++ procedure(), pointer :: pp ++ interface ++ subroutine func(p) ++ procedure(), pointer :: p ++ end ++ end interface ++ pp=>print_cosx ++ call func(pp) ++ !pp=>cos ++ !call pp(1.1) ++contains ++ subroutine print_cosx(x) ++ real(4) :: x ++ print *, cos(x) ++ end ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/007_fortran_call_c_procedure_pointer/fortran_main007.f90 b/test/interoperability_with_c_fortran_call_c_scalar/007_fortran_call_c_procedure_pointer/fortran_main007.f90 +new file mode 100644 +index 0000000..abadafd +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/007_fortran_call_c_procedure_pointer/fortran_main007.f90 +@@ -0,0 +1,14 @@ ++! test fortran call c for procedure pointer that points to C subroutine ++! ++program main ++ interface ++ subroutine func(x) bind(C) ++ integer :: x ++ end ++ end interface ++ procedure(func), bind(C, name = "func_") :: proc ++ procedure(func), pointer :: pp ++ integer :: x = 5 ++ pp=>proc ++ call pp(x) ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/007_fortran_call_c_procedure_pointer/fortran_main008.f90 b/test/interoperability_with_c_fortran_call_c_scalar/007_fortran_call_c_procedure_pointer/fortran_main008.f90 +new file mode 100644 +index 0000000..2fe0611 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/007_fortran_call_c_procedure_pointer/fortran_main008.f90 +@@ -0,0 +1,16 @@ ++! test fortran call c for procedure pointer that points to C function ++! ++program main ++ interface ++ function func(x) bind(C) ++ integer :: x ++ integer :: func ++ end ++ end interface ++ procedure(func), bind(C, name = "func_") :: proc ++ procedure(func), pointer :: pp ++ integer :: x = 5, y ++ pp=>proc ++ y = pp(x) ++ print *, y ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/007_fortran_call_c_procedure_pointer/fortran_main009.f90 b/test/interoperability_with_c_fortran_call_c_scalar/007_fortran_call_c_procedure_pointer/fortran_main009.f90 +new file mode 100644 +index 0000000..2f4dc48 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/007_fortran_call_c_procedure_pointer/fortran_main009.f90 +@@ -0,0 +1,16 @@ ++! test fortran call c for return procedure pointer by function ++! ++program main ++ interface ++ subroutine f() bind(C) ++ end ++ function func(x) bind(C, name = "func_") result(res) ++ procedure(f), pointer :: x ++ procedure(f), pointer :: res ++ end ++ end interface ++ procedure(f), pointer :: pp => null() ++ procedure(f), pointer :: x => null() ++ pp => func(x) ++ call pp() ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/007_fortran_call_c_procedure_pointer/result.md b/test/interoperability_with_c_fortran_call_c_scalar/007_fortran_call_c_procedure_pointer/result.md +new file mode 100644 +index 0000000..679af9b +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/007_fortran_call_c_procedure_pointer/result.md +@@ -0,0 +1,11 @@ ++ | test | gfortran | flang | nvfortran| ++ | 001 | PASS | ERROR | PASS | ++ | 002 | PASS | ERROR | PASS | ++ | 003 | PASS | ERROR | ERROR | ++ | 004 | PASS | ERROR | ERROR | ++ | 005 | PASS | ERROR | PASS | ++ | 006 | PASS | ERROR | PASS | ++ | 007 | PASS | ERROR | PASS | ++ | 008 | PASS | ERROR | PASS | ++ | 009 | PASS | ERROR | PASS | ++ | 010 | ERROR | ERROR | PASS | +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_scalar/007_fortran_call_c_procedure_pointer/run.sh b/test/interoperability_with_c_fortran_call_c_scalar/007_fortran_call_c_procedure_pointer/run.sh +new file mode 100644 +index 0000000..2b09ed3 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_scalar/007_fortran_call_c_procedure_pointer/run.sh +@@ -0,0 +1,22 @@ ++for i in {001..009} ++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 ++echo "----- nvfortran result : " ++clang c_func$i.c -c -o c-test.o ++nvfortran fortran_main$i.f90 -c -o fortran-test.o ++nvfortran c-test.o fortran-test.o ++./a.out ++rm *.o a.out ++done +\ No newline at end of file +-- +2.25.1 + diff --git a/5-test-for-interoperability-with-c-c-call-fortran.patch b/5-test-for-interoperability-with-c-c-call-fortran.patch deleted file mode 100644 index 2af0656..0000000 --- a/5-test-for-interoperability-with-c-c-call-fortran.patch +++ /dev/null @@ -1,11901 +0,0 @@ -From eb07defe0fcb8bbe0581bc3d2fd85fd9033324ea Mon Sep 17 00:00:00 2001 -From: xieyihui -Date: Fri, 21 Oct 2022 00:00:39 +0800 -Subject: [PATCH] add test cases for interoperability with c about c call - fortran - -diff --git a/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/c_main001.c b/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/c_main001.c -new file mode 100644 -index 0000000..4b940d6 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/c_main001.c -@@ -0,0 +1,9 @@ -+// Test c call fortran for scalar type and the scalar type is int -+// -+#include -+extern void f_func_(int *i); -+int main() { -+ int i = 0; -+ f_func_(&i); -+ printf("%d\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/c_main002.c b/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/c_main002.c -new file mode 100644 -index 0000000..d2bf109 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/c_main002.c -@@ -0,0 +1,9 @@ -+// Test c call fortran for scalar type and the scalar type is short -+// -+#include -+extern void f_func_(short *i); -+int main() { -+ short i = 0; -+ f_func_(&i); -+ printf("%hd\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/c_main003.c b/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/c_main003.c -new file mode 100644 -index 0000000..921d6e7 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/c_main003.c -@@ -0,0 +1,9 @@ -+// Test c call fortran for scalar type and the scalar type is long -+// -+#include -+extern void f_func_(long *i); -+int main() { -+ long i = 0; -+ f_func_(&i); -+ printf("%ld\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/c_main004.c b/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/c_main004.c -new file mode 100644 -index 0000000..20e2d27 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/c_main004.c -@@ -0,0 +1,9 @@ -+// Test c call fortran for scalar type and the scalar type is long long -+// -+#include -+extern void f_func_(long long *i); -+int main() { -+ long long i = 0; -+ f_func_(&i); -+ printf("%Ld\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/c_main005.c b/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/c_main005.c -new file mode 100644 -index 0000000..9f396bd ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/c_main005.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for scalar type and the scalar type is signed -+// char -+// -+#include -+extern void f_func_(signed char *i); -+int main() { -+ signed char i = 0; -+ f_func_(&i); -+ printf("%c\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/c_main006.c b/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/c_main006.c -new file mode 100644 -index 0000000..f5f6b65 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/c_main006.c -@@ -0,0 +1,9 @@ -+// Test c call fortran for scalar type and the scalar type is size_t -+// -+#include -+extern void f_func_(size_t *i); -+int main() { -+ size_t i = 0; -+ f_func_(&i); -+ printf("%ld\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/c_main007.c b/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/c_main007.c -new file mode 100644 -index 0000000..a526d24 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/c_main007.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for scalar type and the scalar type is int8_t -+// -+#include -+#include -+extern void f_func_(int8_t *i); -+int main() { -+ int8_t i = 0; -+ f_func_(&i); -+ printf("%hhd\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/c_main008.c b/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/c_main008.c -new file mode 100644 -index 0000000..89b28a5 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/c_main008.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for scalar type and the scalar type is int16_t -+// -+#include -+#include -+extern void f_func_(int16_t *i); -+int main() { -+ int16_t i = 0; -+ f_func_(&i); -+ printf("%hd\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/c_main009.c b/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/c_main009.c -new file mode 100644 -index 0000000..a883214 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/c_main009.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for scalar type and the scalar type is int32_t -+// -+#include -+#include -+extern void f_func_(int32_t *i); -+int main() { -+ int32_t i = 0; -+ f_func_(&i); -+ printf("%d\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/c_main010.c b/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/c_main010.c -new file mode 100644 -index 0000000..f1360d8 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/c_main010.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for scalar type and the scalar type is int64_t -+// -+#include -+#include -+extern void f_func_(int64_t *i); -+int main() { -+ int64_t i = 0; -+ f_func_(&i); -+ printf("%ld\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/c_main011.c b/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/c_main011.c -new file mode 100644 -index 0000000..014c867 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/c_main011.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for scalar type and the scalar type is -+// int_least8_t -+// -+#include -+#include -+extern void f_func_(int_least8_t *i); -+int main() { -+ int_least8_t i = 0; -+ f_func_(&i); -+ printf("%hhd\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/c_main012.c b/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/c_main012.c -new file mode 100644 -index 0000000..7b059ae ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/c_main012.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for scalar type and the scalar type is -+// int_least16_t -+// -+#include -+#include -+extern void f_func_(int_least16_t *i); -+int main() { -+ int_least16_t i = 0; -+ f_func_(&i); -+ printf("%hd\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/c_main013.c b/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/c_main013.c -new file mode 100644 -index 0000000..7d75b28 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/c_main013.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for scalar type and the scalar type is -+// int_least32_t -+// -+#include -+#include -+extern void f_func_(int_least32_t *i); -+int main() { -+ int_least32_t i = 0; -+ f_func_(&i); -+ printf("%d\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/c_main014.c b/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/c_main014.c -new file mode 100644 -index 0000000..90dc33a ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/c_main014.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for scalar type and the scalar type is -+// int_least64_t -+// -+#include -+#include -+extern void f_func_(int_least64_t *i); -+int main() { -+ int_least64_t i = 0; -+ f_func_(&i); -+ printf("%ld\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/c_main015.c b/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/c_main015.c -new file mode 100644 -index 0000000..556f989 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/c_main015.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for scalar type and the scalar type is -+// int_fast8_t -+// -+#include -+#include -+extern void f_func_(int_fast8_t *i); -+int main() { -+ int_fast8_t i = 0; -+ f_func_(&i); -+ printf("%hhd\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/c_main016.c b/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/c_main016.c -new file mode 100644 -index 0000000..05400b2 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/c_main016.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for scalar type and the scalar type is -+// int_fast16_t -+// -+#include -+#include -+extern void f_func_(int_fast16_t *i); -+int main() { -+ int_fast16_t i = 0; -+ f_func_(&i); -+ printf("%ld\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/c_main017.c b/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/c_main017.c -new file mode 100644 -index 0000000..774ceb4 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/c_main017.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for scalar type and the scalar type is -+// int_fast32_t -+// -+#include -+#include -+extern void f_func_(int_fast32_t *i); -+int main() { -+ int_fast32_t i = 0; -+ f_func_(&i); -+ printf("%ld\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/c_main018.c b/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/c_main018.c -new file mode 100644 -index 0000000..3ec2748 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/c_main018.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for scalar type and the scalar type is -+// int_fast64_t -+// -+#include -+#include -+extern void f_func_(int_fast64_t *i); -+int main() { -+ int_fast64_t i = 0; -+ f_func_(&i); -+ printf("%ld\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/c_main019.c b/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/c_main019.c -new file mode 100644 -index 0000000..5b8b2ef ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/c_main019.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for scalar type and the scalar type is intmax_t -+// -+#include -+#include -+extern void f_func_(intmax_t *i); -+int main() { -+ intmax_t i = 0; -+ f_func_(&i); -+ printf("%ld\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/c_main020.c b/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/c_main020.c -new file mode 100644 -index 0000000..ab30f63 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/c_main020.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for scalar type and the scalar type is intptr_t -+// -+#include -+#include -+extern void f_func_(intptr_t *i); -+int main() { -+ intptr_t i = 0; -+ f_func_(&i); -+ printf("%ld\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/c_main021.c b/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/c_main021.c -new file mode 100644 -index 0000000..ccb4136 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/c_main021.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for scalar type and the scalar type is float -+// -+#include -+#include -+extern void f_func_(float *i); -+int main() { -+ float i = 0; -+ f_func_(&i); -+ printf("%0.20f\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/c_main022.c b/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/c_main022.c -new file mode 100644 -index 0000000..19df789 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/c_main022.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for scalar type and the scalar type is double -+// -+#include -+#include -+extern void f_func_(double *i); -+int main() { -+ double i = 0; -+ f_func_(&i); -+ printf("%0.20lf\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/c_main023.c b/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/c_main023.c -new file mode 100644 -index 0000000..819e350 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/c_main023.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for scalar type and the scalar type is long -+// double -+// -+#include -+#include -+extern void f_func_(long double *i); -+int main() { -+ long double i = 0; -+ f_func_(&i); -+ printf("%0.20Lf\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/c_main024.c b/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/c_main024.c -new file mode 100644 -index 0000000..4acf839 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/c_main024.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for scalar type and the scalar type is float -+// _Complex -+// -+#include -+#include -+extern void f_func_(float _Complex *i); -+int main() { -+ float _Complex i; -+ f_func_(&i); -+ printf("%0.20f + %0.20fi\n", creal(i), cimag(i)); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/c_main025.c b/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/c_main025.c -new file mode 100644 -index 0000000..c1803eb ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/c_main025.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for scalar type and the scalar type is double -+// _Complex -+// -+#include -+#include -+extern void f_func_(double _Complex *i); -+int main() { -+ double _Complex i; -+ f_func_(&i); -+ printf("%0.20lf + %0.20lfi\n", creal(i), cimag(i)); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/c_main026.c b/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/c_main026.c -new file mode 100644 -index 0000000..7b5e50e ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/c_main026.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for scalar type and the scalar type is double -+// _Complex -+// -+#include -+#include -+extern void f_func_(long double _Complex *i); -+int main() { -+ long double _Complex i; -+ f_func_(&i); -+ printf("%0.20lf + %0.20lfi\n", creal(i), cimag(i)); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/c_main027.c b/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/c_main027.c -new file mode 100644 -index 0000000..199691d ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/c_main027.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for scalar type and the scalar type is _Bool -+// -+#include -+#include -+extern void f_func_(_Bool *i); -+int main() { -+ _Bool i = 0; -+ f_func_(&i); -+ printf("%d\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/c_main028.c b/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/c_main028.c -new file mode 100644 -index 0000000..3b2376d ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/c_main028.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for scalar type and the scalar type is char -+// -+#include -+#include -+extern void f_func_(char *i); -+int main() { -+ char i; -+ f_func_(&i); -+ printf("%c\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/fortran_func001.f90 b/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/fortran_func001.f90 -new file mode 100644 -index 0000000..95e75fa ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/fortran_func001.f90 -@@ -0,0 +1,4 @@ -+subroutine f_func(i) -+ integer :: i -+ i = 2147483647 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/fortran_func002.f90 b/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/fortran_func002.f90 -new file mode 100644 -index 0000000..74c32fa ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/fortran_func002.f90 -@@ -0,0 +1,4 @@ -+subroutine f_func(i) -+ integer(2) :: i -+ i = 32767 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/fortran_func003.f90 b/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/fortran_func003.f90 -new file mode 100644 -index 0000000..cc3e99a ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/fortran_func003.f90 -@@ -0,0 +1,4 @@ -+subroutine f_func(i) -+ integer(8) :: i -+ i = 9223372036854775807 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/fortran_func004.f90 b/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/fortran_func004.f90 -new file mode 100644 -index 0000000..cc3e99a ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/fortran_func004.f90 -@@ -0,0 +1,4 @@ -+subroutine f_func(i) -+ integer(8) :: i -+ i = 9223372036854775807 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/fortran_func005.f90 b/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/fortran_func005.f90 -new file mode 100644 -index 0000000..9fa97ed ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/fortran_func005.f90 -@@ -0,0 +1,4 @@ -+subroutine f_func(i) -+ integer(1) :: i -+ i = 97 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/fortran_func006.f90 b/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/fortran_func006.f90 -new file mode 100644 -index 0000000..cc3e99a ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/fortran_func006.f90 -@@ -0,0 +1,4 @@ -+subroutine f_func(i) -+ integer(8) :: i -+ i = 9223372036854775807 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/fortran_func007.f90 b/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/fortran_func007.f90 -new file mode 100644 -index 0000000..c854566 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/fortran_func007.f90 -@@ -0,0 +1,4 @@ -+subroutine f_func(i) -+ integer(1) :: i -+ i = 127 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/fortran_func008.f90 b/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/fortran_func008.f90 -new file mode 100644 -index 0000000..74c32fa ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/fortran_func008.f90 -@@ -0,0 +1,4 @@ -+subroutine f_func(i) -+ integer(2) :: i -+ i = 32767 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/fortran_func009.f90 b/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/fortran_func009.f90 -new file mode 100644 -index 0000000..87e7774 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/fortran_func009.f90 -@@ -0,0 +1,4 @@ -+subroutine f_func(i) -+ integer(4) :: i -+ i = 2147483647 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/fortran_func010.f90 b/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/fortran_func010.f90 -new file mode 100644 -index 0000000..cc3e99a ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/fortran_func010.f90 -@@ -0,0 +1,4 @@ -+subroutine f_func(i) -+ integer(8) :: i -+ i = 9223372036854775807 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/fortran_func011.f90 b/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/fortran_func011.f90 -new file mode 100644 -index 0000000..c854566 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/fortran_func011.f90 -@@ -0,0 +1,4 @@ -+subroutine f_func(i) -+ integer(1) :: i -+ i = 127 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/fortran_func012.f90 b/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/fortran_func012.f90 -new file mode 100644 -index 0000000..74c32fa ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/fortran_func012.f90 -@@ -0,0 +1,4 @@ -+subroutine f_func(i) -+ integer(2) :: i -+ i = 32767 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/fortran_func013.f90 b/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/fortran_func013.f90 -new file mode 100644 -index 0000000..87e7774 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/fortran_func013.f90 -@@ -0,0 +1,4 @@ -+subroutine f_func(i) -+ integer(4) :: i -+ i = 2147483647 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/fortran_func014.f90 b/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/fortran_func014.f90 -new file mode 100644 -index 0000000..cc3e99a ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/fortran_func014.f90 -@@ -0,0 +1,4 @@ -+subroutine f_func(i) -+ integer(8) :: i -+ i = 9223372036854775807 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/fortran_func015.f90 b/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/fortran_func015.f90 -new file mode 100644 -index 0000000..c854566 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/fortran_func015.f90 -@@ -0,0 +1,4 @@ -+subroutine f_func(i) -+ integer(1) :: i -+ i = 127 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/fortran_func016.f90 b/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/fortran_func016.f90 -new file mode 100644 -index 0000000..cc3e99a ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/fortran_func016.f90 -@@ -0,0 +1,4 @@ -+subroutine f_func(i) -+ integer(8) :: i -+ i = 9223372036854775807 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/fortran_func017.f90 b/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/fortran_func017.f90 -new file mode 100644 -index 0000000..cc3e99a ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/fortran_func017.f90 -@@ -0,0 +1,4 @@ -+subroutine f_func(i) -+ integer(8) :: i -+ i = 9223372036854775807 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/fortran_func018.f90 b/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/fortran_func018.f90 -new file mode 100644 -index 0000000..cc3e99a ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/fortran_func018.f90 -@@ -0,0 +1,4 @@ -+subroutine f_func(i) -+ integer(8) :: i -+ i = 9223372036854775807 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/fortran_func019.f90 b/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/fortran_func019.f90 -new file mode 100644 -index 0000000..cc3e99a ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/fortran_func019.f90 -@@ -0,0 +1,4 @@ -+subroutine f_func(i) -+ integer(8) :: i -+ i = 9223372036854775807 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/fortran_func020.f90 b/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/fortran_func020.f90 -new file mode 100644 -index 0000000..cc3e99a ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/fortran_func020.f90 -@@ -0,0 +1,4 @@ -+subroutine f_func(i) -+ integer(8) :: i -+ i = 9223372036854775807 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/fortran_func021.f90 b/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/fortran_func021.f90 -new file mode 100644 -index 0000000..342040e ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/fortran_func021.f90 -@@ -0,0 +1,4 @@ -+subroutine f_func(i) -+ real(4) :: i -+ i = 314159265358.979626 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/fortran_func022.f90 b/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/fortran_func022.f90 -new file mode 100644 -index 0000000..5077d70 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/fortran_func022.f90 -@@ -0,0 +1,4 @@ -+subroutine f_func(i) -+ real(8) :: i -+ i = 314159265358.979626 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/fortran_func023.f90 b/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/fortran_func023.f90 -new file mode 100644 -index 0000000..58c7bfd ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/fortran_func023.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(i) -+ integer, parameter :: K = selected_real_kind(16) -+ real(K) :: i -+ i = 314159265358.979626 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/fortran_func024.f90 b/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/fortran_func024.f90 -new file mode 100644 -index 0000000..3a14570 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/fortran_func024.f90 -@@ -0,0 +1,4 @@ -+subroutine f_func(i) -+ complex(4) :: i -+ i = (-12345678.7654321, 1) -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/fortran_func025.f90 b/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/fortran_func025.f90 -new file mode 100644 -index 0000000..6514dfd ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/fortran_func025.f90 -@@ -0,0 +1,4 @@ -+subroutine f_func(i) -+ complex(8) :: i -+ i = (-12345678.7654321, 1) -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/fortran_func026.f90 b/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/fortran_func026.f90 -new file mode 100644 -index 0000000..0acf912 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/fortran_func026.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(i) -+ integer, parameter :: K = selected_real_kind(16) -+ complex(K) :: i -+ i = (-12345678.7654321, 1) -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/fortran_func027.f90 b/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/fortran_func027.f90 -new file mode 100644 -index 0000000..f71da8e ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/fortran_func027.f90 -@@ -0,0 +1,4 @@ -+subroutine f_func(i) -+ logical(1) :: i -+ i = .TRUE. -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/fortran_func028.f90 b/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/fortran_func028.f90 -new file mode 100644 -index 0000000..14181a4 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/fortran_func028.f90 -@@ -0,0 +1,4 @@ -+subroutine f_func(i) -+ character(1) :: i -+ i = 'a' -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/run.sh b/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/run.sh -new file mode 100644 -index 0000000..ad3abb0 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/001_c_call_fortran_scalar/run.sh -@@ -0,0 +1,16 @@ -+for i in {001..028} -+do -+echo "------- test $i ------." -+#echo "----- gfortran result:" -+#gcc c_main$i.c -c -o c-test.o -+#gfortran fortran_func$i.f90 -fno-range-check -c -o fortran-test.o -+#gfortran fortran-test.o c-test.o -+#./a.out -+#rm *.o a.out -+echo "----- flang-new result : " -+clang c_main$i.c -c -o c-test.o -+flang-new fortran_func$i.f90 -c -o fortran-test.o -+flang-new -flang-experimental-exec c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+done -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/c_main001.c b/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/c_main001.c -new file mode 100644 -index 0000000..2def20c ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/c_main001.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for scalar type and the scalar type is int with -+// bindc -+// -+#include -+extern void f_func_(int *i); -+int main() { -+ int i = 0; -+ f_func_(&i); -+ printf("%d\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/c_main002.c b/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/c_main002.c -new file mode 100644 -index 0000000..26bd768 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/c_main002.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for scalar type and the scalar type is short -+// bindc -+// -+#include -+extern void f_func_(short *i); -+int main() { -+ short i = 0; -+ f_func_(&i); -+ printf("%hd\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/c_main003.c b/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/c_main003.c -new file mode 100644 -index 0000000..7e95460 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/c_main003.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for scalar type and the scalar type is long with -+// bindc -+// -+#include -+extern void f_func_(long *i); -+int main() { -+ long i = 0; -+ f_func_(&i); -+ printf("%ld\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/c_main004.c b/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/c_main004.c -new file mode 100644 -index 0000000..ef0c0fa ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/c_main004.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for scalar type and the scalar type is long long -+// with bindc -+// -+#include -+extern void f_func_(long long *i); -+int main() { -+ long long i = 0; -+ f_func_(&i); -+ printf("%Ld\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/c_main005.c b/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/c_main005.c -new file mode 100644 -index 0000000..14ad78c ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/c_main005.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for scalar type and the scalar type is signed -+// char with bindc -+// -+#include -+extern void f_func_(signed char *i); -+int main() { -+ signed char i = 0; -+ f_func_(&i); -+ printf("%c\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/c_main006.c b/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/c_main006.c -new file mode 100644 -index 0000000..5202cc2 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/c_main006.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for scalar type and the scalar type is size_t -+// with bindc -+// -+#include -+extern void f_func_(size_t *i); -+int main() { -+ size_t i = 0; -+ f_func_(&i); -+ printf("%ld\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/c_main007.c b/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/c_main007.c -new file mode 100644 -index 0000000..52fb2a6 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/c_main007.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for scalar type and the scalar type is int8_t -+// with bindc -+// -+#include -+#include -+extern void f_func_(int8_t *i); -+int main() { -+ int8_t i = 0; -+ f_func_(&i); -+ printf("%hhd\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/c_main008.c b/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/c_main008.c -new file mode 100644 -index 0000000..45a3f95 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/c_main008.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for scalar type and the scalar type is int16_t -+// with bindc -+// -+#include -+#include -+extern void f_func_(int16_t *i); -+int main() { -+ int16_t i = 0; -+ f_func_(&i); -+ printf("%hd\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/c_main009.c b/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/c_main009.c -new file mode 100644 -index 0000000..3dbd951 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/c_main009.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for scalar type and the scalar type is int32_t -+// with bindc -+// -+#include -+#include -+extern void f_func_(int32_t *i); -+int main() { -+ int32_t i = 0; -+ f_func_(&i); -+ printf("%d\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/c_main010.c b/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/c_main010.c -new file mode 100644 -index 0000000..e9e3e2c ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/c_main010.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for scalar type and the scalar type is int64_t -+// with bindc -+// -+#include -+#include -+extern void f_func_(int64_t *i); -+int main() { -+ int64_t i = 0; -+ f_func_(&i); -+ printf("%ld\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/c_main011.c b/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/c_main011.c -new file mode 100644 -index 0000000..617fb85 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/c_main011.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for scalar type and the scalar type is -+// int_least8_t with bindc -+// -+#include -+#include -+extern void f_func_(int_least8_t *i); -+int main() { -+ int_least8_t i = 0; -+ f_func_(&i); -+ printf("%hhd\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/c_main012.c b/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/c_main012.c -new file mode 100644 -index 0000000..5eac287 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/c_main012.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for scalar type and the scalar type is -+// int_least16_t with bindc -+// -+#include -+#include -+extern void f_func_(int_least16_t *i); -+int main() { -+ int_least16_t i = 0; -+ f_func_(&i); -+ printf("%hd\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/c_main013.c b/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/c_main013.c -new file mode 100644 -index 0000000..1e81950 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/c_main013.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for scalar type and the scalar type is -+// int_least32_t with bindc -+// -+#include -+#include -+extern void f_func_(int_least32_t *i); -+int main() { -+ int_least32_t i = 0; -+ f_func_(&i); -+ printf("%d\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/c_main014.c b/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/c_main014.c -new file mode 100644 -index 0000000..bb24e29 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/c_main014.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for scalar type and the scalar type is -+// int_least64_t with bindc -+// -+#include -+#include -+extern void f_func_(int_least64_t *i); -+int main() { -+ int_least64_t i = 0; -+ f_func_(&i); -+ printf("%ld\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/c_main015.c b/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/c_main015.c -new file mode 100644 -index 0000000..57d4d21 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/c_main015.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for scalar type and the scalar type is -+// int_fast8_t with bindc -+// -+#include -+#include -+extern void f_func_(int_fast8_t *i); -+int main() { -+ int_fast8_t i = 0; -+ f_func_(&i); -+ printf("%hhd\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/c_main016.c b/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/c_main016.c -new file mode 100644 -index 0000000..e641f17 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/c_main016.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for scalar type and the scalar type is -+// int_fast16_t with bindc -+// -+#include -+#include -+extern void f_func_(int_fast16_t *i); -+int main() { -+ int_fast16_t i = 0; -+ f_func_(&i); -+ printf("%ld\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/c_main017.c b/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/c_main017.c -new file mode 100644 -index 0000000..0634f7a ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/c_main017.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for scalar type and the scalar type is -+// int_fast32_t with bindc -+// -+#include -+#include -+extern void f_func_(int_fast32_t *i); -+int main() { -+ int_fast32_t i = 0; -+ f_func_(&i); -+ printf("%ld\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/c_main018.c b/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/c_main018.c -new file mode 100644 -index 0000000..e309b92 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/c_main018.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for scalar type and the scalar type is -+// int_fast64_t with bindc -+// -+#include -+#include -+extern void f_func_(int_fast64_t *i); -+int main() { -+ int_fast64_t i = 0; -+ f_func_(&i); -+ printf("%ld\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/c_main019.c b/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/c_main019.c -new file mode 100644 -index 0000000..9fc63af ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/c_main019.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for scalar type and the scalar type is intmax_t -+// with bindc -+// -+#include -+#include -+extern void f_func_(intmax_t *i); -+int main() { -+ intmax_t i = 0; -+ f_func_(&i); -+ printf("%ld\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/c_main020.c b/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/c_main020.c -new file mode 100644 -index 0000000..5ea5b4b ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/c_main020.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for scalar type and the scalar type is intptr_t -+// with bindc -+// -+#include -+#include -+extern void f_func_(intptr_t *i); -+int main() { -+ intptr_t i = 0; -+ f_func_(&i); -+ printf("%ld\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/c_main021.c b/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/c_main021.c -new file mode 100644 -index 0000000..b32fc2d ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/c_main021.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for scalar type and the scalar type is float -+// with bindc -+// -+#include -+#include -+extern void f_func_(float *i); -+int main() { -+ float i = 0; -+ f_func_(&i); -+ printf("%0.20f\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/c_main022.c b/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/c_main022.c -new file mode 100644 -index 0000000..dc6bf18 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/c_main022.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for scalar type and the scalar type is double -+// with bindc -+// -+#include -+#include -+extern void f_func_(double *i); -+int main() { -+ double i = 0; -+ f_func_(&i); -+ printf("%0.20lf\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/c_main023.c b/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/c_main023.c -new file mode 100644 -index 0000000..f25288d ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/c_main023.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for scalar type and the scalar type is long -+// double with bindc -+// -+#include -+#include -+extern void f_func_(long double *i); -+int main() { -+ long double i = 0; -+ f_func_(&i); -+ printf("%0.20Lf\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/c_main024.c b/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/c_main024.c -new file mode 100644 -index 0000000..99253d2 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/c_main024.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for scalar type and the scalar type is float -+// _Complex with bindc -+// -+#include -+#include -+extern void f_func_(float _Complex *i); -+int main() { -+ float _Complex i; -+ f_func_(&i); -+ printf("%0.20f + %0.20fi\n", creal(i), cimag(i)); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/c_main025.c b/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/c_main025.c -new file mode 100644 -index 0000000..622e6f9 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/c_main025.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for scalar type and the scalar type is double -+// _Complex with bindc -+// -+#include -+#include -+extern void f_func_(double _Complex *i); -+int main() { -+ double _Complex i; -+ f_func_(&i); -+ printf("%0.20lf + %0.20lfi\n", creal(i), cimag(i)); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/c_main026.c b/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/c_main026.c -new file mode 100644 -index 0000000..5a1852a ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/c_main026.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for scalar type and the scalar type is double -+// _Complex with bindc -+// -+#include -+#include -+extern void f_func_(long double _Complex *i); -+int main() { -+ long double _Complex i; -+ f_func_(&i); -+ printf("%0.20lf + %0.20lfi\n", creal(i), cimag(i)); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/c_main027.c b/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/c_main027.c -new file mode 100644 -index 0000000..147f511 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/c_main027.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for scalar type and the scalar type is _Bool -+// with bindc -+// -+#include -+#include -+extern void f_func_(_Bool *i); -+int main() { -+ _Bool i = 0; -+ f_func_(&i); -+ printf("%d\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/c_main028.c b/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/c_main028.c -new file mode 100644 -index 0000000..a5978f8 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/c_main028.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for scalar type and the scalar type is char with -+// bindc -+// -+#include -+#include -+extern void f_func_(char *i); -+int main() { -+ char i; -+ f_func_(&i); -+ printf("%c\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/fortran_func001.f90 b/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/fortran_func001.f90 -new file mode 100644 -index 0000000..ffc08aa ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/fortran_func001.f90 -@@ -0,0 +1,4 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ integer :: i -+ i = 2147483647 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/fortran_func002.f90 b/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/fortran_func002.f90 -new file mode 100644 -index 0000000..9ecd88b ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/fortran_func002.f90 -@@ -0,0 +1,4 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ integer(2) :: i -+ i = 32767 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/fortran_func003.f90 b/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/fortran_func003.f90 -new file mode 100644 -index 0000000..a1c733a ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/fortran_func003.f90 -@@ -0,0 +1,4 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ integer(8) :: i -+ i = 9223372036854775807 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/fortran_func004.f90 b/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/fortran_func004.f90 -new file mode 100644 -index 0000000..a1c733a ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/fortran_func004.f90 -@@ -0,0 +1,4 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ integer(8) :: i -+ i = 9223372036854775807 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/fortran_func005.f90 b/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/fortran_func005.f90 -new file mode 100644 -index 0000000..1b5a25f ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/fortran_func005.f90 -@@ -0,0 +1,4 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ integer(1) :: i -+ i = 97 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/fortran_func006.f90 b/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/fortran_func006.f90 -new file mode 100644 -index 0000000..a1c733a ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/fortran_func006.f90 -@@ -0,0 +1,4 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ integer(8) :: i -+ i = 9223372036854775807 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/fortran_func007.f90 b/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/fortran_func007.f90 -new file mode 100644 -index 0000000..cd8e40f ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/fortran_func007.f90 -@@ -0,0 +1,4 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ integer(1) :: i -+ i = 127 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/fortran_func008.f90 b/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/fortran_func008.f90 -new file mode 100644 -index 0000000..9ecd88b ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/fortran_func008.f90 -@@ -0,0 +1,4 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ integer(2) :: i -+ i = 32767 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/fortran_func009.f90 b/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/fortran_func009.f90 -new file mode 100644 -index 0000000..6b326f2 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/fortran_func009.f90 -@@ -0,0 +1,4 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ integer(4) :: i -+ i = 2147483647 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/fortran_func010.f90 b/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/fortran_func010.f90 -new file mode 100644 -index 0000000..a1c733a ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/fortran_func010.f90 -@@ -0,0 +1,4 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ integer(8) :: i -+ i = 9223372036854775807 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/fortran_func011.f90 b/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/fortran_func011.f90 -new file mode 100644 -index 0000000..cd8e40f ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/fortran_func011.f90 -@@ -0,0 +1,4 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ integer(1) :: i -+ i = 127 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/fortran_func012.f90 b/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/fortran_func012.f90 -new file mode 100644 -index 0000000..9ecd88b ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/fortran_func012.f90 -@@ -0,0 +1,4 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ integer(2) :: i -+ i = 32767 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/fortran_func013.f90 b/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/fortran_func013.f90 -new file mode 100644 -index 0000000..6b326f2 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/fortran_func013.f90 -@@ -0,0 +1,4 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ integer(4) :: i -+ i = 2147483647 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/fortran_func014.f90 b/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/fortran_func014.f90 -new file mode 100644 -index 0000000..a1c733a ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/fortran_func014.f90 -@@ -0,0 +1,4 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ integer(8) :: i -+ i = 9223372036854775807 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/fortran_func015.f90 b/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/fortran_func015.f90 -new file mode 100644 -index 0000000..cd8e40f ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/fortran_func015.f90 -@@ -0,0 +1,4 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ integer(1) :: i -+ i = 127 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/fortran_func016.f90 b/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/fortran_func016.f90 -new file mode 100644 -index 0000000..a1c733a ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/fortran_func016.f90 -@@ -0,0 +1,4 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ integer(8) :: i -+ i = 9223372036854775807 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/fortran_func017.f90 b/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/fortran_func017.f90 -new file mode 100644 -index 0000000..a1c733a ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/fortran_func017.f90 -@@ -0,0 +1,4 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ integer(8) :: i -+ i = 9223372036854775807 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/fortran_func018.f90 b/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/fortran_func018.f90 -new file mode 100644 -index 0000000..a1c733a ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/fortran_func018.f90 -@@ -0,0 +1,4 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ integer(8) :: i -+ i = 9223372036854775807 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/fortran_func019.f90 b/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/fortran_func019.f90 -new file mode 100644 -index 0000000..a1c733a ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/fortran_func019.f90 -@@ -0,0 +1,4 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ integer(8) :: i -+ i = 9223372036854775807 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/fortran_func020.f90 b/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/fortran_func020.f90 -new file mode 100644 -index 0000000..a1c733a ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/fortran_func020.f90 -@@ -0,0 +1,4 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ integer(8) :: i -+ i = 9223372036854775807 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/fortran_func021.f90 b/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/fortran_func021.f90 -new file mode 100644 -index 0000000..611cdc9 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/fortran_func021.f90 -@@ -0,0 +1,4 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ real(4) :: i -+ i = 314159265358.979626 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/fortran_func022.f90 b/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/fortran_func022.f90 -new file mode 100644 -index 0000000..900e195 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/fortran_func022.f90 -@@ -0,0 +1,4 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ real(8) :: i -+ i = 314159265358.979626 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/fortran_func023.f90 b/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/fortran_func023.f90 -new file mode 100644 -index 0000000..464d3c1 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/fortran_func023.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ integer, parameter :: K = selected_real_kind(16) -+ real(K) :: i -+ i = 314159265358.979626 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/fortran_func024.f90 b/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/fortran_func024.f90 -new file mode 100644 -index 0000000..25c971c ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/fortran_func024.f90 -@@ -0,0 +1,4 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ complex(4) :: i -+ i = (-12345678.7654321, 1) -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/fortran_func025.f90 b/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/fortran_func025.f90 -new file mode 100644 -index 0000000..69fddab ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/fortran_func025.f90 -@@ -0,0 +1,4 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ complex(8) :: i -+ i = (-12345678.7654321, 1) -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/fortran_func026.f90 b/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/fortran_func026.f90 -new file mode 100644 -index 0000000..2698cb4 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/fortran_func026.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ integer, parameter :: K = selected_real_kind(16) -+ complex(K) :: i -+ i = (-12345678.7654321, 1) -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/fortran_func027.f90 b/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/fortran_func027.f90 -new file mode 100644 -index 0000000..2c10c78 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/fortran_func027.f90 -@@ -0,0 +1,4 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ logical(1) :: i -+ i = .TRUE. -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/fortran_func028.f90 b/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/fortran_func028.f90 -new file mode 100644 -index 0000000..55d210f ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/fortran_func028.f90 -@@ -0,0 +1,4 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ character(1) :: i -+ i = 'a' -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/run.sh b/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/run.sh -new file mode 100644 -index 0000000..ad3abb0 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/002_c_call_fortran_scalar_bindc/run.sh -@@ -0,0 +1,16 @@ -+for i in {001..028} -+do -+echo "------- test $i ------." -+#echo "----- gfortran result:" -+#gcc c_main$i.c -c -o c-test.o -+#gfortran fortran_func$i.f90 -fno-range-check -c -o fortran-test.o -+#gfortran fortran-test.o c-test.o -+#./a.out -+#rm *.o a.out -+echo "----- flang-new result : " -+clang c_main$i.c -c -o c-test.o -+flang-new fortran_func$i.f90 -c -o fortran-test.o -+flang-new -flang-experimental-exec c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+done -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/c_main001.c b/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/c_main001.c -new file mode 100644 -index 0000000..2dd7dab ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/c_main001.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the scalar type with value attribute and the -+// scalar type is int without bindc -+// -+#include -+extern void f_func_(int i); -+int main() { -+ int res = 12; -+ f_func_(res); -+ printf("%d\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/c_main002.c b/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/c_main002.c -new file mode 100644 -index 0000000..23ee8a1 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/c_main002.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the scalar type with value attribute and the -+// scalar type is short without bindc -+// -+#include -+extern void f_func_(short i); -+int main() { -+ short res = 12; -+ f_func_(res); -+ printf("%hd\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/c_main003.c b/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/c_main003.c -new file mode 100644 -index 0000000..e116bb8 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/c_main003.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the scalar type with value attribute and the -+// scalar type is long without bindc -+// -+#include -+extern void f_func_(long i); -+int main() { -+ long res = 12; -+ f_func_(res); -+ printf("%ld\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/c_main004.c b/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/c_main004.c -new file mode 100644 -index 0000000..82d8e17 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/c_main004.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the scalar type with value attribute and the -+// scalar type is long long without bindc -+// -+#include -+extern void f_func_(long long i); -+int main() { -+ long long res = 12; -+ f_func_(res); -+ printf("%Ld\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/c_main005.c b/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/c_main005.c -new file mode 100644 -index 0000000..34da053 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/c_main005.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the scalar type with value attribute and the -+// scalar type is signed char without bindc -+// -+#include -+extern void f_func_(signed char i); -+int main() { -+ signed char res = 12; -+ f_func_(res); -+ printf("%hhd\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/c_main006.c b/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/c_main006.c -new file mode 100644 -index 0000000..2f6fa08 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/c_main006.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the scalar type with value attribute and the -+// scalar type is size_t without bindc -+// -+#include -+extern void f_func_(size_t i); -+int main() { -+ size_t res = 12; -+ f_func_(res); -+ printf("%ld\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/c_main007.c b/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/c_main007.c -new file mode 100644 -index 0000000..a24750c ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/c_main007.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the scalar type with value attribute and the -+// scalar type is int8_t without bindc -+// -+#include -+#include -+extern void f_func_(int8_t i); -+int main() { -+ int8_t res = 12; -+ f_func_(res); -+ printf("%hhd\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/c_main008.c b/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/c_main008.c -new file mode 100644 -index 0000000..94355b6 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/c_main008.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the scalar type with value attribute and the -+// scalar type is int16_t without bindc -+// -+#include -+#include -+extern void f_func_(int16_t i); -+int main() { -+ int16_t res = 12; -+ f_func_(res); -+ printf("%hd\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/c_main009.c b/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/c_main009.c -new file mode 100644 -index 0000000..31a1f39 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/c_main009.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the scalar type with value attribute and the -+// scalar type is int32_t without bindc -+// -+#include -+#include -+extern void f_func_(int32_t i); -+int main() { -+ int32_t res = 12; -+ f_func_(res); -+ printf("%d\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/c_main010.c b/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/c_main010.c -new file mode 100644 -index 0000000..cbe3787 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/c_main010.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the scalar type with value attribute and the -+// scalar type is int64_t without bindc -+// -+#include -+#include -+extern void f_func_(int64_t i); -+int main() { -+ int64_t res = 12; -+ f_func_(res); -+ printf("%ld\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/c_main011.c b/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/c_main011.c -new file mode 100644 -index 0000000..14a671e ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/c_main011.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the scalar type with value attribute and the -+// scalar type is int_least8_t without bindc -+// -+#include -+#include -+extern void f_func_(int_least8_t i); -+int main() { -+ int_least8_t res = 12; -+ f_func_(res); -+ printf("%hhd\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/c_main012.c b/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/c_main012.c -new file mode 100644 -index 0000000..3143fbe ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/c_main012.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the scalar type with value attribute and the -+// scalar type is int_least16_t without bindc -+// -+#include -+#include -+extern void f_func_(int_least16_t i); -+int main() { -+ int_least16_t res = 12; -+ f_func_(res); -+ printf("%hd\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/c_main013.c b/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/c_main013.c -new file mode 100644 -index 0000000..8fda433 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/c_main013.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the scalar type with value attribute and the -+// scalar type is int_least32_t without bindc -+// -+#include -+#include -+extern void f_func_(int_least32_t i); -+int main() { -+ int_least32_t res = 12; -+ f_func_(res); -+ printf("%d\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/c_main014.c b/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/c_main014.c -new file mode 100644 -index 0000000..2149a3e ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/c_main014.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the scalar type with value attribute and the -+// scalar type is int_least64_t without bindc -+// -+#include -+#include -+extern void f_func_(int_least64_t i); -+int main() { -+ int_least64_t res = 12; -+ f_func_(res); -+ printf("%ld\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/c_main015.c b/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/c_main015.c -new file mode 100644 -index 0000000..da0e8c4 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/c_main015.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the scalar type with value attribute and the -+// scalar type is int_fast8_t without bindc -+// -+#include -+#include -+extern void f_func_(int_fast8_t i); -+int main() { -+ int_fast8_t res = 12; -+ f_func_(res); -+ printf("%hhd\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/c_main016.c b/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/c_main016.c -new file mode 100644 -index 0000000..82d0ab5 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/c_main016.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the scalar type with value attribute and the -+// scalar type is int_fast16_t without bindc -+// -+#include -+#include -+extern void f_func_(int_fast16_t i); -+int main() { -+ int_fast16_t res = 12; -+ f_func_(res); -+ printf("%ld\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/c_main017.c b/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/c_main017.c -new file mode 100644 -index 0000000..60e6f02 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/c_main017.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the scalar type with value attribute and the -+// scalar type is int_fast32_t without bindc -+// -+#include -+#include -+extern void f_func_(int_fast32_t i); -+int main() { -+ int_fast32_t res = 12; -+ f_func_(res); -+ printf("%ld\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/c_main018.c b/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/c_main018.c -new file mode 100644 -index 0000000..e901780 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/c_main018.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the scalar type with value attribute and the -+// scalar type is int_fast64_t without bindc -+// -+#include -+#include -+extern void f_func_(int_fast64_t i); -+int main() { -+ int_fast64_t res = 12; -+ f_func_(res); -+ printf("%ld\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/c_main019.c b/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/c_main019.c -new file mode 100644 -index 0000000..5501578 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/c_main019.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the scalar type with value attribute and the -+// scalar type is intmax_t without bindc -+// -+#include -+#include -+extern void f_func_(intmax_t i); -+int main() { -+ intmax_t res = 12; -+ f_func_(res); -+ printf("%ld\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/c_main020.c b/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/c_main020.c -new file mode 100644 -index 0000000..e98973c ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/c_main020.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the scalar type with value attribute and the -+// scalar type is intptr_t without bindc -+// -+#include -+#include -+extern void f_func_(intptr_t i); -+int main() { -+ intptr_t res = 12; -+ f_func_(res); -+ printf("%ld\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/c_main021.c b/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/c_main021.c -new file mode 100644 -index 0000000..c664a03 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/c_main021.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the scalar type with value attribute and the -+// scalar type is float without bindc -+// -+#include -+extern void f_func_(float i); -+int main() { -+ float i = 3.14; -+ f_func_(i); -+ printf("%0.20f\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/c_main022.c b/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/c_main022.c -new file mode 100644 -index 0000000..47e0d69 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/c_main022.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the scalar type with value attribute and the -+// scalar type is double without bindc -+// -+#include -+extern void f_func_(double i); -+int main() { -+ double i = 3.14; -+ f_func_(i); -+ printf("%0.20lf\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/c_main023.c b/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/c_main023.c -new file mode 100644 -index 0000000..0feeed3 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/c_main023.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the scalar type with value attribute and the -+// scalar type is long double without bindc -+// -+#include -+extern void f_func_(long double i); -+int main() { -+ long double i = 3.14; -+ f_func_(i); -+ printf("%0.20Lf\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/c_main024.c b/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/c_main024.c -new file mode 100644 -index 0000000..d720a6d ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/c_main024.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the scalar type with value attribute and the -+// scalar type is float _Complex without bindc -+// -+#include -+#include -+extern void f_func_(float _Complex i); -+int main() { -+ float _Complex i = 5.0f + 1.0if; -+ f_func_(i); -+ printf("%0.20f + %0.20fi\n", creal(i), cimag(i)); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/c_main025.c b/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/c_main025.c -new file mode 100644 -index 0000000..2cbc3cb ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/c_main025.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the scalar type with value attribute and the -+// scalar type is double _Complex without bindc -+// -+#include -+#include -+extern void f_func_(double _Complex i); -+int main() { -+ double _Complex i = 5.0f + 1.0if; -+ f_func_(i); -+ printf("%0.20f + %0.20fi\n", creal(i), cimag(i)); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/c_main026.c b/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/c_main026.c -new file mode 100644 -index 0000000..d221b3f ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/c_main026.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the scalar type with value attribute and the -+// scalar type is long double _Complex without bindc -+// -+#include -+#include -+extern void f_func_(long double _Complex i); -+int main() { -+ long double _Complex i = 5.0f + 1.0if; -+ f_func_(i); -+ printf("%0.20f + %0.20fi\n", creal(i), cimag(i)); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/c_main027.c b/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/c_main027.c -new file mode 100644 -index 0000000..54c265f ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/c_main027.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the scalar type with value attribute and the -+// scalar type is _Bool without bindc -+// -+#include -+#include -+extern void f_func_(_Bool i); -+int main() { -+ _Bool i = 0; -+ f_func_(i); -+ printf("%d\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/c_main028.c b/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/c_main028.c -new file mode 100644 -index 0000000..2764a44 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/c_main028.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the scalar type with value attribute and the -+// scalar type is char without bindc -+// -+#include -+#include -+extern void f_func_(char i); -+int main() { -+ char i = 'z'; -+ f_func_(i); -+ printf("%c\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/fortran_func001.f90 b/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/fortran_func001.f90 -new file mode 100644 -index 0000000..9fcc701 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/fortran_func001.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(b) -+ integer, value :: b -+ b = b + 1 -+ print *, b -+end -diff --git a/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/fortran_func002.f90 b/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/fortran_func002.f90 -new file mode 100644 -index 0000000..ed202ed ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/fortran_func002.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(b) -+ integer(2), value :: b -+ b = b + 1 -+ print *, b -+end -diff --git a/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/fortran_func003.f90 b/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/fortran_func003.f90 -new file mode 100644 -index 0000000..5d65e3e ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/fortran_func003.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(b) -+ integer(8), value :: b -+ b = b + 1 -+ print *, b -+end -diff --git a/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/fortran_func004.f90 b/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/fortran_func004.f90 -new file mode 100644 -index 0000000..5d65e3e ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/fortran_func004.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(b) -+ integer(8), value :: b -+ b = b + 1 -+ print *, b -+end -diff --git a/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/fortran_func005.f90 b/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/fortran_func005.f90 -new file mode 100644 -index 0000000..3ec34c9 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/fortran_func005.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(b) -+ integer(1), value :: b -+ b = b + 1 -+ print *, b -+end -diff --git a/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/fortran_func006.f90 b/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/fortran_func006.f90 -new file mode 100644 -index 0000000..5d65e3e ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/fortran_func006.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(b) -+ integer(8), value :: b -+ b = b + 1 -+ print *, b -+end -diff --git a/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/fortran_func007.f90 b/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/fortran_func007.f90 -new file mode 100644 -index 0000000..3ec34c9 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/fortran_func007.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(b) -+ integer(1), value :: b -+ b = b + 1 -+ print *, b -+end -diff --git a/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/fortran_func008.f90 b/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/fortran_func008.f90 -new file mode 100644 -index 0000000..ed202ed ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/fortran_func008.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(b) -+ integer(2), value :: b -+ b = b + 1 -+ print *, b -+end -diff --git a/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/fortran_func009.f90 b/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/fortran_func009.f90 -new file mode 100644 -index 0000000..ccf4748 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/fortran_func009.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(b) -+ integer(4), value :: b -+ b = b + 1 -+ print *, b -+end -diff --git a/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/fortran_func010.f90 b/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/fortran_func010.f90 -new file mode 100644 -index 0000000..5d65e3e ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/fortran_func010.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(b) -+ integer(8), value :: b -+ b = b + 1 -+ print *, b -+end -diff --git a/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/fortran_func011.f90 b/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/fortran_func011.f90 -new file mode 100644 -index 0000000..3ec34c9 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/fortran_func011.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(b) -+ integer(1), value :: b -+ b = b + 1 -+ print *, b -+end -diff --git a/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/fortran_func012.f90 b/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/fortran_func012.f90 -new file mode 100644 -index 0000000..ed202ed ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/fortran_func012.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(b) -+ integer(2), value :: b -+ b = b + 1 -+ print *, b -+end -diff --git a/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/fortran_func013.f90 b/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/fortran_func013.f90 -new file mode 100644 -index 0000000..ccf4748 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/fortran_func013.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(b) -+ integer(4), value :: b -+ b = b + 1 -+ print *, b -+end -diff --git a/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/fortran_func014.f90 b/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/fortran_func014.f90 -new file mode 100644 -index 0000000..5d65e3e ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/fortran_func014.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(b) -+ integer(8), value :: b -+ b = b + 1 -+ print *, b -+end -diff --git a/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/fortran_func015.f90 b/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/fortran_func015.f90 -new file mode 100644 -index 0000000..3ec34c9 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/fortran_func015.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(b) -+ integer(1), value :: b -+ b = b + 1 -+ print *, b -+end -diff --git a/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/fortran_func016.f90 b/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/fortran_func016.f90 -new file mode 100644 -index 0000000..5d65e3e ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/fortran_func016.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(b) -+ integer(8), value :: b -+ b = b + 1 -+ print *, b -+end -diff --git a/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/fortran_func017.f90 b/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/fortran_func017.f90 -new file mode 100644 -index 0000000..5d65e3e ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/fortran_func017.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(b) -+ integer(8), value :: b -+ b = b + 1 -+ print *, b -+end -diff --git a/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/fortran_func018.f90 b/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/fortran_func018.f90 -new file mode 100644 -index 0000000..5d65e3e ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/fortran_func018.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(b) -+ integer(8), value :: b -+ b = b + 1 -+ print *, b -+end -diff --git a/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/fortran_func019.f90 b/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/fortran_func019.f90 -new file mode 100644 -index 0000000..5d65e3e ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/fortran_func019.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(b) -+ integer(8), value :: b -+ b = b + 1 -+ print *, b -+end -diff --git a/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/fortran_func020.f90 b/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/fortran_func020.f90 -new file mode 100644 -index 0000000..5d65e3e ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/fortran_func020.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(b) -+ integer(8), value :: b -+ b = b + 1 -+ print *, b -+end -diff --git a/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/fortran_func021.f90 b/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/fortran_func021.f90 -new file mode 100644 -index 0000000..2e3b41e ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/fortran_func021.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(i) -+ real(4), value :: i -+ i = 314159265358.979626 -+ print *, i -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/fortran_func022.f90 b/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/fortran_func022.f90 -new file mode 100644 -index 0000000..6fadb7b ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/fortran_func022.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(i) -+ real(8), value :: i -+ i = 314159265358.979626 -+ print *, i -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/fortran_func023.f90 b/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/fortran_func023.f90 -new file mode 100644 -index 0000000..7b23ee2 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/fortran_func023.f90 -@@ -0,0 +1,6 @@ -+subroutine f_func(i) -+ integer, parameter :: K = selected_real_kind(16) -+ real(K), value :: i -+ i = 314159265358.979626 -+ print *, i -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/fortran_func024.f90 b/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/fortran_func024.f90 -new file mode 100644 -index 0000000..ff15413 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/fortran_func024.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(i) -+ complex(4), value :: i -+ i = (-12345678.7654321, 1) -+ print *, i -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/fortran_func025.f90 b/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/fortran_func025.f90 -new file mode 100644 -index 0000000..526ad27 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/fortran_func025.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(i) -+ complex(8), value :: i -+ i = (-12345678.7654321, 1) -+ print *, i -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/fortran_func026.f90 b/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/fortran_func026.f90 -new file mode 100644 -index 0000000..bb6278f ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/fortran_func026.f90 -@@ -0,0 +1,6 @@ -+subroutine f_func(i) -+ integer, parameter :: K = selected_real_kind(16) -+ complex(K), value :: i -+ i = (-12345678.7654321, 1) -+ print *, i -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/fortran_func027.f90 b/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/fortran_func027.f90 -new file mode 100644 -index 0000000..af1f057 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/fortran_func027.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(i) -+ logical(1), value :: i -+ i = .TRUE. -+ print *, i -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/fortran_func028.f90 b/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/fortran_func028.f90 -new file mode 100644 -index 0000000..364a371 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/fortran_func028.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(i) -+ character(1), value :: i -+ i = 'a' -+ print *, i -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/run.sh b/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/run.sh -new file mode 100644 -index 0000000..ad3abb0 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/003_c_call_fortran_scalar_value/run.sh -@@ -0,0 +1,16 @@ -+for i in {001..028} -+do -+echo "------- test $i ------." -+#echo "----- gfortran result:" -+#gcc c_main$i.c -c -o c-test.o -+#gfortran fortran_func$i.f90 -fno-range-check -c -o fortran-test.o -+#gfortran fortran-test.o c-test.o -+#./a.out -+#rm *.o a.out -+echo "----- flang-new result : " -+clang c_main$i.c -c -o c-test.o -+flang-new fortran_func$i.f90 -c -o fortran-test.o -+flang-new -flang-experimental-exec c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+done -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/c_main001.c b/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/c_main001.c -new file mode 100644 -index 0000000..3366380 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/c_main001.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for scalar type and the scalar type is int using -+// iso_c_binding -+// -+#include -+extern void f_func_(int *i); -+int main() { -+ int i = 0; -+ f_func_(&i); -+ printf("%d\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/c_main002.c b/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/c_main002.c -new file mode 100644 -index 0000000..d1c3138 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/c_main002.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for scalar type and the scalar type is short -+// using iso_c_binding -+// -+#include -+extern void f_func_(short *i); -+int main() { -+ short i = 0; -+ f_func_(&i); -+ printf("%hd\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/c_main003.c b/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/c_main003.c -new file mode 100644 -index 0000000..d65634c ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/c_main003.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for scalar type and the scalar type is long -+// using iso_c_binding -+// -+#include -+extern void f_func_(long *i); -+int main() { -+ long i = 0; -+ f_func_(&i); -+ printf("%ld\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/c_main004.c b/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/c_main004.c -new file mode 100644 -index 0000000..31d4897 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/c_main004.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for scalar type and the scalar type is long long -+// using iso_c_binding -+// -+#include -+extern void f_func_(long long *i); -+int main() { -+ long long i = 0; -+ f_func_(&i); -+ printf("%Ld\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/c_main005.c b/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/c_main005.c -new file mode 100644 -index 0000000..b0648c7 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/c_main005.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for scalar type and the scalar type is signed -+// char using iso_c_binding -+// -+#include -+extern void f_func_(signed char *i); -+int main() { -+ signed char i = 0; -+ f_func_(&i); -+ printf("%c\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/c_main006.c b/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/c_main006.c -new file mode 100644 -index 0000000..b1b4e73 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/c_main006.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for scalar type and the scalar type is size_t -+// using iso_c_binding -+// -+#include -+extern void f_func_(size_t *i); -+int main() { -+ size_t i = 0; -+ f_func_(&i); -+ printf("%ld\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/c_main007.c b/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/c_main007.c -new file mode 100644 -index 0000000..6862145 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/c_main007.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for scalar type and the scalar type is int8_t -+// using iso_c_binding -+// -+#include -+#include -+extern void f_func_(int8_t *i); -+int main() { -+ int8_t i = 0; -+ f_func_(&i); -+ printf("%hhd\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/c_main008.c b/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/c_main008.c -new file mode 100644 -index 0000000..1f33ad9 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/c_main008.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for scalar type and the scalar type is int16_t -+// using iso_c_binding -+// -+#include -+#include -+extern void f_func_(int16_t *i); -+int main() { -+ int16_t i = 0; -+ f_func_(&i); -+ printf("%hd\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/c_main009.c b/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/c_main009.c -new file mode 100644 -index 0000000..37a1bd9 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/c_main009.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for scalar type and the scalar type is int32_t -+// using iso_c_binding -+// -+#include -+#include -+extern void f_func_(int32_t *i); -+int main() { -+ int32_t i = 0; -+ f_func_(&i); -+ printf("%d\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/c_main010.c b/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/c_main010.c -new file mode 100644 -index 0000000..82745a9 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/c_main010.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for scalar type and the scalar type is int64_t -+// using iso_c_binding -+// -+#include -+#include -+extern void f_func_(int64_t *i); -+int main() { -+ int64_t i = 0; -+ f_func_(&i); -+ printf("%ld\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/c_main011.c b/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/c_main011.c -new file mode 100644 -index 0000000..5326328 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/c_main011.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for scalar type and the scalar type is -+// int_least8_t using iso_c_binding -+// -+#include -+#include -+extern void f_func_(int_least8_t *i); -+int main() { -+ int_least8_t i = 0; -+ f_func_(&i); -+ printf("%hhd\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/c_main012.c b/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/c_main012.c -new file mode 100644 -index 0000000..2c85dd7 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/c_main012.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for scalar type and the scalar type is -+// int_least16_t using iso_c_binding -+// -+#include -+#include -+extern void f_func_(int_least16_t *i); -+int main() { -+ int_least16_t i = 0; -+ f_func_(&i); -+ printf("%hd\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/c_main013.c b/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/c_main013.c -new file mode 100644 -index 0000000..c4f54d4 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/c_main013.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for scalar type and the scalar type is -+// int_least32_t using iso_c_binding -+// -+#include -+#include -+extern void f_func_(int_least32_t *i); -+int main() { -+ int_least32_t i = 0; -+ f_func_(&i); -+ printf("%d\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/c_main014.c b/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/c_main014.c -new file mode 100644 -index 0000000..8885983 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/c_main014.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for scalar type and the scalar type is -+// int_least64_t using iso_c_binding -+// -+#include -+#include -+extern void f_func_(int_least64_t *i); -+int main() { -+ int_least64_t i = 0; -+ f_func_(&i); -+ printf("%ld\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/c_main015.c b/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/c_main015.c -new file mode 100644 -index 0000000..62b01f8 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/c_main015.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for scalar type and the scalar type is -+// int_fast8_t using iso_c_binding -+// -+#include -+#include -+extern void f_func_(int_fast8_t *i); -+int main() { -+ int_fast8_t i = 0; -+ f_func_(&i); -+ printf("%hhd\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/c_main016.c b/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/c_main016.c -new file mode 100644 -index 0000000..68ee278 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/c_main016.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for scalar type and the scalar type is -+// int_fast16_t using iso_c_binding -+// -+#include -+#include -+extern void f_func_(int_fast16_t *i); -+int main() { -+ int_fast16_t i = 0; -+ f_func_(&i); -+ printf("%ld\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/c_main017.c b/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/c_main017.c -new file mode 100644 -index 0000000..4e9518f ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/c_main017.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for scalar type and the scalar type is -+// int_fast32_t using iso_c_binding -+// -+#include -+#include -+extern void f_func_(int_fast32_t *i); -+int main() { -+ int_fast32_t i = 0; -+ f_func_(&i); -+ printf("%ld\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/c_main018.c b/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/c_main018.c -new file mode 100644 -index 0000000..4a0d01a ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/c_main018.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for scalar type and the scalar type is -+// int_fast64_t using iso_c_binding -+// -+#include -+#include -+extern void f_func_(int_fast64_t *i); -+int main() { -+ int_fast64_t i = 0; -+ f_func_(&i); -+ printf("%ld\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/c_main019.c b/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/c_main019.c -new file mode 100644 -index 0000000..26c6db9 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/c_main019.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for scalar type and the scalar type is intmax_t -+// using iso_c_binding -+// -+#include -+#include -+extern void f_func_(intmax_t *i); -+int main() { -+ intmax_t i = 0; -+ f_func_(&i); -+ printf("%ld\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/c_main020.c b/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/c_main020.c -new file mode 100644 -index 0000000..67f97d8 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/c_main020.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for scalar type and the scalar type is intptr_t -+// using iso_c_binding -+// -+#include -+#include -+extern void f_func_(intptr_t *i); -+int main() { -+ intptr_t i = 0; -+ f_func_(&i); -+ printf("%ld\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/c_main021.c b/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/c_main021.c -new file mode 100644 -index 0000000..ae25967 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/c_main021.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for scalar type and the scalar type is float -+// using iso_c_binding -+// -+#include -+#include -+extern void f_func_(float *i); -+int main() { -+ float i = 0; -+ f_func_(&i); -+ printf("%0.20f\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/c_main022.c b/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/c_main022.c -new file mode 100644 -index 0000000..6939356 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/c_main022.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for scalar type and the scalar type is double -+// using iso_c_binding -+// -+#include -+#include -+extern void f_func_(double *i); -+int main() { -+ double i = 0; -+ f_func_(&i); -+ printf("%0.20lf\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/c_main023.c b/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/c_main023.c -new file mode 100644 -index 0000000..4aedaa7 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/c_main023.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for scalar type and the scalar type is long -+// double using iso_c_binding -+// -+#include -+#include -+extern void f_func_(long double *i); -+int main() { -+ long double i = 0; -+ f_func_(&i); -+ printf("%0.20Lf\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/c_main024.c b/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/c_main024.c -new file mode 100644 -index 0000000..cf33e0d ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/c_main024.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for scalar type and the scalar type is float -+// _Complex using iso_c_binding -+// -+#include -+#include -+extern void f_func_(float _Complex *i); -+int main() { -+ float _Complex i; -+ f_func_(&i); -+ printf("%0.20f + %0.20fi\n", creal(i), cimag(i)); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/c_main025.c b/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/c_main025.c -new file mode 100644 -index 0000000..ce3a762 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/c_main025.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for scalar type and the scalar type is double -+// _Complex using iso_c_binding -+// -+#include -+#include -+extern void f_func_(double _Complex *i); -+int main() { -+ double _Complex i; -+ f_func_(&i); -+ printf("%0.20lf + %0.20lfi\n", creal(i), cimag(i)); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/c_main026.c b/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/c_main026.c -new file mode 100644 -index 0000000..4666cef ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/c_main026.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for scalar type and the scalar type is double -+// _Complex using iso_c_binding -+// -+#include -+#include -+extern void f_func_(long double _Complex *i); -+int main() { -+ long double _Complex i; -+ f_func_(&i); -+ printf("%0.20lf + %0.20lfi\n", creal(i), cimag(i)); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/c_main027.c b/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/c_main027.c -new file mode 100644 -index 0000000..9192175 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/c_main027.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for scalar type and the scalar type is _Bool -+// using iso_c_binding -+// -+#include -+#include -+extern void f_func_(_Bool *i); -+int main() { -+ _Bool i = 0; -+ f_func_(&i); -+ printf("%d\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/c_main028.c b/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/c_main028.c -new file mode 100644 -index 0000000..4ade3e9 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/c_main028.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for scalar type and the scalar type is char -+// using iso_c_binding -+// -+#include -+#include -+extern void f_func_(char *i); -+int main() { -+ char i; -+ f_func_(&i); -+ printf("%c\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/fortran_func001.f90 b/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/fortran_func001.f90 -new file mode 100644 -index 0000000..a89bcce ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/fortran_func001.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(i) -+ use iso_c_binding -+ integer(C_INT) :: i -+ i = 2147483647 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/fortran_func002.f90 b/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/fortran_func002.f90 -new file mode 100644 -index 0000000..a8c4269 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/fortran_func002.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(i) -+ use iso_c_binding -+ integer(C_SHORT) :: i -+ i = 32767 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/fortran_func003.f90 b/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/fortran_func003.f90 -new file mode 100644 -index 0000000..2e0a857 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/fortran_func003.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(i) -+ use iso_c_binding -+ integer(C_LONG) :: i -+ i = 9223372036854775807 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/fortran_func004.f90 b/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/fortran_func004.f90 -new file mode 100644 -index 0000000..0499479 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/fortran_func004.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(i) -+ use iso_c_binding -+ integer(C_LONG_LONG) :: i -+ i = 9223372036854775807 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/fortran_func005.f90 b/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/fortran_func005.f90 -new file mode 100644 -index 0000000..bd9ca6c ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/fortran_func005.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(i) -+ use iso_c_binding -+ integer(C_SIGNED_CHAR) :: i -+ i = 97 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/fortran_func006.f90 b/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/fortran_func006.f90 -new file mode 100644 -index 0000000..bfb200a ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/fortran_func006.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(i) -+ use iso_c_binding -+ integer(C_SIZE_T) :: i -+ i = 9223372036854775807 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/fortran_func007.f90 b/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/fortran_func007.f90 -new file mode 100644 -index 0000000..286f948 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/fortran_func007.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(i) -+ use iso_c_binding -+ integer(C_INT8_T) :: i -+ i = 127 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/fortran_func008.f90 b/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/fortran_func008.f90 -new file mode 100644 -index 0000000..01fe7ae ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/fortran_func008.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(i) -+ use iso_c_binding -+ integer(C_INT16_T) :: i -+ i = 32767 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/fortran_func009.f90 b/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/fortran_func009.f90 -new file mode 100644 -index 0000000..1b0e978 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/fortran_func009.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(i) -+ use iso_c_binding -+ integer(C_INT32_T) :: i -+ i = 2147483647 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/fortran_func010.f90 b/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/fortran_func010.f90 -new file mode 100644 -index 0000000..8268291 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/fortran_func010.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(i) -+ use iso_c_binding -+ integer(C_INT64_T) :: i -+ i = 9223372036854775807 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/fortran_func011.f90 b/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/fortran_func011.f90 -new file mode 100644 -index 0000000..b4cc050 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/fortran_func011.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(i) -+ use iso_c_binding -+ integer(C_INT_LEAST8_T) :: i -+ i = 127 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/fortran_func012.f90 b/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/fortran_func012.f90 -new file mode 100644 -index 0000000..c70c162 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/fortran_func012.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(i) -+ use iso_c_binding -+ integer(C_INT_LEAST16_T) :: i -+ i = 32767 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/fortran_func013.f90 b/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/fortran_func013.f90 -new file mode 100644 -index 0000000..b15a907 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/fortran_func013.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(i) -+ use iso_c_binding -+ integer(C_INT_LEAST32_T) :: i -+ i = 2147483647 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/fortran_func014.f90 b/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/fortran_func014.f90 -new file mode 100644 -index 0000000..38387e0 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/fortran_func014.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(i) -+ use iso_c_binding -+ integer(C_INT_LEAST64_T) :: i -+ i = 9223372036854775807 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/fortran_func015.f90 b/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/fortran_func015.f90 -new file mode 100644 -index 0000000..53aa505 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/fortran_func015.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(i) -+ use iso_c_binding -+ integer(C_INT_FAST8_T) :: i -+ i = 127 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/fortran_func016.f90 b/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/fortran_func016.f90 -new file mode 100644 -index 0000000..07004c1 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/fortran_func016.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(i) -+ use iso_c_binding -+ integer(C_INT_FAST16_T) :: i -+ i = 9223372036854775807 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/fortran_func017.f90 b/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/fortran_func017.f90 -new file mode 100644 -index 0000000..17f543d ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/fortran_func017.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(i) -+ use iso_c_binding -+ integer(C_INT_FAST32_T) :: i -+ i = 9223372036854775807 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/fortran_func018.f90 b/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/fortran_func018.f90 -new file mode 100644 -index 0000000..428ae53 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/fortran_func018.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(i) -+ use iso_c_binding -+ integer(C_INT_FAST64_T) :: i -+ i = 9223372036854775807 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/fortran_func019.f90 b/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/fortran_func019.f90 -new file mode 100644 -index 0000000..4229ca5 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/fortran_func019.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(i) -+ use iso_c_binding -+ integer(C_INTMAX_T) :: i -+ i = 9223372036854775807 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/fortran_func020.f90 b/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/fortran_func020.f90 -new file mode 100644 -index 0000000..41e71b3 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/fortran_func020.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(i) -+ use iso_c_binding -+ integer(C_INTPTR_T) :: i -+ i = 9223372036854775807 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/fortran_func021.f90 b/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/fortran_func021.f90 -new file mode 100644 -index 0000000..5c83130 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/fortran_func021.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(i) -+ use iso_c_binding -+ real(C_FLOAT) :: i -+ i = 314159265358.979626 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/fortran_func022.f90 b/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/fortran_func022.f90 -new file mode 100644 -index 0000000..e16e2af ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/fortran_func022.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(i) -+ use iso_c_binding -+ real(C_DOUBLE) :: i -+ i = 314159265358.979626 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/fortran_func023.f90 b/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/fortran_func023.f90 -new file mode 100644 -index 0000000..8794877 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/fortran_func023.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(i) -+ use iso_c_binding -+ real(C_LONG_DOUBLE) :: i -+ i = 314159265358.979626 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/fortran_func024.f90 b/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/fortran_func024.f90 -new file mode 100644 -index 0000000..bb98e62 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/fortran_func024.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(i) -+ use iso_c_binding -+ complex(C_FLOAT_COMPLEX) :: i -+ i = (-12345678.7654321, 1) -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/fortran_func025.f90 b/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/fortran_func025.f90 -new file mode 100644 -index 0000000..378d820 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/fortran_func025.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(i) -+ use iso_c_binding -+ complex(C_DOUBLE_COMPLEX) :: i -+ i = (-12345678.7654321, 1) -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/fortran_func026.f90 b/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/fortran_func026.f90 -new file mode 100644 -index 0000000..ee0c90a ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/fortran_func026.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(i) -+ use iso_c_binding -+ complex(C_LONG_DOUBLE_COMPLEX) :: i -+ i = (-12345678.7654321, 1) -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/fortran_func027.f90 b/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/fortran_func027.f90 -new file mode 100644 -index 0000000..61299c7 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/fortran_func027.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(i) -+ use iso_c_binding -+ logical(C_BOOL) :: i -+ i = .TRUE. -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/fortran_func028.f90 b/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/fortran_func028.f90 -new file mode 100644 -index 0000000..ce5cc88 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/fortran_func028.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(i) -+ use iso_c_binding -+ character(C_CHAR) :: i -+ i = 'a' -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/run.sh b/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/run.sh -new file mode 100644 -index 0000000..ad3abb0 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/004_c_call_fortran_scalar_iso_c_binding/run.sh -@@ -0,0 +1,16 @@ -+for i in {001..028} -+do -+echo "------- test $i ------." -+#echo "----- gfortran result:" -+#gcc c_main$i.c -c -o c-test.o -+#gfortran fortran_func$i.f90 -fno-range-check -c -o fortran-test.o -+#gfortran fortran-test.o c-test.o -+#./a.out -+#rm *.o a.out -+echo "----- flang-new result : " -+clang c_main$i.c -c -o c-test.o -+flang-new fortran_func$i.f90 -c -o fortran-test.o -+flang-new -flang-experimental-exec c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+done -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/c_main001.c b/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/c_main001.c -new file mode 100644 -index 0000000..93e2e96 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/c_main001.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the scalar type with value attribute and the -+// scalar type is int with bindc -+// -+#include -+extern void f_func_(int i); -+int main() { -+ int res = 12; -+ f_func_(res); -+ printf("%d\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/c_main002.c b/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/c_main002.c -new file mode 100644 -index 0000000..e6c7ffc ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/c_main002.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the scalar type with value attribute and the -+// scalar type is short with bindc -+// -+#include -+extern void f_func_(short i); -+int main() { -+ short res = 12; -+ f_func_(res); -+ printf("%hd\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/c_main003.c b/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/c_main003.c -new file mode 100644 -index 0000000..0c15160 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/c_main003.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the scalar type with value attribute and the -+// scalar type is long with bindc -+// -+#include -+extern void f_func_(long i); -+int main() { -+ long res = 12; -+ f_func_(res); -+ printf("%ld\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/c_main004.c b/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/c_main004.c -new file mode 100644 -index 0000000..c8a4326 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/c_main004.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the scalar type with value attribute and the -+// scalar type is long long with bindc -+// -+#include -+extern void f_func_(long long i); -+int main() { -+ long long res = 12; -+ f_func_(res); -+ printf("%Ld\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/c_main005.c b/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/c_main005.c -new file mode 100644 -index 0000000..dbfeab0 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/c_main005.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the scalar type with value attribute and the -+// scalar type is signed char with bindc -+// -+#include -+extern void f_func_(signed char i); -+int main() { -+ signed char res = 12; -+ f_func_(res); -+ printf("%hhd\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/c_main006.c b/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/c_main006.c -new file mode 100644 -index 0000000..bd4992d ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/c_main006.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the scalar type with value attribute and the -+// scalar type is size_t with bindc -+// -+#include -+extern void f_func_(size_t i); -+int main() { -+ size_t res = 12; -+ f_func_(res); -+ printf("%ld\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/c_main007.c b/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/c_main007.c -new file mode 100644 -index 0000000..a4de5e1 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/c_main007.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the scalar type with value attribute and the -+// scalar type is int8_t with bindc -+// -+#include -+#include -+extern void f_func_(int8_t i); -+int main() { -+ int8_t res = 12; -+ f_func_(res); -+ printf("%hhd\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/c_main008.c b/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/c_main008.c -new file mode 100644 -index 0000000..51b166b ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/c_main008.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the scalar type with value attribute and the -+// scalar type is int16_t with bindc -+// -+#include -+#include -+extern void f_func_(int16_t i); -+int main() { -+ int16_t res = 12; -+ f_func_(res); -+ printf("%hd\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/c_main009.c b/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/c_main009.c -new file mode 100644 -index 0000000..982a2a0 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/c_main009.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the scalar type with value attribute and the -+// scalar type is int32_t with bindc -+// -+#include -+#include -+extern void f_func_(int32_t i); -+int main() { -+ int32_t res = 12; -+ f_func_(res); -+ printf("%d\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/c_main010.c b/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/c_main010.c -new file mode 100644 -index 0000000..ff12da7 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/c_main010.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the scalar type with value attribute and the -+// scalar type is int64_t with bindc -+// -+#include -+#include -+extern void f_func_(int64_t i); -+int main() { -+ int64_t res = 12; -+ f_func_(res); -+ printf("%ld\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/c_main011.c b/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/c_main011.c -new file mode 100644 -index 0000000..ff2cdfd ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/c_main011.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the scalar type with value attribute and the -+// scalar type is int_least8_t with bindc -+// -+#include -+#include -+extern void f_func_(int_least8_t i); -+int main() { -+ int_least8_t res = 12; -+ f_func_(res); -+ printf("%hhd\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/c_main012.c b/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/c_main012.c -new file mode 100644 -index 0000000..8a23a89 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/c_main012.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the scalar type with value attribute and the -+// scalar type is int_least16_t with bindc -+// -+#include -+#include -+extern void f_func_(int_least16_t i); -+int main() { -+ int_least16_t res = 12; -+ f_func_(res); -+ printf("%hd\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/c_main013.c b/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/c_main013.c -new file mode 100644 -index 0000000..6257c07 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/c_main013.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the scalar type with value attribute and the -+// scalar type is int_least32_t with bindc -+// -+#include -+#include -+extern void f_func_(int_least32_t i); -+int main() { -+ int_least32_t res = 12; -+ f_func_(res); -+ printf("%d\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/c_main014.c b/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/c_main014.c -new file mode 100644 -index 0000000..21b8378 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/c_main014.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the scalar type with value attribute and the -+// scalar type is int_least64_t with bindc -+// -+#include -+#include -+extern void f_func_(int_least64_t i); -+int main() { -+ int_least64_t res = 12; -+ f_func_(res); -+ printf("%ld\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/c_main015.c b/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/c_main015.c -new file mode 100644 -index 0000000..822f85a ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/c_main015.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the scalar type with value attribute and the -+// scalar type is int_fast8_t with bindc -+// -+#include -+#include -+extern void f_func_(int_fast8_t i); -+int main() { -+ int_fast8_t res = 12; -+ f_func_(res); -+ printf("%hhd\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/c_main016.c b/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/c_main016.c -new file mode 100644 -index 0000000..492be5b ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/c_main016.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the scalar type with value attribute and the -+// scalar type is int_fast16_t with bindc -+// -+#include -+#include -+extern void f_func_(int_fast16_t i); -+int main() { -+ int_fast16_t res = 12; -+ f_func_(res); -+ printf("%ld\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/c_main017.c b/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/c_main017.c -new file mode 100644 -index 0000000..c49574a ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/c_main017.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the scalar type with value attribute and the -+// scalar type is int_fast32_t with bindc -+// -+#include -+#include -+extern void f_func_(int_fast32_t i); -+int main() { -+ int_fast32_t res = 12; -+ f_func_(res); -+ printf("%ld\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/c_main018.c b/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/c_main018.c -new file mode 100644 -index 0000000..cad9eef ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/c_main018.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the scalar type with value attribute and the -+// scalar type is int_fast64_t with bindc -+// -+#include -+#include -+extern void f_func_(int_fast64_t i); -+int main() { -+ int_fast64_t res = 12; -+ f_func_(res); -+ printf("%ld\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/c_main019.c b/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/c_main019.c -new file mode 100644 -index 0000000..2c69046 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/c_main019.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the scalar type with value attribute and the -+// scalar type is intmax_t with bindc -+// -+#include -+#include -+extern void f_func_(intmax_t i); -+int main() { -+ intmax_t res = 12; -+ f_func_(res); -+ printf("%ld\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/c_main020.c b/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/c_main020.c -new file mode 100644 -index 0000000..fd25b96 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/c_main020.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the scalar type with value attribute and the -+// scalar type is intptr_t with bindc -+// -+#include -+#include -+extern void f_func_(intptr_t i); -+int main() { -+ intptr_t res = 12; -+ f_func_(res); -+ printf("%ld\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/c_main021.c b/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/c_main021.c -new file mode 100644 -index 0000000..27131ff ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/c_main021.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the scalar type with value attribute and the -+// scalar type is float with bindc -+// -+#include -+extern void f_func_(float i); -+int main() { -+ float i = 3.14; -+ f_func_(i); -+ printf("%0.20f\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/c_main022.c b/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/c_main022.c -new file mode 100644 -index 0000000..926e1cd ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/c_main022.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the scalar type with value attribute and the -+// scalar type is double with bindc -+// -+#include -+extern void f_func_(double i); -+int main() { -+ double i = 3.14; -+ f_func_(i); -+ printf("%0.20lf\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/c_main023.c b/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/c_main023.c -new file mode 100644 -index 0000000..5cd25a0 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/c_main023.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the scalar type with value attribute and the -+// scalar type is long double with bindc -+// -+#include -+extern void f_func_(long double i); -+int main() { -+ long double i = 3.14; -+ f_func_(i); -+ printf("%0.20Lf\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/c_main024.c b/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/c_main024.c -new file mode 100644 -index 0000000..4488766 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/c_main024.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the scalar type with value attribute and the -+// scalar type is float _Complex with bindc -+// -+#include -+#include -+extern void f_func_(float _Complex i); -+int main() { -+ float _Complex i = 5.0f + 1.0if; -+ f_func_(i); -+ printf("%0.20f + %0.20fi\n", creal(i), cimag(i)); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/c_main025.c b/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/c_main025.c -new file mode 100644 -index 0000000..a612e9f ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/c_main025.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the scalar type with value attribute and the -+// scalar type is double _Complex with bindc -+// -+#include -+#include -+extern void f_func_(double _Complex i); -+int main() { -+ double _Complex i = 5.0f + 1.0if; -+ f_func_(i); -+ printf("%0.20f + %0.20fi\n", creal(i), cimag(i)); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/c_main026.c b/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/c_main026.c -new file mode 100644 -index 0000000..e237729 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/c_main026.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the scalar type with value attribute and the -+// scalar type is long double _Complex with bindc -+// -+#include -+#include -+extern void f_func_(long double _Complex i); -+int main() { -+ long double _Complex i = 5.0f + 1.0if; -+ f_func_(i); -+ printf("%0.20f + %0.20fi\n", creal(i), cimag(i)); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/c_main027.c b/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/c_main027.c -new file mode 100644 -index 0000000..463cb21 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/c_main027.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the scalar type with value attribute and the -+// scalar type is _Bool with bindc -+// -+#include -+#include -+extern void f_func_(_Bool i); -+int main() { -+ _Bool i = 0; -+ f_func_(i); -+ printf("%d\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/c_main028.c b/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/c_main028.c -new file mode 100644 -index 0000000..4152530 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/c_main028.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the scalar type with value attribute and the -+// scalar type is char with bindc -+// -+#include -+#include -+extern void f_func_(char i); -+int main() { -+ char i = 'z'; -+ f_func_(i); -+ printf("%c\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/fortran_func001.f90 b/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/fortran_func001.f90 -new file mode 100644 -index 0000000..de93201 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/fortran_func001.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(b) bind(c, name = "f_func_") -+ integer, value :: b -+ b = b + 1 -+ print *, b -+end -diff --git a/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/fortran_func002.f90 b/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/fortran_func002.f90 -new file mode 100644 -index 0000000..912b855 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/fortran_func002.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(b) bind(c, name = "f_func_") -+ integer(2), value :: b -+ b = b + 1 -+ print *, b -+end -diff --git a/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/fortran_func003.f90 b/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/fortran_func003.f90 -new file mode 100644 -index 0000000..e3bdc20 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/fortran_func003.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(b) bind(c, name = "f_func_") -+ integer(8), value :: b -+ b = b + 1 -+ print *, b -+end -diff --git a/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/fortran_func004.f90 b/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/fortran_func004.f90 -new file mode 100644 -index 0000000..e3bdc20 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/fortran_func004.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(b) bind(c, name = "f_func_") -+ integer(8), value :: b -+ b = b + 1 -+ print *, b -+end -diff --git a/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/fortran_func005.f90 b/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/fortran_func005.f90 -new file mode 100644 -index 0000000..b4d2fe2 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/fortran_func005.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(b) bind(c, name = "f_func_") -+ integer(1), value :: b -+ b = b + 1 -+ print *, b -+end -diff --git a/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/fortran_func006.f90 b/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/fortran_func006.f90 -new file mode 100644 -index 0000000..e3bdc20 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/fortran_func006.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(b) bind(c, name = "f_func_") -+ integer(8), value :: b -+ b = b + 1 -+ print *, b -+end -diff --git a/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/fortran_func007.f90 b/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/fortran_func007.f90 -new file mode 100644 -index 0000000..b4d2fe2 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/fortran_func007.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(b) bind(c, name = "f_func_") -+ integer(1), value :: b -+ b = b + 1 -+ print *, b -+end -diff --git a/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/fortran_func008.f90 b/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/fortran_func008.f90 -new file mode 100644 -index 0000000..912b855 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/fortran_func008.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(b) bind(c, name = "f_func_") -+ integer(2), value :: b -+ b = b + 1 -+ print *, b -+end -diff --git a/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/fortran_func009.f90 b/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/fortran_func009.f90 -new file mode 100644 -index 0000000..35f23ce ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/fortran_func009.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(b) bind(c, name = "f_func_") -+ integer(4), value :: b -+ b = b + 1 -+ print *, b -+end -diff --git a/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/fortran_func010.f90 b/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/fortran_func010.f90 -new file mode 100644 -index 0000000..e3bdc20 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/fortran_func010.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(b) bind(c, name = "f_func_") -+ integer(8), value :: b -+ b = b + 1 -+ print *, b -+end -diff --git a/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/fortran_func011.f90 b/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/fortran_func011.f90 -new file mode 100644 -index 0000000..b4d2fe2 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/fortran_func011.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(b) bind(c, name = "f_func_") -+ integer(1), value :: b -+ b = b + 1 -+ print *, b -+end -diff --git a/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/fortran_func012.f90 b/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/fortran_func012.f90 -new file mode 100644 -index 0000000..912b855 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/fortran_func012.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(b) bind(c, name = "f_func_") -+ integer(2), value :: b -+ b = b + 1 -+ print *, b -+end -diff --git a/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/fortran_func013.f90 b/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/fortran_func013.f90 -new file mode 100644 -index 0000000..35f23ce ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/fortran_func013.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(b) bind(c, name = "f_func_") -+ integer(4), value :: b -+ b = b + 1 -+ print *, b -+end -diff --git a/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/fortran_func014.f90 b/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/fortran_func014.f90 -new file mode 100644 -index 0000000..e3bdc20 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/fortran_func014.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(b) bind(c, name = "f_func_") -+ integer(8), value :: b -+ b = b + 1 -+ print *, b -+end -diff --git a/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/fortran_func015.f90 b/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/fortran_func015.f90 -new file mode 100644 -index 0000000..b4d2fe2 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/fortran_func015.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(b) bind(c, name = "f_func_") -+ integer(1), value :: b -+ b = b + 1 -+ print *, b -+end -diff --git a/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/fortran_func016.f90 b/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/fortran_func016.f90 -new file mode 100644 -index 0000000..e3bdc20 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/fortran_func016.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(b) bind(c, name = "f_func_") -+ integer(8), value :: b -+ b = b + 1 -+ print *, b -+end -diff --git a/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/fortran_func017.f90 b/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/fortran_func017.f90 -new file mode 100644 -index 0000000..e3bdc20 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/fortran_func017.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(b) bind(c, name = "f_func_") -+ integer(8), value :: b -+ b = b + 1 -+ print *, b -+end -diff --git a/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/fortran_func018.f90 b/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/fortran_func018.f90 -new file mode 100644 -index 0000000..e3bdc20 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/fortran_func018.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(b) bind(c, name = "f_func_") -+ integer(8), value :: b -+ b = b + 1 -+ print *, b -+end -diff --git a/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/fortran_func019.f90 b/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/fortran_func019.f90 -new file mode 100644 -index 0000000..e3bdc20 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/fortran_func019.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(b) bind(c, name = "f_func_") -+ integer(8), value :: b -+ b = b + 1 -+ print *, b -+end -diff --git a/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/fortran_func020.f90 b/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/fortran_func020.f90 -new file mode 100644 -index 0000000..e3bdc20 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/fortran_func020.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(b) bind(c, name = "f_func_") -+ integer(8), value :: b -+ b = b + 1 -+ print *, b -+end -diff --git a/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/fortran_func021.f90 b/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/fortran_func021.f90 -new file mode 100644 -index 0000000..671133b ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/fortran_func021.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ real(4), value :: i -+ i = 314159265358.979626 -+ print *, i -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/fortran_func022.f90 b/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/fortran_func022.f90 -new file mode 100644 -index 0000000..b14b9b9 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/fortran_func022.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ real(8), value :: i -+ i = 314159265358.979626 -+ print *, i -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/fortran_func023.f90 b/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/fortran_func023.f90 -new file mode 100644 -index 0000000..afc5e87 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/fortran_func023.f90 -@@ -0,0 +1,6 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ integer, parameter :: K = selected_real_kind(16) -+ real(K), value :: i -+ i = 314159265358.979626 -+ print *, i -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/fortran_func024.f90 b/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/fortran_func024.f90 -new file mode 100644 -index 0000000..a043f8e ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/fortran_func024.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ complex(4), value :: i -+ i = (-12345678.7654321, 1) -+ print *, i -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/fortran_func025.f90 b/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/fortran_func025.f90 -new file mode 100644 -index 0000000..cc4e165 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/fortran_func025.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ complex(8), value :: i -+ i = (-12345678.7654321, 1) -+ print *, i -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/fortran_func026.f90 b/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/fortran_func026.f90 -new file mode 100644 -index 0000000..a256773 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/fortran_func026.f90 -@@ -0,0 +1,6 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ integer, parameter :: K = selected_real_kind(16) -+ complex(K), value :: i -+ i = (-12345678.7654321, 1) -+ print *, i -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/fortran_func027.f90 b/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/fortran_func027.f90 -new file mode 100644 -index 0000000..3a01854 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/fortran_func027.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ logical(1), value :: i -+ i = .TRUE. -+ print *, i -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/fortran_func028.f90 b/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/fortran_func028.f90 -new file mode 100644 -index 0000000..7881678 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/fortran_func028.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ character(1), value :: i -+ i = 'a' -+ print *, i -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/run.sh b/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/run.sh -new file mode 100644 -index 0000000..ad3abb0 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/005_c_call_fortran_scalar_bindc_value/run.sh -@@ -0,0 +1,16 @@ -+for i in {001..028} -+do -+echo "------- test $i ------." -+#echo "----- gfortran result:" -+#gcc c_main$i.c -c -o c-test.o -+#gfortran fortran_func$i.f90 -fno-range-check -c -o fortran-test.o -+#gfortran fortran-test.o c-test.o -+#./a.out -+#rm *.o a.out -+echo "----- flang-new result : " -+clang c_main$i.c -c -o c-test.o -+flang-new fortran_func$i.f90 -c -o fortran-test.o -+flang-new -flang-experimental-exec c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+done -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/c_main001.c b/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/c_main001.c -new file mode 100644 -index 0000000..621bebb ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/c_main001.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the array type and the array type is int -+// -+#include -+extern void f_func_(int *i); -+int main() { -+ int i[5]; -+ f_func_(i); -+ for(int n = 0; n < 5; n++) { -+ printf("%d\n", i[n]); -+ } -+} -diff --git a/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/c_main002.c b/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/c_main002.c -new file mode 100644 -index 0000000..c09f25d ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/c_main002.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the array type and the array type is short -+// -+#include -+extern void f_func_(short *i); -+int main() { -+ short i[5]; -+ f_func_(i); -+ for(int n = 0; n < 5; n++) { -+ printf("%d\n", i[n]); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/c_main003.c b/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/c_main003.c -new file mode 100644 -index 0000000..661840e ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/c_main003.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the array type and the array type is long -+// -+#include -+extern void f_func_(long *i); -+int main() { -+ long i[5]; -+ f_func_(i); -+ for(int n = 0; n < 5; n++) { -+ printf("%ld\n", i[n]); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/c_main004.c b/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/c_main004.c -new file mode 100644 -index 0000000..ad4d69c ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/c_main004.c -@@ -0,0 +1,12 @@ -+// Test c call fortran for the array type and the array type is long -+// long -+// -+#include -+extern void f_func_(long long *i); -+int main() { -+ long long i[5]; -+ f_func_(i); -+ for(int n = 0; n < 5; n++) { -+ printf("%Ld\n", i[n]); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/c_main005.c b/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/c_main005.c -new file mode 100644 -index 0000000..23ad3c8 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/c_main005.c -@@ -0,0 +1,12 @@ -+// Test c call fortran for the array type and the array type is signed -+// char -+// -+#include -+extern void f_func_(signed char *i); -+int main() { -+ signed char i[5]; -+ f_func_(i); -+ for(int n = 0; n < 5; n++) { -+ printf("%hhd\n", i[n]); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/c_main006.c b/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/c_main006.c -new file mode 100644 -index 0000000..f474697 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/c_main006.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the array type and the array type is size_t -+// -+#include -+extern void f_func_(size_t *i); -+int main() { -+ size_t i[5]; -+ f_func_(i); -+ for(int n = 0; n < 5; n++) { -+ printf("%ld\n", i[n]); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/c_main007.c b/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/c_main007.c -new file mode 100644 -index 0000000..9d94602 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/c_main007.c -@@ -0,0 +1,12 @@ -+// Test c call fortran for the array type and the array type is int8_t -+// -+#include -+#include -+extern void f_func_(int8_t *i); -+int main() { -+ int8_t i[5]; -+ f_func_(i); -+ for(int n = 0; n < 5; n++) { -+ printf("%hhd\n", i[n]); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/c_main008.c b/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/c_main008.c -new file mode 100644 -index 0000000..6854e0f ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/c_main008.c -@@ -0,0 +1,12 @@ -+// Test c call fortran for the array type and the array type is int16_t -+// -+#include -+#include -+extern void f_func_(int16_t *i); -+int main() { -+ int16_t i[5]; -+ f_func_(i); -+ for(int n = 0; n < 5; n++) { -+ printf("%hd\n", i[n]); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/c_main009.c b/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/c_main009.c -new file mode 100644 -index 0000000..a9be21e ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/c_main009.c -@@ -0,0 +1,12 @@ -+// Test c call fortran for the array type and the array type is int32_t -+// -+#include -+#include -+extern void f_func_(int32_t *i); -+int main() { -+ int32_t i[5]; -+ f_func_(i); -+ for(int n = 0; n < 5; n++) { -+ printf("%d\n", i[n]); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/c_main010.c b/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/c_main010.c -new file mode 100644 -index 0000000..cbdf3bb ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/c_main010.c -@@ -0,0 +1,12 @@ -+// Test c call fortran for the array type and the array type is int64_t -+// -+#include -+#include -+extern void f_func_(int64_t *i); -+int main() { -+ int64_t i[5]; -+ f_func_(i); -+ for(int n = 0; n < 5; n++) { -+ printf("%ld\n", i[n]); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/c_main011.c b/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/c_main011.c -new file mode 100644 -index 0000000..690ea3a ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/c_main011.c -@@ -0,0 +1,13 @@ -+// Test c call fortran for the array type and the array type is -+// int_least8_t -+// -+#include -+#include -+extern void f_func_(int_least8_t *i); -+int main() { -+ int_least8_t i[5]; -+ f_func_(i); -+ for(int n = 0; n < 5; n++) { -+ printf("%hhd\n", i[n]); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/c_main012.c b/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/c_main012.c -new file mode 100644 -index 0000000..89424aa ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/c_main012.c -@@ -0,0 +1,13 @@ -+// Test c call fortran for the array type and the array type is -+// int_least16_t -+// -+#include -+#include -+extern void f_func_(int_least16_t *i); -+int main() { -+ int_least16_t i[5]; -+ f_func_(i); -+ for(int n = 0; n < 5; n++) { -+ printf("%hd\n", i[n]); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/c_main013.c b/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/c_main013.c -new file mode 100644 -index 0000000..491e593 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/c_main013.c -@@ -0,0 +1,13 @@ -+// Test c call fortran for the array type and the array type is -+// int_least32_t -+// -+#include -+#include -+extern void f_func_(int_least32_t *i); -+int main() { -+ int_least32_t i[5]; -+ f_func_(i); -+ for(int n = 0; n < 5; n++) { -+ printf("%d\n", i[n]); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/c_main014.c b/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/c_main014.c -new file mode 100644 -index 0000000..8cbd80c ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/c_main014.c -@@ -0,0 +1,13 @@ -+// Test c call fortran for the array type and the array type is -+// int_least64_t -+// -+#include -+#include -+extern void f_func_(int_least64_t *i); -+int main() { -+ int_least64_t i[5]; -+ f_func_(i); -+ for(int n = 0; n < 5; n++) { -+ printf("%ld\n", i[n]); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/c_main015.c b/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/c_main015.c -new file mode 100644 -index 0000000..1e63863 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/c_main015.c -@@ -0,0 +1,13 @@ -+// Test c call fortran for the array type and the array type is -+// int_fast8_t -+// -+#include -+#include -+extern void f_func_(int_fast8_t *i); -+int main() { -+ int_fast8_t i[5]; -+ f_func_(i); -+ for(int n = 0; n < 5; n++) { -+ printf("%hhd\n", i[n]); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/c_main016.c b/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/c_main016.c -new file mode 100644 -index 0000000..e4fea02 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/c_main016.c -@@ -0,0 +1,13 @@ -+// Test c call fortran for the array type and the array type is -+// int_fast16_t -+// -+#include -+#include -+extern void f_func_(int_fast16_t *i); -+int main() { -+ int_fast16_t i[5]; -+ f_func_(i); -+ for(int n = 0; n < 5; n++) { -+ printf("%ld\n", i[n]); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/c_main017.c b/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/c_main017.c -new file mode 100644 -index 0000000..f8cbf67 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/c_main017.c -@@ -0,0 +1,13 @@ -+// Test c call fortran for the array type and the array type is -+// int_fast32_t -+// -+#include -+#include -+extern void f_func_(int_fast32_t *i); -+int main() { -+ int_fast32_t i[5]; -+ f_func_(i); -+ for(int n = 0; n < 5; n++) { -+ printf("%ld\n", i[n]); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/c_main018.c b/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/c_main018.c -new file mode 100644 -index 0000000..e9ebf24 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/c_main018.c -@@ -0,0 +1,13 @@ -+// Test c call fortran for the array type and the array type is -+// int_fast64_t -+// -+#include -+#include -+extern void f_func_(int_fast64_t *i); -+int main() { -+ int_fast64_t i[5]; -+ f_func_(i); -+ for(int n = 0; n < 5; n++) { -+ printf("%ld\n", i[n]); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/c_main019.c b/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/c_main019.c -new file mode 100644 -index 0000000..d35e1eb ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/c_main019.c -@@ -0,0 +1,13 @@ -+// Test c call fortran for the array type and the array type is -+// intmax_t -+// -+#include -+#include -+extern void f_func_(intmax_t *i); -+int main() { -+ intmax_t i[5]; -+ f_func_(i); -+ for(int n = 0; n < 5; n++) { -+ printf("%ld\n", i[n]); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/c_main020.c b/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/c_main020.c -new file mode 100644 -index 0000000..5bb25eb ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/c_main020.c -@@ -0,0 +1,13 @@ -+// Test c call fortran for the array type and the array type is -+// intptr_t -+// -+#include -+#include -+extern void f_func_(intptr_t *i); -+int main() { -+ intptr_t i[5]; -+ f_func_(i); -+ for(int n = 0; n < 5; n++) { -+ printf("%ld\n", i[n]); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/c_main021.c b/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/c_main021.c -new file mode 100644 -index 0000000..e8d8891 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/c_main021.c -@@ -0,0 +1,12 @@ -+// Test c call fortran for the array type and the array type is float -+// -+#include -+#include -+extern void f_func_(float *i); -+int main() { -+ float i[5]; -+ f_func_(i); -+ for(int n = 0; n < 5; n++) { -+ printf("%0.20f\n", i[n]); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/c_main022.c b/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/c_main022.c -new file mode 100644 -index 0000000..b284e25 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/c_main022.c -@@ -0,0 +1,12 @@ -+// Test c call fortran for the array type and the array type is double -+// -+#include -+#include -+extern void f_func_(double *i); -+int main() { -+ double i[5]; -+ f_func_(i); -+ for(int n = 0; n < 5; n++) { -+ printf("%0.20lf\n", i[n]); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/c_main023.c b/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/c_main023.c -new file mode 100644 -index 0000000..be8cf39 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/c_main023.c -@@ -0,0 +1,13 @@ -+// Test c call fortran for the array type and the array type is long -+// double -+// -+#include -+#include -+extern void f_func_(long double *i); -+int main() { -+ long double i[5]; -+ f_func_(i); -+ for(int n = 0; n < 5; n++) { -+ printf("%0.20Lf\n", i[n]); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/c_main024.c b/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/c_main024.c -new file mode 100644 -index 0000000..78ae53c ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/c_main024.c -@@ -0,0 +1,13 @@ -+// Test c call fortran for the array type and the array type is float -+// _Complex -+// -+#include -+#include -+extern void f_func_(float _Complex *i); -+int main() { -+ float _Complex i[5]; -+ f_func_(i); -+ for(int n = 0; n < 5; n++) { -+ printf("%0.20f + %0.20fi\n", creal(i[n]), cimag(i[n])); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/c_main025.c b/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/c_main025.c -new file mode 100644 -index 0000000..8676855 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/c_main025.c -@@ -0,0 +1,13 @@ -+// Test c call fortran for the array type and the array type is double -+// _Complex -+// -+#include -+#include -+extern void f_func_(double _Complex *i); -+int main() { -+ double _Complex i[5]; -+ f_func_(i); -+ for(int n = 0; n < 5; n++) { -+ printf("%0.20lf + %0.20lfi\n", creal(i[n]), cimag(i[n])); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/c_main026.c b/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/c_main026.c -new file mode 100644 -index 0000000..50221e7 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/c_main026.c -@@ -0,0 +1,13 @@ -+// Test c call fortran for the array type and the array type is long -+// double _Complex -+// -+#include -+#include -+extern void f_func_(long double _Complex *i); -+int main() { -+ long double _Complex i[5]; -+ f_func_(i); -+ for(int n = 0; n < 5; n++) { -+ printf("%0.20lf + %0.20lfi\n", creal(i[n]), cimag(i[n])); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/c_main027.c b/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/c_main027.c -new file mode 100644 -index 0000000..49ef333 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/c_main027.c -@@ -0,0 +1,12 @@ -+// Test c call fortran for the array type and the array type is _Bool -+// -+#include -+#include -+extern void f_func_(_Bool *i); -+int main() { -+ _Bool i[5]; -+ f_func_(i); -+ for(int n = 0; n < 5; n++) { -+ printf("%d\n", i[n]); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/c_main028.c b/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/c_main028.c -new file mode 100644 -index 0000000..6130858 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/c_main028.c -@@ -0,0 +1,12 @@ -+// Test c call fortran for the array type and the array type is char -+// -+#include -+#include -+extern void f_func_(char *i); -+int main() { -+ char i[5]; -+ f_func_(i); -+ for(int n = 0; n < 5; n++) { -+ printf("%c\n", i[n]); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/fortran_func001.f90 b/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/fortran_func001.f90 -new file mode 100644 -index 0000000..f6f9163 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/fortran_func001.f90 -@@ -0,0 +1,6 @@ -+subroutine f_func(i) -+ integer, dimension(*) :: i -+ do n = 1, 5 -+ i(n) = n -+ end do -+end -diff --git a/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/fortran_func002.f90 b/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/fortran_func002.f90 -new file mode 100644 -index 0000000..67a7fac ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/fortran_func002.f90 -@@ -0,0 +1,6 @@ -+subroutine f_func(i) -+ integer(2), dimension(*) :: i -+ do n = 1, 5 -+ i(n) = n -+ end do -+end -diff --git a/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/fortran_func003.f90 b/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/fortran_func003.f90 -new file mode 100644 -index 0000000..d2b5a12 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/fortran_func003.f90 -@@ -0,0 +1,6 @@ -+subroutine f_func(i) -+ integer(8), dimension(*) :: i -+ do n = 1, 5 -+ i(n) = n -+ end do -+end -diff --git a/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/fortran_func004.f90 b/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/fortran_func004.f90 -new file mode 100644 -index 0000000..d2b5a12 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/fortran_func004.f90 -@@ -0,0 +1,6 @@ -+subroutine f_func(i) -+ integer(8), dimension(*) :: i -+ do n = 1, 5 -+ i(n) = n -+ end do -+end -diff --git a/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/fortran_func005.f90 b/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/fortran_func005.f90 -new file mode 100644 -index 0000000..a993613 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/fortran_func005.f90 -@@ -0,0 +1,6 @@ -+subroutine f_func(i) -+ integer(1), dimension(*) :: i -+ do n = 1, 5 -+ i(n) = n -+ end do -+end -diff --git a/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/fortran_func006.f90 b/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/fortran_func006.f90 -new file mode 100644 -index 0000000..d2b5a12 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/fortran_func006.f90 -@@ -0,0 +1,6 @@ -+subroutine f_func(i) -+ integer(8), dimension(*) :: i -+ do n = 1, 5 -+ i(n) = n -+ end do -+end -diff --git a/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/fortran_func007.f90 b/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/fortran_func007.f90 -new file mode 100644 -index 0000000..a993613 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/fortran_func007.f90 -@@ -0,0 +1,6 @@ -+subroutine f_func(i) -+ integer(1), dimension(*) :: i -+ do n = 1, 5 -+ i(n) = n -+ end do -+end -diff --git a/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/fortran_func008.f90 b/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/fortran_func008.f90 -new file mode 100644 -index 0000000..67a7fac ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/fortran_func008.f90 -@@ -0,0 +1,6 @@ -+subroutine f_func(i) -+ integer(2), dimension(*) :: i -+ do n = 1, 5 -+ i(n) = n -+ end do -+end -diff --git a/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/fortran_func009.f90 b/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/fortran_func009.f90 -new file mode 100644 -index 0000000..c5f780d ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/fortran_func009.f90 -@@ -0,0 +1,6 @@ -+subroutine f_func(i) -+ integer(4), dimension(*) :: i -+ do n = 1, 5 -+ i(n) = n -+ end do -+end -diff --git a/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/fortran_func010.f90 b/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/fortran_func010.f90 -new file mode 100644 -index 0000000..d2b5a12 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/fortran_func010.f90 -@@ -0,0 +1,6 @@ -+subroutine f_func(i) -+ integer(8), dimension(*) :: i -+ do n = 1, 5 -+ i(n) = n -+ end do -+end -diff --git a/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/fortran_func011.f90 b/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/fortran_func011.f90 -new file mode 100644 -index 0000000..a993613 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/fortran_func011.f90 -@@ -0,0 +1,6 @@ -+subroutine f_func(i) -+ integer(1), dimension(*) :: i -+ do n = 1, 5 -+ i(n) = n -+ end do -+end -diff --git a/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/fortran_func012.f90 b/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/fortran_func012.f90 -new file mode 100644 -index 0000000..67a7fac ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/fortran_func012.f90 -@@ -0,0 +1,6 @@ -+subroutine f_func(i) -+ integer(2), dimension(*) :: i -+ do n = 1, 5 -+ i(n) = n -+ end do -+end -diff --git a/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/fortran_func013.f90 b/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/fortran_func013.f90 -new file mode 100644 -index 0000000..c5f780d ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/fortran_func013.f90 -@@ -0,0 +1,6 @@ -+subroutine f_func(i) -+ integer(4), dimension(*) :: i -+ do n = 1, 5 -+ i(n) = n -+ end do -+end -diff --git a/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/fortran_func014.f90 b/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/fortran_func014.f90 -new file mode 100644 -index 0000000..d2b5a12 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/fortran_func014.f90 -@@ -0,0 +1,6 @@ -+subroutine f_func(i) -+ integer(8), dimension(*) :: i -+ do n = 1, 5 -+ i(n) = n -+ end do -+end -diff --git a/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/fortran_func015.f90 b/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/fortran_func015.f90 -new file mode 100644 -index 0000000..a993613 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/fortran_func015.f90 -@@ -0,0 +1,6 @@ -+subroutine f_func(i) -+ integer(1), dimension(*) :: i -+ do n = 1, 5 -+ i(n) = n -+ end do -+end -diff --git a/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/fortran_func016.f90 b/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/fortran_func016.f90 -new file mode 100644 -index 0000000..d2b5a12 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/fortran_func016.f90 -@@ -0,0 +1,6 @@ -+subroutine f_func(i) -+ integer(8), dimension(*) :: i -+ do n = 1, 5 -+ i(n) = n -+ end do -+end -diff --git a/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/fortran_func017.f90 b/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/fortran_func017.f90 -new file mode 100644 -index 0000000..d2b5a12 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/fortran_func017.f90 -@@ -0,0 +1,6 @@ -+subroutine f_func(i) -+ integer(8), dimension(*) :: i -+ do n = 1, 5 -+ i(n) = n -+ end do -+end -diff --git a/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/fortran_func018.f90 b/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/fortran_func018.f90 -new file mode 100644 -index 0000000..d2b5a12 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/fortran_func018.f90 -@@ -0,0 +1,6 @@ -+subroutine f_func(i) -+ integer(8), dimension(*) :: i -+ do n = 1, 5 -+ i(n) = n -+ end do -+end -diff --git a/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/fortran_func019.f90 b/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/fortran_func019.f90 -new file mode 100644 -index 0000000..d2b5a12 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/fortran_func019.f90 -@@ -0,0 +1,6 @@ -+subroutine f_func(i) -+ integer(8), dimension(*) :: i -+ do n = 1, 5 -+ i(n) = n -+ end do -+end -diff --git a/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/fortran_func020.f90 b/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/fortran_func020.f90 -new file mode 100644 -index 0000000..d2b5a12 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/fortran_func020.f90 -@@ -0,0 +1,6 @@ -+subroutine f_func(i) -+ integer(8), dimension(*) :: i -+ do n = 1, 5 -+ i(n) = n -+ end do -+end -diff --git a/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/fortran_func021.f90 b/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/fortran_func021.f90 -new file mode 100644 -index 0000000..3f9350c ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/fortran_func021.f90 -@@ -0,0 +1,6 @@ -+subroutine f_func(i) -+ real(4), dimension(*) :: i -+ do n = 1, 5 -+ i(n) = n + 3.14159265358979 -+ end do -+end -diff --git a/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/fortran_func022.f90 b/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/fortran_func022.f90 -new file mode 100644 -index 0000000..7f8ec30 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/fortran_func022.f90 -@@ -0,0 +1,6 @@ -+subroutine f_func(i) -+ real(8), dimension(*) :: i -+ do n = 1, 5 -+ i(n) = n + 3.14159265358979 -+ end do -+end -diff --git a/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/fortran_func023.f90 b/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/fortran_func023.f90 -new file mode 100644 -index 0000000..1ac77a3 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/fortran_func023.f90 -@@ -0,0 +1,7 @@ -+subroutine f_func(i) -+ integer, parameter :: K = selected_real_kind(16) -+ real(K), dimension(*) :: i -+ do n = 1, 5 -+ i(n) = n + 3.14159265358979 -+ end do -+end -diff --git a/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/fortran_func024.f90 b/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/fortran_func024.f90 -new file mode 100644 -index 0000000..fb4fe82 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/fortran_func024.f90 -@@ -0,0 +1,6 @@ -+subroutine f_func(i) -+ complex(4), dimension(*) :: i -+ do n = 1, 5 -+ i(n) = (-12345678.7654321, 1) -+ end do -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/fortran_func025.f90 b/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/fortran_func025.f90 -new file mode 100644 -index 0000000..a8953b9 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/fortran_func025.f90 -@@ -0,0 +1,6 @@ -+subroutine f_func(i) -+ complex(8), dimension(*) :: i -+ do n = 1, 5 -+ i(n) = (-12345678.7654321, 1) -+ end do -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/fortran_func026.f90 b/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/fortran_func026.f90 -new file mode 100644 -index 0000000..28c3971 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/fortran_func026.f90 -@@ -0,0 +1,7 @@ -+subroutine f_func(i) -+ integer, parameter :: K = selected_real_kind(16) -+ complex(K), dimension(*) :: i -+ do n = 1, 5 -+ i(n) = (-12345678.7654321, 1) -+ end do -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/fortran_func027.f90 b/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/fortran_func027.f90 -new file mode 100644 -index 0000000..3f45a9a ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/fortran_func027.f90 -@@ -0,0 +1,6 @@ -+subroutine f_func(i) -+ logical(1), dimension(*) :: i -+ do n = 1, 5 -+ i(n) = .TRUE. -+ end do -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/fortran_func028.f90 b/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/fortran_func028.f90 -new file mode 100644 -index 0000000..2153d9b ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/fortran_func028.f90 -@@ -0,0 +1,6 @@ -+subroutine f_func(i) -+ character(1), dimension(*) :: i -+ do n = 1, 5 -+ i(n) = 'a' -+ end do -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/run.sh b/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/run.sh -new file mode 100644 -index 0000000..ad3abb0 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/006_c_call_fortran_array/run.sh -@@ -0,0 +1,16 @@ -+for i in {001..028} -+do -+echo "------- test $i ------." -+#echo "----- gfortran result:" -+#gcc c_main$i.c -c -o c-test.o -+#gfortran fortran_func$i.f90 -fno-range-check -c -o fortran-test.o -+#gfortran fortran-test.o c-test.o -+#./a.out -+#rm *.o a.out -+echo "----- flang-new result : " -+clang c_main$i.c -c -o c-test.o -+flang-new fortran_func$i.f90 -c -o fortran-test.o -+flang-new -flang-experimental-exec c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+done -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/c_main001.c b/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/c_main001.c -new file mode 100644 -index 0000000..104f21c ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/c_main001.c -@@ -0,0 +1,12 @@ -+// Test c call fortran for the array type and the array type is int -+// with bindc -+// -+#include -+extern void f_func_(int *i); -+int main() { -+ int i[5]; -+ f_func_(i); -+ for(int n = 0; n < 5; n++) { -+ printf("%d\n", i[n]); -+ } -+} -diff --git a/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/c_main002.c b/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/c_main002.c -new file mode 100644 -index 0000000..1c74e75 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/c_main002.c -@@ -0,0 +1,12 @@ -+// Test c call fortran for the array type and the array type is short -+// with bindc -+// -+#include -+extern void f_func_(short *i); -+int main() { -+ short i[5]; -+ f_func_(i); -+ for(int n = 0; n < 5; n++) { -+ printf("%d\n", i[n]); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/c_main003.c b/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/c_main003.c -new file mode 100644 -index 0000000..661840e ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/c_main003.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the array type and the array type is long -+// -+#include -+extern void f_func_(long *i); -+int main() { -+ long i[5]; -+ f_func_(i); -+ for(int n = 0; n < 5; n++) { -+ printf("%ld\n", i[n]); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/c_main004.c b/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/c_main004.c -new file mode 100644 -index 0000000..18788ca ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/c_main004.c -@@ -0,0 +1,12 @@ -+// Test c call fortran for the array type and the array type is long -+// long with bindc -+// -+#include -+extern void f_func_(long long *i); -+int main() { -+ long long i[5]; -+ f_func_(i); -+ for(int n = 0; n < 5; n++) { -+ printf("%Ld\n", i[n]); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/c_main005.c b/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/c_main005.c -new file mode 100644 -index 0000000..af4be4b ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/c_main005.c -@@ -0,0 +1,12 @@ -+// Test c call fortran for the array type and the array type is signed -+// char with bindc -+// -+#include -+extern void f_func_(signed char *i); -+int main() { -+ signed char i[5]; -+ f_func_(i); -+ for(int n = 0; n < 5; n++) { -+ printf("%hhd\n", i[n]); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/c_main006.c b/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/c_main006.c -new file mode 100644 -index 0000000..b0e7f4d ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/c_main006.c -@@ -0,0 +1,12 @@ -+// Test c call fortran for the array type and the array type is size_t -+// with bindc -+// -+#include -+extern void f_func_(size_t *i); -+int main() { -+ size_t i[5]; -+ f_func_(i); -+ for(int n = 0; n < 5; n++) { -+ printf("%ld\n", i[n]); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/c_main007.c b/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/c_main007.c -new file mode 100644 -index 0000000..e1d7d12 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/c_main007.c -@@ -0,0 +1,13 @@ -+// Test c call fortran for the array type and the array type is int8_t -+// with bindc -+// -+#include -+#include -+extern void f_func_(int8_t *i); -+int main() { -+ int8_t i[5]; -+ f_func_(i); -+ for(int n = 0; n < 5; n++) { -+ printf("%hhd\n", i[n]); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/c_main008.c b/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/c_main008.c -new file mode 100644 -index 0000000..99df9f9 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/c_main008.c -@@ -0,0 +1,13 @@ -+// Test c call fortran for the array type and the array type is int16_t -+// with bindc -+// -+#include -+#include -+extern void f_func_(int16_t *i); -+int main() { -+ int16_t i[5]; -+ f_func_(i); -+ for(int n = 0; n < 5; n++) { -+ printf("%hd\n", i[n]); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/c_main009.c b/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/c_main009.c -new file mode 100644 -index 0000000..f5f3d76 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/c_main009.c -@@ -0,0 +1,13 @@ -+// Test c call fortran for the array type and the array type is int32_t -+// with bindc -+// -+#include -+#include -+extern void f_func_(int32_t *i); -+int main() { -+ int32_t i[5]; -+ f_func_(i); -+ for(int n = 0; n < 5; n++) { -+ printf("%d\n", i[n]); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/c_main010.c b/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/c_main010.c -new file mode 100644 -index 0000000..db9c8e0 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/c_main010.c -@@ -0,0 +1,13 @@ -+// Test c call fortran for the array type and the array type is int64_t -+// with bindc -+// -+#include -+#include -+extern void f_func_(int64_t *i); -+int main() { -+ int64_t i[5]; -+ f_func_(i); -+ for(int n = 0; n < 5; n++) { -+ printf("%ld\n", i[n]); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/c_main011.c b/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/c_main011.c -new file mode 100644 -index 0000000..d7a4379 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/c_main011.c -@@ -0,0 +1,13 @@ -+// Test c call fortran for the array type and the array type is -+// int_least8_t with bindc -+// -+#include -+#include -+extern void f_func_(int_least8_t *i); -+int main() { -+ int_least8_t i[5]; -+ f_func_(i); -+ for(int n = 0; n < 5; n++) { -+ printf("%hhd\n", i[n]); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/c_main012.c b/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/c_main012.c -new file mode 100644 -index 0000000..5e8a295 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/c_main012.c -@@ -0,0 +1,13 @@ -+// Test c call fortran for the array type and the array type is -+// int_least16_t with bindc -+// -+#include -+#include -+extern void f_func_(int_least16_t *i); -+int main() { -+ int_least16_t i[5]; -+ f_func_(i); -+ for(int n = 0; n < 5; n++) { -+ printf("%hd\n", i[n]); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/c_main013.c b/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/c_main013.c -new file mode 100644 -index 0000000..37c0e17 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/c_main013.c -@@ -0,0 +1,13 @@ -+// Test c call fortran for the array type and the array type is -+// int_least32_t with bindc -+// -+#include -+#include -+extern void f_func_(int_least32_t *i); -+int main() { -+ int_least32_t i[5]; -+ f_func_(i); -+ for(int n = 0; n < 5; n++) { -+ printf("%d\n", i[n]); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/c_main014.c b/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/c_main014.c -new file mode 100644 -index 0000000..5ba4762 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/c_main014.c -@@ -0,0 +1,13 @@ -+// Test c call fortran for the array type and the array type is -+// int_least64_t with bindc -+// -+#include -+#include -+extern void f_func_(int_least64_t *i); -+int main() { -+ int_least64_t i[5]; -+ f_func_(i); -+ for(int n = 0; n < 5; n++) { -+ printf("%ld\n", i[n]); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/c_main015.c b/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/c_main015.c -new file mode 100644 -index 0000000..905c80a ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/c_main015.c -@@ -0,0 +1,13 @@ -+// Test c call fortran for the array type and the array type is -+// int_fast8_t with bindc -+// -+#include -+#include -+extern void f_func_(int_fast8_t *i); -+int main() { -+ int_fast8_t i[5]; -+ f_func_(i); -+ for(int n = 0; n < 5; n++) { -+ printf("%hhd\n", i[n]); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/c_main016.c b/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/c_main016.c -new file mode 100644 -index 0000000..51fe904 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/c_main016.c -@@ -0,0 +1,13 @@ -+// Test c call fortran for the array type and the array type is -+// int_fast16_t with bindc -+// -+#include -+#include -+extern void f_func_(int_fast16_t *i); -+int main() { -+ int_fast16_t i[5]; -+ f_func_(i); -+ for(int n = 0; n < 5; n++) { -+ printf("%ld\n", i[n]); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/c_main017.c b/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/c_main017.c -new file mode 100644 -index 0000000..6e2b2ce ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/c_main017.c -@@ -0,0 +1,13 @@ -+// Test c call fortran for the array type and the array type is -+// int_fast32_t with bindc -+// -+#include -+#include -+extern void f_func_(int_fast32_t *i); -+int main() { -+ int_fast32_t i[5]; -+ f_func_(i); -+ for(int n = 0; n < 5; n++) { -+ printf("%ld\n", i[n]); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/c_main018.c b/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/c_main018.c -new file mode 100644 -index 0000000..fbddce9 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/c_main018.c -@@ -0,0 +1,13 @@ -+// Test c call fortran for the array type and the array type is -+// int_fast64_t with bindc -+// -+#include -+#include -+extern void f_func_(int_fast64_t *i); -+int main() { -+ int_fast64_t i[5]; -+ f_func_(i); -+ for(int n = 0; n < 5; n++) { -+ printf("%ld\n", i[n]); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/c_main019.c b/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/c_main019.c -new file mode 100644 -index 0000000..effe5a0 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/c_main019.c -@@ -0,0 +1,13 @@ -+// Test c call fortran for the array type and the array type is -+// intmax_t with bindc -+// -+#include -+#include -+extern void f_func_(intmax_t *i); -+int main() { -+ intmax_t i[5]; -+ f_func_(i); -+ for(int n = 0; n < 5; n++) { -+ printf("%ld\n", i[n]); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/c_main020.c b/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/c_main020.c -new file mode 100644 -index 0000000..f85b7b6 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/c_main020.c -@@ -0,0 +1,13 @@ -+// Test c call fortran for the array type and the array type is -+// intptr_t with bindc -+// -+#include -+#include -+extern void f_func_(intptr_t *i); -+int main() { -+ intptr_t i[5]; -+ f_func_(i); -+ for(int n = 0; n < 5; n++) { -+ printf("%ld\n", i[n]); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/c_main021.c b/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/c_main021.c -new file mode 100644 -index 0000000..57e502b ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/c_main021.c -@@ -0,0 +1,13 @@ -+// Test c call fortran for the array type and the array type is float -+// with bindc -+// -+#include -+#include -+extern void f_func_(float *i); -+int main() { -+ float i[5]; -+ f_func_(i); -+ for(int n = 0; n < 5; n++) { -+ printf("%0.20f\n", i[n]); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/c_main022.c b/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/c_main022.c -new file mode 100644 -index 0000000..ef29ded ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/c_main022.c -@@ -0,0 +1,13 @@ -+// Test c call fortran for the array type and the array type is double -+// with bindc -+// -+#include -+#include -+extern void f_func_(double *i); -+int main() { -+ double i[5]; -+ f_func_(i); -+ for(int n = 0; n < 5; n++) { -+ printf("%0.20lf\n", i[n]); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/c_main023.c b/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/c_main023.c -new file mode 100644 -index 0000000..54098bd ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/c_main023.c -@@ -0,0 +1,13 @@ -+// Test c call fortran for the array type and the array type is long -+// double with bindc -+// -+#include -+#include -+extern void f_func_(long double *i); -+int main() { -+ long double i[5]; -+ f_func_(i); -+ for(int n = 0; n < 5; n++) { -+ printf("%0.20Lf\n", i[n]); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/c_main024.c b/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/c_main024.c -new file mode 100644 -index 0000000..1f09f05 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/c_main024.c -@@ -0,0 +1,13 @@ -+// Test c call fortran for the array type and the array type is float -+// _Complex with bindc -+// -+#include -+#include -+extern void f_func_(float _Complex *i); -+int main() { -+ float _Complex i[5]; -+ f_func_(i); -+ for(int n = 0; n < 5; n++) { -+ printf("%0.20f + %0.20fi\n", creal(i[n]), cimag(i[n])); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/c_main025.c b/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/c_main025.c -new file mode 100644 -index 0000000..196e624 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/c_main025.c -@@ -0,0 +1,13 @@ -+// Test c call fortran for the array type and the array type is double -+// _Complex with bindc -+// -+#include -+#include -+extern void f_func_(double _Complex *i); -+int main() { -+ double _Complex i[5]; -+ f_func_(i); -+ for(int n = 0; n < 5; n++) { -+ printf("%0.20lf + %0.20lfi\n", creal(i[n]), cimag(i[n])); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/c_main026.c b/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/c_main026.c -new file mode 100644 -index 0000000..8855d53 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/c_main026.c -@@ -0,0 +1,13 @@ -+// Test c call fortran for the array type and the array type is long -+// double _Complex with bindc -+// -+#include -+#include -+extern void f_func_(long double _Complex *i); -+int main() { -+ long double _Complex i[5]; -+ f_func_(i); -+ for(int n = 0; n < 5; n++) { -+ printf("%0.20lf + %0.20lfi\n", creal(i[n]), cimag(i[n])); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/c_main027.c b/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/c_main027.c -new file mode 100644 -index 0000000..e43e643 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/c_main027.c -@@ -0,0 +1,13 @@ -+// Test c call fortran for the array type and the array type is _Bool -+// with bindc -+// -+#include -+#include -+extern void f_func_(_Bool *i); -+int main() { -+ _Bool i[5]; -+ f_func_(i); -+ for(int n = 0; n < 5; n++) { -+ printf("%d\n", i[n]); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/c_main028.c b/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/c_main028.c -new file mode 100644 -index 0000000..8b449d5 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/c_main028.c -@@ -0,0 +1,13 @@ -+// Test c call fortran for the array type and the array type is char -+// with bindc -+// -+#include -+#include -+extern void f_func_(char *i); -+int main() { -+ char i[5]; -+ f_func_(i); -+ for(int n = 0; n < 5; n++) { -+ printf("%c\n", i[n]); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/fortran_func001.f90 b/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/fortran_func001.f90 -new file mode 100644 -index 0000000..2b618c6 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/fortran_func001.f90 -@@ -0,0 +1,6 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ integer, dimension(*) :: i -+ do n = 1, 5 -+ i(n) = n -+ end do -+end -diff --git a/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/fortran_func002.f90 b/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/fortran_func002.f90 -new file mode 100644 -index 0000000..88bf55a ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/fortran_func002.f90 -@@ -0,0 +1,6 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ integer(2), dimension(*) :: i -+ do n = 1, 5 -+ i(n) = n -+ end do -+end -diff --git a/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/fortran_func003.f90 b/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/fortran_func003.f90 -new file mode 100644 -index 0000000..f7e9ec7 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/fortran_func003.f90 -@@ -0,0 +1,6 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ integer(8), dimension(*) :: i -+ do n = 1, 5 -+ i(n) = n -+ end do -+end -diff --git a/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/fortran_func004.f90 b/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/fortran_func004.f90 -new file mode 100644 -index 0000000..f7e9ec7 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/fortran_func004.f90 -@@ -0,0 +1,6 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ integer(8), dimension(*) :: i -+ do n = 1, 5 -+ i(n) = n -+ end do -+end -diff --git a/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/fortran_func005.f90 b/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/fortran_func005.f90 -new file mode 100644 -index 0000000..7f76df3 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/fortran_func005.f90 -@@ -0,0 +1,6 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ integer(1), dimension(*) :: i -+ do n = 1, 5 -+ i(n) = n -+ end do -+end -diff --git a/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/fortran_func006.f90 b/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/fortran_func006.f90 -new file mode 100644 -index 0000000..f7e9ec7 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/fortran_func006.f90 -@@ -0,0 +1,6 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ integer(8), dimension(*) :: i -+ do n = 1, 5 -+ i(n) = n -+ end do -+end -diff --git a/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/fortran_func007.f90 b/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/fortran_func007.f90 -new file mode 100644 -index 0000000..7f76df3 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/fortran_func007.f90 -@@ -0,0 +1,6 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ integer(1), dimension(*) :: i -+ do n = 1, 5 -+ i(n) = n -+ end do -+end -diff --git a/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/fortran_func008.f90 b/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/fortran_func008.f90 -new file mode 100644 -index 0000000..88bf55a ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/fortran_func008.f90 -@@ -0,0 +1,6 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ integer(2), dimension(*) :: i -+ do n = 1, 5 -+ i(n) = n -+ end do -+end -diff --git a/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/fortran_func009.f90 b/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/fortran_func009.f90 -new file mode 100644 -index 0000000..f1607ec ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/fortran_func009.f90 -@@ -0,0 +1,6 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ integer(4), dimension(*) :: i -+ do n = 1, 5 -+ i(n) = n -+ end do -+end -diff --git a/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/fortran_func010.f90 b/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/fortran_func010.f90 -new file mode 100644 -index 0000000..f7e9ec7 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/fortran_func010.f90 -@@ -0,0 +1,6 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ integer(8), dimension(*) :: i -+ do n = 1, 5 -+ i(n) = n -+ end do -+end -diff --git a/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/fortran_func011.f90 b/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/fortran_func011.f90 -new file mode 100644 -index 0000000..7f76df3 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/fortran_func011.f90 -@@ -0,0 +1,6 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ integer(1), dimension(*) :: i -+ do n = 1, 5 -+ i(n) = n -+ end do -+end -diff --git a/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/fortran_func012.f90 b/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/fortran_func012.f90 -new file mode 100644 -index 0000000..88bf55a ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/fortran_func012.f90 -@@ -0,0 +1,6 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ integer(2), dimension(*) :: i -+ do n = 1, 5 -+ i(n) = n -+ end do -+end -diff --git a/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/fortran_func013.f90 b/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/fortran_func013.f90 -new file mode 100644 -index 0000000..f1607ec ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/fortran_func013.f90 -@@ -0,0 +1,6 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ integer(4), dimension(*) :: i -+ do n = 1, 5 -+ i(n) = n -+ end do -+end -diff --git a/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/fortran_func014.f90 b/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/fortran_func014.f90 -new file mode 100644 -index 0000000..f7e9ec7 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/fortran_func014.f90 -@@ -0,0 +1,6 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ integer(8), dimension(*) :: i -+ do n = 1, 5 -+ i(n) = n -+ end do -+end -diff --git a/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/fortran_func015.f90 b/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/fortran_func015.f90 -new file mode 100644 -index 0000000..7f76df3 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/fortran_func015.f90 -@@ -0,0 +1,6 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ integer(1), dimension(*) :: i -+ do n = 1, 5 -+ i(n) = n -+ end do -+end -diff --git a/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/fortran_func016.f90 b/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/fortran_func016.f90 -new file mode 100644 -index 0000000..f7e9ec7 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/fortran_func016.f90 -@@ -0,0 +1,6 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ integer(8), dimension(*) :: i -+ do n = 1, 5 -+ i(n) = n -+ end do -+end -diff --git a/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/fortran_func017.f90 b/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/fortran_func017.f90 -new file mode 100644 -index 0000000..f7e9ec7 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/fortran_func017.f90 -@@ -0,0 +1,6 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ integer(8), dimension(*) :: i -+ do n = 1, 5 -+ i(n) = n -+ end do -+end -diff --git a/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/fortran_func018.f90 b/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/fortran_func018.f90 -new file mode 100644 -index 0000000..f7e9ec7 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/fortran_func018.f90 -@@ -0,0 +1,6 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ integer(8), dimension(*) :: i -+ do n = 1, 5 -+ i(n) = n -+ end do -+end -diff --git a/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/fortran_func019.f90 b/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/fortran_func019.f90 -new file mode 100644 -index 0000000..f7e9ec7 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/fortran_func019.f90 -@@ -0,0 +1,6 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ integer(8), dimension(*) :: i -+ do n = 1, 5 -+ i(n) = n -+ end do -+end -diff --git a/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/fortran_func020.f90 b/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/fortran_func020.f90 -new file mode 100644 -index 0000000..f7e9ec7 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/fortran_func020.f90 -@@ -0,0 +1,6 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ integer(8), dimension(*) :: i -+ do n = 1, 5 -+ i(n) = n -+ end do -+end -diff --git a/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/fortran_func021.f90 b/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/fortran_func021.f90 -new file mode 100644 -index 0000000..968582c ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/fortran_func021.f90 -@@ -0,0 +1,6 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ real(4), dimension(*) :: i -+ do n = 1, 5 -+ i(n) = n + 3.14159265358979 -+ end do -+end -diff --git a/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/fortran_func022.f90 b/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/fortran_func022.f90 -new file mode 100644 -index 0000000..6dedde8 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/fortran_func022.f90 -@@ -0,0 +1,6 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ real(8), dimension(*) :: i -+ do n = 1, 5 -+ i(n) = n + 3.14159265358979 -+ end do -+end -diff --git a/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/fortran_func023.f90 b/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/fortran_func023.f90 -new file mode 100644 -index 0000000..441062e ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/fortran_func023.f90 -@@ -0,0 +1,7 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ integer, parameter :: K = selected_real_kind(16) -+ real(K), dimension(*) :: i -+ do n = 1, 5 -+ i(n) = n + 3.14159265358979 -+ end do -+end -diff --git a/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/fortran_func024.f90 b/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/fortran_func024.f90 -new file mode 100644 -index 0000000..1de9dc0 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/fortran_func024.f90 -@@ -0,0 +1,6 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ complex(4), dimension(*) :: i -+ do n = 1, 5 -+ i(n) = (-12345678.7654321, 1) -+ end do -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/fortran_func025.f90 b/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/fortran_func025.f90 -new file mode 100644 -index 0000000..e7a7b5a ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/fortran_func025.f90 -@@ -0,0 +1,6 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ complex(8), dimension(*) :: i -+ do n = 1, 5 -+ i(n) = (-12345678.7654321, 1) -+ end do -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/fortran_func026.f90 b/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/fortran_func026.f90 -new file mode 100644 -index 0000000..af23ec9 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/fortran_func026.f90 -@@ -0,0 +1,7 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ integer, parameter :: K = selected_real_kind(16) -+ complex(K), dimension(*) :: i -+ do n = 1, 5 -+ i(n) = (-12345678.7654321, 1) -+ end do -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/fortran_func027.f90 b/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/fortran_func027.f90 -new file mode 100644 -index 0000000..1a4fc9d ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/fortran_func027.f90 -@@ -0,0 +1,6 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ logical(1), dimension(*) :: i -+ do n = 1, 5 -+ i(n) = .TRUE. -+ end do -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/fortran_func028.f90 b/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/fortran_func028.f90 -new file mode 100644 -index 0000000..e039766 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/fortran_func028.f90 -@@ -0,0 +1,6 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ character(1), dimension(*) :: i -+ do n = 1, 5 -+ i(n) = 'a' -+ end do -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/run.sh b/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/run.sh -new file mode 100644 -index 0000000..ad3abb0 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/007_c_call_fortan_array_bindc/run.sh -@@ -0,0 +1,16 @@ -+for i in {001..028} -+do -+echo "------- test $i ------." -+#echo "----- gfortran result:" -+#gcc c_main$i.c -c -o c-test.o -+#gfortran fortran_func$i.f90 -fno-range-check -c -o fortran-test.o -+#gfortran fortran-test.o c-test.o -+#./a.out -+#rm *.o a.out -+echo "----- flang-new result : " -+clang c_main$i.c -c -o c-test.o -+flang-new fortran_func$i.f90 -c -o fortran-test.o -+flang-new -flang-experimental-exec c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+done -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/c_main001.c b/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/c_main001.c -new file mode 100644 -index 0000000..11d0136 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/c_main001.c -@@ -0,0 +1,13 @@ -+// Test c call fortran for the derived type and the component of the -+// derived type is scalar of type int -+// -+#include -+struct test { -+ int t; -+}; -+extern void f_func_(struct test *s); -+int main() { -+ struct test a; -+ f_func_(&a); -+ printf("%d\n", a.t); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/c_main002.c b/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/c_main002.c -new file mode 100644 -index 0000000..c44d440 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/c_main002.c -@@ -0,0 +1,13 @@ -+// Test c call fortran for the derived type and the component of the -+// derived type is scalar of type short -+// -+#include -+struct test { -+ short t; -+}; -+extern void f_func_(struct test *s); -+int main() { -+ struct test a; -+ f_func_(&a); -+ printf("%hd\n", a.t); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/c_main003.c b/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/c_main003.c -new file mode 100644 -index 0000000..76739dc ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/c_main003.c -@@ -0,0 +1,13 @@ -+// Test c call fortran for the derived type and the component of the -+// derived type is scalar of type long -+// -+#include -+struct test { -+ long t; -+}; -+extern void f_func_(struct test *s); -+int main() { -+ struct test a; -+ f_func_(&a); -+ printf("%ld\n", a.t); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/c_main004.c b/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/c_main004.c -new file mode 100644 -index 0000000..d696b17 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/c_main004.c -@@ -0,0 +1,13 @@ -+// Test c call fortran for the derived type and the component of the -+// derived type is scalar of type long long -+// -+#include -+struct test { -+ long long t; -+}; -+extern void f_func_(struct test *s); -+int main() { -+ struct test a; -+ f_func_(&a); -+ printf("%Ld\n", a.t); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/c_main005.c b/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/c_main005.c -new file mode 100644 -index 0000000..ec2abe6 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/c_main005.c -@@ -0,0 +1,13 @@ -+// Test c call fortran for the derived type and the component of the -+// derived type is scalar of signed char -+// -+#include -+struct test { -+ signed char t; -+}; -+extern void f_func_(struct test *s); -+int main() { -+ struct test a; -+ f_func_(&a); -+ printf("%hhd\n", a.t); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/c_main006.c b/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/c_main006.c -new file mode 100644 -index 0000000..a063a8a ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/c_main006.c -@@ -0,0 +1,13 @@ -+// Test c call fortran for the derived type and the component of the -+// derived type is scalar of type size_t -+// -+#include -+struct test { -+ size_t t; -+}; -+extern void f_func_(struct test *s); -+int main() { -+ struct test a; -+ f_func_(&a); -+ printf("%ld\n", a.t); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/c_main007.c b/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/c_main007.c -new file mode 100644 -index 0000000..809e893 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/c_main007.c -@@ -0,0 +1,14 @@ -+// Test c call fortran for the derived type and the component of the -+// derived type is scalar of type int8_t -+// -+#include -+#include -+struct test { -+ int8_t t; -+}; -+extern void f_func_(struct test *s); -+int main() { -+ struct test a; -+ f_func_(&a); -+ printf("%hhd\n", a.t); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/c_main008.c b/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/c_main008.c -new file mode 100644 -index 0000000..3366e85 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/c_main008.c -@@ -0,0 +1,14 @@ -+// Test c call fortran for the derived type and the component of the -+// derived type is scalar of type int16_t -+// -+#include -+#include -+struct test { -+ int16_t t; -+}; -+extern void f_func_(struct test *s); -+int main() { -+ struct test a; -+ f_func_(&a); -+ printf("%hd\n", a.t); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/c_main009.c b/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/c_main009.c -new file mode 100644 -index 0000000..edd916a ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/c_main009.c -@@ -0,0 +1,14 @@ -+// Test c call fortran for the derived type and the component of the -+// derived type is scalar of type int32_t -+// -+#include -+#include -+struct test { -+ int32_t t; -+}; -+extern void f_func_(struct test *s); -+int main() { -+ struct test a; -+ f_func_(&a); -+ printf("%d\n", a.t); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/c_main010.c b/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/c_main010.c -new file mode 100644 -index 0000000..743e4b6 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/c_main010.c -@@ -0,0 +1,14 @@ -+// Test c call fortran for the derived type and the component of the -+// derived type is scalar of type int64_t -+// -+#include -+#include -+struct test { -+ int64_t t; -+}; -+extern void f_func_(struct test *s); -+int main() { -+ struct test a; -+ f_func_(&a); -+ printf("%ld\n", a.t); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/c_main011.c b/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/c_main011.c -new file mode 100644 -index 0000000..f77bc3f ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/c_main011.c -@@ -0,0 +1,14 @@ -+// Test c call fortran for the derived type and the component of the -+// derived type is scalar of type int_least8_t -+// -+#include -+#include -+struct test { -+ int_least8_t t; -+}; -+extern void f_func_(struct test *s); -+int main() { -+ struct test a; -+ f_func_(&a); -+ printf("%hhd\n", a.t); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/c_main012.c b/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/c_main012.c -new file mode 100644 -index 0000000..39e1a52 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/c_main012.c -@@ -0,0 +1,14 @@ -+// Test c call fortran for the derived type and the component of the -+// derived type is scalar of type int_least16_t -+// -+#include -+#include -+struct test { -+ int_least16_t t; -+}; -+extern void f_func_(struct test *s); -+int main() { -+ struct test a; -+ f_func_(&a); -+ printf("%hd\n", a.t); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/c_main013.c b/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/c_main013.c -new file mode 100644 -index 0000000..296873d ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/c_main013.c -@@ -0,0 +1,14 @@ -+// Test c call fortran for the derived type and the component of the -+// derived type is scalar of type int_least32_t -+// -+#include -+#include -+struct test { -+ int_least32_t t; -+}; -+extern void f_func_(struct test *s); -+int main() { -+ struct test a; -+ f_func_(&a); -+ printf("%d\n", a.t); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/c_main014.c b/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/c_main014.c -new file mode 100644 -index 0000000..e2a48ae ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/c_main014.c -@@ -0,0 +1,14 @@ -+// Test c call fortran for the derived type and the component of the -+// derived type is scalar of type int_least64_t -+// -+#include -+#include -+struct test { -+ int_least64_t t; -+}; -+extern void f_func_(struct test *s); -+int main() { -+ struct test a; -+ f_func_(&a); -+ printf("%ld\n", a.t); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/c_main015.c b/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/c_main015.c -new file mode 100644 -index 0000000..fda3683 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/c_main015.c -@@ -0,0 +1,14 @@ -+// Test c call fortran for the derived type and the component of the -+// derived type is scalar of type int_fast8_t -+// -+#include -+#include -+struct test { -+ int_fast8_t t; -+}; -+extern void f_func_(struct test *s); -+int main() { -+ struct test a; -+ f_func_(&a); -+ printf("%hhd\n", a.t); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/c_main016.c b/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/c_main016.c -new file mode 100644 -index 0000000..c88cf3e ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/c_main016.c -@@ -0,0 +1,14 @@ -+// Test c call fortran for the derived type and the component of the -+// derived type is scalar of type int_fast16_t -+// -+#include -+#include -+struct test { -+ int_fast16_t t; -+}; -+extern void f_func_(struct test *s); -+int main() { -+ struct test a; -+ f_func_(&a); -+ printf("%ld\n", a.t); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/c_main017.c b/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/c_main017.c -new file mode 100644 -index 0000000..e7c385d ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/c_main017.c -@@ -0,0 +1,14 @@ -+// Test c call fortran for the derived type and the component of the -+// derived type is scalar of type int_fast32_t -+// -+#include -+#include -+struct test { -+ int_fast32_t t; -+}; -+extern void f_func_(struct test *s); -+int main() { -+ struct test a; -+ f_func_(&a); -+ printf("%ld\n", a.t); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/c_main018.c b/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/c_main018.c -new file mode 100644 -index 0000000..959a511 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/c_main018.c -@@ -0,0 +1,14 @@ -+// Test c call fortran for the derived type and the component of the -+// derived type is scalar of type int_fast64_t -+// -+#include -+#include -+struct test { -+ int_fast64_t t; -+}; -+extern void f_func_(struct test *s); -+int main() { -+ struct test a; -+ f_func_(&a); -+ printf("%ld\n", a.t); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/c_main019.c b/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/c_main019.c -new file mode 100644 -index 0000000..0dbf9d8 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/c_main019.c -@@ -0,0 +1,14 @@ -+// Test c call fortran for the derived type and the component of the -+// derived type is scalar of type intmax_t -+// -+#include -+#include -+struct test { -+ intmax_t t; -+}; -+extern void f_func_(struct test *s); -+int main() { -+ struct test a; -+ f_func_(&a); -+ printf("%ld\n", a.t); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/c_main020.c b/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/c_main020.c -new file mode 100644 -index 0000000..7aca7aa ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/c_main020.c -@@ -0,0 +1,14 @@ -+// Test c call fortran for the derived type and the component of the -+// derived type is scalar of type intptr_t -+// -+#include -+#include -+struct test { -+ intptr_t t; -+}; -+extern void f_func_(struct test *s); -+int main() { -+ struct test a; -+ f_func_(&a); -+ printf("%ld\n", a.t); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/c_main021.c b/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/c_main021.c -new file mode 100644 -index 0000000..d6e95af ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/c_main021.c -@@ -0,0 +1,14 @@ -+// Test c call fortran for the derived type and the component of the -+// derived type is scalar of type float -+// -+#include -+#include -+struct test { -+ float t; -+}; -+extern void f_func_(struct test *s); -+int main() { -+ struct test a; -+ f_func_(&a); -+ printf("%0.20f\n", a.t); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/c_main022.c b/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/c_main022.c -new file mode 100644 -index 0000000..153aaa0 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/c_main022.c -@@ -0,0 +1,14 @@ -+// Test c call fortran for the derived type and the component of the -+// derived type is scalar of type double -+// -+#include -+#include -+struct test { -+ double t; -+}; -+extern void f_func_(struct test *s); -+int main() { -+ struct test a; -+ f_func_(&a); -+ printf("%0.20lf\n", a.t); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/c_main023.c b/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/c_main023.c -new file mode 100644 -index 0000000..6232a85 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/c_main023.c -@@ -0,0 +1,14 @@ -+// Test c call fortran for the derived type and the component of the -+// derived type is scalar of type long double -+// -+#include -+#include -+struct test { -+ long double t; -+}; -+extern void f_func_(struct test *s); -+int main() { -+ struct test a; -+ f_func_(&a); -+ printf("%0.20Lf\n", a.t); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/c_main024.c b/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/c_main024.c -new file mode 100644 -index 0000000..d57ddfc ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/c_main024.c -@@ -0,0 +1,14 @@ -+// Test c call fortran for the derived type and the component of the -+// derived type is scalar of type float _Complex -+// -+#include -+#include -+struct test { -+ float _Complex t; -+}; -+extern void f_func_(struct test *s); -+int main() { -+ struct test a; -+ f_func_(&a); -+ printf("%0.20f + %0.20fi\n", creal(a.t), cimag(a.t)); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/c_main025.c b/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/c_main025.c -new file mode 100644 -index 0000000..c5daac4 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/c_main025.c -@@ -0,0 +1,14 @@ -+// Test c call fortran for the derived type and the component of the -+// derived type is scalar of type double _Complex -+// -+#include -+#include -+struct test { -+ double _Complex t; -+}; -+extern void f_func_(struct test *s); -+int main() { -+ struct test a; -+ f_func_(&a); -+ printf("%0.20lf + %0.20lfi\n", creal(a.t), cimag(a.t)); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/c_main026.c b/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/c_main026.c -new file mode 100644 -index 0000000..1b26750 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/c_main026.c -@@ -0,0 +1,14 @@ -+// Test c call fortran for the derived type and the component of the -+// derived type is scalar of type long double _Complex -+// -+#include -+#include -+struct test { -+ long double _Complex t; -+}; -+extern void f_func_(struct test *s); -+int main() { -+ struct test a; -+ f_func_(&a); -+ printf("%0.20lf + %0.20lfi\n", creal(a.t), cimag(a.t)); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/c_main027.c b/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/c_main027.c -new file mode 100644 -index 0000000..2a4ce6c ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/c_main027.c -@@ -0,0 +1,14 @@ -+// Test c call fortran for the derived type and the component of the -+// derived type is scalar of type _Bool -+// -+#include -+#include -+struct test { -+ _Bool t; -+}; -+extern void f_func_(struct test *s); -+int main() { -+ struct test a; -+ f_func_(&a); -+ printf("%d\n", a.t); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/c_main028.c b/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/c_main028.c -new file mode 100644 -index 0000000..4bfabde ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/c_main028.c -@@ -0,0 +1,14 @@ -+// Test c call fortran for the derived type and the component of the -+// derived type is scalar of type char -+// -+#include -+#include -+struct test { -+ char t; -+}; -+extern void f_func_(struct test *s); -+int main() { -+ struct test a; -+ f_func_(&a); -+ printf("%c\n", a.t); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/fortran_func001.f90 b/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/fortran_func001.f90 -new file mode 100644 -index 0000000..042bc57 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/fortran_func001.f90 -@@ -0,0 +1,7 @@ -+subroutine f_func(t) -+ type test -+ integer n -+ end type -+ type(test) :: t -+ t%n = 100 -+end -diff --git a/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/fortran_func002.f90 b/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/fortran_func002.f90 -new file mode 100644 -index 0000000..9ec2ac8 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/fortran_func002.f90 -@@ -0,0 +1,7 @@ -+subroutine f_func(t) -+ type test -+ integer(2) n -+ end type -+ type(test) :: t -+ t%n = 100 -+end -diff --git a/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/fortran_func003.f90 b/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/fortran_func003.f90 -new file mode 100644 -index 0000000..c2bffdc ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/fortran_func003.f90 -@@ -0,0 +1,7 @@ -+subroutine f_func(t) -+ type test -+ integer(8) n -+ end type -+ type(test) :: t -+ t%n = 100 -+end -diff --git a/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/fortran_func004.f90 b/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/fortran_func004.f90 -new file mode 100644 -index 0000000..c2bffdc ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/fortran_func004.f90 -@@ -0,0 +1,7 @@ -+subroutine f_func(t) -+ type test -+ integer(8) n -+ end type -+ type(test) :: t -+ t%n = 100 -+end -diff --git a/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/fortran_func005.f90 b/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/fortran_func005.f90 -new file mode 100644 -index 0000000..0f05a35 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/fortran_func005.f90 -@@ -0,0 +1,7 @@ -+subroutine f_func(t) -+ type test -+ integer(1) n -+ end type -+ type(test) :: t -+ t%n = 100 -+end -diff --git a/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/fortran_func006.f90 b/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/fortran_func006.f90 -new file mode 100644 -index 0000000..c2bffdc ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/fortran_func006.f90 -@@ -0,0 +1,7 @@ -+subroutine f_func(t) -+ type test -+ integer(8) n -+ end type -+ type(test) :: t -+ t%n = 100 -+end -diff --git a/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/fortran_func007.f90 b/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/fortran_func007.f90 -new file mode 100644 -index 0000000..0f05a35 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/fortran_func007.f90 -@@ -0,0 +1,7 @@ -+subroutine f_func(t) -+ type test -+ integer(1) n -+ end type -+ type(test) :: t -+ t%n = 100 -+end -diff --git a/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/fortran_func008.f90 b/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/fortran_func008.f90 -new file mode 100644 -index 0000000..9ec2ac8 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/fortran_func008.f90 -@@ -0,0 +1,7 @@ -+subroutine f_func(t) -+ type test -+ integer(2) n -+ end type -+ type(test) :: t -+ t%n = 100 -+end -diff --git a/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/fortran_func009.f90 b/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/fortran_func009.f90 -new file mode 100644 -index 0000000..64f54d3 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/fortran_func009.f90 -@@ -0,0 +1,7 @@ -+subroutine f_func(t) -+ type test -+ integer(4) n -+ end type -+ type(test) :: t -+ t%n = 100 -+end -diff --git a/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/fortran_func010.f90 b/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/fortran_func010.f90 -new file mode 100644 -index 0000000..c2bffdc ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/fortran_func010.f90 -@@ -0,0 +1,7 @@ -+subroutine f_func(t) -+ type test -+ integer(8) n -+ end type -+ type(test) :: t -+ t%n = 100 -+end -diff --git a/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/fortran_func011.f90 b/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/fortran_func011.f90 -new file mode 100644 -index 0000000..0f05a35 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/fortran_func011.f90 -@@ -0,0 +1,7 @@ -+subroutine f_func(t) -+ type test -+ integer(1) n -+ end type -+ type(test) :: t -+ t%n = 100 -+end -diff --git a/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/fortran_func012.f90 b/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/fortran_func012.f90 -new file mode 100644 -index 0000000..9ec2ac8 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/fortran_func012.f90 -@@ -0,0 +1,7 @@ -+subroutine f_func(t) -+ type test -+ integer(2) n -+ end type -+ type(test) :: t -+ t%n = 100 -+end -diff --git a/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/fortran_func013.f90 b/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/fortran_func013.f90 -new file mode 100644 -index 0000000..64f54d3 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/fortran_func013.f90 -@@ -0,0 +1,7 @@ -+subroutine f_func(t) -+ type test -+ integer(4) n -+ end type -+ type(test) :: t -+ t%n = 100 -+end -diff --git a/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/fortran_func014.f90 b/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/fortran_func014.f90 -new file mode 100644 -index 0000000..c2bffdc ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/fortran_func014.f90 -@@ -0,0 +1,7 @@ -+subroutine f_func(t) -+ type test -+ integer(8) n -+ end type -+ type(test) :: t -+ t%n = 100 -+end -diff --git a/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/fortran_func015.f90 b/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/fortran_func015.f90 -new file mode 100644 -index 0000000..0f05a35 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/fortran_func015.f90 -@@ -0,0 +1,7 @@ -+subroutine f_func(t) -+ type test -+ integer(1) n -+ end type -+ type(test) :: t -+ t%n = 100 -+end -diff --git a/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/fortran_func016.f90 b/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/fortran_func016.f90 -new file mode 100644 -index 0000000..c2bffdc ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/fortran_func016.f90 -@@ -0,0 +1,7 @@ -+subroutine f_func(t) -+ type test -+ integer(8) n -+ end type -+ type(test) :: t -+ t%n = 100 -+end -diff --git a/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/fortran_func017.f90 b/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/fortran_func017.f90 -new file mode 100644 -index 0000000..c2bffdc ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/fortran_func017.f90 -@@ -0,0 +1,7 @@ -+subroutine f_func(t) -+ type test -+ integer(8) n -+ end type -+ type(test) :: t -+ t%n = 100 -+end -diff --git a/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/fortran_func018.f90 b/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/fortran_func018.f90 -new file mode 100644 -index 0000000..c2bffdc ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/fortran_func018.f90 -@@ -0,0 +1,7 @@ -+subroutine f_func(t) -+ type test -+ integer(8) n -+ end type -+ type(test) :: t -+ t%n = 100 -+end -diff --git a/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/fortran_func019.f90 b/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/fortran_func019.f90 -new file mode 100644 -index 0000000..c2bffdc ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/fortran_func019.f90 -@@ -0,0 +1,7 @@ -+subroutine f_func(t) -+ type test -+ integer(8) n -+ end type -+ type(test) :: t -+ t%n = 100 -+end -diff --git a/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/fortran_func020.f90 b/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/fortran_func020.f90 -new file mode 100644 -index 0000000..c2bffdc ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/fortran_func020.f90 -@@ -0,0 +1,7 @@ -+subroutine f_func(t) -+ type test -+ integer(8) n -+ end type -+ type(test) :: t -+ t%n = 100 -+end -diff --git a/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/fortran_func021.f90 b/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/fortran_func021.f90 -new file mode 100644 -index 0000000..75d8e36 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/fortran_func021.f90 -@@ -0,0 +1,7 @@ -+subroutine f_func(t) -+ type test -+ real(4) n -+ end type -+ type(test) :: t -+ t%n = 3.14 -+end -diff --git a/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/fortran_func022.f90 b/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/fortran_func022.f90 -new file mode 100644 -index 0000000..b8dc58e ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/fortran_func022.f90 -@@ -0,0 +1,7 @@ -+subroutine f_func(t) -+ type test -+ real(8) n -+ end type -+ type(test) :: t -+ t%n = 3.14 -+end -diff --git a/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/fortran_func023.f90 b/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/fortran_func023.f90 -new file mode 100644 -index 0000000..7e7d3ab ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/fortran_func023.f90 -@@ -0,0 +1,8 @@ -+subroutine f_func(t) -+ integer, parameter :: K = selected_real_kind(16) -+ type test -+ real(K) n -+ end type -+ type(test) :: t -+ t%n = 3.14 -+end -diff --git a/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/fortran_func024.f90 b/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/fortran_func024.f90 -new file mode 100644 -index 0000000..2c5946d ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/fortran_func024.f90 -@@ -0,0 +1,7 @@ -+subroutine f_func(t) -+ type test -+ complex(4) n -+ end type -+ type(test) :: t -+ t%n = (-12345678.7654321, 1) -+end -diff --git a/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/fortran_func025.f90 b/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/fortran_func025.f90 -new file mode 100644 -index 0000000..37d5023 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/fortran_func025.f90 -@@ -0,0 +1,7 @@ -+subroutine f_func(t) -+ type test -+ complex(8) n -+ end type -+ type(test) :: t -+ t%n = (-12345678.7654321, 1) -+end -diff --git a/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/fortran_func026.f90 b/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/fortran_func026.f90 -new file mode 100644 -index 0000000..e5882c2 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/fortran_func026.f90 -@@ -0,0 +1,8 @@ -+subroutine f_func(t) -+ integer, parameter :: K = selected_real_kind(16) -+ type test -+ complex(K) n -+ end type -+ type(test) :: t -+ t%n = (-12345678.7654321, 1) -+end -diff --git a/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/fortran_func027.f90 b/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/fortran_func027.f90 -new file mode 100644 -index 0000000..3672b88 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/fortran_func027.f90 -@@ -0,0 +1,7 @@ -+subroutine f_func(t) -+ type test -+ logical(1) n -+ end type -+ type(test) :: t -+ t%n = .TRUE. -+end -diff --git a/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/fortran_func028.f90 b/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/fortran_func028.f90 -new file mode 100644 -index 0000000..af8daba ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/fortran_func028.f90 -@@ -0,0 +1,7 @@ -+subroutine f_func(t) -+ type test -+ character(1) n -+ end type -+ type(test) :: t -+ t%n = 'a' -+end -diff --git a/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/run.sh b/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/run.sh -new file mode 100644 -index 0000000..ad3abb0 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/008_c_call_fortran_struct/run.sh -@@ -0,0 +1,16 @@ -+for i in {001..028} -+do -+echo "------- test $i ------." -+#echo "----- gfortran result:" -+#gcc c_main$i.c -c -o c-test.o -+#gfortran fortran_func$i.f90 -fno-range-check -c -o fortran-test.o -+#gfortran fortran-test.o c-test.o -+#./a.out -+#rm *.o a.out -+echo "----- flang-new result : " -+clang c_main$i.c -c -o c-test.o -+flang-new fortran_func$i.f90 -c -o fortran-test.o -+flang-new -flang-experimental-exec c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+done -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/c_main001.c b/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/c_main001.c -new file mode 100644 -index 0000000..82f07ce ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/c_main001.c -@@ -0,0 +1,16 @@ -+// Test c call fortran for the derived type and the component of the -+// derived type is scalar of type int -+// -+#include -+struct t { -+ int x; -+}; -+struct test { -+ struct t w; -+}; -+extern void f_func_(struct test *s); -+int main() { -+ struct test a; -+ f_func_(&a); -+ printf("%d\n", a.w.x); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/c_main002.c b/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/c_main002.c -new file mode 100644 -index 0000000..16adfde ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/c_main002.c -@@ -0,0 +1,16 @@ -+// Test c call fortran for the derived type and the component of the -+// derived type is scalar of type short -+// -+#include -+struct t { -+ short x; -+}; -+struct test { -+ struct t w; -+}; -+extern void f_func_(struct test *s); -+int main() { -+ struct test a; -+ f_func_(&a); -+ printf("%hd\n", a.w.x); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/c_main003.c b/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/c_main003.c -new file mode 100644 -index 0000000..f5e7c6f ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/c_main003.c -@@ -0,0 +1,16 @@ -+// Test c call fortran for the derived type and the component of the -+// derived type is scalar of type long -+// -+#include -+struct t { -+ long x; -+}; -+struct test { -+ struct t w; -+}; -+extern void f_func_(struct test *s); -+int main() { -+ struct test a; -+ f_func_(&a); -+ printf("%ld\n", a.w.x); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/c_main004.c b/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/c_main004.c -new file mode 100644 -index 0000000..6945b96 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/c_main004.c -@@ -0,0 +1,16 @@ -+// Test c call fortran for the derived type and the component of the -+// derived type is scalar of type long long -+// -+#include -+struct t { -+ long long x; -+}; -+struct test { -+ struct t w; -+}; -+extern void f_func_(struct test *s); -+int main() { -+ struct test a; -+ f_func_(&a); -+ printf("%Ld\n", a.w.x); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/c_main005.c b/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/c_main005.c -new file mode 100644 -index 0000000..5313969 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/c_main005.c -@@ -0,0 +1,16 @@ -+// Test c call fortran for the derived type and the component of the -+// derived type is scalar of type signed char -+// -+#include -+struct t { -+ signed char x; -+}; -+struct test { -+ struct t w; -+}; -+extern void f_func_(struct test *s); -+int main() { -+ struct test a; -+ f_func_(&a); -+ printf("%hhd\n", a.w.x); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/c_main006.c b/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/c_main006.c -new file mode 100644 -index 0000000..999d759 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/c_main006.c -@@ -0,0 +1,16 @@ -+// Test c call fortran for the derived type and the component of the -+// derived type is scalar of type size_t -+// -+#include -+struct t { -+ size_t x; -+}; -+struct test { -+ struct t w; -+}; -+extern void f_func_(struct test *s); -+int main() { -+ struct test a; -+ f_func_(&a); -+ printf("%ld\n", a.w.x); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/c_main007.c b/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/c_main007.c -new file mode 100644 -index 0000000..680992f ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/c_main007.c -@@ -0,0 +1,17 @@ -+// Test c call fortran for the derived type and the component of the -+// derived type is scalar of type int8_t -+// -+#include -+#include -+struct t { -+ int8_t x; -+}; -+struct test { -+ struct t w; -+}; -+extern void f_func_(struct test *s); -+int main() { -+ struct test a; -+ f_func_(&a); -+ printf("%hhd\n", a.w.x); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/c_main008.c b/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/c_main008.c -new file mode 100644 -index 0000000..f5b7510 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/c_main008.c -@@ -0,0 +1,17 @@ -+// Test c call fortran for the derived type and the component of the -+// derived type is scalar of type int16_t -+// -+#include -+#include -+struct t { -+ int16_t x; -+}; -+struct test { -+ struct t w; -+}; -+extern void f_func_(struct test *s); -+int main() { -+ struct test a; -+ f_func_(&a); -+ printf("%hd\n", a.w.x); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/c_main009.c b/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/c_main009.c -new file mode 100644 -index 0000000..2227047 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/c_main009.c -@@ -0,0 +1,17 @@ -+// Test c call fortran for the derived type and the component of the -+// derived type is scalar of type int32_t -+// -+#include -+#include -+struct t { -+ int32_t x; -+}; -+struct test { -+ struct t w; -+}; -+extern void f_func_(struct test *s); -+int main() { -+ struct test a; -+ f_func_(&a); -+ printf("%d\n", a.w.x); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/c_main010.c b/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/c_main010.c -new file mode 100644 -index 0000000..355b4c5 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/c_main010.c -@@ -0,0 +1,17 @@ -+// Test c call fortran for the derived type and the component of the -+// derived type is scalar of type int64_t -+// -+#include -+#include -+struct t { -+ int64_t x; -+}; -+struct test { -+ struct t w; -+}; -+extern void f_func_(struct test *s); -+int main() { -+ struct test a; -+ f_func_(&a); -+ printf("%ld\n", a.w.x); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/c_main011.c b/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/c_main011.c -new file mode 100644 -index 0000000..88754d2 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/c_main011.c -@@ -0,0 +1,17 @@ -+// Test c call fortran for the derived type and the component of the -+// derived type is scalar of type int_least8_t -+// -+#include -+#include -+struct t { -+ int_least8_t x; -+}; -+struct test { -+ struct t w; -+}; -+extern void f_func_(struct test *s); -+int main() { -+ struct test a; -+ f_func_(&a); -+ printf("%hhd\n", a.w.x); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/c_main012.c b/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/c_main012.c -new file mode 100644 -index 0000000..930d148 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/c_main012.c -@@ -0,0 +1,17 @@ -+// Test c call fortran for the derived type and the component of the -+// derived type is scalar of type int_least16_t -+// -+#include -+#include -+struct t { -+ int_least16_t x; -+}; -+struct test { -+ struct t w; -+}; -+extern void f_func_(struct test *s); -+int main() { -+ struct test a; -+ f_func_(&a); -+ printf("%hd\n", a.w.x); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/c_main013.c b/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/c_main013.c -new file mode 100644 -index 0000000..b26527a ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/c_main013.c -@@ -0,0 +1,17 @@ -+// Test c call fortran for the derived type and the component of the -+// derived type is scalar of type int_least32_t -+// -+#include -+#include -+struct t { -+ int_least32_t x; -+}; -+struct test { -+ struct t w; -+}; -+extern void f_func_(struct test *s); -+int main() { -+ struct test a; -+ f_func_(&a); -+ printf("%d\n", a.w.x); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/c_main014.c b/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/c_main014.c -new file mode 100644 -index 0000000..9effff1 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/c_main014.c -@@ -0,0 +1,17 @@ -+// Test c call fortran for the derived type and the component of the -+// derived type is scalar of type int_least64_t -+// -+#include -+#include -+struct t { -+ int_least64_t x; -+}; -+struct test { -+ struct t w; -+}; -+extern void f_func_(struct test *s); -+int main() { -+ struct test a; -+ f_func_(&a); -+ printf("%ld\n", a.w.x); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/c_main015.c b/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/c_main015.c -new file mode 100644 -index 0000000..7be24d8 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/c_main015.c -@@ -0,0 +1,17 @@ -+// Test c call fortran for the derived type and the component of the -+// derived type is scalar of type int_fast8_t -+// -+#include -+#include -+struct t { -+ int_fast8_t x; -+}; -+struct test { -+ struct t w; -+}; -+extern void f_func_(struct test *s); -+int main() { -+ struct test a; -+ f_func_(&a); -+ printf("%hhd\n", a.w.x); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/c_main016.c b/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/c_main016.c -new file mode 100644 -index 0000000..e394f92 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/c_main016.c -@@ -0,0 +1,17 @@ -+// Test c call fortran for the derived type and the component of the -+// derived type is scalar of type int_fast16_t -+// -+#include -+#include -+struct t { -+ int_fast16_t x; -+}; -+struct test { -+ struct t w; -+}; -+extern void f_func_(struct test *s); -+int main() { -+ struct test a; -+ f_func_(&a); -+ printf("%ld\n", a.w.x); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/c_main017.c b/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/c_main017.c -new file mode 100644 -index 0000000..cffa904 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/c_main017.c -@@ -0,0 +1,17 @@ -+// Test c call fortran for the derived type and the component of the -+// derived type is scalar of type int_fast32_t -+// -+#include -+#include -+struct t { -+ int_fast32_t x; -+}; -+struct test { -+ struct t w; -+}; -+extern void f_func_(struct test *s); -+int main() { -+ struct test a; -+ f_func_(&a); -+ printf("%ld\n", a.w.x); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/c_main018.c b/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/c_main018.c -new file mode 100644 -index 0000000..9a6ad4c ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/c_main018.c -@@ -0,0 +1,17 @@ -+// Test c call fortran for the derived type and the component of the -+// derived type is scalar of type int_fast64_t -+// -+#include -+#include -+struct t { -+ int_fast64_t x; -+}; -+struct test { -+ struct t w; -+}; -+extern void f_func_(struct test *s); -+int main() { -+ struct test a; -+ f_func_(&a); -+ printf("%ld\n", a.w.x); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/c_main019.c b/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/c_main019.c -new file mode 100644 -index 0000000..ed94ed7 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/c_main019.c -@@ -0,0 +1,17 @@ -+// Test c call fortran for the derived type and the component of the -+// derived type is scalar of type intmax_t -+// -+#include -+#include -+struct t { -+ intmax_t x; -+}; -+struct test { -+ struct t w; -+}; -+extern void f_func_(struct test *s); -+int main() { -+ struct test a; -+ f_func_(&a); -+ printf("%ld\n", a.w.x); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/c_main020.c b/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/c_main020.c -new file mode 100644 -index 0000000..7235d2f ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/c_main020.c -@@ -0,0 +1,17 @@ -+// Test c call fortran for the derived type and the component of the -+// derived type is scalar of type intptr_t -+// -+#include -+#include -+struct t { -+ intptr_t x; -+}; -+struct test { -+ struct t w; -+}; -+extern void f_func_(struct test *s); -+int main() { -+ struct test a; -+ f_func_(&a); -+ printf("%ld\n", a.w.x); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/c_main021.c b/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/c_main021.c -new file mode 100644 -index 0000000..7947fb4 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/c_main021.c -@@ -0,0 +1,16 @@ -+// Test c call fortran for the derived type and the component of the -+// derived type is scalar of type float -+// -+#include -+struct t { -+ float x; -+}; -+struct test { -+ struct t w; -+}; -+extern void f_func_(struct test *s); -+int main() { -+ struct test a; -+ f_func_(&a); -+ printf("%0.20f\n", a.w.x); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/c_main022.c b/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/c_main022.c -new file mode 100644 -index 0000000..39765cf ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/c_main022.c -@@ -0,0 +1,16 @@ -+// Test c call fortran for the derived type and the component of the -+// derived type is scalar of type double -+// -+#include -+struct t { -+ double x; -+}; -+struct test { -+ struct t w; -+}; -+extern void f_func_(struct test *s); -+int main() { -+ struct test a; -+ f_func_(&a); -+ printf("%0.20lf\n", a.w.x); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/c_main023.c b/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/c_main023.c -new file mode 100644 -index 0000000..b560246 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/c_main023.c -@@ -0,0 +1,16 @@ -+// Test c call fortran for the derived type and the component of the -+// derived type is scalar of type long double -+// -+#include -+struct t { -+ long double x; -+}; -+struct test { -+ struct t w; -+}; -+extern void f_func_(struct test *s); -+int main() { -+ struct test a; -+ f_func_(&a); -+ printf("%0.20Lf\n", a.w.x); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/c_main024.c b/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/c_main024.c -new file mode 100644 -index 0000000..882ac49 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/c_main024.c -@@ -0,0 +1,18 @@ -+// Test c call fortran for the derived type and the component of the -+// derived type is scalar of type float _Complex -+// -+#include -+#include -+struct t { -+ float _Complex x; -+}; -+struct test { -+ struct t w; -+}; -+extern void f_func_(struct test *s); -+int main() { -+ struct test a; -+ f_func_(&a); -+ printf("%0.20f + %0.20fi\n", creal(a.w.x), cimag(a.w.x)); -+} -+ -diff --git a/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/c_main025.c b/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/c_main025.c -new file mode 100644 -index 0000000..d85a610 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/c_main025.c -@@ -0,0 +1,18 @@ -+// Test c call fortran for the derived type and the component of the -+// derived type is scalar of type double _Complex -+// -+#include -+#include -+struct t { -+ double _Complex x; -+}; -+struct test { -+ struct t w; -+}; -+extern void f_func_(struct test *s); -+int main() { -+ struct test a; -+ f_func_(&a); -+ printf("%0.20lf + %0.20lfi\n", creal(a.w.x), cimag(a.w.x)); -+} -+ -diff --git a/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/c_main026.c b/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/c_main026.c -new file mode 100644 -index 0000000..bf45517 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/c_main026.c -@@ -0,0 +1,18 @@ -+// Test c call fortran for the derived type and the component of the -+// derived type is scalar of type long double _Complex -+// -+#include -+#include -+struct t { -+ long double _Complex x; -+}; -+struct test { -+ struct t w; -+}; -+extern void f_func_(struct test *s); -+int main() { -+ struct test a; -+ f_func_(&a); -+ printf("%0.20lf + %0.20lfi\n", creal(a.w.x), cimag(a.w.x)); -+} -+ -diff --git a/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/c_main027.c b/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/c_main027.c -new file mode 100644 -index 0000000..d2f28cb ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/c_main027.c -@@ -0,0 +1,16 @@ -+// Test c call fortran for the derived type and the component of the -+// derived type is scalar of type _Bool -+// -+#include -+struct t { -+ _Bool x; -+}; -+struct test { -+ struct t w; -+}; -+extern void f_func_(struct test *s); -+int main() { -+ struct test a; -+ f_func_(&a); -+ printf("%d\n", a.w.x); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/c_main028.c b/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/c_main028.c -new file mode 100644 -index 0000000..55c5de0 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/c_main028.c -@@ -0,0 +1,16 @@ -+// Test c call fortran for the derived type and the component of the -+// derived type is scalar of type char -+// -+#include -+struct t { -+ char x; -+}; -+struct test { -+ struct t w; -+}; -+extern void f_func_(struct test *s); -+int main() { -+ struct test a; -+ f_func_(&a); -+ printf("%c\n", a.w.x); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/fortran_func001.f90 b/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/fortran_func001.f90 -new file mode 100644 -index 0000000..293ee2a ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/fortran_func001.f90 -@@ -0,0 +1,10 @@ -+subroutine f_func(i) -+ type t -+ integer n -+ end type t -+ type test -+ type(t) x -+ end type test -+ type(test) :: i -+ i%x%n = 100 -+end -diff --git a/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/fortran_func002.f90 b/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/fortran_func002.f90 -new file mode 100644 -index 0000000..71f216b ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/fortran_func002.f90 -@@ -0,0 +1,10 @@ -+subroutine f_func(i) -+ type t -+ integer(2) n -+ end type t -+ type test -+ type(t) x -+ end type test -+ type(test) :: i -+ i%x%n = 100 -+end -diff --git a/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/fortran_func003.f90 b/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/fortran_func003.f90 -new file mode 100644 -index 0000000..4f89b40 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/fortran_func003.f90 -@@ -0,0 +1,10 @@ -+subroutine f_func(i) -+ type t -+ integer(8) n -+ end type t -+ type test -+ type(t) x -+ end type test -+ type(test) :: i -+ i%x%n = 100 -+end -diff --git a/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/fortran_func004.f90 b/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/fortran_func004.f90 -new file mode 100644 -index 0000000..4f89b40 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/fortran_func004.f90 -@@ -0,0 +1,10 @@ -+subroutine f_func(i) -+ type t -+ integer(8) n -+ end type t -+ type test -+ type(t) x -+ end type test -+ type(test) :: i -+ i%x%n = 100 -+end -diff --git a/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/fortran_func005.f90 b/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/fortran_func005.f90 -new file mode 100644 -index 0000000..b16ce20 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/fortran_func005.f90 -@@ -0,0 +1,10 @@ -+subroutine f_func(i) -+ type t -+ integer(1) n -+ end type t -+ type test -+ type(t) x -+ end type test -+ type(test) :: i -+ i%x%n = 100 -+end -diff --git a/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/fortran_func006.f90 b/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/fortran_func006.f90 -new file mode 100644 -index 0000000..4f89b40 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/fortran_func006.f90 -@@ -0,0 +1,10 @@ -+subroutine f_func(i) -+ type t -+ integer(8) n -+ end type t -+ type test -+ type(t) x -+ end type test -+ type(test) :: i -+ i%x%n = 100 -+end -diff --git a/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/fortran_func007.f90 b/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/fortran_func007.f90 -new file mode 100644 -index 0000000..b16ce20 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/fortran_func007.f90 -@@ -0,0 +1,10 @@ -+subroutine f_func(i) -+ type t -+ integer(1) n -+ end type t -+ type test -+ type(t) x -+ end type test -+ type(test) :: i -+ i%x%n = 100 -+end -diff --git a/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/fortran_func008.f90 b/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/fortran_func008.f90 -new file mode 100644 -index 0000000..71f216b ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/fortran_func008.f90 -@@ -0,0 +1,10 @@ -+subroutine f_func(i) -+ type t -+ integer(2) n -+ end type t -+ type test -+ type(t) x -+ end type test -+ type(test) :: i -+ i%x%n = 100 -+end -diff --git a/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/fortran_func009.f90 b/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/fortran_func009.f90 -new file mode 100644 -index 0000000..c53073a ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/fortran_func009.f90 -@@ -0,0 +1,10 @@ -+subroutine f_func(i) -+ type t -+ integer(4) n -+ end type t -+ type test -+ type(t) x -+ end type test -+ type(test) :: i -+ i%x%n = 100 -+end -diff --git a/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/fortran_func010.f90 b/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/fortran_func010.f90 -new file mode 100644 -index 0000000..4f89b40 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/fortran_func010.f90 -@@ -0,0 +1,10 @@ -+subroutine f_func(i) -+ type t -+ integer(8) n -+ end type t -+ type test -+ type(t) x -+ end type test -+ type(test) :: i -+ i%x%n = 100 -+end -diff --git a/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/fortran_func011.f90 b/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/fortran_func011.f90 -new file mode 100644 -index 0000000..b16ce20 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/fortran_func011.f90 -@@ -0,0 +1,10 @@ -+subroutine f_func(i) -+ type t -+ integer(1) n -+ end type t -+ type test -+ type(t) x -+ end type test -+ type(test) :: i -+ i%x%n = 100 -+end -diff --git a/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/fortran_func012.f90 b/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/fortran_func012.f90 -new file mode 100644 -index 0000000..71f216b ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/fortran_func012.f90 -@@ -0,0 +1,10 @@ -+subroutine f_func(i) -+ type t -+ integer(2) n -+ end type t -+ type test -+ type(t) x -+ end type test -+ type(test) :: i -+ i%x%n = 100 -+end -diff --git a/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/fortran_func013.f90 b/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/fortran_func013.f90 -new file mode 100644 -index 0000000..c53073a ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/fortran_func013.f90 -@@ -0,0 +1,10 @@ -+subroutine f_func(i) -+ type t -+ integer(4) n -+ end type t -+ type test -+ type(t) x -+ end type test -+ type(test) :: i -+ i%x%n = 100 -+end -diff --git a/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/fortran_func014.f90 b/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/fortran_func014.f90 -new file mode 100644 -index 0000000..4f89b40 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/fortran_func014.f90 -@@ -0,0 +1,10 @@ -+subroutine f_func(i) -+ type t -+ integer(8) n -+ end type t -+ type test -+ type(t) x -+ end type test -+ type(test) :: i -+ i%x%n = 100 -+end -diff --git a/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/fortran_func015.f90 b/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/fortran_func015.f90 -new file mode 100644 -index 0000000..b16ce20 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/fortran_func015.f90 -@@ -0,0 +1,10 @@ -+subroutine f_func(i) -+ type t -+ integer(1) n -+ end type t -+ type test -+ type(t) x -+ end type test -+ type(test) :: i -+ i%x%n = 100 -+end -diff --git a/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/fortran_func016.f90 b/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/fortran_func016.f90 -new file mode 100644 -index 0000000..4f89b40 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/fortran_func016.f90 -@@ -0,0 +1,10 @@ -+subroutine f_func(i) -+ type t -+ integer(8) n -+ end type t -+ type test -+ type(t) x -+ end type test -+ type(test) :: i -+ i%x%n = 100 -+end -diff --git a/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/fortran_func017.f90 b/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/fortran_func017.f90 -new file mode 100644 -index 0000000..4f89b40 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/fortran_func017.f90 -@@ -0,0 +1,10 @@ -+subroutine f_func(i) -+ type t -+ integer(8) n -+ end type t -+ type test -+ type(t) x -+ end type test -+ type(test) :: i -+ i%x%n = 100 -+end -diff --git a/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/fortran_func018.f90 b/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/fortran_func018.f90 -new file mode 100644 -index 0000000..4f89b40 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/fortran_func018.f90 -@@ -0,0 +1,10 @@ -+subroutine f_func(i) -+ type t -+ integer(8) n -+ end type t -+ type test -+ type(t) x -+ end type test -+ type(test) :: i -+ i%x%n = 100 -+end -diff --git a/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/fortran_func019.f90 b/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/fortran_func019.f90 -new file mode 100644 -index 0000000..4f89b40 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/fortran_func019.f90 -@@ -0,0 +1,10 @@ -+subroutine f_func(i) -+ type t -+ integer(8) n -+ end type t -+ type test -+ type(t) x -+ end type test -+ type(test) :: i -+ i%x%n = 100 -+end -diff --git a/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/fortran_func020.f90 b/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/fortran_func020.f90 -new file mode 100644 -index 0000000..4f89b40 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/fortran_func020.f90 -@@ -0,0 +1,10 @@ -+subroutine f_func(i) -+ type t -+ integer(8) n -+ end type t -+ type test -+ type(t) x -+ end type test -+ type(test) :: i -+ i%x%n = 100 -+end -diff --git a/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/fortran_func021.f90 b/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/fortran_func021.f90 -new file mode 100644 -index 0000000..0542cd2 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/fortran_func021.f90 -@@ -0,0 +1,10 @@ -+subroutine f_func(i) -+ type t -+ real(4) n -+ end type t -+ type test -+ type(t) x -+ end type test -+ type(test) :: i -+ i%x%n = 123.4567898765432123456789 -+end -diff --git a/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/fortran_func022.f90 b/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/fortran_func022.f90 -new file mode 100644 -index 0000000..b3463b7 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/fortran_func022.f90 -@@ -0,0 +1,10 @@ -+subroutine f_func(i) -+ type t -+ real(8) n -+ end type t -+ type test -+ type(t) x -+ end type test -+ type(test) :: i -+ i%x%n = 123.4567898765432123456789 -+end -diff --git a/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/fortran_func023.f90 b/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/fortran_func023.f90 -new file mode 100644 -index 0000000..6e0641b ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/fortran_func023.f90 -@@ -0,0 +1,12 @@ -+subroutine f_func(i) -+ integer, parameter :: K = selected_real_kind(16) -+ type t -+ real(K) n -+ end type t -+ type test -+ type(t) x -+ end type test -+ type(test) :: i -+ i%x%n = 123.4567898765432123456789 -+end -+ -diff --git a/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/fortran_func024.f90 b/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/fortran_func024.f90 -new file mode 100644 -index 0000000..e05aa79 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/fortran_func024.f90 -@@ -0,0 +1,12 @@ -+subroutine f_func(i) -+ type t -+ complex(4) n -+ end type t -+ type test -+ type(t) x -+ end type test -+ type(test) :: i -+ i%x%n = (123.4567898765432123456789, 1) -+end -+ -+ -diff --git a/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/fortran_func025.f90 b/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/fortran_func025.f90 -new file mode 100644 -index 0000000..835cd59 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/fortran_func025.f90 -@@ -0,0 +1,12 @@ -+subroutine f_func(i) -+ type t -+ complex(8) n -+ end type t -+ type test -+ type(t) x -+ end type test -+ type(test) :: i -+ i%x%n = (123.4567898765432123456789, 1) -+end -+ -+ -diff --git a/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/fortran_func026.f90 b/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/fortran_func026.f90 -new file mode 100644 -index 0000000..bb690e7 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/fortran_func026.f90 -@@ -0,0 +1,14 @@ -+subroutine f_func(i) -+ integer, parameter :: K = selected_real_kind(16) -+ type t -+ complex(K) n -+ end type t -+ type test -+ type(t) x -+ end type test -+ type(test) :: i -+ i%x%n = (123.4567898765432123456789, 1) -+end -+ -+ -+ -diff --git a/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/fortran_func027.f90 b/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/fortran_func027.f90 -new file mode 100644 -index 0000000..8044a61 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/fortran_func027.f90 -@@ -0,0 +1,10 @@ -+subroutine f_func(i) -+ type t -+ logical(1) n -+ end type t -+ type test -+ type(t) x -+ end type test -+ type(test) :: i -+ i%x%n = .TRUE. -+end -diff --git a/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/fortran_func028.f90 b/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/fortran_func028.f90 -new file mode 100644 -index 0000000..0b4f672 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/fortran_func028.f90 -@@ -0,0 +1,10 @@ -+subroutine f_func(i) -+ type t -+ character(1) n -+ end type t -+ type test -+ type(t) x -+ end type test -+ type(test) :: i -+ i%x%n = 'a' -+end -diff --git a/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/run.sh b/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/run.sh -new file mode 100644 -index 0000000..ad3abb0 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/009_c_call_fortran_nested_struct_simple/run.sh -@@ -0,0 +1,16 @@ -+for i in {001..028} -+do -+echo "------- test $i ------." -+#echo "----- gfortran result:" -+#gcc c_main$i.c -c -o c-test.o -+#gfortran fortran_func$i.f90 -fno-range-check -c -o fortran-test.o -+#gfortran fortran-test.o c-test.o -+#./a.out -+#rm *.o a.out -+echo "----- flang-new result : " -+clang c_main$i.c -c -o c-test.o -+flang-new fortran_func$i.f90 -c -o fortran-test.o -+flang-new -flang-experimental-exec c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+done -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/010_c_call_fortran_nested_struct_complicated/c_main001.c b/test/interoperability_with_c_c_call_fortran/010_c_call_fortran_nested_struct_complicated/c_main001.c -new file mode 100644 -index 0000000..c76dd0a ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/010_c_call_fortran_nested_struct_complicated/c_main001.c -@@ -0,0 +1,21 @@ -+// Test c call fortran for the derived type and the component of the -+// derived type is derived type -+// -+#include -+struct t { -+ int x; -+}; -+struct test { -+ struct t w; -+ int ww[4]; -+}; -+extern void f_func_(struct test *s); -+int main() { -+ struct test a; -+ f_func_(&a); -+ printf("%d\n", a.w.x); -+ printf("%d\n", a.ww[0]); -+ printf("%d\n", a.ww[1]); -+ printf("%d\n", a.ww[2]); -+ printf("%d\n", a.ww[3]); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/010_c_call_fortran_nested_struct_complicated/c_main002.c b/test/interoperability_with_c_c_call_fortran/010_c_call_fortran_nested_struct_complicated/c_main002.c -new file mode 100644 -index 0000000..1f77697 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/010_c_call_fortran_nested_struct_complicated/c_main002.c -@@ -0,0 +1,26 @@ -+// Test c call fortran for the array of derived type and the component -+// of the derived type is derived type -+// -+#include -+struct t { -+ int x; -+}; -+struct test { -+ struct t w; -+ int ww[4]; -+}; -+extern void f_func_(struct test s[2]); -+int main() { -+ struct test a[2]; -+ f_func_(a); -+ printf("%d\n", a[0].w.x); -+ printf("%d\n", a[0].ww[0]); -+ printf("%d\n", a[0].ww[1]); -+ printf("%d\n", a[0].ww[2]); -+ printf("%d\n", a[0].ww[3]); -+ printf("%d\n", a[1].w.x); -+ printf("%d\n", a[1].ww[0]); -+ printf("%d\n", a[1].ww[1]); -+ printf("%d\n", a[1].ww[2]); -+ printf("%d\n", a[1].ww[3]); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/010_c_call_fortran_nested_struct_complicated/c_main003.c b/test/interoperability_with_c_c_call_fortran/010_c_call_fortran_nested_struct_complicated/c_main003.c -new file mode 100644 -index 0000000..75fc179 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/010_c_call_fortran_nested_struct_complicated/c_main003.c -@@ -0,0 +1,23 @@ -+// Test c call fortran for the derived type and the component of the -+// derived type are derived types -+// -+#include -+struct t { -+ int x; -+}; -+struct t2 { -+ struct t t2w; -+ int t2x; -+}; -+struct test { -+ struct t w; -+ struct t2 ww; -+}; -+extern void f_func_(struct test *s); -+int main() { -+ struct test a; -+ f_func_(&a); -+ printf("%d\n", a.w.x); -+ printf("%d\n", a.ww.t2x); -+ printf("%d\n", a.ww.t2w.x); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/010_c_call_fortran_nested_struct_complicated/c_main004.c b/test/interoperability_with_c_c_call_fortran/010_c_call_fortran_nested_struct_complicated/c_main004.c -new file mode 100644 -index 0000000..d861d2d ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/010_c_call_fortran_nested_struct_complicated/c_main004.c -@@ -0,0 +1,30 @@ -+// Test c call fortran for the nesting of derived types -+// -+#include -+struct t { -+ int x; -+}; -+struct t1 { -+ struct t t1t; -+ int x1; -+}; -+struct t2 { -+ struct t1 t2t1; -+ int x2; -+}; -+struct t3 { -+ struct t2 t3t2; -+ int x3; -+}; -+struct test { -+ struct t3 w; -+}; -+extern void f_func_(struct test *s); -+int main() { -+ struct test a; -+ f_func_(&a); -+ printf("%d\n", a.w.x3); -+ printf("%d\n", a.w.t3t2.x2); -+ printf("%d\n", a.w.t3t2.t2t1.x1); -+ printf("%d\n", a.w.t3t2.t2t1.t1t.x); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/010_c_call_fortran_nested_struct_complicated/c_main005.c b/test/interoperability_with_c_c_call_fortran/010_c_call_fortran_nested_struct_complicated/c_main005.c -new file mode 100644 -index 0000000..e270b60 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/010_c_call_fortran_nested_struct_complicated/c_main005.c -@@ -0,0 +1,19 @@ -+// Test c call fortran for the derived type and the component of the -+// derived type is array of derived type -+// -+#include -+struct t { -+ int x; -+}; -+struct test { -+ struct t w[4]; -+}; -+extern void f_func_(struct test *s); -+int main() { -+ struct test a; -+ f_func_(&a); -+ printf("%d\n", a.w[0].x); -+ printf("%d\n", a.w[1].x); -+ printf("%d\n", a.w[2].x); -+ printf("%d\n", a.w[3].x); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/010_c_call_fortran_nested_struct_complicated/c_main006.c b/test/interoperability_with_c_c_call_fortran/010_c_call_fortran_nested_struct_complicated/c_main006.c -new file mode 100644 -index 0000000..706d40a ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/010_c_call_fortran_nested_struct_complicated/c_main006.c -@@ -0,0 +1,15 @@ -+// Test c call fortran for the derived type and the component of the -+// derived type is scalar of type int -+// -+#include -+struct t { -+ int x; -+}; -+extern struct t f_func_(struct t *s); -+int main() { -+ struct t a; -+ struct t b; -+ b = f_func_(&a); -+ printf("%d\n", a.x); -+ printf("%d\n", b.x); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/010_c_call_fortran_nested_struct_complicated/fortran_func001.f90 b/test/interoperability_with_c_c_call_fortran/010_c_call_fortran_nested_struct_complicated/fortran_func001.f90 -new file mode 100644 -index 0000000..eddf162 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/010_c_call_fortran_nested_struct_complicated/fortran_func001.f90 -@@ -0,0 +1,14 @@ -+subroutine f_func(i) -+ type t -+ integer n -+ end type t -+ type test -+ type(t) x -+ integer :: ww(4) -+ end type test -+ type(test) :: i -+ i%x%n = 100 -+ do j = 1, 4 -+ i%ww(j) = j -+ end do -+end -diff --git a/test/interoperability_with_c_c_call_fortran/010_c_call_fortran_nested_struct_complicated/fortran_func002.f90 b/test/interoperability_with_c_c_call_fortran/010_c_call_fortran_nested_struct_complicated/fortran_func002.f90 -new file mode 100644 -index 0000000..d05af6d ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/010_c_call_fortran_nested_struct_complicated/fortran_func002.f90 -@@ -0,0 +1,18 @@ -+subroutine f_func(i) -+ type t -+ integer n -+ end type t -+ type test -+ type(t) x -+ integer :: ww(4) -+ end type test -+ type(test) :: i(2) -+ i(1)%x%n = 100 -+ do j = 1, 4 -+ i(1)%ww(j) = j -+ end do -+ i(2)%x%n = 200 -+ do j = 1, 4 -+ i(2)%ww(j) = j + 1 -+ end do -+end -diff --git a/test/interoperability_with_c_c_call_fortran/010_c_call_fortran_nested_struct_complicated/fortran_func003.f90 b/test/interoperability_with_c_c_call_fortran/010_c_call_fortran_nested_struct_complicated/fortran_func003.f90 -new file mode 100644 -index 0000000..4b00f99 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/010_c_call_fortran_nested_struct_complicated/fortran_func003.f90 -@@ -0,0 +1,17 @@ -+subroutine f_func(i) -+ type t -+ integer n -+ end type t -+ type t2 -+ type(t) t2x -+ integer t2n -+ end type t2 -+ type test -+ type(t) x -+ type(t2) x2 -+ end type test -+ type(test) :: i -+ i%x%n = 100 -+ i%x2%t2n = 100 -+ i%x2%t2x%n = 100 -+end -diff --git a/test/interoperability_with_c_c_call_fortran/010_c_call_fortran_nested_struct_complicated/fortran_func004.f90 b/test/interoperability_with_c_c_call_fortran/010_c_call_fortran_nested_struct_complicated/fortran_func004.f90 -new file mode 100644 -index 0000000..652f176 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/010_c_call_fortran_nested_struct_complicated/fortran_func004.f90 -@@ -0,0 +1,25 @@ -+subroutine f_func(i) -+ type t -+ integer n -+ end type t -+ type t1 -+ type(t) x1 -+ integer n1 -+ end type t1 -+ type t2 -+ type(t1) x2 -+ integer n2 -+ end type t2 -+ type t3 -+ type(t2) x3 -+ integer n3 -+ end type t3 -+ type test -+ type(t3) x -+ end type test -+ type(test) :: i -+ i%x%n3 = 100 -+ i%x%x3%n2 = 100 -+ i%x%x3%x2%n1 = 100 -+ i%x%x3%x2%x1%n = 100 -+end -diff --git a/test/interoperability_with_c_c_call_fortran/010_c_call_fortran_nested_struct_complicated/fortran_func005.f90 b/test/interoperability_with_c_c_call_fortran/010_c_call_fortran_nested_struct_complicated/fortran_func005.f90 -new file mode 100644 -index 0000000..d4dc973 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/010_c_call_fortran_nested_struct_complicated/fortran_func005.f90 -@@ -0,0 +1,12 @@ -+subroutine f_func(i) -+ type t -+ integer n -+ end type t -+ type test -+ type(t) x(4) -+ end type test -+ type(test) :: i -+ do j = 1, 4 -+ i%x(j)%n = j -+ end do -+end -diff --git a/test/interoperability_with_c_c_call_fortran/010_c_call_fortran_nested_struct_complicated/fortran_func006.f90 b/test/interoperability_with_c_c_call_fortran/010_c_call_fortran_nested_struct_complicated/fortran_func006.f90 -new file mode 100644 -index 0000000..95c3653 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/010_c_call_fortran_nested_struct_complicated/fortran_func006.f90 -@@ -0,0 +1,9 @@ -+function f_func(a) -+ type t -+ integer n -+ end type t -+ type(t) :: a -+ type(t) :: f_func -+ a%n = 1 -+ f_func%n = 2 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/010_c_call_fortran_nested_struct_complicated/run.sh b/test/interoperability_with_c_c_call_fortran/010_c_call_fortran_nested_struct_complicated/run.sh -new file mode 100644 -index 0000000..7f7ca3d ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/010_c_call_fortran_nested_struct_complicated/run.sh -@@ -0,0 +1,16 @@ -+for i in {001..006} -+do -+echo "------- test $i ------." -+#echo "----- gfortran result:" -+#gcc c_main$i.c -c -o c-test.o -+#gfortran fortran_func$i.f90 -fno-range-check -c -o fortran-test.o -+#gfortran fortran-test.o c-test.o -+#./a.out -+#rm *.o a.out -+echo "----- flang-new result : " -+clang c_main$i.c -c -o c-test.o -+flang-new fortran_func$i.f90 -c -o fortran-test.o -+flang-new -flang-experimental-exec c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+done -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main001.c b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main001.c -new file mode 100644 -index 0000000..8889aba ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main001.c -@@ -0,0 +1,9 @@ -+// Test c call fortran for the return type is int -+// -+#include -+extern int f_func_(int *i); -+int main() { -+ int s1 = 5; -+ int res = f_func_(&s1); -+ printf("%d\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main002.c b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main002.c -new file mode 100644 -index 0000000..31b044f ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main002.c -@@ -0,0 +1,9 @@ -+// Test c call fortran for the return type is short -+// -+#include -+extern short f_func_(short *i); -+int main() { -+ short s1 = 5; -+ short res = f_func_(&s1); -+ printf("%hd\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main003.c b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main003.c -new file mode 100644 -index 0000000..d01bca9 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main003.c -@@ -0,0 +1,9 @@ -+// Test c call fortran for the return type is long -+// -+#include -+extern long f_func_(long *i); -+int main() { -+ long s1 = 5; -+ long res = f_func_(&s1); -+ printf("%ld\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main004.c b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main004.c -new file mode 100644 -index 0000000..7680380 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main004.c -@@ -0,0 +1,9 @@ -+// Test c call fortran for the return type is long long -+// -+#include -+extern long long f_func_(long long *i); -+int main() { -+ long long s1 = 5; -+ long long res = f_func_(&s1); -+ printf("%Ld\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main005.c b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main005.c -new file mode 100644 -index 0000000..4cf34d1 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main005.c -@@ -0,0 +1,9 @@ -+// Test c call fortran for the return type is signed char -+// -+#include -+extern signed char f_func_(signed char *i); -+int main() { -+ signed char s1 = 85; -+ signed char res = f_func_(&s1); -+ printf("%c\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main006.c b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main006.c -new file mode 100644 -index 0000000..1066139 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main006.c -@@ -0,0 +1,9 @@ -+// Test c call fortran for the return type is size_t -+// -+#include -+extern size_t f_func_(size_t *i); -+int main() { -+ size_t s1 = 5; -+ size_t res = f_func_(&s1); -+ printf("%ld\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main007.c b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main007.c -new file mode 100644 -index 0000000..547b2a1 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main007.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is int8_t -+// -+#include -+#include -+extern int8_t f_func_(int8_t *i); -+int main() { -+ int8_t s1 = 5; -+ int8_t res = f_func_(&s1); -+ printf("%hhd\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main008.c b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main008.c -new file mode 100644 -index 0000000..0a91427 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main008.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is int16_t -+// -+#include -+#include -+extern int16_t f_func_(int16_t *i); -+int main() { -+ int16_t s1 = 5; -+ int16_t res = f_func_(&s1); -+ printf("%hd\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main009.c b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main009.c -new file mode 100644 -index 0000000..ec7c9dd ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main009.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is int32_t -+// -+#include -+#include -+extern int32_t f_func_(int32_t *i); -+int main() { -+ int32_t s1 = 5; -+ int32_t res = f_func_(&s1); -+ printf("%d\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main010.c b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main010.c -new file mode 100644 -index 0000000..40aa8e9 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main010.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is int64_t -+// -+#include -+#include -+extern int64_t f_func_(int64_t *i); -+int main() { -+ int64_t s1 = 5; -+ int64_t res = f_func_(&s1); -+ printf("%ld\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main011.c b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main011.c -new file mode 100644 -index 0000000..2ff6688 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main011.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is int_least8_t -+// -+#include -+#include -+extern int_least8_t f_func_(int_least8_t *i); -+int main() { -+ int_least8_t s1 = 5; -+ int_least8_t res = f_func_(&s1); -+ printf("%hhd\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main012.c b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main012.c -new file mode 100644 -index 0000000..c332da0 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main012.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is int_least16_t -+// -+#include -+#include -+extern int_least16_t f_func_(int_least16_t *i); -+int main() { -+ int_least16_t s1 = 5; -+ int_least16_t res = f_func_(&s1); -+ printf("%hd\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main013.c b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main013.c -new file mode 100644 -index 0000000..f72441e ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main013.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is int_least32_t -+// -+#include -+#include -+extern int_least32_t f_func_(int_least32_t *i); -+int main() { -+ int_least32_t s1 = 5; -+ int_least32_t res = f_func_(&s1); -+ printf("%d\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main014.c b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main014.c -new file mode 100644 -index 0000000..4d98217 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main014.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is int_least64_t -+// -+#include -+#include -+extern int_least64_t f_func_(int_least64_t *i); -+int main() { -+ int_least64_t s1 = 5; -+ int_least64_t res = f_func_(&s1); -+ printf("%ld\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main015.c b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main015.c -new file mode 100644 -index 0000000..dd99955 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main015.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is int_fast8_t -+// -+#include -+#include -+extern int_fast8_t f_func_(int_fast8_t *i); -+int main() { -+ int_fast8_t s1 = 5; -+ int_fast8_t res = f_func_(&s1); -+ printf("%hhd\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main016.c b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main016.c -new file mode 100644 -index 0000000..c8ca6e2 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main016.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is int_fast16_t -+// -+#include -+#include -+extern int_fast16_t f_func_(int_fast16_t *i); -+int main() { -+ int_fast16_t s1 = 5; -+ int_fast16_t res = f_func_(&s1); -+ printf("%ld\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main017.c b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main017.c -new file mode 100644 -index 0000000..d5dbfa1 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main017.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is int_fast32_t -+// -+#include -+#include -+extern int_fast32_t f_func_(int_fast32_t *i); -+int main() { -+ int_fast32_t s1 = 5; -+ int_fast32_t res = f_func_(&s1); -+ printf("%ld\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main018.c b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main018.c -new file mode 100644 -index 0000000..11536d8 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main018.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is int_fast64_t -+// -+#include -+#include -+extern int_fast64_t f_func_(int_fast64_t *i); -+int main() { -+ int_fast64_t s1 = 5; -+ int_fast64_t res = f_func_(&s1); -+ printf("%ld\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main019.c b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main019.c -new file mode 100644 -index 0000000..c5c0ac0 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main019.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is intmax_t -+// -+#include -+#include -+extern intmax_t f_func_(intmax_t *i); -+int main() { -+ intmax_t s1 = 5; -+ intmax_t res = f_func_(&s1); -+ printf("%ld\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main020.c b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main020.c -new file mode 100644 -index 0000000..3985c08 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main020.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is intptr_t -+// -+#include -+#include -+extern intptr_t f_func_(intptr_t *i); -+int main() { -+ intptr_t s1 = 5; -+ intptr_t res = f_func_(&s1); -+ printf("%ld\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main021.c b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main021.c -new file mode 100644 -index 0000000..e260dd4 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main021.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is float -+// -+#include -+#include -+extern float f_func_(float *i); -+int main() { -+ float i = 0.5; -+ float res = f_func_(&i); -+ printf("%0.20f\n", res); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main022.c b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main022.c -new file mode 100644 -index 0000000..1e9fdd4 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main022.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is double -+// -+#include -+#include -+extern double f_func_(double *i); -+int main() { -+ double i = 0.5; -+ double res = f_func_(&i); -+ printf("%0.20lf\n", res); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main023.c b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main023.c -new file mode 100644 -index 0000000..8b1d692 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main023.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is long double -+// -+#include -+#include -+extern long double f_func_(long double *i); -+int main() { -+ long double i = 0.5; -+ long double res = f_func_(&i); -+ printf("%0.20Lf\n", res); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main024.c b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main024.c -new file mode 100644 -index 0000000..350055a ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main024.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is float _Complex -+// -+#include -+#include -+extern float _Complex f_func_(float _Complex *i); -+int main() { -+ float _Complex i; -+ float _Complex res = f_func_(&i); -+ printf("%0.20f + %0.20fi\n", creal(res), cimag(res)); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main025.c b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main025.c -new file mode 100644 -index 0000000..b81188d ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main025.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is double _Complex -+// -+#include -+#include -+extern double _Complex f_func_(double _Complex *i); -+int main() { -+ double _Complex i; -+ double _Complex res = f_func_(&i); -+ printf("%0.20lf + %0.20lfi\n", creal(res), cimag(res)); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main026.c b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main026.c -new file mode 100644 -index 0000000..630ab26 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main026.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is long double _Complex -+// -+#include -+#include -+extern long double _Complex f_func_(long double _Complex *i); -+int main() { -+ long double _Complex i; -+ long double _Complex res = f_func_(&i); -+ printf("%0.20lf + %0.20lfi\n", creal(res), cimag(res)); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main027.c b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main027.c -new file mode 100644 -index 0000000..dd95917 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main027.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is _Bool -+// -+#include -+#include -+extern _Bool f_func_(_Bool *i); -+int main() { -+ _Bool i = 0; -+ _Bool res = f_func_(&i); -+ printf("%d\n", res); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main028.c b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main028.c -new file mode 100644 -index 0000000..1bbb2a6 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/c_main028.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is char -+// -+#include -+#include -+extern char f_func_(char *i); -+int main() { -+ char i; -+ char res = f_func_(&i); -+ printf("%c\n", res); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func001.f90 b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func001.f90 -new file mode 100644 -index 0000000..8809b59 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func001.f90 -@@ -0,0 +1,4 @@ -+integer function f_func(i) -+ integer :: i -+ f_func = 10 + i -+end -diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func002.f90 b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func002.f90 -new file mode 100644 -index 0000000..91a5d95 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func002.f90 -@@ -0,0 +1,4 @@ -+integer function f_func(i) -+ integer(2) :: i -+ f_func = 10 + i -+end -diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func003.f90 b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func003.f90 -new file mode 100644 -index 0000000..d91ed67 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func003.f90 -@@ -0,0 +1,4 @@ -+integer function f_func(i) -+ integer(8) :: i -+ f_func = 10 + i -+end -diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func004.f90 b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func004.f90 -new file mode 100644 -index 0000000..d91ed67 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func004.f90 -@@ -0,0 +1,4 @@ -+integer function f_func(i) -+ integer(8) :: i -+ f_func = 10 + i -+end -diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func005.f90 b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func005.f90 -new file mode 100644 -index 0000000..bd7b3fc ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func005.f90 -@@ -0,0 +1,4 @@ -+integer function f_func(i) -+ integer(1) :: i -+ f_func = 10 + i -+end -diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func006.f90 b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func006.f90 -new file mode 100644 -index 0000000..d91ed67 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func006.f90 -@@ -0,0 +1,4 @@ -+integer function f_func(i) -+ integer(8) :: i -+ f_func = 10 + i -+end -diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func007.f90 b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func007.f90 -new file mode 100644 -index 0000000..bd7b3fc ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func007.f90 -@@ -0,0 +1,4 @@ -+integer function f_func(i) -+ integer(1) :: i -+ f_func = 10 + i -+end -diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func008.f90 b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func008.f90 -new file mode 100644 -index 0000000..91a5d95 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func008.f90 -@@ -0,0 +1,4 @@ -+integer function f_func(i) -+ integer(2) :: i -+ f_func = 10 + i -+end -diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func009.f90 b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func009.f90 -new file mode 100644 -index 0000000..c386948 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func009.f90 -@@ -0,0 +1,4 @@ -+integer function f_func(i) -+ integer(4) :: i -+ f_func = 10 + i -+end -diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func010.f90 b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func010.f90 -new file mode 100644 -index 0000000..d91ed67 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func010.f90 -@@ -0,0 +1,4 @@ -+integer function f_func(i) -+ integer(8) :: i -+ f_func = 10 + i -+end -diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func011.f90 b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func011.f90 -new file mode 100644 -index 0000000..bd7b3fc ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func011.f90 -@@ -0,0 +1,4 @@ -+integer function f_func(i) -+ integer(1) :: i -+ f_func = 10 + i -+end -diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func012.f90 b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func012.f90 -new file mode 100644 -index 0000000..91a5d95 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func012.f90 -@@ -0,0 +1,4 @@ -+integer function f_func(i) -+ integer(2) :: i -+ f_func = 10 + i -+end -diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func013.f90 b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func013.f90 -new file mode 100644 -index 0000000..c386948 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func013.f90 -@@ -0,0 +1,4 @@ -+integer function f_func(i) -+ integer(4) :: i -+ f_func = 10 + i -+end -diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func014.f90 b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func014.f90 -new file mode 100644 -index 0000000..d91ed67 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func014.f90 -@@ -0,0 +1,4 @@ -+integer function f_func(i) -+ integer(8) :: i -+ f_func = 10 + i -+end -diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func015.f90 b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func015.f90 -new file mode 100644 -index 0000000..bd7b3fc ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func015.f90 -@@ -0,0 +1,4 @@ -+integer function f_func(i) -+ integer(1) :: i -+ f_func = 10 + i -+end -diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func016.f90 b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func016.f90 -new file mode 100644 -index 0000000..d91ed67 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func016.f90 -@@ -0,0 +1,4 @@ -+integer function f_func(i) -+ integer(8) :: i -+ f_func = 10 + i -+end -diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func017.f90 b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func017.f90 -new file mode 100644 -index 0000000..d91ed67 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func017.f90 -@@ -0,0 +1,4 @@ -+integer function f_func(i) -+ integer(8) :: i -+ f_func = 10 + i -+end -diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func018.f90 b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func018.f90 -new file mode 100644 -index 0000000..d91ed67 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func018.f90 -@@ -0,0 +1,4 @@ -+integer function f_func(i) -+ integer(8) :: i -+ f_func = 10 + i -+end -diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func019.f90 b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func019.f90 -new file mode 100644 -index 0000000..d91ed67 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func019.f90 -@@ -0,0 +1,4 @@ -+integer function f_func(i) -+ integer(8) :: i -+ f_func = 10 + i -+end -diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func020.f90 b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func020.f90 -new file mode 100644 -index 0000000..d91ed67 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func020.f90 -@@ -0,0 +1,4 @@ -+integer function f_func(i) -+ integer(8) :: i -+ f_func = 10 + i -+end -diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func021.f90 b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func021.f90 -new file mode 100644 -index 0000000..27c8008 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func021.f90 -@@ -0,0 +1,4 @@ -+real function f_func(i) -+ real(4) :: i -+ f_func = i + 0.1 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func022.f90 b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func022.f90 -new file mode 100644 -index 0000000..b862910 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func022.f90 -@@ -0,0 +1,4 @@ -+real(8) function f_func(i) -+ real(8) :: i -+ f_func = i + 0.1 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func023.f90 b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func023.f90 -new file mode 100644 -index 0000000..5a24ed7 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func023.f90 -@@ -0,0 +1,6 @@ -+function f_func(i) -+ integer, parameter :: K = selected_real_kind(16) -+ real(K) :: i -+ real(K) :: f_func -+ f_func = i + 0.1 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func024.f90 b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func024.f90 -new file mode 100644 -index 0000000..e158cce ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func024.f90 -@@ -0,0 +1,4 @@ -+complex(4) function f_func(i) -+ complex(4) :: i -+ f_func = (-12345678.7654321, 1) -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func025.f90 b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func025.f90 -new file mode 100644 -index 0000000..3cd9e4e ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func025.f90 -@@ -0,0 +1,4 @@ -+complex(8) function f_func(i) -+ complex(8) :: i -+ f_func = (-12345678.7654321, 1) -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func026.f90 b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func026.f90 -new file mode 100644 -index 0000000..fb3c477 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func026.f90 -@@ -0,0 +1,6 @@ -+function f_func(i) -+ integer, parameter :: K = selected_real_kind(16) -+ complex(K) :: i -+ complex(K) :: f_func -+ f_func = (-12345678.7654321, 1) -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func027.f90 b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func027.f90 -new file mode 100644 -index 0000000..f331e96 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func027.f90 -@@ -0,0 +1,4 @@ -+logical function f_func(i) -+ logical(1) :: i -+ f_func = .TRUE. -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func028.f90 b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func028.f90 -new file mode 100644 -index 0000000..228b066 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/fortran_func028.f90 -@@ -0,0 +1,4 @@ -+character function f_func(i) -+ character(1) :: i -+ f_func = 'b' -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/run.sh b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/run.sh -new file mode 100644 -index 0000000..ad3abb0 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function_value/run.sh -@@ -0,0 +1,16 @@ -+for i in {001..028} -+do -+echo "------- test $i ------." -+#echo "----- gfortran result:" -+#gcc c_main$i.c -c -o c-test.o -+#gfortran fortran_func$i.f90 -fno-range-check -c -o fortran-test.o -+#gfortran fortran-test.o c-test.o -+#./a.out -+#rm *.o a.out -+echo "----- flang-new result : " -+clang c_main$i.c -c -o c-test.o -+flang-new fortran_func$i.f90 -c -o fortran-test.o -+flang-new -flang-experimental-exec c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+done -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main001.c b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main001.c -new file mode 100644 -index 0000000..750e07c ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main001.c -@@ -0,0 +1,9 @@ -+// Test c call fortran for the return type is int with bindc -+// -+#include -+extern int f_func_(int *i); -+int main() { -+ int s1 = 5; -+ int res = f_func_(&s1); -+ printf("%d\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main002.c b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main002.c -new file mode 100644 -index 0000000..801bbd9 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main002.c -@@ -0,0 +1,9 @@ -+// Test c call fortran for the return type is short with bindc -+// -+#include -+extern short f_func_(short *i); -+int main() { -+ short s1 = 5; -+ short res = f_func_(&s1); -+ printf("%hd\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main003.c b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main003.c -new file mode 100644 -index 0000000..d141bc0 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main003.c -@@ -0,0 +1,9 @@ -+// Test c call fortran for the return type is long with bindc -+// -+#include -+extern long f_func_(long *i); -+int main() { -+ long s1 = 5; -+ long res = f_func_(&s1); -+ printf("%ld\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main004.c b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main004.c -new file mode 100644 -index 0000000..447e373 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main004.c -@@ -0,0 +1,9 @@ -+// Test c call fortran for the return type is long long with bindc -+// -+#include -+extern long long f_func_(long long *i); -+int main() { -+ long long s1 = 5; -+ long long res = f_func_(&s1); -+ printf("%Ld\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main005.c b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main005.c -new file mode 100644 -index 0000000..2f680d5 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main005.c -@@ -0,0 +1,9 @@ -+// Test c call fortran for the return type is signed char with bindc -+// -+#include -+extern signed char f_func_(signed char *i); -+int main() { -+ signed char s1 = 85; -+ signed char res = f_func_(&s1); -+ printf("%c\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main006.c b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main006.c -new file mode 100644 -index 0000000..47eec77 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main006.c -@@ -0,0 +1,9 @@ -+// Test c call fortran for the return type is size_t with bindc -+// -+#include -+extern size_t f_func_(size_t *i); -+int main() { -+ size_t s1 = 5; -+ size_t res = f_func_(&s1); -+ printf("%ld\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main007.c b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main007.c -new file mode 100644 -index 0000000..7e39eb4 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main007.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is int8_t with bindc -+// -+#include -+#include -+extern int8_t f_func_(int8_t *i); -+int main() { -+ int8_t s1 = 5; -+ int8_t res = f_func_(&s1); -+ printf("%hhd\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main008.c b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main008.c -new file mode 100644 -index 0000000..5a96518 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main008.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is int16_t with bindc -+// -+#include -+#include -+extern int16_t f_func_(int16_t *i); -+int main() { -+ int16_t s1 = 5; -+ int16_t res = f_func_(&s1); -+ printf("%hd\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main009.c b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main009.c -new file mode 100644 -index 0000000..61b0a1c ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main009.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is int32_t with bindc -+// -+#include -+#include -+extern int32_t f_func_(int32_t *i); -+int main() { -+ int32_t s1 = 5; -+ int32_t res = f_func_(&s1); -+ printf("%d\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main010.c b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main010.c -new file mode 100644 -index 0000000..f74292e ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main010.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is int64_t with bindc -+// -+#include -+#include -+extern int64_t f_func_(int64_t *i); -+int main() { -+ int64_t s1 = 5; -+ int64_t res = f_func_(&s1); -+ printf("%ld\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main011.c b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main011.c -new file mode 100644 -index 0000000..034044f ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main011.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is int_least8_t with bindc -+// -+#include -+#include -+extern int_least8_t f_func_(int_least8_t *i); -+int main() { -+ int_least8_t s1 = 5; -+ int_least8_t res = f_func_(&s1); -+ printf("%hhd\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main012.c b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main012.c -new file mode 100644 -index 0000000..1597575 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main012.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is int_least16_t with bindc -+// -+#include -+#include -+extern int_least16_t f_func_(int_least16_t *i); -+int main() { -+ int_least16_t s1 = 5; -+ int_least16_t res = f_func_(&s1); -+ printf("%hd\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main013.c b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main013.c -new file mode 100644 -index 0000000..dc2226d ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main013.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is int_least32_t with bindc -+// -+#include -+#include -+extern int_least32_t f_func_(int_least32_t *i); -+int main() { -+ int_least32_t s1 = 5; -+ int_least32_t res = f_func_(&s1); -+ printf("%d\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main014.c b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main014.c -new file mode 100644 -index 0000000..b935d4a ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main014.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is int_least64_t with bindc -+// -+#include -+#include -+extern int_least64_t f_func_(int_least64_t *i); -+int main() { -+ int_least64_t s1 = 5; -+ int_least64_t res = f_func_(&s1); -+ printf("%ld\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main015.c b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main015.c -new file mode 100644 -index 0000000..ce49dad ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main015.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is int_fast8_t with bindc -+// -+#include -+#include -+extern int_fast8_t f_func_(int_fast8_t *i); -+int main() { -+ int_fast8_t s1 = 5; -+ int_fast8_t res = f_func_(&s1); -+ printf("%hhd\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main016.c b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main016.c -new file mode 100644 -index 0000000..9f0bef4 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main016.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is int_fast16_t with bindc -+// -+#include -+#include -+extern int_fast16_t f_func_(int_fast16_t *i); -+int main() { -+ int_fast16_t s1 = 5; -+ int_fast16_t res = f_func_(&s1); -+ printf("%ld\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main017.c b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main017.c -new file mode 100644 -index 0000000..8ab1c0a ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main017.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is int_fast32_t with bindc -+// -+#include -+#include -+extern int_fast32_t f_func_(int_fast32_t *i); -+int main() { -+ int_fast32_t s1 = 5; -+ int_fast32_t res = f_func_(&s1); -+ printf("%ld\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main018.c b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main018.c -new file mode 100644 -index 0000000..9310bfa ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main018.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is int_fast64_t with bindc -+// -+#include -+#include -+extern int_fast64_t f_func_(int_fast64_t *i); -+int main() { -+ int_fast64_t s1 = 5; -+ int_fast64_t res = f_func_(&s1); -+ printf("%ld\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main019.c b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main019.c -new file mode 100644 -index 0000000..af4c9c7 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main019.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is intmax_t with bindc -+// -+#include -+#include -+extern intmax_t f_func_(intmax_t *i); -+int main() { -+ intmax_t s1 = 5; -+ intmax_t res = f_func_(&s1); -+ printf("%ld\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main020.c b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main020.c -new file mode 100644 -index 0000000..f3fbe2f ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main020.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is intptr_t with bindc -+// -+#include -+#include -+extern intptr_t f_func_(intptr_t *i); -+int main() { -+ intptr_t s1 = 5; -+ intptr_t res = f_func_(&s1); -+ printf("%ld\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main021.c b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main021.c -new file mode 100644 -index 0000000..850d4ad ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main021.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is float with bindc -+// -+#include -+#include -+extern float f_func_(float *i); -+int main() { -+ float i = 0.5; -+ float res = f_func_(&i); -+ printf("%0.20f\n", res); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main022.c b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main022.c -new file mode 100644 -index 0000000..6340c04 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main022.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is double with bindc -+// -+#include -+#include -+extern double f_func_(double *i); -+int main() { -+ double i = 0.5; -+ double res = f_func_(&i); -+ printf("%0.20lf\n", res); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main023.c b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main023.c -new file mode 100644 -index 0000000..66a84a1 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main023.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is long double with bindc -+// -+#include -+#include -+extern long double f_func_(long double *i); -+int main() { -+ long double i = 0.5; -+ long double res = f_func_(&i); -+ printf("%0.20Lf\n", res); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main024.c b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main024.c -new file mode 100644 -index 0000000..c508d13 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main024.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is float _Complex with bindc -+// -+#include -+#include -+extern float _Complex f_func_(float _Complex *i); -+int main() { -+ float _Complex i; -+ float _Complex res = f_func_(&i); -+ printf("%0.20f + %0.20fi\n", creal(res), cimag(res)); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main025.c b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main025.c -new file mode 100644 -index 0000000..cae3878 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main025.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the return type is double _Complex with -+// bindc -+// -+#include -+#include -+extern double _Complex f_func_(double _Complex *i); -+int main() { -+ double _Complex i; -+ double _Complex res = f_func_(&i); -+ printf("%0.20lf + %0.20lfi\n", creal(res), cimag(res)); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main026.c b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main026.c -new file mode 100644 -index 0000000..b1aabf8 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main026.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the return type is long double _Complex with -+// bindc -+// -+#include -+#include -+extern long double _Complex f_func_(long double _Complex *i); -+int main() { -+ long double _Complex i; -+ long double _Complex res = f_func_(&i); -+ printf("%0.20lf + %0.20lfi\n", creal(res), cimag(res)); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main027.c b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main027.c -new file mode 100644 -index 0000000..e90c830 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main027.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is _Bool with bindc -+// -+#include -+#include -+extern _Bool f_func_(_Bool *i); -+int main() { -+ _Bool i = 0; -+ _Bool res = f_func_(&i); -+ printf("%d\n", res); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main028.c b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main028.c -new file mode 100644 -index 0000000..7885475 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/c_main028.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is char with bindc -+// -+#include -+#include -+extern char f_func_(char *i); -+int main() { -+ char i; -+ char res = f_func_(&i); -+ printf("%c\n", res); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func001.f90 b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func001.f90 -new file mode 100644 -index 0000000..97fc0ff ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func001.f90 -@@ -0,0 +1,4 @@ -+integer function f_func(i) bind(c, name = "f_func_") -+ integer :: i -+ f_func = 10 + i -+end -diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func002.f90 b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func002.f90 -new file mode 100644 -index 0000000..a92967c ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func002.f90 -@@ -0,0 +1,4 @@ -+integer function f_func(i) bind(c, name = "f_func_") -+ integer(2) :: i -+ f_func = 10 + i -+end -diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func003.f90 b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func003.f90 -new file mode 100644 -index 0000000..0003034 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func003.f90 -@@ -0,0 +1,4 @@ -+integer function f_func(i) bind(c, name = "f_func_") -+ integer(8) :: i -+ f_func = 10 + i -+end -diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func004.f90 b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func004.f90 -new file mode 100644 -index 0000000..0003034 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func004.f90 -@@ -0,0 +1,4 @@ -+integer function f_func(i) bind(c, name = "f_func_") -+ integer(8) :: i -+ f_func = 10 + i -+end -diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func005.f90 b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func005.f90 -new file mode 100644 -index 0000000..4a50645 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func005.f90 -@@ -0,0 +1,4 @@ -+integer function f_func(i) bind(c, name = "f_func_") -+ integer(1) :: i -+ f_func = 10 + i -+end -diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func006.f90 b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func006.f90 -new file mode 100644 -index 0000000..0003034 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func006.f90 -@@ -0,0 +1,4 @@ -+integer function f_func(i) bind(c, name = "f_func_") -+ integer(8) :: i -+ f_func = 10 + i -+end -diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func007.f90 b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func007.f90 -new file mode 100644 -index 0000000..4a50645 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func007.f90 -@@ -0,0 +1,4 @@ -+integer function f_func(i) bind(c, name = "f_func_") -+ integer(1) :: i -+ f_func = 10 + i -+end -diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func008.f90 b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func008.f90 -new file mode 100644 -index 0000000..a92967c ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func008.f90 -@@ -0,0 +1,4 @@ -+integer function f_func(i) bind(c, name = "f_func_") -+ integer(2) :: i -+ f_func = 10 + i -+end -diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func009.f90 b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func009.f90 -new file mode 100644 -index 0000000..fbe023b ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func009.f90 -@@ -0,0 +1,4 @@ -+integer function f_func(i) bind(c, name = "f_func_") -+ integer(4) :: i -+ f_func = 10 + i -+end -diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func010.f90 b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func010.f90 -new file mode 100644 -index 0000000..0003034 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func010.f90 -@@ -0,0 +1,4 @@ -+integer function f_func(i) bind(c, name = "f_func_") -+ integer(8) :: i -+ f_func = 10 + i -+end -diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func011.f90 b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func011.f90 -new file mode 100644 -index 0000000..4a50645 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func011.f90 -@@ -0,0 +1,4 @@ -+integer function f_func(i) bind(c, name = "f_func_") -+ integer(1) :: i -+ f_func = 10 + i -+end -diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func012.f90 b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func012.f90 -new file mode 100644 -index 0000000..a92967c ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func012.f90 -@@ -0,0 +1,4 @@ -+integer function f_func(i) bind(c, name = "f_func_") -+ integer(2) :: i -+ f_func = 10 + i -+end -diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func013.f90 b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func013.f90 -new file mode 100644 -index 0000000..fbe023b ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func013.f90 -@@ -0,0 +1,4 @@ -+integer function f_func(i) bind(c, name = "f_func_") -+ integer(4) :: i -+ f_func = 10 + i -+end -diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func014.f90 b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func014.f90 -new file mode 100644 -index 0000000..0003034 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func014.f90 -@@ -0,0 +1,4 @@ -+integer function f_func(i) bind(c, name = "f_func_") -+ integer(8) :: i -+ f_func = 10 + i -+end -diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func015.f90 b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func015.f90 -new file mode 100644 -index 0000000..4a50645 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func015.f90 -@@ -0,0 +1,4 @@ -+integer function f_func(i) bind(c, name = "f_func_") -+ integer(1) :: i -+ f_func = 10 + i -+end -diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func016.f90 b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func016.f90 -new file mode 100644 -index 0000000..0003034 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func016.f90 -@@ -0,0 +1,4 @@ -+integer function f_func(i) bind(c, name = "f_func_") -+ integer(8) :: i -+ f_func = 10 + i -+end -diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func017.f90 b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func017.f90 -new file mode 100644 -index 0000000..0003034 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func017.f90 -@@ -0,0 +1,4 @@ -+integer function f_func(i) bind(c, name = "f_func_") -+ integer(8) :: i -+ f_func = 10 + i -+end -diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func018.f90 b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func018.f90 -new file mode 100644 -index 0000000..0003034 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func018.f90 -@@ -0,0 +1,4 @@ -+integer function f_func(i) bind(c, name = "f_func_") -+ integer(8) :: i -+ f_func = 10 + i -+end -diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func019.f90 b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func019.f90 -new file mode 100644 -index 0000000..0003034 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func019.f90 -@@ -0,0 +1,4 @@ -+integer function f_func(i) bind(c, name = "f_func_") -+ integer(8) :: i -+ f_func = 10 + i -+end -diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func020.f90 b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func020.f90 -new file mode 100644 -index 0000000..0003034 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func020.f90 -@@ -0,0 +1,4 @@ -+integer function f_func(i) bind(c, name = "f_func_") -+ integer(8) :: i -+ f_func = 10 + i -+end -diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func021.f90 b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func021.f90 -new file mode 100644 -index 0000000..830bae6 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func021.f90 -@@ -0,0 +1,4 @@ -+real function f_func(i) bind(c, name = "f_func_") -+ real(4) :: i -+ f_func = i + 0.1 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func022.f90 b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func022.f90 -new file mode 100644 -index 0000000..5e78483 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func022.f90 -@@ -0,0 +1,4 @@ -+real(8) function f_func(i) bind(c, name = "f_func_") -+ real(8) :: i -+ f_func = i + 0.1 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func023.f90 b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func023.f90 -new file mode 100644 -index 0000000..af3887a ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func023.f90 -@@ -0,0 +1,6 @@ -+function f_func(i) bind(c, name = "f_func_") -+ integer, parameter :: K = selected_real_kind(16) -+ real(K) :: i -+ real(K) :: f_func -+ f_func = i + 0.1 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func024.f90 b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func024.f90 -new file mode 100644 -index 0000000..62de96e ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func024.f90 -@@ -0,0 +1,4 @@ -+complex(4) function f_func(i) bind(c, name = "f_func_") -+ complex(4) :: i -+ f_func = (-12345678.7654321, 1) -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func025.f90 b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func025.f90 -new file mode 100644 -index 0000000..9474d00 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func025.f90 -@@ -0,0 +1,4 @@ -+complex(8) function f_func(i) bind(c, name = "f_func_") -+ complex(8) :: i -+ f_func = (-12345678.7654321, 1) -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func026.f90 b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func026.f90 -new file mode 100644 -index 0000000..4221aff ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func026.f90 -@@ -0,0 +1,6 @@ -+function f_func(i) bind(c, name = "f_func_") -+ integer, parameter :: K = selected_real_kind(16) -+ complex(K) :: i -+ complex(K) :: f_func -+ f_func = (-12345678.7654321, 1) -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func027.f90 b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func027.f90 -new file mode 100644 -index 0000000..d6a9631 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func027.f90 -@@ -0,0 +1,4 @@ -+logical function f_func(i) bind(c, name = "f_func_") -+ logical(1) :: i -+ f_func = .TRUE. -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func028.f90 b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func028.f90 -new file mode 100644 -index 0000000..ae4df1e ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/fortran_func028.f90 -@@ -0,0 +1,4 @@ -+character function f_func(i) bind(c, name = "f_func_") -+ character :: i -+ f_func = 'a' -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/run.sh b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/run.sh -new file mode 100644 -index 0000000..ad3abb0 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_value_bindc/run.sh -@@ -0,0 +1,16 @@ -+for i in {001..028} -+do -+echo "------- test $i ------." -+#echo "----- gfortran result:" -+#gcc c_main$i.c -c -o c-test.o -+#gfortran fortran_func$i.f90 -fno-range-check -c -o fortran-test.o -+#gfortran fortran-test.o c-test.o -+#./a.out -+#rm *.o a.out -+echo "----- flang-new result : " -+clang c_main$i.c -c -o c-test.o -+flang-new fortran_func$i.f90 -c -o fortran-test.o -+flang-new -flang-experimental-exec c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+done -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main001.c b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main001.c -new file mode 100644 -index 0000000..8eb1204 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main001.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is ptr of type int -+// -+#include -+extern int* f_func_(int *i); -+int main() { -+ int s1 = 5; -+ int *res = f_func_(&s1); -+ printf("%d\n", *res); -+} -+ -diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main002.c b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main002.c -new file mode 100644 -index 0000000..325438b ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main002.c -@@ -0,0 +1,9 @@ -+// Test c call fortran for the return type is ptr of type short -+// -+#include -+extern short* f_func_(short *i); -+int main() { -+ short s1 = 5; -+ short *res = f_func_(&s1); -+ printf("%hd\n", *res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main003.c b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main003.c -new file mode 100644 -index 0000000..3afb3b2 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main003.c -@@ -0,0 +1,9 @@ -+// Test c call fortran for the return type is ptr of type long -+// -+#include -+extern long* f_func_(long *i); -+int main() { -+ long s1 = 5; -+ long *res = f_func_(&s1); -+ printf("%ld\n", *res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main004.c b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main004.c -new file mode 100644 -index 0000000..d1031ab ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main004.c -@@ -0,0 +1,9 @@ -+// Test c call fortran for the return type is ptr of type long long -+// -+#include -+extern long long* f_func_(long long *i); -+int main() { -+ long long s1 = 5; -+ long long *res = f_func_(&s1); -+ printf("%Ld\n", *res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main005.c b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main005.c -new file mode 100644 -index 0000000..51b51d4 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main005.c -@@ -0,0 +1,9 @@ -+// Test c call fortran for the return type is ptr of type signed char -+// -+#include -+extern signed char* f_func_(signed char *i); -+int main() { -+ signed char s1 = 85; -+ signed char *res = f_func_(&s1); -+ printf("%c\n", *res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main006.c b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main006.c -new file mode 100644 -index 0000000..cd3e8bb ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main006.c -@@ -0,0 +1,9 @@ -+// Test c call fortran for the return type is ptr of type size_t -+// -+#include -+extern size_t* f_func_(size_t *i); -+int main() { -+ size_t s1 = 5; -+ size_t *res = f_func_(&s1); -+ printf("%ld\n", *res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main007.c b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main007.c -new file mode 100644 -index 0000000..aff24d6 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main007.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is ptr of type int8_t -+// -+#include -+#include -+extern int8_t* f_func_(int8_t *i); -+int main() { -+ int8_t s1 = 5; -+ int8_t *res = f_func_(&s1); -+ printf("%hhd\n", *res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main008.c b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main008.c -new file mode 100644 -index 0000000..fa388de ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main008.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is ptr of type int16_t -+// -+#include -+#include -+extern int16_t* f_func_(int16_t *i); -+int main() { -+ int16_t s1 = 5; -+ int16_t *res = f_func_(&s1); -+ printf("%hd\n", *res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main009.c b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main009.c -new file mode 100644 -index 0000000..12fc747 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main009.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is ptr of type int32_t -+// -+#include -+#include -+extern int32_t* f_func_(int32_t *i); -+int main() { -+ int32_t s1 = 5; -+ int32_t *res = f_func_(&s1); -+ printf("%d\n", *res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main010.c b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main010.c -new file mode 100644 -index 0000000..0154808 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main010.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is ptr of type int64_t -+// -+#include -+#include -+extern int64_t* f_func_(int64_t *i); -+int main() { -+ int64_t s1 = 5; -+ int64_t *res = f_func_(&s1); -+ printf("%ld\n", *res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main011.c b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main011.c -new file mode 100644 -index 0000000..8ea7c30 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main011.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is ptr of type int_least8_t -+// -+#include -+#include -+extern int_least8_t* f_func_(int_least8_t *i); -+int main() { -+ int_least8_t s1 = 5; -+ int_least8_t *res = f_func_(&s1); -+ printf("%hhd\n", *res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main012.c b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main012.c -new file mode 100644 -index 0000000..aac8267 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main012.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is ptr of type int_least16_t -+// -+#include -+#include -+extern int_least16_t* f_func_(int_least16_t *i); -+int main() { -+ int_least16_t s1 = 5; -+ int_least16_t *res = f_func_(&s1); -+ printf("%hd\n", *res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main013.c b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main013.c -new file mode 100644 -index 0000000..679a0b0 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main013.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is ptr of type int_least32_t -+// -+#include -+#include -+extern int_least32_t* f_func_(int_least32_t *i); -+int main() { -+ int_least32_t s1 = 5; -+ int_least32_t *res = f_func_(&s1); -+ printf("%d\n", *res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main014.c b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main014.c -new file mode 100644 -index 0000000..451e0af ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main014.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is ptr of type int_least64_t -+// -+#include -+#include -+extern int_least64_t* f_func_(int_least64_t *i); -+int main() { -+ int_least64_t s1 = 5; -+ int_least64_t *res = f_func_(&s1); -+ printf("%ld\n", *res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main015.c b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main015.c -new file mode 100644 -index 0000000..c71eb46 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main015.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is ptr of type int_fast8_t -+// -+#include -+#include -+extern int_fast8_t* f_func_(int_fast8_t *i); -+int main() { -+ int_fast8_t s1 = 5; -+ int_fast8_t *res = f_func_(&s1); -+ printf("%hhd\n", *res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main016.c b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main016.c -new file mode 100644 -index 0000000..14ef2eb ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main016.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is ptr of type int_fast16_t -+// -+#include -+#include -+extern int_fast16_t* f_func_(int_fast16_t *i); -+int main() { -+ int_fast16_t s1 = 5; -+ int_fast16_t *res = f_func_(&s1); -+ printf("%ld\n", *res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main017.c b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main017.c -new file mode 100644 -index 0000000..7539524 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main017.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is ptr of type int_fast32_t -+// -+#include -+#include -+extern int_fast32_t* f_func_(int_fast32_t *i); -+int main() { -+ int_fast32_t s1 = 5; -+ int_fast32_t *res = f_func_(&s1); -+ printf("%ld\n", *res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main018.c b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main018.c -new file mode 100644 -index 0000000..fa74746 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main018.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is ptr of type int_fast64_t -+// -+#include -+#include -+extern int_fast64_t* f_func_(int_fast64_t *i); -+int main() { -+ int_fast64_t s1 = 5; -+ int_fast64_t *res = f_func_(&s1); -+ printf("%ld\n", *res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main019.c b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main019.c -new file mode 100644 -index 0000000..88b466c ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main019.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is ptr of type intmax_t -+// -+#include -+#include -+extern intmax_t* f_func_(intmax_t *i); -+int main() { -+ intmax_t s1 = 5; -+ intmax_t *res = f_func_(&s1); -+ printf("%ld\n", *res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main020.c b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main020.c -new file mode 100644 -index 0000000..198ff81 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main020.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is ptr of type intptr_t -+// -+#include -+#include -+extern intptr_t* f_func_(intptr_t *i); -+int main() { -+ intptr_t s1 = 5; -+ intptr_t *res = f_func_(&s1); -+ printf("%ld\n", *res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main021.c b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main021.c -new file mode 100644 -index 0000000..381859e ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main021.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is ptr of type float -+// -+#include -+#include -+extern float* f_func_(float *i); -+int main() { -+ float i = 0.5; -+ float *res = f_func_(&i); -+ printf("%0.20f\n", *res); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main022.c b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main022.c -new file mode 100644 -index 0000000..082273e ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main022.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is ptr of type double -+// -+#include -+#include -+extern double* f_func_(double *i); -+int main() { -+ double i = 0.5; -+ double *res = f_func_(&i); -+ printf("%0.20lf\n", *res); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main023.c b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main023.c -new file mode 100644 -index 0000000..1e4934d ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main023.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is ptr of type long double -+// -+#include -+#include -+extern long double* f_func_(long double *i); -+int main() { -+ long double i = 0.5; -+ long double *res = f_func_(&i); -+ printf("%0.20Lf\n", *res); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main024.c b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main024.c -new file mode 100644 -index 0000000..e34d02b ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main024.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the return type is ptr of type float -+// _Complex -+// -+#include -+#include -+extern float _Complex* f_func_(float _Complex *i); -+int main() { -+ float _Complex i; -+ float _Complex *res = f_func_(&i); -+ printf("%0.20f + %0.20fi\n", creal(*res), cimag(*res)); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main025.c b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main025.c -new file mode 100644 -index 0000000..fc3dd26 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main025.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the return type is ptr of type double -+// _Complex -+// -+#include -+#include -+extern double _Complex* f_func_(double _Complex *i); -+int main() { -+ double _Complex i; -+ double _Complex *res = f_func_(&i); -+ printf("%0.20lf + %0.20lfi\n", creal(*res), cimag(*res)); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main026.c b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main026.c -new file mode 100644 -index 0000000..b2f0dc3 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main026.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the return type is ptr of type long double -+// _Complex -+// -+#include -+#include -+extern long double _Complex* f_func_(long double _Complex *i); -+int main() { -+ long double _Complex i; -+ long double _Complex *res = f_func_(&i); -+ printf("%0.20lf + %0.20lfi\n", creal(*res), cimag(*res)); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main027.c b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main027.c -new file mode 100644 -index 0000000..081b376 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main027.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is ptr of type _Bool -+// -+#include -+#include -+extern _Bool* f_func_(_Bool *i); -+int main() { -+ _Bool i = 0; -+ _Bool *res = f_func_(&i); -+ printf("%d\n", *res); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main028.c b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main028.c -new file mode 100644 -index 0000000..a12499d ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/c_main028.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is ptr of type char -+// -+#include -+#include -+extern char* f_func_(char *i); -+int main() { -+ char i; -+ char *res = f_func_(&i); -+ printf("%c\n", *res); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func001.f90 b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func001.f90 -new file mode 100644 -index 0000000..d8cce54 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func001.f90 -@@ -0,0 +1,6 @@ -+function f_func(b) result(res) -+ integer, target :: b -+ integer, pointer :: res -+ b = b + 1 -+ res => b -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func002.f90 b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func002.f90 -new file mode 100644 -index 0000000..393d5dc ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func002.f90 -@@ -0,0 +1,6 @@ -+function f_func(b) result(res) -+ integer(2), target :: b -+ integer(2), pointer :: res -+ b = b + 1 -+ res => b -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func003.f90 b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func003.f90 -new file mode 100644 -index 0000000..3080e86 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func003.f90 -@@ -0,0 +1,6 @@ -+function f_func(b) result(res) -+ integer(8), target :: b -+ integer(8), pointer :: res -+ b = b + 1 -+ res => b -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func004.f90 b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func004.f90 -new file mode 100644 -index 0000000..3080e86 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func004.f90 -@@ -0,0 +1,6 @@ -+function f_func(b) result(res) -+ integer(8), target :: b -+ integer(8), pointer :: res -+ b = b + 1 -+ res => b -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func005.f90 b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func005.f90 -new file mode 100644 -index 0000000..6b52903 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func005.f90 -@@ -0,0 +1,6 @@ -+function f_func(b) result(res) -+ integer(1), target :: b -+ integer(1), pointer :: res -+ b = b + 1 -+ res => b -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func006.f90 b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func006.f90 -new file mode 100644 -index 0000000..3080e86 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func006.f90 -@@ -0,0 +1,6 @@ -+function f_func(b) result(res) -+ integer(8), target :: b -+ integer(8), pointer :: res -+ b = b + 1 -+ res => b -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func007.f90 b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func007.f90 -new file mode 100644 -index 0000000..6b52903 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func007.f90 -@@ -0,0 +1,6 @@ -+function f_func(b) result(res) -+ integer(1), target :: b -+ integer(1), pointer :: res -+ b = b + 1 -+ res => b -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func008.f90 b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func008.f90 -new file mode 100644 -index 0000000..393d5dc ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func008.f90 -@@ -0,0 +1,6 @@ -+function f_func(b) result(res) -+ integer(2), target :: b -+ integer(2), pointer :: res -+ b = b + 1 -+ res => b -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func009.f90 b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func009.f90 -new file mode 100644 -index 0000000..50d1fb2 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func009.f90 -@@ -0,0 +1,6 @@ -+function f_func(b) result(res) -+ integer(4), target :: b -+ integer(4), pointer :: res -+ b = b + 1 -+ res => b -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func010.f90 b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func010.f90 -new file mode 100644 -index 0000000..3080e86 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func010.f90 -@@ -0,0 +1,6 @@ -+function f_func(b) result(res) -+ integer(8), target :: b -+ integer(8), pointer :: res -+ b = b + 1 -+ res => b -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func011.f90 b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func011.f90 -new file mode 100644 -index 0000000..6b52903 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func011.f90 -@@ -0,0 +1,6 @@ -+function f_func(b) result(res) -+ integer(1), target :: b -+ integer(1), pointer :: res -+ b = b + 1 -+ res => b -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func012.f90 b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func012.f90 -new file mode 100644 -index 0000000..393d5dc ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func012.f90 -@@ -0,0 +1,6 @@ -+function f_func(b) result(res) -+ integer(2), target :: b -+ integer(2), pointer :: res -+ b = b + 1 -+ res => b -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func013.f90 b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func013.f90 -new file mode 100644 -index 0000000..50d1fb2 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func013.f90 -@@ -0,0 +1,6 @@ -+function f_func(b) result(res) -+ integer(4), target :: b -+ integer(4), pointer :: res -+ b = b + 1 -+ res => b -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func014.f90 b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func014.f90 -new file mode 100644 -index 0000000..3080e86 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func014.f90 -@@ -0,0 +1,6 @@ -+function f_func(b) result(res) -+ integer(8), target :: b -+ integer(8), pointer :: res -+ b = b + 1 -+ res => b -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func015.f90 b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func015.f90 -new file mode 100644 -index 0000000..6b52903 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func015.f90 -@@ -0,0 +1,6 @@ -+function f_func(b) result(res) -+ integer(1), target :: b -+ integer(1), pointer :: res -+ b = b + 1 -+ res => b -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func016.f90 b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func016.f90 -new file mode 100644 -index 0000000..3080e86 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func016.f90 -@@ -0,0 +1,6 @@ -+function f_func(b) result(res) -+ integer(8), target :: b -+ integer(8), pointer :: res -+ b = b + 1 -+ res => b -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func017.f90 b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func017.f90 -new file mode 100644 -index 0000000..3080e86 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func017.f90 -@@ -0,0 +1,6 @@ -+function f_func(b) result(res) -+ integer(8), target :: b -+ integer(8), pointer :: res -+ b = b + 1 -+ res => b -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func018.f90 b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func018.f90 -new file mode 100644 -index 0000000..3080e86 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func018.f90 -@@ -0,0 +1,6 @@ -+function f_func(b) result(res) -+ integer(8), target :: b -+ integer(8), pointer :: res -+ b = b + 1 -+ res => b -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func019.f90 b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func019.f90 -new file mode 100644 -index 0000000..3080e86 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func019.f90 -@@ -0,0 +1,6 @@ -+function f_func(b) result(res) -+ integer(8), target :: b -+ integer(8), pointer :: res -+ b = b + 1 -+ res => b -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func020.f90 b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func020.f90 -new file mode 100644 -index 0000000..3080e86 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func020.f90 -@@ -0,0 +1,6 @@ -+function f_func(b) result(res) -+ integer(8), target :: b -+ integer(8), pointer :: res -+ b = b + 1 -+ res => b -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func021.f90 b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func021.f90 -new file mode 100644 -index 0000000..72c883d ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func021.f90 -@@ -0,0 +1,6 @@ -+function f_func(i) result(res) -+ real(4), target :: i -+ real(4), pointer :: res -+ i = i + 0.1 -+ res => i -+end -diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func022.f90 b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func022.f90 -new file mode 100644 -index 0000000..9c29036 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func022.f90 -@@ -0,0 +1,6 @@ -+function f_func(i) result(res) -+ real(8), target :: i -+ real(8), pointer :: res -+ i = i + 0.1 -+ res => i -+end -diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func023.f90 b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func023.f90 -new file mode 100644 -index 0000000..2304e96 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func023.f90 -@@ -0,0 +1,7 @@ -+function f_func(i) result(res) -+ integer, parameter :: K = selected_real_kind(16) -+ real(K), target :: i -+ real(K), pointer :: res -+ i = i + 0.1 -+ res => i -+end -diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func024.f90 b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func024.f90 -new file mode 100644 -index 0000000..bd11ffd ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func024.f90 -@@ -0,0 +1,6 @@ -+function f_func(i) result(res) -+ complex(4), target :: i -+ complex(4), pointer :: res -+ i = (-12345678.7654321, 1) -+ res => i -+end -diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func025.f90 b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func025.f90 -new file mode 100644 -index 0000000..b67ac5d ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func025.f90 -@@ -0,0 +1,6 @@ -+function f_func(i) result(res) -+ complex(8), target :: i -+ complex(8), pointer :: res -+ i = (-12345678.7654321, 1) -+ res => i -+end -diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func026.f90 b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func026.f90 -new file mode 100644 -index 0000000..aaad4f2 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func026.f90 -@@ -0,0 +1,7 @@ -+function f_func(i) result(res) -+ integer, parameter :: K = selected_real_kind(16) -+ complex(K), target :: i -+ complex(K), pointer :: res -+ i = (-12345678.7654321, 1) -+ res => i -+end -diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func027.f90 b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func027.f90 -new file mode 100644 -index 0000000..51a5ae5 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func027.f90 -@@ -0,0 +1,6 @@ -+function f_func(b) result(res) -+ logical(1), target :: b -+ logical(1), pointer :: res -+ b = .TRUE. -+ res => b -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func028.f90 b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func028.f90 -new file mode 100644 -index 0000000..6487ee2 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/fortran_func028.f90 -@@ -0,0 +1,6 @@ -+function f_func(b) result(res) -+ character(1), target :: b -+ character(1), pointer :: res -+ b = 'a' -+ res => b -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/run.sh b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/run.sh -new file mode 100644 -index 0000000..ad3abb0 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_ptr/run.sh -@@ -0,0 +1,16 @@ -+for i in {001..028} -+do -+echo "------- test $i ------." -+#echo "----- gfortran result:" -+#gcc c_main$i.c -c -o c-test.o -+#gfortran fortran_func$i.f90 -fno-range-check -c -o fortran-test.o -+#gfortran fortran-test.o c-test.o -+#./a.out -+#rm *.o a.out -+echo "----- flang-new result : " -+clang c_main$i.c -c -o c-test.o -+flang-new fortran_func$i.f90 -c -o fortran-test.o -+flang-new -flang-experimental-exec c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+done -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main001.c b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main001.c -new file mode 100644 -index 0000000..b615d87 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main001.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the return type is ptr of type int with -+// bindc -+// -+#include -+extern int* f_func_(int *i); -+int main() { -+ int s1 = 5; -+ int *res = f_func_(&s1); -+ printf("%d\n", *res); -+} -+ -diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main002.c b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main002.c -new file mode 100644 -index 0000000..6012316 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main002.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is ptr of type short with -+// bindc -+// -+#include -+extern short* f_func_(short *i); -+int main() { -+ short s1 = 5; -+ short *res = f_func_(&s1); -+ printf("%hd\n", *res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main003.c b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main003.c -new file mode 100644 -index 0000000..a6aef18 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main003.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is ptr of type long with -+// bindc -+// -+#include -+extern long* f_func_(long *i); -+int main() { -+ long s1 = 5; -+ long *res = f_func_(&s1); -+ printf("%ld\n", *res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main004.c b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main004.c -new file mode 100644 -index 0000000..342c438 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main004.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is ptr of type long long -+// with bindc -+// -+#include -+extern long long* f_func_(long long *i); -+int main() { -+ long long s1 = 5; -+ long long *res = f_func_(&s1); -+ printf("%Ld\n", *res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main005.c b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main005.c -new file mode 100644 -index 0000000..d4e4f55 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main005.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is ptr of type signed char -+// with bindc -+// -+#include -+extern signed char* f_func_(signed char *i); -+int main() { -+ signed char s1 = 85; -+ signed char *res = f_func_(&s1); -+ printf("%c\n", *res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main006.c b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main006.c -new file mode 100644 -index 0000000..5f0663e ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main006.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is ptr of type size_t with -+// bindc -+// -+#include -+extern size_t* f_func_(size_t *i); -+int main() { -+ size_t s1 = 5; -+ size_t *res = f_func_(&s1); -+ printf("%ld\n", *res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main007.c b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main007.c -new file mode 100644 -index 0000000..dd19a2c ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main007.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the return type is ptr of type int8_t with -+// bindc -+// -+#include -+#include -+extern int8_t* f_func_(int8_t *i); -+int main() { -+ int8_t s1 = 5; -+ int8_t *res = f_func_(&s1); -+ printf("%hhd\n", *res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main008.c b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main008.c -new file mode 100644 -index 0000000..c8a62df ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main008.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the return type is ptr of type int16_t with -+// bindc -+// -+#include -+#include -+extern int16_t* f_func_(int16_t *i); -+int main() { -+ int16_t s1 = 5; -+ int16_t *res = f_func_(&s1); -+ printf("%hd\n", *res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main009.c b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main009.c -new file mode 100644 -index 0000000..992c05d ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main009.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the return type is ptr of type int32_t with -+// bindc -+// -+#include -+#include -+extern int32_t* f_func_(int32_t *i); -+int main() { -+ int32_t s1 = 5; -+ int32_t *res = f_func_(&s1); -+ printf("%d\n", *res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main010.c b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main010.c -new file mode 100644 -index 0000000..44843b1 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main010.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the return type is ptr of type int64_t with -+// bindc -+// -+#include -+#include -+extern int64_t* f_func_(int64_t *i); -+int main() { -+ int64_t s1 = 5; -+ int64_t *res = f_func_(&s1); -+ printf("%ld\n", *res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main011.c b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main011.c -new file mode 100644 -index 0000000..5fc5115 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main011.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the return type is ptr of type int_least8_t -+// with bindc -+// -+#include -+#include -+extern int_least8_t* f_func_(int_least8_t *i); -+int main() { -+ int_least8_t s1 = 5; -+ int_least8_t *res = f_func_(&s1); -+ printf("%hhd\n", *res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main012.c b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main012.c -new file mode 100644 -index 0000000..2a51a21 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main012.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the return type is ptr of type int_least16_t -+// with bindc -+// -+#include -+#include -+extern int_least16_t* f_func_(int_least16_t *i); -+int main() { -+ int_least16_t s1 = 5; -+ int_least16_t *res = f_func_(&s1); -+ printf("%hd\n", *res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main013.c b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main013.c -new file mode 100644 -index 0000000..ab81bab ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main013.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the return type is ptr of type int_least32_t -+// with bindc -+// -+#include -+#include -+extern int_least32_t* f_func_(int_least32_t *i); -+int main() { -+ int_least32_t s1 = 5; -+ int_least32_t *res = f_func_(&s1); -+ printf("%d\n", *res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main014.c b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main014.c -new file mode 100644 -index 0000000..9576f05 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main014.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the return type is ptr of type int_least64_t -+// with bindc -+// -+#include -+#include -+extern int_least64_t* f_func_(int_least64_t *i); -+int main() { -+ int_least64_t s1 = 5; -+ int_least64_t *res = f_func_(&s1); -+ printf("%ld\n", *res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main015.c b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main015.c -new file mode 100644 -index 0000000..c23aeca ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main015.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the return type is ptr of type int_fast8_t -+// with bindc -+// -+#include -+#include -+extern int_fast8_t* f_func_(int_fast8_t *i); -+int main() { -+ int_fast8_t s1 = 5; -+ int_fast8_t *res = f_func_(&s1); -+ printf("%hhd\n", *res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main016.c b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main016.c -new file mode 100644 -index 0000000..dfa53bf ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main016.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the return type is ptr of type int_fast16_t -+// with bindc -+// -+#include -+#include -+extern int_fast16_t* f_func_(int_fast16_t *i); -+int main() { -+ int_fast16_t s1 = 5; -+ int_fast16_t *res = f_func_(&s1); -+ printf("%ld\n", *res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main017.c b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main017.c -new file mode 100644 -index 0000000..e9414da ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main017.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the return type is ptr of type int_fast32_t -+// with bindc -+// -+#include -+#include -+extern int_fast32_t* f_func_(int_fast32_t *i); -+int main() { -+ int_fast32_t s1 = 5; -+ int_fast32_t *res = f_func_(&s1); -+ printf("%ld\n", *res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main018.c b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main018.c -new file mode 100644 -index 0000000..7b84fdf ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main018.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the return type is ptr of type int_fast64_t -+// with bindc -+// -+#include -+#include -+extern int_fast64_t* f_func_(int_fast64_t *i); -+int main() { -+ int_fast64_t s1 = 5; -+ int_fast64_t *res = f_func_(&s1); -+ printf("%ld\n", *res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main019.c b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main019.c -new file mode 100644 -index 0000000..9a74d6c ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main019.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the return type is ptr of type intmax_t with -+// bindc -+// -+#include -+#include -+extern intmax_t* f_func_(intmax_t *i); -+int main() { -+ intmax_t s1 = 5; -+ intmax_t *res = f_func_(&s1); -+ printf("%ld\n", *res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main020.c b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main020.c -new file mode 100644 -index 0000000..7f073be ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main020.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the return type is ptr of type intptr_t with -+// bindc -+// -+#include -+#include -+extern intptr_t* f_func_(intptr_t *i); -+int main() { -+ intptr_t s1 = 5; -+ intptr_t *res = f_func_(&s1); -+ printf("%ld\n", *res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main021.c b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main021.c -new file mode 100644 -index 0000000..ab108c2 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main021.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the return type is ptr of type float with -+// bindc -+// -+#include -+#include -+extern float* f_func_(float *i); -+int main() { -+ float i = 0.5; -+ float *res = f_func_(&i); -+ printf("%0.20f\n", *res); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main022.c b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main022.c -new file mode 100644 -index 0000000..c814ef4 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main022.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the return type is ptr of type double with -+// bindc -+// -+#include -+#include -+extern double* f_func_(double *i); -+int main() { -+ double i = 0.5; -+ double *res = f_func_(&i); -+ printf("%0.20lf\n", *res); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main023.c b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main023.c -new file mode 100644 -index 0000000..707b692 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main023.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the return type is ptr of type long double -+// with bindc -+// -+#include -+#include -+extern long double* f_func_(long double *i); -+int main() { -+ long double i = 0.5; -+ long double *res = f_func_(&i); -+ printf("%0.20Lf\n", *res); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main024.c b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main024.c -new file mode 100644 -index 0000000..ff6af62 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main024.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the return type is ptr of type float -+// _Complex with bindc -+// -+#include -+#include -+extern float _Complex* f_func_(float _Complex *i); -+int main() { -+ float _Complex i; -+ float _Complex *res = f_func_(&i); -+ printf("%0.20f + %0.20fi\n", creal(*res), cimag(*res)); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main025.c b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main025.c -new file mode 100644 -index 0000000..9d0e8b3 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main025.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the return type is ptr of type double -+// _Complex with bindc -+// -+#include -+#include -+extern double _Complex* f_func_(double _Complex *i); -+int main() { -+ double _Complex i; -+ double _Complex *res = f_func_(&i); -+ printf("%0.20lf + %0.20lfi\n", creal(*res), cimag(*res)); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main026.c b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main026.c -new file mode 100644 -index 0000000..7751d18 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main026.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the return type is ptr of type long double -+// _Complex with bindc -+// -+#include -+#include -+extern long double _Complex* f_func_(long double _Complex *i); -+int main() { -+ long double _Complex i; -+ long double _Complex *res = f_func_(&i); -+ printf("%0.20lf + %0.20lfi\n", creal(*res), cimag(*res)); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main027.c b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main027.c -new file mode 100644 -index 0000000..3a8a3de ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main027.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the return type is ptr of type _Bool with -+// bindc -+// -+#include -+#include -+extern _Bool* f_func_(_Bool *i); -+int main() { -+ _Bool i = 0; -+ _Bool *res = f_func_(&i); -+ printf("%d\n", *res); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main028.c b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main028.c -new file mode 100644 -index 0000000..1184003 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/c_main028.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the return type is ptr of type char with -+// bindc -+// -+#include -+#include -+extern char* f_func_(char *i); -+int main() { -+ char i; -+ char *res = f_func_(&i); -+ printf("%c\n", *res); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func001.f90 b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func001.f90 -new file mode 100644 -index 0000000..c36beda ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func001.f90 -@@ -0,0 +1,6 @@ -+function f_func(b) result(res) bind(c, name = "f_func_") -+ integer, target :: b -+ integer, pointer :: res -+ b = b + 1 -+ res => b -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func002.f90 b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func002.f90 -new file mode 100644 -index 0000000..e3e115d ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func002.f90 -@@ -0,0 +1,6 @@ -+function f_func(b) result(res) bind(c, name = "f_func_") -+ integer(2), target :: b -+ integer(2), pointer :: res -+ b = b + 1 -+ res => b -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func003.f90 b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func003.f90 -new file mode 100644 -index 0000000..98b5ce1 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func003.f90 -@@ -0,0 +1,6 @@ -+function f_func(b) result(res) bind(c, name = "f_func_") -+ integer(8), target :: b -+ integer(8), pointer :: res -+ b = b + 1 -+ res => b -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func004.f90 b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func004.f90 -new file mode 100644 -index 0000000..98b5ce1 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func004.f90 -@@ -0,0 +1,6 @@ -+function f_func(b) result(res) bind(c, name = "f_func_") -+ integer(8), target :: b -+ integer(8), pointer :: res -+ b = b + 1 -+ res => b -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func005.f90 b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func005.f90 -new file mode 100644 -index 0000000..a86b428 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func005.f90 -@@ -0,0 +1,6 @@ -+function f_func(b) result(res) bind(c, name = "f_func_") -+ integer(1), target :: b -+ integer(1), pointer :: res -+ b = b + 1 -+ res => b -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func006.f90 b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func006.f90 -new file mode 100644 -index 0000000..98b5ce1 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func006.f90 -@@ -0,0 +1,6 @@ -+function f_func(b) result(res) bind(c, name = "f_func_") -+ integer(8), target :: b -+ integer(8), pointer :: res -+ b = b + 1 -+ res => b -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func007.f90 b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func007.f90 -new file mode 100644 -index 0000000..a86b428 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func007.f90 -@@ -0,0 +1,6 @@ -+function f_func(b) result(res) bind(c, name = "f_func_") -+ integer(1), target :: b -+ integer(1), pointer :: res -+ b = b + 1 -+ res => b -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func008.f90 b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func008.f90 -new file mode 100644 -index 0000000..e3e115d ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func008.f90 -@@ -0,0 +1,6 @@ -+function f_func(b) result(res) bind(c, name = "f_func_") -+ integer(2), target :: b -+ integer(2), pointer :: res -+ b = b + 1 -+ res => b -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func009.f90 b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func009.f90 -new file mode 100644 -index 0000000..c5e3ff3 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func009.f90 -@@ -0,0 +1,6 @@ -+function f_func(b) result(res) bind(c, name = "f_func_") -+ integer(4), target :: b -+ integer(4), pointer :: res -+ b = b + 1 -+ res => b -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func010.f90 b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func010.f90 -new file mode 100644 -index 0000000..98b5ce1 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func010.f90 -@@ -0,0 +1,6 @@ -+function f_func(b) result(res) bind(c, name = "f_func_") -+ integer(8), target :: b -+ integer(8), pointer :: res -+ b = b + 1 -+ res => b -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func011.f90 b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func011.f90 -new file mode 100644 -index 0000000..a86b428 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func011.f90 -@@ -0,0 +1,6 @@ -+function f_func(b) result(res) bind(c, name = "f_func_") -+ integer(1), target :: b -+ integer(1), pointer :: res -+ b = b + 1 -+ res => b -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func012.f90 b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func012.f90 -new file mode 100644 -index 0000000..e3e115d ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func012.f90 -@@ -0,0 +1,6 @@ -+function f_func(b) result(res) bind(c, name = "f_func_") -+ integer(2), target :: b -+ integer(2), pointer :: res -+ b = b + 1 -+ res => b -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func013.f90 b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func013.f90 -new file mode 100644 -index 0000000..c5e3ff3 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func013.f90 -@@ -0,0 +1,6 @@ -+function f_func(b) result(res) bind(c, name = "f_func_") -+ integer(4), target :: b -+ integer(4), pointer :: res -+ b = b + 1 -+ res => b -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func014.f90 b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func014.f90 -new file mode 100644 -index 0000000..98b5ce1 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func014.f90 -@@ -0,0 +1,6 @@ -+function f_func(b) result(res) bind(c, name = "f_func_") -+ integer(8), target :: b -+ integer(8), pointer :: res -+ b = b + 1 -+ res => b -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func015.f90 b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func015.f90 -new file mode 100644 -index 0000000..a86b428 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func015.f90 -@@ -0,0 +1,6 @@ -+function f_func(b) result(res) bind(c, name = "f_func_") -+ integer(1), target :: b -+ integer(1), pointer :: res -+ b = b + 1 -+ res => b -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func016.f90 b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func016.f90 -new file mode 100644 -index 0000000..98b5ce1 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func016.f90 -@@ -0,0 +1,6 @@ -+function f_func(b) result(res) bind(c, name = "f_func_") -+ integer(8), target :: b -+ integer(8), pointer :: res -+ b = b + 1 -+ res => b -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func017.f90 b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func017.f90 -new file mode 100644 -index 0000000..98b5ce1 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func017.f90 -@@ -0,0 +1,6 @@ -+function f_func(b) result(res) bind(c, name = "f_func_") -+ integer(8), target :: b -+ integer(8), pointer :: res -+ b = b + 1 -+ res => b -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func018.f90 b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func018.f90 -new file mode 100644 -index 0000000..98b5ce1 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func018.f90 -@@ -0,0 +1,6 @@ -+function f_func(b) result(res) bind(c, name = "f_func_") -+ integer(8), target :: b -+ integer(8), pointer :: res -+ b = b + 1 -+ res => b -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func019.f90 b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func019.f90 -new file mode 100644 -index 0000000..98b5ce1 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func019.f90 -@@ -0,0 +1,6 @@ -+function f_func(b) result(res) bind(c, name = "f_func_") -+ integer(8), target :: b -+ integer(8), pointer :: res -+ b = b + 1 -+ res => b -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func020.f90 b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func020.f90 -new file mode 100644 -index 0000000..98b5ce1 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func020.f90 -@@ -0,0 +1,6 @@ -+function f_func(b) result(res) bind(c, name = "f_func_") -+ integer(8), target :: b -+ integer(8), pointer :: res -+ b = b + 1 -+ res => b -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func021.f90 b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func021.f90 -new file mode 100644 -index 0000000..e58e139 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func021.f90 -@@ -0,0 +1,6 @@ -+function f_func(i) result(res) bind(c, name = "f_func_") -+ real(4), target :: i -+ real(4), pointer :: res -+ i = i + 0.1 -+ res => i -+end -diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func022.f90 b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func022.f90 -new file mode 100644 -index 0000000..340d2f2 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func022.f90 -@@ -0,0 +1,6 @@ -+function f_func(i) result(res) bind(c, name = "f_func_") -+ real(8), target :: i -+ real(8), pointer :: res -+ i = i + 0.1 -+ res => i -+end -diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func023.f90 b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func023.f90 -new file mode 100644 -index 0000000..7863881 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func023.f90 -@@ -0,0 +1,7 @@ -+function f_func(i) result(res) bind(c, name = "f_func_") -+ integer, parameter :: K = selected_real_kind(16) -+ real(K), target :: i -+ real(K), pointer :: res -+ i = i + 0.1 -+ res => i -+end -diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func024.f90 b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func024.f90 -new file mode 100644 -index 0000000..cb093eb ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func024.f90 -@@ -0,0 +1,6 @@ -+function f_func(i) result(res) bind(c, name = "f_func_") -+ complex(4), target :: i -+ complex(4), pointer :: res -+ i = (-12345678.7654321, 1) -+ res => i -+end -diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func025.f90 b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func025.f90 -new file mode 100644 -index 0000000..0ec6812 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func025.f90 -@@ -0,0 +1,6 @@ -+function f_func(i) result(res) bind(c, name = "f_func_") -+ complex(8), target :: i -+ complex(8), pointer :: res -+ i = (-12345678.7654321, 1) -+ res => i -+end -diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func026.f90 b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func026.f90 -new file mode 100644 -index 0000000..97df80a ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func026.f90 -@@ -0,0 +1,7 @@ -+function f_func(i) result(res) bind(c, name = "f_func_") -+ integer, parameter :: K = selected_real_kind(16) -+ complex(K), target :: i -+ complex(K), pointer :: res -+ i = (-12345678.7654321, 1) -+ res => i -+end -diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func027.f90 b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func027.f90 -new file mode 100644 -index 0000000..f8f22bd ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func027.f90 -@@ -0,0 +1,6 @@ -+function f_func(b) result(res) bind(c, name = "f_func_") -+ logical(1), target :: b -+ logical(1), pointer :: res -+ b = .TRUE. -+ res => b -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func028.f90 b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func028.f90 -new file mode 100644 -index 0000000..69cff1e ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/fortran_func028.f90 -@@ -0,0 +1,6 @@ -+function f_func(b) result(res) bind(c, name = "f_func_") -+ character(1), target :: b -+ character(1), pointer :: res -+ b = 'a' -+ res => b -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/run.sh b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/run.sh -new file mode 100644 -index 0000000..ad3abb0 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_ptr_bindc/run.sh -@@ -0,0 +1,16 @@ -+for i in {001..028} -+do -+echo "------- test $i ------." -+#echo "----- gfortran result:" -+#gcc c_main$i.c -c -o c-test.o -+#gfortran fortran_func$i.f90 -fno-range-check -c -o fortran-test.o -+#gfortran fortran-test.o c-test.o -+#./a.out -+#rm *.o a.out -+echo "----- flang-new result : " -+clang c_main$i.c -c -o c-test.o -+flang-new fortran_func$i.f90 -c -o fortran-test.o -+flang-new -flang-experimental-exec c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+done -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/015_c_call_fortran_pointer/c_main001.c b/test/interoperability_with_c_c_call_fortran/015_c_call_fortran_pointer/c_main001.c -new file mode 100644 -index 0000000..d1592b4 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/015_c_call_fortran_pointer/c_main001.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the pointer type and allocate a free space -+// for the pointer -+// -+#include -+#include -+extern void f_func_(int *i); -+int main() { -+ int *i = (int*) malloc(sizeof(int)); -+ f_func_(i); -+ printf("%d\n", *i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/015_c_call_fortran_pointer/c_main002.c b/test/interoperability_with_c_c_call_fortran/015_c_call_fortran_pointer/c_main002.c -new file mode 100644 -index 0000000..5dc36ae ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/015_c_call_fortran_pointer/c_main002.c -@@ -0,0 +1,15 @@ -+// Test c call fortan for the pointer type and let the pointer point to -+// a variable array -+// -+#include -+#include -+extern void f_func_(int *i); -+int main() { -+ int x[5] = {5, 4, 3, 2, 1}; -+ int *i = x; -+ f_func_(i); -+ for(int w = 0; w < 5; w++) { -+ printf("%d\n", i[w]); -+ printf("%d\n", x[w]); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/015_c_call_fortran_pointer/c_main003.c b/test/interoperability_with_c_c_call_fortran/015_c_call_fortran_pointer/c_main003.c -new file mode 100644 -index 0000000..85d12b7 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/015_c_call_fortran_pointer/c_main003.c -@@ -0,0 +1,13 @@ -+// Test c call fortan for the pointer type and let the pointer point to -+// a variable -+// -+#include -+#include -+extern void f_func_(int *i); -+int main() { -+ int x = 5; -+ int *i = &x; -+ f_func_(i); -+ printf("%d\n", *i); -+ printf("%d\n", x); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/015_c_call_fortran_pointer/c_main004.c b/test/interoperability_with_c_c_call_fortran/015_c_call_fortran_pointer/c_main004.c -new file mode 100644 -index 0000000..c4326b9 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/015_c_call_fortran_pointer/c_main004.c -@@ -0,0 +1,20 @@ -+// Test c call fortran for the pointer type and let the pointer point -+// to a variable two-dimensinal array -+// -+#include -+#include -+extern void f_func_(int [][3]); -+int main() { -+ int x[3][3]; -+ for(int n = 0; n < 3; n++) { -+ for(int w = 0; w < 3; w++) { -+ x[n][w] = 1; -+ } -+ } -+ f_func_(x); -+ for(int n = 0; n < 3; n++) { -+ for(int w = 0; w < 3; w++) { -+ printf("%d\n", x[n][w]); -+ } -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/015_c_call_fortran_pointer/fortran_func001.f90 b/test/interoperability_with_c_c_call_fortran/015_c_call_fortran_pointer/fortran_func001.f90 -new file mode 100644 -index 0000000..f107dca ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/015_c_call_fortran_pointer/fortran_func001.f90 -@@ -0,0 +1,4 @@ -+subroutine f_func(i) -+ integer :: i -+ i = 1 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/015_c_call_fortran_pointer/fortran_func002.f90 b/test/interoperability_with_c_c_call_fortran/015_c_call_fortran_pointer/fortran_func002.f90 -new file mode 100644 -index 0000000..a2fa9d6 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/015_c_call_fortran_pointer/fortran_func002.f90 -@@ -0,0 +1,6 @@ -+subroutine f_func(i) -+ integer, dimension(*) :: i -+ do n = 1, 5 -+ i(n) = n -+ end do -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/015_c_call_fortran_pointer/fortran_func003.f90 b/test/interoperability_with_c_c_call_fortran/015_c_call_fortran_pointer/fortran_func003.f90 -new file mode 100644 -index 0000000..f107dca ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/015_c_call_fortran_pointer/fortran_func003.f90 -@@ -0,0 +1,4 @@ -+subroutine f_func(i) -+ integer :: i -+ i = 1 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/015_c_call_fortran_pointer/fortran_func004.f90 b/test/interoperability_with_c_c_call_fortran/015_c_call_fortran_pointer/fortran_func004.f90 -new file mode 100644 -index 0000000..0d721cb ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/015_c_call_fortran_pointer/fortran_func004.f90 -@@ -0,0 +1,8 @@ -+subroutine f_func(i) -+ integer :: i(3, 3) -+ do n = 1, 3 -+ do j = 1, 3 -+ i(n, j) = n + j -+ end do -+ end do -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/015_c_call_fortran_pointer/run.sh b/test/interoperability_with_c_c_call_fortran/015_c_call_fortran_pointer/run.sh -new file mode 100644 -index 0000000..1a0cb99 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/015_c_call_fortran_pointer/run.sh -@@ -0,0 +1,16 @@ -+for i in {001..004} -+do -+echo "------- test $i ------." -+#echo "----- gfortran result:" -+#gcc c_main$i.c -c -o c-test.o -+#gfortran fortran_func$i.f90 -fno-range-check -c -o fortran-test.o -+#gfortran fortran-test.o c-test.o -+#./a.out -+#rm *.o a.out -+echo "----- flang-new result : " -+clang c_main$i.c -c -o c-test.o -+flang-new fortran_func$i.f90 -c -o fortran-test.o -+flang-new -flang-experimental-exec c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+done -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/016_c_call_fortran_string/c_main001.c b/test/interoperability_with_c_c_call_fortran/016_c_call_fortran_string/c_main001.c -new file mode 100644 -index 0000000..a55520c ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/016_c_call_fortran_string/c_main001.c -@@ -0,0 +1,10 @@ -+// Test c call fortran with the array type for string -+// -+#include -+#include -+extern void f_func_(char i[]); -+int main() { -+ char str1[5]; -+ f_func_(str1); -+ printf("the string is:%s\n", str1); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/016_c_call_fortran_string/c_main002.c b/test/interoperability_with_c_c_call_fortran/016_c_call_fortran_string/c_main002.c -new file mode 100644 -index 0000000..bde3f26 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/016_c_call_fortran_string/c_main002.c -@@ -0,0 +1,13 @@ -+// Test c call fortran with the pointer type for string -+// -+#include -+#include -+#include -+extern void f_func_(char *i); -+int main() { -+ char *str1; -+ str1 = (char*) malloc(5 * sizeof(char)); -+ f_func_(str1); -+ printf("the string is:%s\n", str1); -+ free(str1); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/016_c_call_fortran_string/c_main003.c b/test/interoperability_with_c_c_call_fortran/016_c_call_fortran_string/c_main003.c -new file mode 100644 -index 0000000..733182e ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/016_c_call_fortran_string/c_main003.c -@@ -0,0 +1,13 @@ -+// Test c call fortran with the two-dimensional array type for string -+// -+#include -+#include -+#include -+extern void f_func_(char i[][4]); -+int main() { -+ char s[4][4]; -+ f_func_(s); -+ for(int i = 0; i < 4; i++) { -+ printf("the string%d is:%s\n", i+1, s[i]); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/016_c_call_fortran_string/c_main004.c b/test/interoperability_with_c_c_call_fortran/016_c_call_fortran_string/c_main004.c -new file mode 100644 -index 0000000..f73be9e ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/016_c_call_fortran_string/c_main004.c -@@ -0,0 +1,13 @@ -+// Test c call fortran with the array type for string and return array -+// of char -+// -+#include -+#include -+#include -+extern char* f_func_(); -+int main() { -+ char *p; -+ p = (char*) malloc(4 * sizeof(char)); -+ p = f_func_(); -+ printf("%s\n", p); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/016_c_call_fortran_string/fortran_func001.f90 b/test/interoperability_with_c_c_call_fortran/016_c_call_fortran_string/fortran_func001.f90 -new file mode 100644 -index 0000000..2ad420a ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/016_c_call_fortran_string/fortran_func001.f90 -@@ -0,0 +1,6 @@ -+subroutine f_func(i) -+ character, dimension(*) :: i -+ do n = 1, 5 -+ i(n) = 'a' -+ end do -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/016_c_call_fortran_string/fortran_func002.f90 b/test/interoperability_with_c_c_call_fortran/016_c_call_fortran_string/fortran_func002.f90 -new file mode 100644 -index 0000000..2ad420a ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/016_c_call_fortran_string/fortran_func002.f90 -@@ -0,0 +1,6 @@ -+subroutine f_func(i) -+ character, dimension(*) :: i -+ do n = 1, 5 -+ i(n) = 'a' -+ end do -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/016_c_call_fortran_string/fortran_func003.f90 b/test/interoperability_with_c_c_call_fortran/016_c_call_fortran_string/fortran_func003.f90 -new file mode 100644 -index 0000000..3fa8b48 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/016_c_call_fortran_string/fortran_func003.f90 -@@ -0,0 +1,8 @@ -+subroutine f_func(i) -+ character :: i(4, 4) -+ do n = 1, 4 -+ do j = 1, 3 -+ i(j, n) = 'b' -+ end do -+ end do -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran/016_c_call_fortran_string/fortran_func004.f90 b/test/interoperability_with_c_c_call_fortran/016_c_call_fortran_string/fortran_func004.f90 -new file mode 100644 -index 0000000..b855a95 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/016_c_call_fortran_string/fortran_func004.f90 -@@ -0,0 +1,8 @@ -+function f_func() bind(c, name = "f_func_") -+ character, target :: b(4) -+ character, pointer :: res(:) -+ do i = 1, 4 -+ b(i) = 'a' -+ end do -+ res => b -+end -diff --git a/test/interoperability_with_c_c_call_fortran/016_c_call_fortran_string/run.sh b/test/interoperability_with_c_c_call_fortran/016_c_call_fortran_string/run.sh -new file mode 100644 -index 0000000..1a0cb99 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran/016_c_call_fortran_string/run.sh -@@ -0,0 +1,16 @@ -+for i in {001..004} -+do -+echo "------- test $i ------." -+#echo "----- gfortran result:" -+#gcc c_main$i.c -c -o c-test.o -+#gfortran fortran_func$i.f90 -fno-range-check -c -o fortran-test.o -+#gfortran fortran-test.o c-test.o -+#./a.out -+#rm *.o a.out -+echo "----- flang-new result : " -+clang c_main$i.c -c -o c-test.o -+flang-new fortran_func$i.f90 -c -o fortran-test.o -+flang-new -flang-experimental-exec c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+done -\ No newline at end of file --- -2.25.1 - diff --git a/5-test-interoperability-with-c-c-call-fortran-scalar.patch b/5-test-interoperability-with-c-c-call-fortran-scalar.patch new file mode 100644 index 0000000..914b24a --- /dev/null +++ b/5-test-interoperability-with-c-c-call-fortran-scalar.patch @@ -0,0 +1,4814 @@ +From dd8de0230f8f43745f341068ace91d276b31c759 Mon Sep 17 00:00:00 2001 +From: xieyihui +Date: Fri, 18 Nov 2022 13:02:04 +0800 +Subject: [PATCH] Add new test cases about scalar for interoperability with C + about C call fortran + +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main001.c b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main001.c +new file mode 100644 +index 0000000..4b940d6 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main001.c +@@ -0,0 +1,9 @@ ++// Test c call fortran for scalar type and the scalar type is int ++// ++#include ++extern void f_func_(int *i); ++int main() { ++ int i = 0; ++ f_func_(&i); ++ printf("%d\n", i); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main002.c b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main002.c +new file mode 100644 +index 0000000..d2bf109 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main002.c +@@ -0,0 +1,9 @@ ++// Test c call fortran for scalar type and the scalar type is short ++// ++#include ++extern void f_func_(short *i); ++int main() { ++ short i = 0; ++ f_func_(&i); ++ printf("%hd\n", i); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main003.c b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main003.c +new file mode 100644 +index 0000000..921d6e7 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main003.c +@@ -0,0 +1,9 @@ ++// Test c call fortran for scalar type and the scalar type is long ++// ++#include ++extern void f_func_(long *i); ++int main() { ++ long i = 0; ++ f_func_(&i); ++ printf("%ld\n", i); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main004.c b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main004.c +new file mode 100644 +index 0000000..20e2d27 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main004.c +@@ -0,0 +1,9 @@ ++// Test c call fortran for scalar type and the scalar type is long long ++// ++#include ++extern void f_func_(long long *i); ++int main() { ++ long long i = 0; ++ f_func_(&i); ++ printf("%Ld\n", i); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main005.c b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main005.c +new file mode 100644 +index 0000000..9f396bd +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main005.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for scalar type and the scalar type is signed ++// char ++// ++#include ++extern void f_func_(signed char *i); ++int main() { ++ signed char i = 0; ++ f_func_(&i); ++ printf("%c\n", i); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main006.c b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main006.c +new file mode 100644 +index 0000000..f5f6b65 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main006.c +@@ -0,0 +1,9 @@ ++// Test c call fortran for scalar type and the scalar type is size_t ++// ++#include ++extern void f_func_(size_t *i); ++int main() { ++ size_t i = 0; ++ f_func_(&i); ++ printf("%ld\n", i); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main007.c b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main007.c +new file mode 100644 +index 0000000..a526d24 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main007.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for scalar type and the scalar type is int8_t ++// ++#include ++#include ++extern void f_func_(int8_t *i); ++int main() { ++ int8_t i = 0; ++ f_func_(&i); ++ printf("%hhd\n", i); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main008.c b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main008.c +new file mode 100644 +index 0000000..89b28a5 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main008.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for scalar type and the scalar type is int16_t ++// ++#include ++#include ++extern void f_func_(int16_t *i); ++int main() { ++ int16_t i = 0; ++ f_func_(&i); ++ printf("%hd\n", i); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main009.c b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main009.c +new file mode 100644 +index 0000000..a883214 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main009.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for scalar type and the scalar type is int32_t ++// ++#include ++#include ++extern void f_func_(int32_t *i); ++int main() { ++ int32_t i = 0; ++ f_func_(&i); ++ printf("%d\n", i); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main010.c b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main010.c +new file mode 100644 +index 0000000..f1360d8 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main010.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for scalar type and the scalar type is int64_t ++// ++#include ++#include ++extern void f_func_(int64_t *i); ++int main() { ++ int64_t i = 0; ++ f_func_(&i); ++ printf("%ld\n", i); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main011.c b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main011.c +new file mode 100644 +index 0000000..014c867 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main011.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for scalar type and the scalar type is ++// int_least8_t ++// ++#include ++#include ++extern void f_func_(int_least8_t *i); ++int main() { ++ int_least8_t i = 0; ++ f_func_(&i); ++ printf("%hhd\n", i); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main012.c b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main012.c +new file mode 100644 +index 0000000..7b059ae +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main012.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for scalar type and the scalar type is ++// int_least16_t ++// ++#include ++#include ++extern void f_func_(int_least16_t *i); ++int main() { ++ int_least16_t i = 0; ++ f_func_(&i); ++ printf("%hd\n", i); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main013.c b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main013.c +new file mode 100644 +index 0000000..7d75b28 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main013.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for scalar type and the scalar type is ++// int_least32_t ++// ++#include ++#include ++extern void f_func_(int_least32_t *i); ++int main() { ++ int_least32_t i = 0; ++ f_func_(&i); ++ printf("%d\n", i); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main014.c b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main014.c +new file mode 100644 +index 0000000..90dc33a +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main014.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for scalar type and the scalar type is ++// int_least64_t ++// ++#include ++#include ++extern void f_func_(int_least64_t *i); ++int main() { ++ int_least64_t i = 0; ++ f_func_(&i); ++ printf("%ld\n", i); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main015.c b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main015.c +new file mode 100644 +index 0000000..556f989 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main015.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for scalar type and the scalar type is ++// int_fast8_t ++// ++#include ++#include ++extern void f_func_(int_fast8_t *i); ++int main() { ++ int_fast8_t i = 0; ++ f_func_(&i); ++ printf("%hhd\n", i); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main016.c b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main016.c +new file mode 100644 +index 0000000..05400b2 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main016.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for scalar type and the scalar type is ++// int_fast16_t ++// ++#include ++#include ++extern void f_func_(int_fast16_t *i); ++int main() { ++ int_fast16_t i = 0; ++ f_func_(&i); ++ printf("%ld\n", i); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main017.c b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main017.c +new file mode 100644 +index 0000000..774ceb4 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main017.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for scalar type and the scalar type is ++// int_fast32_t ++// ++#include ++#include ++extern void f_func_(int_fast32_t *i); ++int main() { ++ int_fast32_t i = 0; ++ f_func_(&i); ++ printf("%ld\n", i); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main018.c b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main018.c +new file mode 100644 +index 0000000..3ec2748 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main018.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for scalar type and the scalar type is ++// int_fast64_t ++// ++#include ++#include ++extern void f_func_(int_fast64_t *i); ++int main() { ++ int_fast64_t i = 0; ++ f_func_(&i); ++ printf("%ld\n", i); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main019.c b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main019.c +new file mode 100644 +index 0000000..5b8b2ef +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main019.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for scalar type and the scalar type is intmax_t ++// ++#include ++#include ++extern void f_func_(intmax_t *i); ++int main() { ++ intmax_t i = 0; ++ f_func_(&i); ++ printf("%ld\n", i); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main020.c b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main020.c +new file mode 100644 +index 0000000..ab30f63 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main020.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for scalar type and the scalar type is intptr_t ++// ++#include ++#include ++extern void f_func_(intptr_t *i); ++int main() { ++ intptr_t i = 0; ++ f_func_(&i); ++ printf("%ld\n", i); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main021.c b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main021.c +new file mode 100644 +index 0000000..ccb4136 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main021.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for scalar type and the scalar type is float ++// ++#include ++#include ++extern void f_func_(float *i); ++int main() { ++ float i = 0; ++ f_func_(&i); ++ printf("%0.20f\n", i); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main022.c b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main022.c +new file mode 100644 +index 0000000..19df789 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main022.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for scalar type and the scalar type is double ++// ++#include ++#include ++extern void f_func_(double *i); ++int main() { ++ double i = 0; ++ f_func_(&i); ++ printf("%0.20lf\n", i); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main023.c b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main023.c +new file mode 100644 +index 0000000..819e350 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main023.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for scalar type and the scalar type is long ++// double ++// ++#include ++#include ++extern void f_func_(long double *i); ++int main() { ++ long double i = 0; ++ f_func_(&i); ++ printf("%0.20Lf\n", i); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main024.c b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main024.c +new file mode 100644 +index 0000000..4acf839 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main024.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for scalar type and the scalar type is float ++// _Complex ++// ++#include ++#include ++extern void f_func_(float _Complex *i); ++int main() { ++ float _Complex i; ++ f_func_(&i); ++ printf("%0.20f + %0.20fi\n", creal(i), cimag(i)); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main025.c b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main025.c +new file mode 100644 +index 0000000..c1803eb +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main025.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for scalar type and the scalar type is double ++// _Complex ++// ++#include ++#include ++extern void f_func_(double _Complex *i); ++int main() { ++ double _Complex i; ++ f_func_(&i); ++ printf("%0.20lf + %0.20lfi\n", creal(i), cimag(i)); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main026.c b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main026.c +new file mode 100644 +index 0000000..7b5e50e +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main026.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for scalar type and the scalar type is double ++// _Complex ++// ++#include ++#include ++extern void f_func_(long double _Complex *i); ++int main() { ++ long double _Complex i; ++ f_func_(&i); ++ printf("%0.20lf + %0.20lfi\n", creal(i), cimag(i)); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main027.c b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main027.c +new file mode 100644 +index 0000000..199691d +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main027.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for scalar type and the scalar type is _Bool ++// ++#include ++#include ++extern void f_func_(_Bool *i); ++int main() { ++ _Bool i = 0; ++ f_func_(&i); ++ printf("%d\n", i); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main028.c b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main028.c +new file mode 100644 +index 0000000..3b2376d +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main028.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for scalar type and the scalar type is char ++// ++#include ++#include ++extern void f_func_(char *i); ++int main() { ++ char i; ++ f_func_(&i); ++ printf("%c\n", i); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func001.f90 b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func001.f90 +new file mode 100644 +index 0000000..95e75fa +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func001.f90 +@@ -0,0 +1,4 @@ ++subroutine f_func(i) ++ integer :: i ++ i = 2147483647 ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func002.f90 b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func002.f90 +new file mode 100644 +index 0000000..74c32fa +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func002.f90 +@@ -0,0 +1,4 @@ ++subroutine f_func(i) ++ integer(2) :: i ++ i = 32767 ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func003.f90 b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func003.f90 +new file mode 100644 +index 0000000..cc3e99a +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func003.f90 +@@ -0,0 +1,4 @@ ++subroutine f_func(i) ++ integer(8) :: i ++ i = 9223372036854775807 ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func004.f90 b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func004.f90 +new file mode 100644 +index 0000000..cc3e99a +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func004.f90 +@@ -0,0 +1,4 @@ ++subroutine f_func(i) ++ integer(8) :: i ++ i = 9223372036854775807 ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func005.f90 b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func005.f90 +new file mode 100644 +index 0000000..9fa97ed +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func005.f90 +@@ -0,0 +1,4 @@ ++subroutine f_func(i) ++ integer(1) :: i ++ i = 97 ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func006.f90 b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func006.f90 +new file mode 100644 +index 0000000..cc3e99a +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func006.f90 +@@ -0,0 +1,4 @@ ++subroutine f_func(i) ++ integer(8) :: i ++ i = 9223372036854775807 ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func007.f90 b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func007.f90 +new file mode 100644 +index 0000000..c854566 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func007.f90 +@@ -0,0 +1,4 @@ ++subroutine f_func(i) ++ integer(1) :: i ++ i = 127 ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func008.f90 b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func008.f90 +new file mode 100644 +index 0000000..74c32fa +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func008.f90 +@@ -0,0 +1,4 @@ ++subroutine f_func(i) ++ integer(2) :: i ++ i = 32767 ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func009.f90 b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func009.f90 +new file mode 100644 +index 0000000..87e7774 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func009.f90 +@@ -0,0 +1,4 @@ ++subroutine f_func(i) ++ integer(4) :: i ++ i = 2147483647 ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func010.f90 b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func010.f90 +new file mode 100644 +index 0000000..cc3e99a +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func010.f90 +@@ -0,0 +1,4 @@ ++subroutine f_func(i) ++ integer(8) :: i ++ i = 9223372036854775807 ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func011.f90 b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func011.f90 +new file mode 100644 +index 0000000..c854566 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func011.f90 +@@ -0,0 +1,4 @@ ++subroutine f_func(i) ++ integer(1) :: i ++ i = 127 ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func012.f90 b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func012.f90 +new file mode 100644 +index 0000000..74c32fa +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func012.f90 +@@ -0,0 +1,4 @@ ++subroutine f_func(i) ++ integer(2) :: i ++ i = 32767 ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func013.f90 b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func013.f90 +new file mode 100644 +index 0000000..87e7774 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func013.f90 +@@ -0,0 +1,4 @@ ++subroutine f_func(i) ++ integer(4) :: i ++ i = 2147483647 ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func014.f90 b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func014.f90 +new file mode 100644 +index 0000000..cc3e99a +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func014.f90 +@@ -0,0 +1,4 @@ ++subroutine f_func(i) ++ integer(8) :: i ++ i = 9223372036854775807 ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func015.f90 b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func015.f90 +new file mode 100644 +index 0000000..c854566 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func015.f90 +@@ -0,0 +1,4 @@ ++subroutine f_func(i) ++ integer(1) :: i ++ i = 127 ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func016.f90 b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func016.f90 +new file mode 100644 +index 0000000..cc3e99a +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func016.f90 +@@ -0,0 +1,4 @@ ++subroutine f_func(i) ++ integer(8) :: i ++ i = 9223372036854775807 ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func017.f90 b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func017.f90 +new file mode 100644 +index 0000000..cc3e99a +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func017.f90 +@@ -0,0 +1,4 @@ ++subroutine f_func(i) ++ integer(8) :: i ++ i = 9223372036854775807 ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func018.f90 b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func018.f90 +new file mode 100644 +index 0000000..cc3e99a +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func018.f90 +@@ -0,0 +1,4 @@ ++subroutine f_func(i) ++ integer(8) :: i ++ i = 9223372036854775807 ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func019.f90 b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func019.f90 +new file mode 100644 +index 0000000..cc3e99a +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func019.f90 +@@ -0,0 +1,4 @@ ++subroutine f_func(i) ++ integer(8) :: i ++ i = 9223372036854775807 ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func020.f90 b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func020.f90 +new file mode 100644 +index 0000000..cc3e99a +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func020.f90 +@@ -0,0 +1,4 @@ ++subroutine f_func(i) ++ integer(8) :: i ++ i = 9223372036854775807 ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func021.f90 b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func021.f90 +new file mode 100644 +index 0000000..342040e +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func021.f90 +@@ -0,0 +1,4 @@ ++subroutine f_func(i) ++ real(4) :: i ++ i = 314159265358.979626 ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func022.f90 b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func022.f90 +new file mode 100644 +index 0000000..5077d70 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func022.f90 +@@ -0,0 +1,4 @@ ++subroutine f_func(i) ++ real(8) :: i ++ i = 314159265358.979626 ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func023.f90 b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func023.f90 +new file mode 100644 +index 0000000..58c7bfd +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func023.f90 +@@ -0,0 +1,5 @@ ++subroutine f_func(i) ++ integer, parameter :: K = selected_real_kind(16) ++ real(K) :: i ++ i = 314159265358.979626 ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func024.f90 b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func024.f90 +new file mode 100644 +index 0000000..3a14570 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func024.f90 +@@ -0,0 +1,4 @@ ++subroutine f_func(i) ++ complex(4) :: i ++ i = (-12345678.7654321, 1) ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func025.f90 b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func025.f90 +new file mode 100644 +index 0000000..6514dfd +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func025.f90 +@@ -0,0 +1,4 @@ ++subroutine f_func(i) ++ complex(8) :: i ++ i = (-12345678.7654321, 1) ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func026.f90 b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func026.f90 +new file mode 100644 +index 0000000..0acf912 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func026.f90 +@@ -0,0 +1,5 @@ ++subroutine f_func(i) ++ integer, parameter :: K = selected_real_kind(16) ++ complex(K) :: i ++ i = (-12345678.7654321, 1) ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func027.f90 b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func027.f90 +new file mode 100644 +index 0000000..f71da8e +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func027.f90 +@@ -0,0 +1,4 @@ ++subroutine f_func(i) ++ logical(1) :: i ++ i = .TRUE. ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func028.f90 b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func028.f90 +new file mode 100644 +index 0000000..14181a4 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func028.f90 +@@ -0,0 +1,4 @@ ++subroutine f_func(i) ++ character(1) :: i ++ i = 'a' ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/result.md b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/result.md +new file mode 100644 +index 0000000..347da21 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/result.md +@@ -0,0 +1,29 @@ ++ | test | gfortran | flang | ++ | 001 | PASS | PASS | ++ | 002 | PASS | PASS | ++ | 003 | PASS | PASS | ++ | 004 | PASS | PASS | ++ | 005 | PASS | PASS | ++ | 006 | PASS | PASS | ++ | 007 | PASS | PASS | ++ | 008 | PASS | PASS | ++ | 009 | PASS | PASS | ++ | 010 | PASS | PASS | ++ | 011 | PASS | PASS | ++ | 012 | PASS | PASS | ++ | 013 | PASS | PASS | ++ | 014 | PASS | PASS | ++ | 015 | PASS | PASS | ++ | 016 | PASS | PASS | ++ | 017 | PASS | PASS | ++ | 018 | PASS | PASS | ++ | 019 | PASS | PASS | ++ | 020 | PASS | PASS | ++ | 021 | PASS | PASS | ++ | 022 | PASS | PASS | ++ | 023 | PASS | PASS | ++ | 024 | PASS | PASS | ++ | 025 | PASS | PASS | ++ | 026 | PASS | PASS | ++ | 027 | PASS | PASS | ++ | 028 | PASS | PASS | +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/run.sh b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/run.sh +new file mode 100644 +index 0000000..5b2202e +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/run.sh +@@ -0,0 +1,16 @@ ++for i in {001..028} ++do ++echo "------- test $i ------." ++echo "----- gfortran result:" ++gcc c_main$i.c -c -o c-test.o ++gfortran fortran_func$i.f90 -fno-range-check -c -o fortran-test.o ++gfortran fortran-test.o c-test.o ++./a.out ++rm *.o a.out ++echo "----- flang-new result : " ++clang c_main$i.c -c -o c-test.o ++flang-new fortran_func$i.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o a.out ++done +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main001.c b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main001.c +new file mode 100644 +index 0000000..2def20c +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main001.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for scalar type and the scalar type is int with ++// bindc ++// ++#include ++extern void f_func_(int *i); ++int main() { ++ int i = 0; ++ f_func_(&i); ++ printf("%d\n", i); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main002.c b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main002.c +new file mode 100644 +index 0000000..26bd768 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main002.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for scalar type and the scalar type is short ++// bindc ++// ++#include ++extern void f_func_(short *i); ++int main() { ++ short i = 0; ++ f_func_(&i); ++ printf("%hd\n", i); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main003.c b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main003.c +new file mode 100644 +index 0000000..7e95460 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main003.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for scalar type and the scalar type is long with ++// bindc ++// ++#include ++extern void f_func_(long *i); ++int main() { ++ long i = 0; ++ f_func_(&i); ++ printf("%ld\n", i); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main004.c b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main004.c +new file mode 100644 +index 0000000..ef0c0fa +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main004.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for scalar type and the scalar type is long long ++// with bindc ++// ++#include ++extern void f_func_(long long *i); ++int main() { ++ long long i = 0; ++ f_func_(&i); ++ printf("%Ld\n", i); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main005.c b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main005.c +new file mode 100644 +index 0000000..14ad78c +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main005.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for scalar type and the scalar type is signed ++// char with bindc ++// ++#include ++extern void f_func_(signed char *i); ++int main() { ++ signed char i = 0; ++ f_func_(&i); ++ printf("%c\n", i); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main006.c b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main006.c +new file mode 100644 +index 0000000..5202cc2 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main006.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for scalar type and the scalar type is size_t ++// with bindc ++// ++#include ++extern void f_func_(size_t *i); ++int main() { ++ size_t i = 0; ++ f_func_(&i); ++ printf("%ld\n", i); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main007.c b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main007.c +new file mode 100644 +index 0000000..52fb2a6 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main007.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for scalar type and the scalar type is int8_t ++// with bindc ++// ++#include ++#include ++extern void f_func_(int8_t *i); ++int main() { ++ int8_t i = 0; ++ f_func_(&i); ++ printf("%hhd\n", i); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main008.c b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main008.c +new file mode 100644 +index 0000000..45a3f95 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main008.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for scalar type and the scalar type is int16_t ++// with bindc ++// ++#include ++#include ++extern void f_func_(int16_t *i); ++int main() { ++ int16_t i = 0; ++ f_func_(&i); ++ printf("%hd\n", i); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main009.c b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main009.c +new file mode 100644 +index 0000000..3dbd951 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main009.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for scalar type and the scalar type is int32_t ++// with bindc ++// ++#include ++#include ++extern void f_func_(int32_t *i); ++int main() { ++ int32_t i = 0; ++ f_func_(&i); ++ printf("%d\n", i); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main010.c b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main010.c +new file mode 100644 +index 0000000..e9e3e2c +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main010.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for scalar type and the scalar type is int64_t ++// with bindc ++// ++#include ++#include ++extern void f_func_(int64_t *i); ++int main() { ++ int64_t i = 0; ++ f_func_(&i); ++ printf("%ld\n", i); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main011.c b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main011.c +new file mode 100644 +index 0000000..617fb85 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main011.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for scalar type and the scalar type is ++// int_least8_t with bindc ++// ++#include ++#include ++extern void f_func_(int_least8_t *i); ++int main() { ++ int_least8_t i = 0; ++ f_func_(&i); ++ printf("%hhd\n", i); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main012.c b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main012.c +new file mode 100644 +index 0000000..5eac287 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main012.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for scalar type and the scalar type is ++// int_least16_t with bindc ++// ++#include ++#include ++extern void f_func_(int_least16_t *i); ++int main() { ++ int_least16_t i = 0; ++ f_func_(&i); ++ printf("%hd\n", i); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main013.c b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main013.c +new file mode 100644 +index 0000000..1e81950 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main013.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for scalar type and the scalar type is ++// int_least32_t with bindc ++// ++#include ++#include ++extern void f_func_(int_least32_t *i); ++int main() { ++ int_least32_t i = 0; ++ f_func_(&i); ++ printf("%d\n", i); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main014.c b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main014.c +new file mode 100644 +index 0000000..bb24e29 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main014.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for scalar type and the scalar type is ++// int_least64_t with bindc ++// ++#include ++#include ++extern void f_func_(int_least64_t *i); ++int main() { ++ int_least64_t i = 0; ++ f_func_(&i); ++ printf("%ld\n", i); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main015.c b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main015.c +new file mode 100644 +index 0000000..57d4d21 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main015.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for scalar type and the scalar type is ++// int_fast8_t with bindc ++// ++#include ++#include ++extern void f_func_(int_fast8_t *i); ++int main() { ++ int_fast8_t i = 0; ++ f_func_(&i); ++ printf("%hhd\n", i); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main016.c b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main016.c +new file mode 100644 +index 0000000..e641f17 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main016.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for scalar type and the scalar type is ++// int_fast16_t with bindc ++// ++#include ++#include ++extern void f_func_(int_fast16_t *i); ++int main() { ++ int_fast16_t i = 0; ++ f_func_(&i); ++ printf("%ld\n", i); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main017.c b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main017.c +new file mode 100644 +index 0000000..0634f7a +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main017.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for scalar type and the scalar type is ++// int_fast32_t with bindc ++// ++#include ++#include ++extern void f_func_(int_fast32_t *i); ++int main() { ++ int_fast32_t i = 0; ++ f_func_(&i); ++ printf("%ld\n", i); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main018.c b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main018.c +new file mode 100644 +index 0000000..e309b92 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main018.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for scalar type and the scalar type is ++// int_fast64_t with bindc ++// ++#include ++#include ++extern void f_func_(int_fast64_t *i); ++int main() { ++ int_fast64_t i = 0; ++ f_func_(&i); ++ printf("%ld\n", i); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main019.c b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main019.c +new file mode 100644 +index 0000000..9fc63af +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main019.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for scalar type and the scalar type is intmax_t ++// with bindc ++// ++#include ++#include ++extern void f_func_(intmax_t *i); ++int main() { ++ intmax_t i = 0; ++ f_func_(&i); ++ printf("%ld\n", i); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main020.c b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main020.c +new file mode 100644 +index 0000000..5ea5b4b +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main020.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for scalar type and the scalar type is intptr_t ++// with bindc ++// ++#include ++#include ++extern void f_func_(intptr_t *i); ++int main() { ++ intptr_t i = 0; ++ f_func_(&i); ++ printf("%ld\n", i); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main021.c b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main021.c +new file mode 100644 +index 0000000..b32fc2d +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main021.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for scalar type and the scalar type is float ++// with bindc ++// ++#include ++#include ++extern void f_func_(float *i); ++int main() { ++ float i = 0; ++ f_func_(&i); ++ printf("%0.20f\n", i); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main022.c b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main022.c +new file mode 100644 +index 0000000..dc6bf18 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main022.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for scalar type and the scalar type is double ++// with bindc ++// ++#include ++#include ++extern void f_func_(double *i); ++int main() { ++ double i = 0; ++ f_func_(&i); ++ printf("%0.20lf\n", i); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main023.c b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main023.c +new file mode 100644 +index 0000000..f25288d +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main023.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for scalar type and the scalar type is long ++// double with bindc ++// ++#include ++#include ++extern void f_func_(long double *i); ++int main() { ++ long double i = 0; ++ f_func_(&i); ++ printf("%0.20Lf\n", i); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main024.c b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main024.c +new file mode 100644 +index 0000000..99253d2 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main024.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for scalar type and the scalar type is float ++// _Complex with bindc ++// ++#include ++#include ++extern void f_func_(float _Complex *i); ++int main() { ++ float _Complex i; ++ f_func_(&i); ++ printf("%0.20f + %0.20fi\n", creal(i), cimag(i)); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main025.c b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main025.c +new file mode 100644 +index 0000000..622e6f9 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main025.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for scalar type and the scalar type is double ++// _Complex with bindc ++// ++#include ++#include ++extern void f_func_(double _Complex *i); ++int main() { ++ double _Complex i; ++ f_func_(&i); ++ printf("%0.20lf + %0.20lfi\n", creal(i), cimag(i)); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main026.c b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main026.c +new file mode 100644 +index 0000000..5a1852a +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main026.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for scalar type and the scalar type is double ++// _Complex with bindc ++// ++#include ++#include ++extern void f_func_(long double _Complex *i); ++int main() { ++ long double _Complex i; ++ f_func_(&i); ++ printf("%0.20lf + %0.20lfi\n", creal(i), cimag(i)); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main027.c b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main027.c +new file mode 100644 +index 0000000..147f511 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main027.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for scalar type and the scalar type is _Bool ++// with bindc ++// ++#include ++#include ++extern void f_func_(_Bool *i); ++int main() { ++ _Bool i = 0; ++ f_func_(&i); ++ printf("%d\n", i); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main028.c b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main028.c +new file mode 100644 +index 0000000..a5978f8 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main028.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for scalar type and the scalar type is char with ++// bindc ++// ++#include ++#include ++extern void f_func_(char *i); ++int main() { ++ char i; ++ f_func_(&i); ++ printf("%c\n", i); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func001.f90 b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func001.f90 +new file mode 100644 +index 0000000..ffc08aa +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func001.f90 +@@ -0,0 +1,4 @@ ++subroutine f_func(i) bind(c, name = "f_func_") ++ integer :: i ++ i = 2147483647 ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func002.f90 b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func002.f90 +new file mode 100644 +index 0000000..9ecd88b +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func002.f90 +@@ -0,0 +1,4 @@ ++subroutine f_func(i) bind(c, name = "f_func_") ++ integer(2) :: i ++ i = 32767 ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func003.f90 b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func003.f90 +new file mode 100644 +index 0000000..a1c733a +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func003.f90 +@@ -0,0 +1,4 @@ ++subroutine f_func(i) bind(c, name = "f_func_") ++ integer(8) :: i ++ i = 9223372036854775807 ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func004.f90 b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func004.f90 +new file mode 100644 +index 0000000..a1c733a +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func004.f90 +@@ -0,0 +1,4 @@ ++subroutine f_func(i) bind(c, name = "f_func_") ++ integer(8) :: i ++ i = 9223372036854775807 ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func005.f90 b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func005.f90 +new file mode 100644 +index 0000000..1b5a25f +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func005.f90 +@@ -0,0 +1,4 @@ ++subroutine f_func(i) bind(c, name = "f_func_") ++ integer(1) :: i ++ i = 97 ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func006.f90 b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func006.f90 +new file mode 100644 +index 0000000..a1c733a +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func006.f90 +@@ -0,0 +1,4 @@ ++subroutine f_func(i) bind(c, name = "f_func_") ++ integer(8) :: i ++ i = 9223372036854775807 ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func007.f90 b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func007.f90 +new file mode 100644 +index 0000000..cd8e40f +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func007.f90 +@@ -0,0 +1,4 @@ ++subroutine f_func(i) bind(c, name = "f_func_") ++ integer(1) :: i ++ i = 127 ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func008.f90 b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func008.f90 +new file mode 100644 +index 0000000..9ecd88b +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func008.f90 +@@ -0,0 +1,4 @@ ++subroutine f_func(i) bind(c, name = "f_func_") ++ integer(2) :: i ++ i = 32767 ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func009.f90 b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func009.f90 +new file mode 100644 +index 0000000..6b326f2 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func009.f90 +@@ -0,0 +1,4 @@ ++subroutine f_func(i) bind(c, name = "f_func_") ++ integer(4) :: i ++ i = 2147483647 ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func010.f90 b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func010.f90 +new file mode 100644 +index 0000000..a1c733a +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func010.f90 +@@ -0,0 +1,4 @@ ++subroutine f_func(i) bind(c, name = "f_func_") ++ integer(8) :: i ++ i = 9223372036854775807 ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func011.f90 b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func011.f90 +new file mode 100644 +index 0000000..cd8e40f +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func011.f90 +@@ -0,0 +1,4 @@ ++subroutine f_func(i) bind(c, name = "f_func_") ++ integer(1) :: i ++ i = 127 ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func012.f90 b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func012.f90 +new file mode 100644 +index 0000000..9ecd88b +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func012.f90 +@@ -0,0 +1,4 @@ ++subroutine f_func(i) bind(c, name = "f_func_") ++ integer(2) :: i ++ i = 32767 ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func013.f90 b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func013.f90 +new file mode 100644 +index 0000000..6b326f2 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func013.f90 +@@ -0,0 +1,4 @@ ++subroutine f_func(i) bind(c, name = "f_func_") ++ integer(4) :: i ++ i = 2147483647 ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func014.f90 b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func014.f90 +new file mode 100644 +index 0000000..a1c733a +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func014.f90 +@@ -0,0 +1,4 @@ ++subroutine f_func(i) bind(c, name = "f_func_") ++ integer(8) :: i ++ i = 9223372036854775807 ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func015.f90 b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func015.f90 +new file mode 100644 +index 0000000..cd8e40f +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func015.f90 +@@ -0,0 +1,4 @@ ++subroutine f_func(i) bind(c, name = "f_func_") ++ integer(1) :: i ++ i = 127 ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func016.f90 b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func016.f90 +new file mode 100644 +index 0000000..a1c733a +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func016.f90 +@@ -0,0 +1,4 @@ ++subroutine f_func(i) bind(c, name = "f_func_") ++ integer(8) :: i ++ i = 9223372036854775807 ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func017.f90 b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func017.f90 +new file mode 100644 +index 0000000..a1c733a +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func017.f90 +@@ -0,0 +1,4 @@ ++subroutine f_func(i) bind(c, name = "f_func_") ++ integer(8) :: i ++ i = 9223372036854775807 ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func018.f90 b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func018.f90 +new file mode 100644 +index 0000000..a1c733a +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func018.f90 +@@ -0,0 +1,4 @@ ++subroutine f_func(i) bind(c, name = "f_func_") ++ integer(8) :: i ++ i = 9223372036854775807 ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func019.f90 b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func019.f90 +new file mode 100644 +index 0000000..a1c733a +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func019.f90 +@@ -0,0 +1,4 @@ ++subroutine f_func(i) bind(c, name = "f_func_") ++ integer(8) :: i ++ i = 9223372036854775807 ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func020.f90 b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func020.f90 +new file mode 100644 +index 0000000..a1c733a +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func020.f90 +@@ -0,0 +1,4 @@ ++subroutine f_func(i) bind(c, name = "f_func_") ++ integer(8) :: i ++ i = 9223372036854775807 ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func021.f90 b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func021.f90 +new file mode 100644 +index 0000000..611cdc9 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func021.f90 +@@ -0,0 +1,4 @@ ++subroutine f_func(i) bind(c, name = "f_func_") ++ real(4) :: i ++ i = 314159265358.979626 ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func022.f90 b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func022.f90 +new file mode 100644 +index 0000000..900e195 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func022.f90 +@@ -0,0 +1,4 @@ ++subroutine f_func(i) bind(c, name = "f_func_") ++ real(8) :: i ++ i = 314159265358.979626 ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func023.f90 b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func023.f90 +new file mode 100644 +index 0000000..464d3c1 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func023.f90 +@@ -0,0 +1,5 @@ ++subroutine f_func(i) bind(c, name = "f_func_") ++ integer, parameter :: K = selected_real_kind(16) ++ real(K) :: i ++ i = 314159265358.979626 ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func024.f90 b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func024.f90 +new file mode 100644 +index 0000000..25c971c +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func024.f90 +@@ -0,0 +1,4 @@ ++subroutine f_func(i) bind(c, name = "f_func_") ++ complex(4) :: i ++ i = (-12345678.7654321, 1) ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func025.f90 b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func025.f90 +new file mode 100644 +index 0000000..69fddab +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func025.f90 +@@ -0,0 +1,4 @@ ++subroutine f_func(i) bind(c, name = "f_func_") ++ complex(8) :: i ++ i = (-12345678.7654321, 1) ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func026.f90 b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func026.f90 +new file mode 100644 +index 0000000..2698cb4 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func026.f90 +@@ -0,0 +1,5 @@ ++subroutine f_func(i) bind(c, name = "f_func_") ++ integer, parameter :: K = selected_real_kind(16) ++ complex(K) :: i ++ i = (-12345678.7654321, 1) ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func027.f90 b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func027.f90 +new file mode 100644 +index 0000000..2c10c78 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func027.f90 +@@ -0,0 +1,4 @@ ++subroutine f_func(i) bind(c, name = "f_func_") ++ logical(1) :: i ++ i = .TRUE. ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func028.f90 b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func028.f90 +new file mode 100644 +index 0000000..55d210f +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func028.f90 +@@ -0,0 +1,4 @@ ++subroutine f_func(i) bind(c, name = "f_func_") ++ character(1) :: i ++ i = 'a' ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/result.md b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/result.md +new file mode 100644 +index 0000000..347da21 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/result.md +@@ -0,0 +1,29 @@ ++ | test | gfortran | flang | ++ | 001 | PASS | PASS | ++ | 002 | PASS | PASS | ++ | 003 | PASS | PASS | ++ | 004 | PASS | PASS | ++ | 005 | PASS | PASS | ++ | 006 | PASS | PASS | ++ | 007 | PASS | PASS | ++ | 008 | PASS | PASS | ++ | 009 | PASS | PASS | ++ | 010 | PASS | PASS | ++ | 011 | PASS | PASS | ++ | 012 | PASS | PASS | ++ | 013 | PASS | PASS | ++ | 014 | PASS | PASS | ++ | 015 | PASS | PASS | ++ | 016 | PASS | PASS | ++ | 017 | PASS | PASS | ++ | 018 | PASS | PASS | ++ | 019 | PASS | PASS | ++ | 020 | PASS | PASS | ++ | 021 | PASS | PASS | ++ | 022 | PASS | PASS | ++ | 023 | PASS | PASS | ++ | 024 | PASS | PASS | ++ | 025 | PASS | PASS | ++ | 026 | PASS | PASS | ++ | 027 | PASS | PASS | ++ | 028 | PASS | PASS | +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/run.sh b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/run.sh +new file mode 100644 +index 0000000..5b2202e +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/run.sh +@@ -0,0 +1,16 @@ ++for i in {001..028} ++do ++echo "------- test $i ------." ++echo "----- gfortran result:" ++gcc c_main$i.c -c -o c-test.o ++gfortran fortran_func$i.f90 -fno-range-check -c -o fortran-test.o ++gfortran fortran-test.o c-test.o ++./a.out ++rm *.o a.out ++echo "----- flang-new result : " ++clang c_main$i.c -c -o c-test.o ++flang-new fortran_func$i.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o a.out ++done +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main001.c b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main001.c +new file mode 100644 +index 0000000..2dd7dab +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main001.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for the scalar type with value attribute and the ++// scalar type is int without bindc ++// ++#include ++extern void f_func_(int i); ++int main() { ++ int res = 12; ++ f_func_(res); ++ printf("%d\n", res); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main002.c b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main002.c +new file mode 100644 +index 0000000..23ee8a1 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main002.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for the scalar type with value attribute and the ++// scalar type is short without bindc ++// ++#include ++extern void f_func_(short i); ++int main() { ++ short res = 12; ++ f_func_(res); ++ printf("%hd\n", res); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main003.c b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main003.c +new file mode 100644 +index 0000000..e116bb8 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main003.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for the scalar type with value attribute and the ++// scalar type is long without bindc ++// ++#include ++extern void f_func_(long i); ++int main() { ++ long res = 12; ++ f_func_(res); ++ printf("%ld\n", res); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main004.c b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main004.c +new file mode 100644 +index 0000000..82d8e17 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main004.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for the scalar type with value attribute and the ++// scalar type is long long without bindc ++// ++#include ++extern void f_func_(long long i); ++int main() { ++ long long res = 12; ++ f_func_(res); ++ printf("%Ld\n", res); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main005.c b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main005.c +new file mode 100644 +index 0000000..34da053 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main005.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for the scalar type with value attribute and the ++// scalar type is signed char without bindc ++// ++#include ++extern void f_func_(signed char i); ++int main() { ++ signed char res = 12; ++ f_func_(res); ++ printf("%hhd\n", res); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main006.c b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main006.c +new file mode 100644 +index 0000000..2f6fa08 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main006.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for the scalar type with value attribute and the ++// scalar type is size_t without bindc ++// ++#include ++extern void f_func_(size_t i); ++int main() { ++ size_t res = 12; ++ f_func_(res); ++ printf("%ld\n", res); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main007.c b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main007.c +new file mode 100644 +index 0000000..a24750c +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main007.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for the scalar type with value attribute and the ++// scalar type is int8_t without bindc ++// ++#include ++#include ++extern void f_func_(int8_t i); ++int main() { ++ int8_t res = 12; ++ f_func_(res); ++ printf("%hhd\n", res); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main008.c b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main008.c +new file mode 100644 +index 0000000..94355b6 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main008.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for the scalar type with value attribute and the ++// scalar type is int16_t without bindc ++// ++#include ++#include ++extern void f_func_(int16_t i); ++int main() { ++ int16_t res = 12; ++ f_func_(res); ++ printf("%hd\n", res); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main009.c b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main009.c +new file mode 100644 +index 0000000..31a1f39 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main009.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for the scalar type with value attribute and the ++// scalar type is int32_t without bindc ++// ++#include ++#include ++extern void f_func_(int32_t i); ++int main() { ++ int32_t res = 12; ++ f_func_(res); ++ printf("%d\n", res); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main010.c b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main010.c +new file mode 100644 +index 0000000..cbe3787 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main010.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for the scalar type with value attribute and the ++// scalar type is int64_t without bindc ++// ++#include ++#include ++extern void f_func_(int64_t i); ++int main() { ++ int64_t res = 12; ++ f_func_(res); ++ printf("%ld\n", res); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main011.c b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main011.c +new file mode 100644 +index 0000000..14a671e +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main011.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for the scalar type with value attribute and the ++// scalar type is int_least8_t without bindc ++// ++#include ++#include ++extern void f_func_(int_least8_t i); ++int main() { ++ int_least8_t res = 12; ++ f_func_(res); ++ printf("%hhd\n", res); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main012.c b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main012.c +new file mode 100644 +index 0000000..3143fbe +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main012.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for the scalar type with value attribute and the ++// scalar type is int_least16_t without bindc ++// ++#include ++#include ++extern void f_func_(int_least16_t i); ++int main() { ++ int_least16_t res = 12; ++ f_func_(res); ++ printf("%hd\n", res); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main013.c b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main013.c +new file mode 100644 +index 0000000..8fda433 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main013.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for the scalar type with value attribute and the ++// scalar type is int_least32_t without bindc ++// ++#include ++#include ++extern void f_func_(int_least32_t i); ++int main() { ++ int_least32_t res = 12; ++ f_func_(res); ++ printf("%d\n", res); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main014.c b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main014.c +new file mode 100644 +index 0000000..2149a3e +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main014.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for the scalar type with value attribute and the ++// scalar type is int_least64_t without bindc ++// ++#include ++#include ++extern void f_func_(int_least64_t i); ++int main() { ++ int_least64_t res = 12; ++ f_func_(res); ++ printf("%ld\n", res); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main015.c b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main015.c +new file mode 100644 +index 0000000..da0e8c4 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main015.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for the scalar type with value attribute and the ++// scalar type is int_fast8_t without bindc ++// ++#include ++#include ++extern void f_func_(int_fast8_t i); ++int main() { ++ int_fast8_t res = 12; ++ f_func_(res); ++ printf("%hhd\n", res); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main016.c b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main016.c +new file mode 100644 +index 0000000..82d0ab5 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main016.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for the scalar type with value attribute and the ++// scalar type is int_fast16_t without bindc ++// ++#include ++#include ++extern void f_func_(int_fast16_t i); ++int main() { ++ int_fast16_t res = 12; ++ f_func_(res); ++ printf("%ld\n", res); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main017.c b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main017.c +new file mode 100644 +index 0000000..60e6f02 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main017.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for the scalar type with value attribute and the ++// scalar type is int_fast32_t without bindc ++// ++#include ++#include ++extern void f_func_(int_fast32_t i); ++int main() { ++ int_fast32_t res = 12; ++ f_func_(res); ++ printf("%ld\n", res); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main018.c b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main018.c +new file mode 100644 +index 0000000..e901780 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main018.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for the scalar type with value attribute and the ++// scalar type is int_fast64_t without bindc ++// ++#include ++#include ++extern void f_func_(int_fast64_t i); ++int main() { ++ int_fast64_t res = 12; ++ f_func_(res); ++ printf("%ld\n", res); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main019.c b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main019.c +new file mode 100644 +index 0000000..5501578 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main019.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for the scalar type with value attribute and the ++// scalar type is intmax_t without bindc ++// ++#include ++#include ++extern void f_func_(intmax_t i); ++int main() { ++ intmax_t res = 12; ++ f_func_(res); ++ printf("%ld\n", res); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main020.c b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main020.c +new file mode 100644 +index 0000000..e98973c +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main020.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for the scalar type with value attribute and the ++// scalar type is intptr_t without bindc ++// ++#include ++#include ++extern void f_func_(intptr_t i); ++int main() { ++ intptr_t res = 12; ++ f_func_(res); ++ printf("%ld\n", res); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main021.c b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main021.c +new file mode 100644 +index 0000000..c664a03 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main021.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for the scalar type with value attribute and the ++// scalar type is float without bindc ++// ++#include ++extern void f_func_(float i); ++int main() { ++ float i = 3.14; ++ f_func_(i); ++ printf("%0.20f\n", i); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main022.c b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main022.c +new file mode 100644 +index 0000000..47e0d69 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main022.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for the scalar type with value attribute and the ++// scalar type is double without bindc ++// ++#include ++extern void f_func_(double i); ++int main() { ++ double i = 3.14; ++ f_func_(i); ++ printf("%0.20lf\n", i); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main023.c b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main023.c +new file mode 100644 +index 0000000..0feeed3 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main023.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for the scalar type with value attribute and the ++// scalar type is long double without bindc ++// ++#include ++extern void f_func_(long double i); ++int main() { ++ long double i = 3.14; ++ f_func_(i); ++ printf("%0.20Lf\n", i); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main024.c b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main024.c +new file mode 100644 +index 0000000..d720a6d +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main024.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for the scalar type with value attribute and the ++// scalar type is float _Complex without bindc ++// ++#include ++#include ++extern void f_func_(float _Complex i); ++int main() { ++ float _Complex i = 5.0f + 1.0if; ++ f_func_(i); ++ printf("%0.20f + %0.20fi\n", creal(i), cimag(i)); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main025.c b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main025.c +new file mode 100644 +index 0000000..2cbc3cb +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main025.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for the scalar type with value attribute and the ++// scalar type is double _Complex without bindc ++// ++#include ++#include ++extern void f_func_(double _Complex i); ++int main() { ++ double _Complex i = 5.0f + 1.0if; ++ f_func_(i); ++ printf("%0.20f + %0.20fi\n", creal(i), cimag(i)); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main026.c b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main026.c +new file mode 100644 +index 0000000..d221b3f +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main026.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for the scalar type with value attribute and the ++// scalar type is long double _Complex without bindc ++// ++#include ++#include ++extern void f_func_(long double _Complex i); ++int main() { ++ long double _Complex i = 5.0f + 1.0if; ++ f_func_(i); ++ printf("%0.20f + %0.20fi\n", creal(i), cimag(i)); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main027.c b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main027.c +new file mode 100644 +index 0000000..54c265f +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main027.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for the scalar type with value attribute and the ++// scalar type is _Bool without bindc ++// ++#include ++#include ++extern void f_func_(_Bool i); ++int main() { ++ _Bool i = 0; ++ f_func_(i); ++ printf("%d\n", i); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main028.c b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main028.c +new file mode 100644 +index 0000000..2764a44 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main028.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for the scalar type with value attribute and the ++// scalar type is char without bindc ++// ++#include ++#include ++extern void f_func_(char i); ++int main() { ++ char i = 'z'; ++ f_func_(i); ++ printf("%c\n", i); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func001.f90 b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func001.f90 +new file mode 100644 +index 0000000..9fcc701 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func001.f90 +@@ -0,0 +1,5 @@ ++subroutine f_func(b) ++ integer, value :: b ++ b = b + 1 ++ print *, b ++end +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func002.f90 b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func002.f90 +new file mode 100644 +index 0000000..ed202ed +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func002.f90 +@@ -0,0 +1,5 @@ ++subroutine f_func(b) ++ integer(2), value :: b ++ b = b + 1 ++ print *, b ++end +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func003.f90 b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func003.f90 +new file mode 100644 +index 0000000..5d65e3e +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func003.f90 +@@ -0,0 +1,5 @@ ++subroutine f_func(b) ++ integer(8), value :: b ++ b = b + 1 ++ print *, b ++end +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func004.f90 b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func004.f90 +new file mode 100644 +index 0000000..5d65e3e +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func004.f90 +@@ -0,0 +1,5 @@ ++subroutine f_func(b) ++ integer(8), value :: b ++ b = b + 1 ++ print *, b ++end +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func005.f90 b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func005.f90 +new file mode 100644 +index 0000000..3ec34c9 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func005.f90 +@@ -0,0 +1,5 @@ ++subroutine f_func(b) ++ integer(1), value :: b ++ b = b + 1 ++ print *, b ++end +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func006.f90 b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func006.f90 +new file mode 100644 +index 0000000..5d65e3e +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func006.f90 +@@ -0,0 +1,5 @@ ++subroutine f_func(b) ++ integer(8), value :: b ++ b = b + 1 ++ print *, b ++end +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func007.f90 b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func007.f90 +new file mode 100644 +index 0000000..3ec34c9 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func007.f90 +@@ -0,0 +1,5 @@ ++subroutine f_func(b) ++ integer(1), value :: b ++ b = b + 1 ++ print *, b ++end +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func008.f90 b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func008.f90 +new file mode 100644 +index 0000000..ed202ed +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func008.f90 +@@ -0,0 +1,5 @@ ++subroutine f_func(b) ++ integer(2), value :: b ++ b = b + 1 ++ print *, b ++end +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func009.f90 b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func009.f90 +new file mode 100644 +index 0000000..ccf4748 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func009.f90 +@@ -0,0 +1,5 @@ ++subroutine f_func(b) ++ integer(4), value :: b ++ b = b + 1 ++ print *, b ++end +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func010.f90 b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func010.f90 +new file mode 100644 +index 0000000..5d65e3e +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func010.f90 +@@ -0,0 +1,5 @@ ++subroutine f_func(b) ++ integer(8), value :: b ++ b = b + 1 ++ print *, b ++end +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func011.f90 b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func011.f90 +new file mode 100644 +index 0000000..3ec34c9 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func011.f90 +@@ -0,0 +1,5 @@ ++subroutine f_func(b) ++ integer(1), value :: b ++ b = b + 1 ++ print *, b ++end +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func012.f90 b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func012.f90 +new file mode 100644 +index 0000000..ed202ed +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func012.f90 +@@ -0,0 +1,5 @@ ++subroutine f_func(b) ++ integer(2), value :: b ++ b = b + 1 ++ print *, b ++end +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func013.f90 b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func013.f90 +new file mode 100644 +index 0000000..ccf4748 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func013.f90 +@@ -0,0 +1,5 @@ ++subroutine f_func(b) ++ integer(4), value :: b ++ b = b + 1 ++ print *, b ++end +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func014.f90 b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func014.f90 +new file mode 100644 +index 0000000..5d65e3e +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func014.f90 +@@ -0,0 +1,5 @@ ++subroutine f_func(b) ++ integer(8), value :: b ++ b = b + 1 ++ print *, b ++end +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func015.f90 b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func015.f90 +new file mode 100644 +index 0000000..3ec34c9 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func015.f90 +@@ -0,0 +1,5 @@ ++subroutine f_func(b) ++ integer(1), value :: b ++ b = b + 1 ++ print *, b ++end +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func016.f90 b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func016.f90 +new file mode 100644 +index 0000000..5d65e3e +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func016.f90 +@@ -0,0 +1,5 @@ ++subroutine f_func(b) ++ integer(8), value :: b ++ b = b + 1 ++ print *, b ++end +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func017.f90 b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func017.f90 +new file mode 100644 +index 0000000..5d65e3e +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func017.f90 +@@ -0,0 +1,5 @@ ++subroutine f_func(b) ++ integer(8), value :: b ++ b = b + 1 ++ print *, b ++end +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func018.f90 b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func018.f90 +new file mode 100644 +index 0000000..5d65e3e +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func018.f90 +@@ -0,0 +1,5 @@ ++subroutine f_func(b) ++ integer(8), value :: b ++ b = b + 1 ++ print *, b ++end +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func019.f90 b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func019.f90 +new file mode 100644 +index 0000000..5d65e3e +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func019.f90 +@@ -0,0 +1,5 @@ ++subroutine f_func(b) ++ integer(8), value :: b ++ b = b + 1 ++ print *, b ++end +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func020.f90 b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func020.f90 +new file mode 100644 +index 0000000..5d65e3e +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func020.f90 +@@ -0,0 +1,5 @@ ++subroutine f_func(b) ++ integer(8), value :: b ++ b = b + 1 ++ print *, b ++end +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func021.f90 b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func021.f90 +new file mode 100644 +index 0000000..2e3b41e +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func021.f90 +@@ -0,0 +1,5 @@ ++subroutine f_func(i) ++ real(4), value :: i ++ i = 314159265358.979626 ++ print *, i ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func022.f90 b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func022.f90 +new file mode 100644 +index 0000000..6fadb7b +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func022.f90 +@@ -0,0 +1,5 @@ ++subroutine f_func(i) ++ real(8), value :: i ++ i = 314159265358.979626 ++ print *, i ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func023.f90 b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func023.f90 +new file mode 100644 +index 0000000..7b23ee2 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func023.f90 +@@ -0,0 +1,6 @@ ++subroutine f_func(i) ++ integer, parameter :: K = selected_real_kind(16) ++ real(K), value :: i ++ i = 314159265358.979626 ++ print *, i ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func024.f90 b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func024.f90 +new file mode 100644 +index 0000000..ff15413 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func024.f90 +@@ -0,0 +1,5 @@ ++subroutine f_func(i) ++ complex(4), value :: i ++ i = (-12345678.7654321, 1) ++ print *, i ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func025.f90 b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func025.f90 +new file mode 100644 +index 0000000..526ad27 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func025.f90 +@@ -0,0 +1,5 @@ ++subroutine f_func(i) ++ complex(8), value :: i ++ i = (-12345678.7654321, 1) ++ print *, i ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func026.f90 b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func026.f90 +new file mode 100644 +index 0000000..bb6278f +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func026.f90 +@@ -0,0 +1,6 @@ ++subroutine f_func(i) ++ integer, parameter :: K = selected_real_kind(16) ++ complex(K), value :: i ++ i = (-12345678.7654321, 1) ++ print *, i ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func027.f90 b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func027.f90 +new file mode 100644 +index 0000000..af1f057 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func027.f90 +@@ -0,0 +1,5 @@ ++subroutine f_func(i) ++ logical(1), value :: i ++ i = .TRUE. ++ print *, i ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func028.f90 b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func028.f90 +new file mode 100644 +index 0000000..364a371 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func028.f90 +@@ -0,0 +1,5 @@ ++subroutine f_func(i) ++ character(1), value :: i ++ i = 'a' ++ print *, i ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/result.md b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/result.md +new file mode 100644 +index 0000000..4b52221 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/result.md +@@ -0,0 +1,29 @@ ++ | test | gfortran | flang | ++ | 001 | PASS | ERROR | ++ | 002 | PASS | ERROR | ++ | 003 | PASS | ERROR | ++ | 004 | PASS | ERROR | ++ | 005 | PASS | ERROR | ++ | 006 | PASS | ERROR | ++ | 007 | PASS | ERROR | ++ | 008 | PASS | ERROR | ++ | 009 | PASS | ERROR | ++ | 010 | PASS | ERROR | ++ | 011 | PASS | ERROR | ++ | 012 | PASS | ERROR | ++ | 013 | PASS | ERROR | ++ | 014 | PASS | ERROR | ++ | 015 | PASS | ERROR | ++ | 016 | PASS | ERROR | ++ | 017 | PASS | ERROR | ++ | 018 | PASS | ERROR | ++ | 019 | PASS | ERROR | ++ | 020 | PASS | ERROR | ++ | 021 | PASS | ERROR | ++ | 022 | PASS | ERROR | ++ | 023 | PASS | ERROR | ++ | 024 | PASS | ERROR | ++ | 025 | PASS | ERROR | ++ | 026 | PASS | ERROR | ++ | 027 | PASS | ERROR | ++ | 028 | PASS | ERROR | +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/run.sh b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/run.sh +new file mode 100644 +index 0000000..5b2202e +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/run.sh +@@ -0,0 +1,16 @@ ++for i in {001..028} ++do ++echo "------- test $i ------." ++echo "----- gfortran result:" ++gcc c_main$i.c -c -o c-test.o ++gfortran fortran_func$i.f90 -fno-range-check -c -o fortran-test.o ++gfortran fortran-test.o c-test.o ++./a.out ++rm *.o a.out ++echo "----- flang-new result : " ++clang c_main$i.c -c -o c-test.o ++flang-new fortran_func$i.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o a.out ++done +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main001.c b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main001.c +new file mode 100644 +index 0000000..3366380 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main001.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for scalar type and the scalar type is int using ++// iso_c_binding ++// ++#include ++extern void f_func_(int *i); ++int main() { ++ int i = 0; ++ f_func_(&i); ++ printf("%d\n", i); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main002.c b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main002.c +new file mode 100644 +index 0000000..d1c3138 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main002.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for scalar type and the scalar type is short ++// using iso_c_binding ++// ++#include ++extern void f_func_(short *i); ++int main() { ++ short i = 0; ++ f_func_(&i); ++ printf("%hd\n", i); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main003.c b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main003.c +new file mode 100644 +index 0000000..d65634c +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main003.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for scalar type and the scalar type is long ++// using iso_c_binding ++// ++#include ++extern void f_func_(long *i); ++int main() { ++ long i = 0; ++ f_func_(&i); ++ printf("%ld\n", i); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main004.c b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main004.c +new file mode 100644 +index 0000000..31d4897 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main004.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for scalar type and the scalar type is long long ++// using iso_c_binding ++// ++#include ++extern void f_func_(long long *i); ++int main() { ++ long long i = 0; ++ f_func_(&i); ++ printf("%Ld\n", i); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main005.c b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main005.c +new file mode 100644 +index 0000000..b0648c7 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main005.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for scalar type and the scalar type is signed ++// char using iso_c_binding ++// ++#include ++extern void f_func_(signed char *i); ++int main() { ++ signed char i = 0; ++ f_func_(&i); ++ printf("%c\n", i); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main006.c b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main006.c +new file mode 100644 +index 0000000..b1b4e73 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main006.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for scalar type and the scalar type is size_t ++// using iso_c_binding ++// ++#include ++extern void f_func_(size_t *i); ++int main() { ++ size_t i = 0; ++ f_func_(&i); ++ printf("%ld\n", i); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main007.c b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main007.c +new file mode 100644 +index 0000000..6862145 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main007.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for scalar type and the scalar type is int8_t ++// using iso_c_binding ++// ++#include ++#include ++extern void f_func_(int8_t *i); ++int main() { ++ int8_t i = 0; ++ f_func_(&i); ++ printf("%hhd\n", i); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main008.c b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main008.c +new file mode 100644 +index 0000000..1f33ad9 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main008.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for scalar type and the scalar type is int16_t ++// using iso_c_binding ++// ++#include ++#include ++extern void f_func_(int16_t *i); ++int main() { ++ int16_t i = 0; ++ f_func_(&i); ++ printf("%hd\n", i); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main009.c b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main009.c +new file mode 100644 +index 0000000..37a1bd9 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main009.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for scalar type and the scalar type is int32_t ++// using iso_c_binding ++// ++#include ++#include ++extern void f_func_(int32_t *i); ++int main() { ++ int32_t i = 0; ++ f_func_(&i); ++ printf("%d\n", i); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main010.c b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main010.c +new file mode 100644 +index 0000000..82745a9 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main010.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for scalar type and the scalar type is int64_t ++// using iso_c_binding ++// ++#include ++#include ++extern void f_func_(int64_t *i); ++int main() { ++ int64_t i = 0; ++ f_func_(&i); ++ printf("%ld\n", i); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main011.c b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main011.c +new file mode 100644 +index 0000000..5326328 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main011.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for scalar type and the scalar type is ++// int_least8_t using iso_c_binding ++// ++#include ++#include ++extern void f_func_(int_least8_t *i); ++int main() { ++ int_least8_t i = 0; ++ f_func_(&i); ++ printf("%hhd\n", i); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main012.c b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main012.c +new file mode 100644 +index 0000000..2c85dd7 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main012.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for scalar type and the scalar type is ++// int_least16_t using iso_c_binding ++// ++#include ++#include ++extern void f_func_(int_least16_t *i); ++int main() { ++ int_least16_t i = 0; ++ f_func_(&i); ++ printf("%hd\n", i); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main013.c b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main013.c +new file mode 100644 +index 0000000..c4f54d4 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main013.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for scalar type and the scalar type is ++// int_least32_t using iso_c_binding ++// ++#include ++#include ++extern void f_func_(int_least32_t *i); ++int main() { ++ int_least32_t i = 0; ++ f_func_(&i); ++ printf("%d\n", i); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main014.c b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main014.c +new file mode 100644 +index 0000000..8885983 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main014.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for scalar type and the scalar type is ++// int_least64_t using iso_c_binding ++// ++#include ++#include ++extern void f_func_(int_least64_t *i); ++int main() { ++ int_least64_t i = 0; ++ f_func_(&i); ++ printf("%ld\n", i); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main015.c b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main015.c +new file mode 100644 +index 0000000..62b01f8 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main015.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for scalar type and the scalar type is ++// int_fast8_t using iso_c_binding ++// ++#include ++#include ++extern void f_func_(int_fast8_t *i); ++int main() { ++ int_fast8_t i = 0; ++ f_func_(&i); ++ printf("%hhd\n", i); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main016.c b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main016.c +new file mode 100644 +index 0000000..68ee278 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main016.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for scalar type and the scalar type is ++// int_fast16_t using iso_c_binding ++// ++#include ++#include ++extern void f_func_(int_fast16_t *i); ++int main() { ++ int_fast16_t i = 0; ++ f_func_(&i); ++ printf("%ld\n", i); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main017.c b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main017.c +new file mode 100644 +index 0000000..4e9518f +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main017.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for scalar type and the scalar type is ++// int_fast32_t using iso_c_binding ++// ++#include ++#include ++extern void f_func_(int_fast32_t *i); ++int main() { ++ int_fast32_t i = 0; ++ f_func_(&i); ++ printf("%ld\n", i); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main018.c b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main018.c +new file mode 100644 +index 0000000..4a0d01a +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main018.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for scalar type and the scalar type is ++// int_fast64_t using iso_c_binding ++// ++#include ++#include ++extern void f_func_(int_fast64_t *i); ++int main() { ++ int_fast64_t i = 0; ++ f_func_(&i); ++ printf("%ld\n", i); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main019.c b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main019.c +new file mode 100644 +index 0000000..26c6db9 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main019.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for scalar type and the scalar type is intmax_t ++// using iso_c_binding ++// ++#include ++#include ++extern void f_func_(intmax_t *i); ++int main() { ++ intmax_t i = 0; ++ f_func_(&i); ++ printf("%ld\n", i); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main020.c b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main020.c +new file mode 100644 +index 0000000..67f97d8 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main020.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for scalar type and the scalar type is intptr_t ++// using iso_c_binding ++// ++#include ++#include ++extern void f_func_(intptr_t *i); ++int main() { ++ intptr_t i = 0; ++ f_func_(&i); ++ printf("%ld\n", i); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main021.c b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main021.c +new file mode 100644 +index 0000000..ae25967 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main021.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for scalar type and the scalar type is float ++// using iso_c_binding ++// ++#include ++#include ++extern void f_func_(float *i); ++int main() { ++ float i = 0; ++ f_func_(&i); ++ printf("%0.20f\n", i); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main022.c b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main022.c +new file mode 100644 +index 0000000..6939356 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main022.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for scalar type and the scalar type is double ++// using iso_c_binding ++// ++#include ++#include ++extern void f_func_(double *i); ++int main() { ++ double i = 0; ++ f_func_(&i); ++ printf("%0.20lf\n", i); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main023.c b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main023.c +new file mode 100644 +index 0000000..4aedaa7 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main023.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for scalar type and the scalar type is long ++// double using iso_c_binding ++// ++#include ++#include ++extern void f_func_(long double *i); ++int main() { ++ long double i = 0; ++ f_func_(&i); ++ printf("%0.20Lf\n", i); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main024.c b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main024.c +new file mode 100644 +index 0000000..cf33e0d +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main024.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for scalar type and the scalar type is float ++// _Complex using iso_c_binding ++// ++#include ++#include ++extern void f_func_(float _Complex *i); ++int main() { ++ float _Complex i; ++ f_func_(&i); ++ printf("%0.20f + %0.20fi\n", creal(i), cimag(i)); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main025.c b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main025.c +new file mode 100644 +index 0000000..ce3a762 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main025.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for scalar type and the scalar type is double ++// _Complex using iso_c_binding ++// ++#include ++#include ++extern void f_func_(double _Complex *i); ++int main() { ++ double _Complex i; ++ f_func_(&i); ++ printf("%0.20lf + %0.20lfi\n", creal(i), cimag(i)); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main026.c b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main026.c +new file mode 100644 +index 0000000..4666cef +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main026.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for scalar type and the scalar type is double ++// _Complex using iso_c_binding ++// ++#include ++#include ++extern void f_func_(long double _Complex *i); ++int main() { ++ long double _Complex i; ++ f_func_(&i); ++ printf("%0.20lf + %0.20lfi\n", creal(i), cimag(i)); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main027.c b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main027.c +new file mode 100644 +index 0000000..9192175 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main027.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for scalar type and the scalar type is _Bool ++// using iso_c_binding ++// ++#include ++#include ++extern void f_func_(_Bool *i); ++int main() { ++ _Bool i = 0; ++ f_func_(&i); ++ printf("%d\n", i); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main028.c b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main028.c +new file mode 100644 +index 0000000..4ade3e9 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main028.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for scalar type and the scalar type is char ++// using iso_c_binding ++// ++#include ++#include ++extern void f_func_(char *i); ++int main() { ++ char i; ++ f_func_(&i); ++ printf("%c\n", i); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func001.f90 b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func001.f90 +new file mode 100644 +index 0000000..a89bcce +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func001.f90 +@@ -0,0 +1,5 @@ ++subroutine f_func(i) ++ use iso_c_binding ++ integer(C_INT) :: i ++ i = 2147483647 ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func002.f90 b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func002.f90 +new file mode 100644 +index 0000000..a8c4269 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func002.f90 +@@ -0,0 +1,5 @@ ++subroutine f_func(i) ++ use iso_c_binding ++ integer(C_SHORT) :: i ++ i = 32767 ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func003.f90 b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func003.f90 +new file mode 100644 +index 0000000..2e0a857 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func003.f90 +@@ -0,0 +1,5 @@ ++subroutine f_func(i) ++ use iso_c_binding ++ integer(C_LONG) :: i ++ i = 9223372036854775807 ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func004.f90 b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func004.f90 +new file mode 100644 +index 0000000..0499479 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func004.f90 +@@ -0,0 +1,5 @@ ++subroutine f_func(i) ++ use iso_c_binding ++ integer(C_LONG_LONG) :: i ++ i = 9223372036854775807 ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func005.f90 b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func005.f90 +new file mode 100644 +index 0000000..bd9ca6c +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func005.f90 +@@ -0,0 +1,5 @@ ++subroutine f_func(i) ++ use iso_c_binding ++ integer(C_SIGNED_CHAR) :: i ++ i = 97 ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func006.f90 b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func006.f90 +new file mode 100644 +index 0000000..bfb200a +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func006.f90 +@@ -0,0 +1,5 @@ ++subroutine f_func(i) ++ use iso_c_binding ++ integer(C_SIZE_T) :: i ++ i = 9223372036854775807 ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func007.f90 b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func007.f90 +new file mode 100644 +index 0000000..286f948 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func007.f90 +@@ -0,0 +1,5 @@ ++subroutine f_func(i) ++ use iso_c_binding ++ integer(C_INT8_T) :: i ++ i = 127 ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func008.f90 b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func008.f90 +new file mode 100644 +index 0000000..01fe7ae +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func008.f90 +@@ -0,0 +1,5 @@ ++subroutine f_func(i) ++ use iso_c_binding ++ integer(C_INT16_T) :: i ++ i = 32767 ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func009.f90 b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func009.f90 +new file mode 100644 +index 0000000..1b0e978 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func009.f90 +@@ -0,0 +1,5 @@ ++subroutine f_func(i) ++ use iso_c_binding ++ integer(C_INT32_T) :: i ++ i = 2147483647 ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func010.f90 b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func010.f90 +new file mode 100644 +index 0000000..8268291 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func010.f90 +@@ -0,0 +1,5 @@ ++subroutine f_func(i) ++ use iso_c_binding ++ integer(C_INT64_T) :: i ++ i = 9223372036854775807 ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func011.f90 b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func011.f90 +new file mode 100644 +index 0000000..b4cc050 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func011.f90 +@@ -0,0 +1,5 @@ ++subroutine f_func(i) ++ use iso_c_binding ++ integer(C_INT_LEAST8_T) :: i ++ i = 127 ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func012.f90 b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func012.f90 +new file mode 100644 +index 0000000..c70c162 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func012.f90 +@@ -0,0 +1,5 @@ ++subroutine f_func(i) ++ use iso_c_binding ++ integer(C_INT_LEAST16_T) :: i ++ i = 32767 ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func013.f90 b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func013.f90 +new file mode 100644 +index 0000000..b15a907 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func013.f90 +@@ -0,0 +1,5 @@ ++subroutine f_func(i) ++ use iso_c_binding ++ integer(C_INT_LEAST32_T) :: i ++ i = 2147483647 ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func014.f90 b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func014.f90 +new file mode 100644 +index 0000000..38387e0 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func014.f90 +@@ -0,0 +1,5 @@ ++subroutine f_func(i) ++ use iso_c_binding ++ integer(C_INT_LEAST64_T) :: i ++ i = 9223372036854775807 ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func015.f90 b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func015.f90 +new file mode 100644 +index 0000000..53aa505 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func015.f90 +@@ -0,0 +1,5 @@ ++subroutine f_func(i) ++ use iso_c_binding ++ integer(C_INT_FAST8_T) :: i ++ i = 127 ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func016.f90 b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func016.f90 +new file mode 100644 +index 0000000..07004c1 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func016.f90 +@@ -0,0 +1,5 @@ ++subroutine f_func(i) ++ use iso_c_binding ++ integer(C_INT_FAST16_T) :: i ++ i = 9223372036854775807 ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func017.f90 b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func017.f90 +new file mode 100644 +index 0000000..17f543d +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func017.f90 +@@ -0,0 +1,5 @@ ++subroutine f_func(i) ++ use iso_c_binding ++ integer(C_INT_FAST32_T) :: i ++ i = 9223372036854775807 ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func018.f90 b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func018.f90 +new file mode 100644 +index 0000000..428ae53 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func018.f90 +@@ -0,0 +1,5 @@ ++subroutine f_func(i) ++ use iso_c_binding ++ integer(C_INT_FAST64_T) :: i ++ i = 9223372036854775807 ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func019.f90 b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func019.f90 +new file mode 100644 +index 0000000..4229ca5 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func019.f90 +@@ -0,0 +1,5 @@ ++subroutine f_func(i) ++ use iso_c_binding ++ integer(C_INTMAX_T) :: i ++ i = 9223372036854775807 ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func020.f90 b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func020.f90 +new file mode 100644 +index 0000000..41e71b3 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func020.f90 +@@ -0,0 +1,5 @@ ++subroutine f_func(i) ++ use iso_c_binding ++ integer(C_INTPTR_T) :: i ++ i = 9223372036854775807 ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func021.f90 b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func021.f90 +new file mode 100644 +index 0000000..5c83130 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func021.f90 +@@ -0,0 +1,5 @@ ++subroutine f_func(i) ++ use iso_c_binding ++ real(C_FLOAT) :: i ++ i = 314159265358.979626 ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func022.f90 b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func022.f90 +new file mode 100644 +index 0000000..e16e2af +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func022.f90 +@@ -0,0 +1,5 @@ ++subroutine f_func(i) ++ use iso_c_binding ++ real(C_DOUBLE) :: i ++ i = 314159265358.979626 ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func023.f90 b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func023.f90 +new file mode 100644 +index 0000000..8794877 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func023.f90 +@@ -0,0 +1,5 @@ ++subroutine f_func(i) ++ use iso_c_binding ++ real(C_LONG_DOUBLE) :: i ++ i = 314159265358.979626 ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func024.f90 b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func024.f90 +new file mode 100644 +index 0000000..bb98e62 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func024.f90 +@@ -0,0 +1,5 @@ ++subroutine f_func(i) ++ use iso_c_binding ++ complex(C_FLOAT_COMPLEX) :: i ++ i = (-12345678.7654321, 1) ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func025.f90 b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func025.f90 +new file mode 100644 +index 0000000..378d820 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func025.f90 +@@ -0,0 +1,5 @@ ++subroutine f_func(i) ++ use iso_c_binding ++ complex(C_DOUBLE_COMPLEX) :: i ++ i = (-12345678.7654321, 1) ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func026.f90 b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func026.f90 +new file mode 100644 +index 0000000..ee0c90a +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func026.f90 +@@ -0,0 +1,5 @@ ++subroutine f_func(i) ++ use iso_c_binding ++ complex(C_LONG_DOUBLE_COMPLEX) :: i ++ i = (-12345678.7654321, 1) ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func027.f90 b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func027.f90 +new file mode 100644 +index 0000000..61299c7 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func027.f90 +@@ -0,0 +1,5 @@ ++subroutine f_func(i) ++ use iso_c_binding ++ logical(C_BOOL) :: i ++ i = .TRUE. ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func028.f90 b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func028.f90 +new file mode 100644 +index 0000000..ce5cc88 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func028.f90 +@@ -0,0 +1,5 @@ ++subroutine f_func(i) ++ use iso_c_binding ++ character(C_CHAR) :: i ++ i = 'a' ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/result.md b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/result.md +new file mode 100644 +index 0000000..89bbd52 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/result.md +@@ -0,0 +1,29 @@ ++ | test | gfortran | flang | ++ | 001 | PASS | PASS | ++ | 002 | PASS | PASS | ++ | 003 | PASS | PASS | ++ | 004 | PASS | PASS | ++ | 005 | PASS | PASS | ++ | 006 | PASS | PASS | ++ | 007 | PASS | PASS | ++ | 008 | PASS | PASS | ++ | 009 | PASS | PASS | ++ | 010 | PASS | PASS | ++ | 011 | PASS | PASS | ++ | 012 | PASS | PASS | ++ | 013 | PASS | PASS | ++ | 014 | PASS | PASS | ++ | 015 | PASS | PASS | ++ | 016 | PASS | ERROR | ++ | 017 | PASS | ERROR | ++ | 018 | PASS | PASS | ++ | 019 | PASS | PASS | ++ | 020 | PASS | PASS | ++ | 021 | PASS | PASS | ++ | 022 | PASS | PASS | ++ | 023 | PASS | ERROR | ++ | 024 | PASS | PASS | ++ | 025 | PASS | PASS | ++ | 026 | PASS | ERROR | ++ | 027 | PASS | PASS | ++ | 028 | PASS | PASS | +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/run.sh b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/run.sh +new file mode 100644 +index 0000000..5b2202e +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/run.sh +@@ -0,0 +1,16 @@ ++for i in {001..028} ++do ++echo "------- test $i ------." ++echo "----- gfortran result:" ++gcc c_main$i.c -c -o c-test.o ++gfortran fortran_func$i.f90 -fno-range-check -c -o fortran-test.o ++gfortran fortran-test.o c-test.o ++./a.out ++rm *.o a.out ++echo "----- flang-new result : " ++clang c_main$i.c -c -o c-test.o ++flang-new fortran_func$i.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o a.out ++done +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main001.c b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main001.c +new file mode 100644 +index 0000000..93e2e96 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main001.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for the scalar type with value attribute and the ++// scalar type is int with bindc ++// ++#include ++extern void f_func_(int i); ++int main() { ++ int res = 12; ++ f_func_(res); ++ printf("%d\n", res); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main002.c b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main002.c +new file mode 100644 +index 0000000..e6c7ffc +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main002.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for the scalar type with value attribute and the ++// scalar type is short with bindc ++// ++#include ++extern void f_func_(short i); ++int main() { ++ short res = 12; ++ f_func_(res); ++ printf("%hd\n", res); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main003.c b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main003.c +new file mode 100644 +index 0000000..0c15160 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main003.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for the scalar type with value attribute and the ++// scalar type is long with bindc ++// ++#include ++extern void f_func_(long i); ++int main() { ++ long res = 12; ++ f_func_(res); ++ printf("%ld\n", res); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main004.c b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main004.c +new file mode 100644 +index 0000000..c8a4326 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main004.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for the scalar type with value attribute and the ++// scalar type is long long with bindc ++// ++#include ++extern void f_func_(long long i); ++int main() { ++ long long res = 12; ++ f_func_(res); ++ printf("%Ld\n", res); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main005.c b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main005.c +new file mode 100644 +index 0000000..dbfeab0 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main005.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for the scalar type with value attribute and the ++// scalar type is signed char with bindc ++// ++#include ++extern void f_func_(signed char i); ++int main() { ++ signed char res = 12; ++ f_func_(res); ++ printf("%hhd\n", res); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main006.c b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main006.c +new file mode 100644 +index 0000000..bd4992d +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main006.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for the scalar type with value attribute and the ++// scalar type is size_t with bindc ++// ++#include ++extern void f_func_(size_t i); ++int main() { ++ size_t res = 12; ++ f_func_(res); ++ printf("%ld\n", res); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main007.c b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main007.c +new file mode 100644 +index 0000000..a4de5e1 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main007.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for the scalar type with value attribute and the ++// scalar type is int8_t with bindc ++// ++#include ++#include ++extern void f_func_(int8_t i); ++int main() { ++ int8_t res = 12; ++ f_func_(res); ++ printf("%hhd\n", res); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main008.c b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main008.c +new file mode 100644 +index 0000000..51b166b +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main008.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for the scalar type with value attribute and the ++// scalar type is int16_t with bindc ++// ++#include ++#include ++extern void f_func_(int16_t i); ++int main() { ++ int16_t res = 12; ++ f_func_(res); ++ printf("%hd\n", res); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main009.c b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main009.c +new file mode 100644 +index 0000000..982a2a0 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main009.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for the scalar type with value attribute and the ++// scalar type is int32_t with bindc ++// ++#include ++#include ++extern void f_func_(int32_t i); ++int main() { ++ int32_t res = 12; ++ f_func_(res); ++ printf("%d\n", res); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main010.c b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main010.c +new file mode 100644 +index 0000000..ff12da7 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main010.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for the scalar type with value attribute and the ++// scalar type is int64_t with bindc ++// ++#include ++#include ++extern void f_func_(int64_t i); ++int main() { ++ int64_t res = 12; ++ f_func_(res); ++ printf("%ld\n", res); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main011.c b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main011.c +new file mode 100644 +index 0000000..ff2cdfd +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main011.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for the scalar type with value attribute and the ++// scalar type is int_least8_t with bindc ++// ++#include ++#include ++extern void f_func_(int_least8_t i); ++int main() { ++ int_least8_t res = 12; ++ f_func_(res); ++ printf("%hhd\n", res); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main012.c b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main012.c +new file mode 100644 +index 0000000..8a23a89 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main012.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for the scalar type with value attribute and the ++// scalar type is int_least16_t with bindc ++// ++#include ++#include ++extern void f_func_(int_least16_t i); ++int main() { ++ int_least16_t res = 12; ++ f_func_(res); ++ printf("%hd\n", res); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main013.c b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main013.c +new file mode 100644 +index 0000000..6257c07 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main013.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for the scalar type with value attribute and the ++// scalar type is int_least32_t with bindc ++// ++#include ++#include ++extern void f_func_(int_least32_t i); ++int main() { ++ int_least32_t res = 12; ++ f_func_(res); ++ printf("%d\n", res); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main014.c b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main014.c +new file mode 100644 +index 0000000..21b8378 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main014.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for the scalar type with value attribute and the ++// scalar type is int_least64_t with bindc ++// ++#include ++#include ++extern void f_func_(int_least64_t i); ++int main() { ++ int_least64_t res = 12; ++ f_func_(res); ++ printf("%ld\n", res); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main015.c b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main015.c +new file mode 100644 +index 0000000..822f85a +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main015.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for the scalar type with value attribute and the ++// scalar type is int_fast8_t with bindc ++// ++#include ++#include ++extern void f_func_(int_fast8_t i); ++int main() { ++ int_fast8_t res = 12; ++ f_func_(res); ++ printf("%hhd\n", res); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main016.c b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main016.c +new file mode 100644 +index 0000000..492be5b +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main016.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for the scalar type with value attribute and the ++// scalar type is int_fast16_t with bindc ++// ++#include ++#include ++extern void f_func_(int_fast16_t i); ++int main() { ++ int_fast16_t res = 12; ++ f_func_(res); ++ printf("%ld\n", res); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main017.c b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main017.c +new file mode 100644 +index 0000000..c49574a +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main017.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for the scalar type with value attribute and the ++// scalar type is int_fast32_t with bindc ++// ++#include ++#include ++extern void f_func_(int_fast32_t i); ++int main() { ++ int_fast32_t res = 12; ++ f_func_(res); ++ printf("%ld\n", res); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main018.c b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main018.c +new file mode 100644 +index 0000000..cad9eef +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main018.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for the scalar type with value attribute and the ++// scalar type is int_fast64_t with bindc ++// ++#include ++#include ++extern void f_func_(int_fast64_t i); ++int main() { ++ int_fast64_t res = 12; ++ f_func_(res); ++ printf("%ld\n", res); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main019.c b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main019.c +new file mode 100644 +index 0000000..2c69046 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main019.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for the scalar type with value attribute and the ++// scalar type is intmax_t with bindc ++// ++#include ++#include ++extern void f_func_(intmax_t i); ++int main() { ++ intmax_t res = 12; ++ f_func_(res); ++ printf("%ld\n", res); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main020.c b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main020.c +new file mode 100644 +index 0000000..fd25b96 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main020.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for the scalar type with value attribute and the ++// scalar type is intptr_t with bindc ++// ++#include ++#include ++extern void f_func_(intptr_t i); ++int main() { ++ intptr_t res = 12; ++ f_func_(res); ++ printf("%ld\n", res); ++} +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main021.c b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main021.c +new file mode 100644 +index 0000000..27131ff +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main021.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for the scalar type with value attribute and the ++// scalar type is float with bindc ++// ++#include ++extern void f_func_(float i); ++int main() { ++ float i = 3.14; ++ f_func_(i); ++ printf("%0.20f\n", i); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main022.c b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main022.c +new file mode 100644 +index 0000000..926e1cd +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main022.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for the scalar type with value attribute and the ++// scalar type is double with bindc ++// ++#include ++extern void f_func_(double i); ++int main() { ++ double i = 3.14; ++ f_func_(i); ++ printf("%0.20lf\n", i); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main023.c b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main023.c +new file mode 100644 +index 0000000..5cd25a0 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main023.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for the scalar type with value attribute and the ++// scalar type is long double with bindc ++// ++#include ++extern void f_func_(long double i); ++int main() { ++ long double i = 3.14; ++ f_func_(i); ++ printf("%0.20Lf\n", i); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main024.c b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main024.c +new file mode 100644 +index 0000000..4488766 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main024.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for the scalar type with value attribute and the ++// scalar type is float _Complex with bindc ++// ++#include ++#include ++extern void f_func_(float _Complex i); ++int main() { ++ float _Complex i = 5.0f + 1.0if; ++ f_func_(i); ++ printf("%0.20f + %0.20fi\n", creal(i), cimag(i)); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main025.c b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main025.c +new file mode 100644 +index 0000000..a612e9f +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main025.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for the scalar type with value attribute and the ++// scalar type is double _Complex with bindc ++// ++#include ++#include ++extern void f_func_(double _Complex i); ++int main() { ++ double _Complex i = 5.0f + 1.0if; ++ f_func_(i); ++ printf("%0.20f + %0.20fi\n", creal(i), cimag(i)); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main026.c b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main026.c +new file mode 100644 +index 0000000..e237729 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main026.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for the scalar type with value attribute and the ++// scalar type is long double _Complex with bindc ++// ++#include ++#include ++extern void f_func_(long double _Complex i); ++int main() { ++ long double _Complex i = 5.0f + 1.0if; ++ f_func_(i); ++ printf("%0.20f + %0.20fi\n", creal(i), cimag(i)); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main027.c b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main027.c +new file mode 100644 +index 0000000..463cb21 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main027.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for the scalar type with value attribute and the ++// scalar type is _Bool with bindc ++// ++#include ++#include ++extern void f_func_(_Bool i); ++int main() { ++ _Bool i = 0; ++ f_func_(i); ++ printf("%d\n", i); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main028.c b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main028.c +new file mode 100644 +index 0000000..4152530 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main028.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for the scalar type with value attribute and the ++// scalar type is char with bindc ++// ++#include ++#include ++extern void f_func_(char i); ++int main() { ++ char i = 'z'; ++ f_func_(i); ++ printf("%c\n", i); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func001.f90 b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func001.f90 +new file mode 100644 +index 0000000..de93201 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func001.f90 +@@ -0,0 +1,5 @@ ++subroutine f_func(b) bind(c, name = "f_func_") ++ integer, value :: b ++ b = b + 1 ++ print *, b ++end +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func002.f90 b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func002.f90 +new file mode 100644 +index 0000000..912b855 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func002.f90 +@@ -0,0 +1,5 @@ ++subroutine f_func(b) bind(c, name = "f_func_") ++ integer(2), value :: b ++ b = b + 1 ++ print *, b ++end +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func003.f90 b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func003.f90 +new file mode 100644 +index 0000000..e3bdc20 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func003.f90 +@@ -0,0 +1,5 @@ ++subroutine f_func(b) bind(c, name = "f_func_") ++ integer(8), value :: b ++ b = b + 1 ++ print *, b ++end +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func004.f90 b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func004.f90 +new file mode 100644 +index 0000000..e3bdc20 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func004.f90 +@@ -0,0 +1,5 @@ ++subroutine f_func(b) bind(c, name = "f_func_") ++ integer(8), value :: b ++ b = b + 1 ++ print *, b ++end +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func005.f90 b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func005.f90 +new file mode 100644 +index 0000000..b4d2fe2 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func005.f90 +@@ -0,0 +1,5 @@ ++subroutine f_func(b) bind(c, name = "f_func_") ++ integer(1), value :: b ++ b = b + 1 ++ print *, b ++end +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func006.f90 b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func006.f90 +new file mode 100644 +index 0000000..e3bdc20 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func006.f90 +@@ -0,0 +1,5 @@ ++subroutine f_func(b) bind(c, name = "f_func_") ++ integer(8), value :: b ++ b = b + 1 ++ print *, b ++end +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func007.f90 b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func007.f90 +new file mode 100644 +index 0000000..b4d2fe2 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func007.f90 +@@ -0,0 +1,5 @@ ++subroutine f_func(b) bind(c, name = "f_func_") ++ integer(1), value :: b ++ b = b + 1 ++ print *, b ++end +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func008.f90 b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func008.f90 +new file mode 100644 +index 0000000..912b855 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func008.f90 +@@ -0,0 +1,5 @@ ++subroutine f_func(b) bind(c, name = "f_func_") ++ integer(2), value :: b ++ b = b + 1 ++ print *, b ++end +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func009.f90 b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func009.f90 +new file mode 100644 +index 0000000..35f23ce +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func009.f90 +@@ -0,0 +1,5 @@ ++subroutine f_func(b) bind(c, name = "f_func_") ++ integer(4), value :: b ++ b = b + 1 ++ print *, b ++end +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func010.f90 b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func010.f90 +new file mode 100644 +index 0000000..e3bdc20 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func010.f90 +@@ -0,0 +1,5 @@ ++subroutine f_func(b) bind(c, name = "f_func_") ++ integer(8), value :: b ++ b = b + 1 ++ print *, b ++end +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func011.f90 b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func011.f90 +new file mode 100644 +index 0000000..b4d2fe2 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func011.f90 +@@ -0,0 +1,5 @@ ++subroutine f_func(b) bind(c, name = "f_func_") ++ integer(1), value :: b ++ b = b + 1 ++ print *, b ++end +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func012.f90 b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func012.f90 +new file mode 100644 +index 0000000..912b855 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func012.f90 +@@ -0,0 +1,5 @@ ++subroutine f_func(b) bind(c, name = "f_func_") ++ integer(2), value :: b ++ b = b + 1 ++ print *, b ++end +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func013.f90 b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func013.f90 +new file mode 100644 +index 0000000..35f23ce +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func013.f90 +@@ -0,0 +1,5 @@ ++subroutine f_func(b) bind(c, name = "f_func_") ++ integer(4), value :: b ++ b = b + 1 ++ print *, b ++end +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func014.f90 b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func014.f90 +new file mode 100644 +index 0000000..e3bdc20 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func014.f90 +@@ -0,0 +1,5 @@ ++subroutine f_func(b) bind(c, name = "f_func_") ++ integer(8), value :: b ++ b = b + 1 ++ print *, b ++end +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func015.f90 b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func015.f90 +new file mode 100644 +index 0000000..b4d2fe2 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func015.f90 +@@ -0,0 +1,5 @@ ++subroutine f_func(b) bind(c, name = "f_func_") ++ integer(1), value :: b ++ b = b + 1 ++ print *, b ++end +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func016.f90 b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func016.f90 +new file mode 100644 +index 0000000..e3bdc20 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func016.f90 +@@ -0,0 +1,5 @@ ++subroutine f_func(b) bind(c, name = "f_func_") ++ integer(8), value :: b ++ b = b + 1 ++ print *, b ++end +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func017.f90 b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func017.f90 +new file mode 100644 +index 0000000..e3bdc20 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func017.f90 +@@ -0,0 +1,5 @@ ++subroutine f_func(b) bind(c, name = "f_func_") ++ integer(8), value :: b ++ b = b + 1 ++ print *, b ++end +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func018.f90 b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func018.f90 +new file mode 100644 +index 0000000..e3bdc20 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func018.f90 +@@ -0,0 +1,5 @@ ++subroutine f_func(b) bind(c, name = "f_func_") ++ integer(8), value :: b ++ b = b + 1 ++ print *, b ++end +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func019.f90 b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func019.f90 +new file mode 100644 +index 0000000..e3bdc20 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func019.f90 +@@ -0,0 +1,5 @@ ++subroutine f_func(b) bind(c, name = "f_func_") ++ integer(8), value :: b ++ b = b + 1 ++ print *, b ++end +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func020.f90 b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func020.f90 +new file mode 100644 +index 0000000..e3bdc20 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func020.f90 +@@ -0,0 +1,5 @@ ++subroutine f_func(b) bind(c, name = "f_func_") ++ integer(8), value :: b ++ b = b + 1 ++ print *, b ++end +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func021.f90 b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func021.f90 +new file mode 100644 +index 0000000..671133b +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func021.f90 +@@ -0,0 +1,5 @@ ++subroutine f_func(i) bind(c, name = "f_func_") ++ real(4), value :: i ++ i = 314159265358.979626 ++ print *, i ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func022.f90 b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func022.f90 +new file mode 100644 +index 0000000..b14b9b9 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func022.f90 +@@ -0,0 +1,5 @@ ++subroutine f_func(i) bind(c, name = "f_func_") ++ real(8), value :: i ++ i = 314159265358.979626 ++ print *, i ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func023.f90 b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func023.f90 +new file mode 100644 +index 0000000..afc5e87 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func023.f90 +@@ -0,0 +1,6 @@ ++subroutine f_func(i) bind(c, name = "f_func_") ++ integer, parameter :: K = selected_real_kind(16) ++ real(K), value :: i ++ i = 314159265358.979626 ++ print *, i ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func024.f90 b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func024.f90 +new file mode 100644 +index 0000000..a043f8e +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func024.f90 +@@ -0,0 +1,5 @@ ++subroutine f_func(i) bind(c, name = "f_func_") ++ complex(4), value :: i ++ i = (-12345678.7654321, 1) ++ print *, i ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func025.f90 b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func025.f90 +new file mode 100644 +index 0000000..cc4e165 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func025.f90 +@@ -0,0 +1,5 @@ ++subroutine f_func(i) bind(c, name = "f_func_") ++ complex(8), value :: i ++ i = (-12345678.7654321, 1) ++ print *, i ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func026.f90 b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func026.f90 +new file mode 100644 +index 0000000..a256773 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func026.f90 +@@ -0,0 +1,6 @@ ++subroutine f_func(i) bind(c, name = "f_func_") ++ integer, parameter :: K = selected_real_kind(16) ++ complex(K), value :: i ++ i = (-12345678.7654321, 1) ++ print *, i ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func027.f90 b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func027.f90 +new file mode 100644 +index 0000000..3a01854 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func027.f90 +@@ -0,0 +1,5 @@ ++subroutine f_func(i) bind(c, name = "f_func_") ++ logical(1), value :: i ++ i = .TRUE. ++ print *, i ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func028.f90 b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func028.f90 +new file mode 100644 +index 0000000..7881678 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func028.f90 +@@ -0,0 +1,5 @@ ++subroutine f_func(i) bind(c, name = "f_func_") ++ character(1), value :: i ++ i = 'a' ++ print *, i ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/result.md b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/result.md +new file mode 100644 +index 0000000..4b52221 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/result.md +@@ -0,0 +1,29 @@ ++ | test | gfortran | flang | ++ | 001 | PASS | ERROR | ++ | 002 | PASS | ERROR | ++ | 003 | PASS | ERROR | ++ | 004 | PASS | ERROR | ++ | 005 | PASS | ERROR | ++ | 006 | PASS | ERROR | ++ | 007 | PASS | ERROR | ++ | 008 | PASS | ERROR | ++ | 009 | PASS | ERROR | ++ | 010 | PASS | ERROR | ++ | 011 | PASS | ERROR | ++ | 012 | PASS | ERROR | ++ | 013 | PASS | ERROR | ++ | 014 | PASS | ERROR | ++ | 015 | PASS | ERROR | ++ | 016 | PASS | ERROR | ++ | 017 | PASS | ERROR | ++ | 018 | PASS | ERROR | ++ | 019 | PASS | ERROR | ++ | 020 | PASS | ERROR | ++ | 021 | PASS | ERROR | ++ | 022 | PASS | ERROR | ++ | 023 | PASS | ERROR | ++ | 024 | PASS | ERROR | ++ | 025 | PASS | ERROR | ++ | 026 | PASS | ERROR | ++ | 027 | PASS | ERROR | ++ | 028 | PASS | ERROR | +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/run.sh b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/run.sh +new file mode 100644 +index 0000000..5b2202e +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/run.sh +@@ -0,0 +1,16 @@ ++for i in {001..028} ++do ++echo "------- test $i ------." ++echo "----- gfortran result:" ++gcc c_main$i.c -c -o c-test.o ++gfortran fortran_func$i.f90 -fno-range-check -c -o fortran-test.o ++gfortran fortran-test.o c-test.o ++./a.out ++rm *.o a.out ++echo "----- flang-new result : " ++clang c_main$i.c -c -o c-test.o ++flang-new fortran_func$i.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o a.out ++done +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/006_c_call_fortran_pointer/c_main001.c b/test/interoperability_with_c_c_call_fortran_scalar/006_c_call_fortran_pointer/c_main001.c +new file mode 100644 +index 0000000..d1592b4 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/006_c_call_fortran_pointer/c_main001.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for the pointer type and allocate a free space ++// for the pointer ++// ++#include ++#include ++extern void f_func_(int *i); ++int main() { ++ int *i = (int*) malloc(sizeof(int)); ++ f_func_(i); ++ printf("%d\n", *i); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/006_c_call_fortran_pointer/c_main002.c b/test/interoperability_with_c_c_call_fortran_scalar/006_c_call_fortran_pointer/c_main002.c +new file mode 100644 +index 0000000..5dc36ae +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/006_c_call_fortran_pointer/c_main002.c +@@ -0,0 +1,15 @@ ++// Test c call fortan for the pointer type and let the pointer point to ++// a variable array ++// ++#include ++#include ++extern void f_func_(int *i); ++int main() { ++ int x[5] = {5, 4, 3, 2, 1}; ++ int *i = x; ++ f_func_(i); ++ for(int w = 0; w < 5; w++) { ++ printf("%d\n", i[w]); ++ printf("%d\n", x[w]); ++ } ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/006_c_call_fortran_pointer/c_main003.c b/test/interoperability_with_c_c_call_fortran_scalar/006_c_call_fortran_pointer/c_main003.c +new file mode 100644 +index 0000000..85d12b7 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/006_c_call_fortran_pointer/c_main003.c +@@ -0,0 +1,13 @@ ++// Test c call fortan for the pointer type and let the pointer point to ++// a variable ++// ++#include ++#include ++extern void f_func_(int *i); ++int main() { ++ int x = 5; ++ int *i = &x; ++ f_func_(i); ++ printf("%d\n", *i); ++ printf("%d\n", x); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/006_c_call_fortran_pointer/c_main004.c b/test/interoperability_with_c_c_call_fortran_scalar/006_c_call_fortran_pointer/c_main004.c +new file mode 100644 +index 0000000..c4326b9 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/006_c_call_fortran_pointer/c_main004.c +@@ -0,0 +1,20 @@ ++// Test c call fortran for the pointer type and let the pointer point ++// to a variable two-dimensinal array ++// ++#include ++#include ++extern void f_func_(int [][3]); ++int main() { ++ int x[3][3]; ++ for(int n = 0; n < 3; n++) { ++ for(int w = 0; w < 3; w++) { ++ x[n][w] = 1; ++ } ++ } ++ f_func_(x); ++ for(int n = 0; n < 3; n++) { ++ for(int w = 0; w < 3; w++) { ++ printf("%d\n", x[n][w]); ++ } ++ } ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/006_c_call_fortran_pointer/fortran_func001.f90 b/test/interoperability_with_c_c_call_fortran_scalar/006_c_call_fortran_pointer/fortran_func001.f90 +new file mode 100644 +index 0000000..f107dca +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/006_c_call_fortran_pointer/fortran_func001.f90 +@@ -0,0 +1,4 @@ ++subroutine f_func(i) ++ integer :: i ++ i = 1 ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/006_c_call_fortran_pointer/fortran_func002.f90 b/test/interoperability_with_c_c_call_fortran_scalar/006_c_call_fortran_pointer/fortran_func002.f90 +new file mode 100644 +index 0000000..a2fa9d6 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/006_c_call_fortran_pointer/fortran_func002.f90 +@@ -0,0 +1,6 @@ ++subroutine f_func(i) ++ integer, dimension(*) :: i ++ do n = 1, 5 ++ i(n) = n ++ end do ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/006_c_call_fortran_pointer/fortran_func003.f90 b/test/interoperability_with_c_c_call_fortran_scalar/006_c_call_fortran_pointer/fortran_func003.f90 +new file mode 100644 +index 0000000..f107dca +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/006_c_call_fortran_pointer/fortran_func003.f90 +@@ -0,0 +1,4 @@ ++subroutine f_func(i) ++ integer :: i ++ i = 1 ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/006_c_call_fortran_pointer/fortran_func004.f90 b/test/interoperability_with_c_c_call_fortran_scalar/006_c_call_fortran_pointer/fortran_func004.f90 +new file mode 100644 +index 0000000..0d721cb +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/006_c_call_fortran_pointer/fortran_func004.f90 +@@ -0,0 +1,8 @@ ++subroutine f_func(i) ++ integer :: i(3, 3) ++ do n = 1, 3 ++ do j = 1, 3 ++ i(n, j) = n + j ++ end do ++ end do ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/006_c_call_fortran_pointer/result.md b/test/interoperability_with_c_c_call_fortran_scalar/006_c_call_fortran_pointer/result.md +new file mode 100644 +index 0000000..ed1f4be +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/006_c_call_fortran_pointer/result.md +@@ -0,0 +1,5 @@ ++ | test | gfortran | flang | ++ | 001 | PASS | PASS | ++ | 002 | PASS | PASS | ++ | 003 | PASS | PASS | ++ | 004 | PASS | PASS | +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/006_c_call_fortran_pointer/run.sh b/test/interoperability_with_c_c_call_fortran_scalar/006_c_call_fortran_pointer/run.sh +new file mode 100644 +index 0000000..fd0df6a +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/006_c_call_fortran_pointer/run.sh +@@ -0,0 +1,16 @@ ++for i in {001..004} ++do ++echo "------- test $i ------." ++echo "----- gfortran result:" ++gcc c_main$i.c -c -o c-test.o ++gfortran fortran_func$i.f90 -fno-range-check -c -o fortran-test.o ++gfortran fortran-test.o c-test.o ++./a.out ++rm *.o a.out ++echo "----- flang-new result : " ++clang c_main$i.c -c -o c-test.o ++flang-new fortran_func$i.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o a.out ++done +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/007_c_call_fortran_procedure_pointer/c_main001.c b/test/interoperability_with_c_c_call_fortran_scalar/007_c_call_fortran_procedure_pointer/c_main001.c +new file mode 100644 +index 0000000..2bc9194 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/007_c_call_fortran_procedure_pointer/c_main001.c +@@ -0,0 +1,13 @@ ++// test c call fortran for procedure about callback ++// ++#include ++extern void f_func_(void (*foo)(int *)); ++void print(int *x) { ++ printf("%d\n", *x); ++} ++int main() { ++ int i = 0; ++ void (*foo)(int *); ++ foo = print; ++ f_func_(foo); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/007_c_call_fortran_procedure_pointer/c_main002.c b/test/interoperability_with_c_c_call_fortran_scalar/007_c_call_fortran_procedure_pointer/c_main002.c +new file mode 100644 +index 0000000..701f6af +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/007_c_call_fortran_procedure_pointer/c_main002.c +@@ -0,0 +1,13 @@ ++// test c call fortran for procedure about callback ++// ++#include ++extern void f_func_(void (**foo)(int *)); ++void print(int *x) { ++ printf("%d\n", *x); ++} ++int main() { ++ int i = 0; ++ void (*foo[1])(int *); ++ foo[0] = print; ++ f_func_(foo); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/007_c_call_fortran_procedure_pointer/c_main003.c b/test/interoperability_with_c_c_call_fortran_scalar/007_c_call_fortran_procedure_pointer/c_main003.c +new file mode 100644 +index 0000000..7991526 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/007_c_call_fortran_procedure_pointer/c_main003.c +@@ -0,0 +1,13 @@ ++// test c call fortran for procedure about callback ++// ++#include ++extern void f_func_(int (*foo)(int *)); ++int ret(int *x) { ++ return *x + 1; ++} ++int main() { ++ int i = 0; ++ int (*foo)(int *); ++ foo = ret; ++ f_func_(foo); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/007_c_call_fortran_procedure_pointer/c_main004.c b/test/interoperability_with_c_c_call_fortran_scalar/007_c_call_fortran_procedure_pointer/c_main004.c +new file mode 100644 +index 0000000..2e93c83 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/007_c_call_fortran_procedure_pointer/c_main004.c +@@ -0,0 +1,13 @@ ++// test c call fortran for procedure about callback ++// ++#include ++extern void f_func_(int (**foo)(int *)); ++int ret(int *x) { ++ return *x + 1; ++} ++int main() { ++ int i = 0; ++ int (*foo[1])(int *); ++ foo[0] = ret; ++ f_func_(foo); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/007_c_call_fortran_procedure_pointer/c_main005.c b/test/interoperability_with_c_c_call_fortran_scalar/007_c_call_fortran_procedure_pointer/c_main005.c +new file mode 100644 +index 0000000..6f7e931 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/007_c_call_fortran_procedure_pointer/c_main005.c +@@ -0,0 +1,12 @@ ++// test c call fortran for procedure pointer that points to fortran ++// subroutine ++// ++#include ++extern void f_func_(int *); ++int main() { ++ int *i , y = 2; ++ i = &y; ++ void (*foo[1])(int *); ++ foo[0] = f_func_; ++ (*foo)(i); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/007_c_call_fortran_procedure_pointer/c_main006.c b/test/interoperability_with_c_c_call_fortran_scalar/007_c_call_fortran_procedure_pointer/c_main006.c +new file mode 100644 +index 0000000..1b51e46 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/007_c_call_fortran_procedure_pointer/c_main006.c +@@ -0,0 +1,13 @@ ++// test c call fortran for procedure pointer that points to fortran ++// subroutine ++// ++#include ++extern int f_func_(int *); ++int main() { ++ int *i , y = 2; ++ i = &y; ++ int (*foo[1])(int *); ++ foo[0] = f_func_; ++ int x = (*foo)(i); ++ printf("%d\n", x); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/007_c_call_fortran_procedure_pointer/c_main007.c b/test/interoperability_with_c_c_call_fortran_scalar/007_c_call_fortran_procedure_pointer/c_main007.c +new file mode 100644 +index 0000000..389ed1a +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/007_c_call_fortran_procedure_pointer/c_main007.c +@@ -0,0 +1,18 @@ ++// test c call fortran for procedures about callback ++// ++#include ++extern void f_func_(void (**foo)(int *), void (**foo2)(int *)); ++void print(int *x) { ++ printf("%d\n", *x); ++} ++void printn(int *x) { ++ printf("%d\n", *x * -1); ++} ++int main() { ++ int i = 0; ++ void (*foo[1])(int *); ++ void (*foo2[1])(int *); ++ foo[0] = print; ++ foo2[0] = printn; ++ f_func_(foo, foo2); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/007_c_call_fortran_procedure_pointer/c_main008.c b/test/interoperability_with_c_c_call_fortran_scalar/007_c_call_fortran_procedure_pointer/c_main008.c +new file mode 100644 +index 0000000..6ce0048 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/007_c_call_fortran_procedure_pointer/c_main008.c +@@ -0,0 +1,10 @@ ++// test c call fortran for return procedure pointer ++// ++ ++extern void (**func_(void (**fx)()))(); ++int main() { ++ void (**fx)(void); ++ void (**res)(void); ++ res = func_(fx); ++ (*res)(); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/007_c_call_fortran_procedure_pointer/fortran_func001.f90 b/test/interoperability_with_c_c_call_fortran_scalar/007_c_call_fortran_procedure_pointer/fortran_func001.f90 +new file mode 100644 +index 0000000..ffd7ff0 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/007_c_call_fortran_procedure_pointer/fortran_func001.f90 +@@ -0,0 +1,4 @@ ++subroutine f_func(p) ++ procedure() :: p ++ call p(1) ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/007_c_call_fortran_procedure_pointer/fortran_func002.f90 b/test/interoperability_with_c_c_call_fortran_scalar/007_c_call_fortran_procedure_pointer/fortran_func002.f90 +new file mode 100644 +index 0000000..b87a30f +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/007_c_call_fortran_procedure_pointer/fortran_func002.f90 +@@ -0,0 +1,4 @@ ++subroutine f_func(p) ++ procedure(), pointer :: p ++ call p(1) ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/007_c_call_fortran_procedure_pointer/fortran_func003.f90 b/test/interoperability_with_c_c_call_fortran_scalar/007_c_call_fortran_procedure_pointer/fortran_func003.f90 +new file mode 100644 +index 0000000..3b8f913 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/007_c_call_fortran_procedure_pointer/fortran_func003.f90 +@@ -0,0 +1,12 @@ ++subroutine f_func(p) ++ interface ++ function f(x) ++ integer :: x ++ integer :: f ++ end ++ end interface ++ procedure(f) :: p ++ integer :: w = 1 ++ w = p(1) ++ print * , w ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/007_c_call_fortran_procedure_pointer/fortran_func004.f90 b/test/interoperability_with_c_c_call_fortran_scalar/007_c_call_fortran_procedure_pointer/fortran_func004.f90 +new file mode 100644 +index 0000000..c77662a +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/007_c_call_fortran_procedure_pointer/fortran_func004.f90 +@@ -0,0 +1,12 @@ ++subroutine f_func(p) ++ interface ++ function f(x) ++ integer :: x ++ integer :: f ++ end ++ end interface ++ procedure(f), pointer :: p ++ integer :: w = 1 ++ w = p(1) ++ print * , w ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/007_c_call_fortran_procedure_pointer/fortran_func005.f90 b/test/interoperability_with_c_c_call_fortran_scalar/007_c_call_fortran_procedure_pointer/fortran_func005.f90 +new file mode 100644 +index 0000000..8bb7a41 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/007_c_call_fortran_procedure_pointer/fortran_func005.f90 +@@ -0,0 +1,4 @@ ++subroutine f_func(i) ++ integer :: i ++ print *, i ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/007_c_call_fortran_procedure_pointer/fortran_func006.f90 b/test/interoperability_with_c_c_call_fortran_scalar/007_c_call_fortran_procedure_pointer/fortran_func006.f90 +new file mode 100644 +index 0000000..02861a1 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/007_c_call_fortran_procedure_pointer/fortran_func006.f90 +@@ -0,0 +1,5 @@ ++function f_func(i) ++ integer :: i ++ integer :: f_func ++ f_func = i + 1 ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/007_c_call_fortran_procedure_pointer/fortran_func007.f90 b/test/interoperability_with_c_c_call_fortran_scalar/007_c_call_fortran_procedure_pointer/fortran_func007.f90 +new file mode 100644 +index 0000000..3cff57c +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/007_c_call_fortran_procedure_pointer/fortran_func007.f90 +@@ -0,0 +1,7 @@ ++subroutine f_func(p, q) ++ procedure(), pointer :: p ++ procedure(), pointer :: q ++ call q(1) ++ call p(1) ++ ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/007_c_call_fortran_procedure_pointer/fortran_func008.f90 b/test/interoperability_with_c_c_call_fortran_scalar/007_c_call_fortran_procedure_pointer/fortran_func008.f90 +new file mode 100644 +index 0000000..212458d +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/007_c_call_fortran_procedure_pointer/fortran_func008.f90 +@@ -0,0 +1,14 @@ ++function func(x) ++ interface ++ subroutine common ++ end ++ end interface ++ procedure(common), pointer :: x ++ procedure(common), pointer :: func ++ print *, 'ok' ++ x => printx ++ contains ++ subroutine printx() ++ print *, 'ook' ++ end ++end +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/007_c_call_fortran_procedure_pointer/result.md b/test/interoperability_with_c_c_call_fortran_scalar/007_c_call_fortran_procedure_pointer/result.md +new file mode 100644 +index 0000000..7b04196 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/007_c_call_fortran_procedure_pointer/result.md +@@ -0,0 +1,9 @@ ++ | test | gfortran | flang | ++ | 001 | PASS | PASS | ++ | 002 | PASS | ERROR | ++ | 003 | PASS | PASS | ++ | 004 | PASS | ERROR | ++ | 005 | PASS | PASS | ++ | 006 | PASS | PASS | ++ | 007 | PASS | ERROR | ++ | 008 | PASS | ERROR | +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran_scalar/007_c_call_fortran_procedure_pointer/run.sh b/test/interoperability_with_c_c_call_fortran_scalar/007_c_call_fortran_procedure_pointer/run.sh +new file mode 100644 +index 0000000..01f477d +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran_scalar/007_c_call_fortran_procedure_pointer/run.sh +@@ -0,0 +1,16 @@ ++for i in {001..009} ++do ++echo "------- test $i ------." ++echo "----- gfortran result:" ++gcc c_main$i.c -c -o c-test.o ++gfortran fortran_func$i.f90 -fno-range-check -c -o fortran-test.o ++gfortran fortran-test.o c-test.o ++./a.out ++rm *.o a.out ++echo "----- flang-new result : " ++clang c_main$i.c -c -o c-test.o ++flang-new fortran_func$i.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o a.out ++done +\ No newline at end of file +-- +2.25.1 + diff --git a/8-test-interoperability-with-c-fortran-call-c-array.patch b/8-test-interoperability-with-c-fortran-call-c-array.patch new file mode 100644 index 0000000..2e97306 --- /dev/null +++ b/8-test-interoperability-with-c-fortran-call-c-array.patch @@ -0,0 +1,3066 @@ +From ebc7950f1d916776bf8e785083df58caad184187 Mon Sep 17 00:00:00 2001 +From: xieyihui +Date: Fri, 18 Nov 2022 12:39:03 +0800 +Subject: [PATCH] Add new test cases about array for interoperability with C + about fortran call C + +diff --git a/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func001.c b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func001.c +new file mode 100644 +index 0000000..c7cf73f +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/001_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_fortran_call_c_array/001_fortran_call_c_array/c_func002.c b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func002.c +new file mode 100644 +index 0000000..010cdf7 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func002.c +@@ -0,0 +1,6 @@ ++#include ++#include ++void c_func_(short *a) { ++ printf("%hd\n", a[0]); ++ printf("%hd\n", a[1]); ++} +diff --git a/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func003.c b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func003.c +new file mode 100644 +index 0000000..5e69081 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func003.c +@@ -0,0 +1,6 @@ ++#include ++#include ++void c_func_(long *a) { ++ printf("%ld\n", a[0]); ++ printf("%ld\n", a[1]); ++} +diff --git a/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func004.c b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func004.c +new file mode 100644 +index 0000000..3f74c8e +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func004.c +@@ -0,0 +1,6 @@ ++#include ++#include ++void c_func_(long long *a) { ++ printf("%lld\n", a[0]); ++ printf("%lld\n", a[1]); ++} +diff --git a/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func005.c b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func005.c +new file mode 100644 +index 0000000..77794d4 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/001_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_fortran_call_c_array/001_fortran_call_c_array/c_func006.c b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func006.c +new file mode 100644 +index 0000000..27c475f +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func006.c +@@ -0,0 +1,6 @@ ++#include ++#include ++void c_func_(size_t *a) { ++ printf("%ld\n", a[0]); ++ printf("%ld\n", a[1]); ++} +diff --git a/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func007.c b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func007.c +new file mode 100644 +index 0000000..f7c4384 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func007.c +@@ -0,0 +1,6 @@ ++#include ++#include ++void c_func_(int8_t *a) { ++ printf("%hhd\n", a[0]); ++ printf("%hhd\n", a[1]); ++} +diff --git a/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func008.c b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func008.c +new file mode 100644 +index 0000000..e29971f +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func008.c +@@ -0,0 +1,6 @@ ++#include ++#include ++void c_func_(int16_t *a) { ++ printf("%hd\n", a[0]); ++ printf("%hd\n", a[1]); ++} +diff --git a/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func009.c b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func009.c +new file mode 100644 +index 0000000..3b84c1a +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func009.c +@@ -0,0 +1,6 @@ ++#include ++#include ++void c_func_(int32_t *a) { ++ printf("%d\n", a[0]); ++ printf("%d\n", a[1]); ++} +diff --git a/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func010.c b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func010.c +new file mode 100644 +index 0000000..11ca3e1 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func010.c +@@ -0,0 +1,6 @@ ++#include ++#include ++void c_func_(int64_t *a) { ++ printf("%ld\n", a[0]); ++ printf("%ld\n", a[1]); ++} +diff --git a/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func011.c b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func011.c +new file mode 100644 +index 0000000..f830d74 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func011.c +@@ -0,0 +1,6 @@ ++#include ++#include ++void c_func_(int_least8_t *a) { ++ printf("%hhd\n", a[0]); ++ printf("%hhd\n", a[1]); ++} +diff --git a/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func012.c b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func012.c +new file mode 100644 +index 0000000..6ffd7e3 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func012.c +@@ -0,0 +1,6 @@ ++#include ++#include ++void c_func_(int_least16_t *a) { ++ printf("%hd\n", a[0]); ++ printf("%hd\n", a[1]); ++} +diff --git a/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func013.c b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func013.c +new file mode 100644 +index 0000000..4b367cb +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func013.c +@@ -0,0 +1,6 @@ ++#include ++#include ++void c_func_(int_least32_t *a) { ++ printf("%d\n", a[0]); ++ printf("%d\n", a[1]); ++} +diff --git a/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func014.c b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func014.c +new file mode 100644 +index 0000000..6b2d5b3 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func014.c +@@ -0,0 +1,6 @@ ++#include ++#include ++void c_func_(int_least64_t *a) { ++ printf("%ld\n", a[0]); ++ printf("%ld\n", a[1]); ++} +diff --git a/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func015.c b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func015.c +new file mode 100644 +index 0000000..81d223a +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func015.c +@@ -0,0 +1,6 @@ ++#include ++#include ++void c_func_(int_fast8_t *a) { ++ printf("%hhd\n", a[0]); ++ printf("%hhd\n", a[1]); ++} +diff --git a/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func016.c b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func016.c +new file mode 100644 +index 0000000..297be3a +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func016.c +@@ -0,0 +1,6 @@ ++#include ++#include ++void c_func_(int_fast16_t *a) { ++ printf("%ld\n", a[0]); ++ printf("%ld\n", a[1]); ++} +diff --git a/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func017.c b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func017.c +new file mode 100644 +index 0000000..8eb5818 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func017.c +@@ -0,0 +1,6 @@ ++#include ++#include ++void c_func_(int_fast32_t *a) { ++ printf("%ld\n", a[0]); ++ printf("%ld\n", a[1]); ++} +diff --git a/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func018.c b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func018.c +new file mode 100644 +index 0000000..030b1f7 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func018.c +@@ -0,0 +1,6 @@ ++#include ++#include ++void c_func_(int_fast64_t *a) { ++ printf("%ld\n", a[0]); ++ printf("%ld\n", a[1]); ++} +diff --git a/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func019.c b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func019.c +new file mode 100644 +index 0000000..babfc75 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func019.c +@@ -0,0 +1,6 @@ ++#include ++#include ++void c_func_(intmax_t *a) { ++ printf("%ld\n", a[0]); ++ printf("%ld\n", a[1]); ++} +diff --git a/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func020.c b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func020.c +new file mode 100644 +index 0000000..26c7726 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func020.c +@@ -0,0 +1,6 @@ ++#include ++#include ++void c_func_(intptr_t *a) { ++ printf("%ld\n", a[0]); ++ printf("%ld\n", a[1]); ++} +diff --git a/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func021.c b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func021.c +new file mode 100644 +index 0000000..a73f11b +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/001_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_fortran_call_c_array/001_fortran_call_c_array/c_func022.c b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func022.c +new file mode 100644 +index 0000000..688f3c0 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func022.c +@@ -0,0 +1,5 @@ ++#include ++void c_func_(double *a) { ++ printf("%20lf\n", a[0]); ++ printf("%20lf\n", a[1]); ++} +diff --git a/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func023.c b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func023.c +new file mode 100644 +index 0000000..af86ba3 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/001_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]); ++} +diff --git a/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func024.c b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func024.c +new file mode 100644 +index 0000000..1d34f02 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func024.c +@@ -0,0 +1,6 @@ ++#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])); ++} +diff --git a/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func025.c b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func025.c +new file mode 100644 +index 0000000..12b9abb +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func025.c +@@ -0,0 +1,6 @@ ++#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])); ++} +diff --git a/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func026.c b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func026.c +new file mode 100644 +index 0000000..78011d4 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func026.c +@@ -0,0 +1,6 @@ ++#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])); ++} +diff --git a/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func027.c b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func027.c +new file mode 100644 +index 0000000..91a49b5 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/001_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_fortran_call_c_array/001_fortran_call_c_array/c_func028.c b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func028.c +new file mode 100644 +index 0000000..9335307 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/001_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_fortran_call_c_array/001_fortran_call_c_array/fortran_main001.f90 b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main001.f90 +new file mode 100644 +index 0000000..6e1f16f +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/001_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 ++ integer :: my_x(2) = 1 ++ interface ++ subroutine c_func(b) ++ integer :: b(2) ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main002.f90 b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main002.f90 +new file mode 100644 +index 0000000..50f36f6 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/001_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 ++ integer(2) :: my_x(2) = 1 ++ interface ++ subroutine c_func(b) ++ integer(2) :: b(2) ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main003.f90 b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main003.f90 +new file mode 100644 +index 0000000..5109bc3 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/001_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 ++ integer(8) :: my_x(2) = 1 ++ interface ++ subroutine c_func(b) ++ integer(8) :: b(2) ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main004.f90 b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main004.f90 +new file mode 100644 +index 0000000..a4e1bc6 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/001_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 ++ integer(8) :: my_x(2) = 1 ++ interface ++ subroutine c_func(b) ++ integer(8) :: b(2) ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main005.f90 b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main005.f90 +new file mode 100644 +index 0000000..6f52cca +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/001_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 ++ integer(1) :: my_x(2) = 65 ++ interface ++ subroutine c_func(b) ++ integer(1) :: b(2) ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main006.f90 b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main006.f90 +new file mode 100644 +index 0000000..3505849 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/001_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 ++ integer(8) :: my_x(2) = 3 ++ interface ++ subroutine c_func(b) ++ integer(8) :: b(2) ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main007.f90 b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main007.f90 +new file mode 100644 +index 0000000..3ce82ad +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/001_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 ++ integer(1) :: my_x(2) = 1 ++ interface ++ subroutine c_func(b) ++ integer(1) :: b(2) ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main008.f90 b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main008.f90 +new file mode 100644 +index 0000000..12a52ee +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/001_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 ++ integer(2) :: my_x(2) = 1 ++ interface ++ subroutine c_func(b) ++ integer(2) :: b(2) ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main009.f90 b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main009.f90 +new file mode 100644 +index 0000000..139d7f9 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/001_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 ++ integer(4) :: my_x(2) = 1 ++ interface ++ subroutine c_func(b) ++ integer(4) :: b(2) ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main010.f90 b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main010.f90 +new file mode 100644 +index 0000000..81859b7 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/001_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 ++ integer(8) :: my_x(2) = 1 ++ interface ++ subroutine c_func(b) ++ integer(8) :: b(2) ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main011.f90 b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main011.f90 +new file mode 100644 +index 0000000..cee5bab +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/001_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_least8_t ++! ++program main ++ integer(1) :: my_x(2) = 1 ++ interface ++ subroutine c_func(b) ++ integer(1) :: b(2) ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main012.f90 b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main012.f90 +new file mode 100644 +index 0000000..fd005f2 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/001_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 ++! ++program main ++ integer(2) :: my_x(2) = 1 ++ interface ++ subroutine c_func(b) ++ integer(2) :: b(2) ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main013.f90 b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main013.f90 +new file mode 100644 +index 0000000..1fe884b +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/001_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 ++! ++program main ++ integer(4) :: my_x(2) = 1 ++ interface ++ subroutine c_func(b) ++ integer(4) :: b(2) ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main014.f90 b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main014.f90 +new file mode 100644 +index 0000000..ada1c56 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/001_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 ++! ++program main ++ integer(8) :: my_x(2) = 1 ++ interface ++ subroutine c_func(b) ++ integer(8) :: b(2) ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main015.f90 b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main015.f90 +new file mode 100644 +index 0000000..a025c8a +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/001_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 ++! ++program main ++ integer(1) :: my_x(2) = 1 ++ interface ++ subroutine c_func(b) ++ integer(1) :: b(2) ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main016.f90 b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main016.f90 +new file mode 100644 +index 0000000..d6d3f63 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/001_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 ++! ++program main ++ integer(8) :: my_x(2) = 1 ++ interface ++ subroutine c_func(b) ++ integer(8) :: b(2) ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main017.f90 b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main017.f90 +new file mode 100644 +index 0000000..851d06d +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/001_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 ++! ++program main ++ integer(8) :: my_x(2) = 1 ++ interface ++ subroutine c_func(b) ++ integer(8) :: b(2) ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main018.f90 b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main018.f90 +new file mode 100644 +index 0000000..9b62610 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/001_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 ++! ++program main ++ integer(8) :: my_x(2) = 1 ++ interface ++ subroutine c_func(b) ++ integer(8) :: b(2) ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main019.f90 b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main019.f90 +new file mode 100644 +index 0000000..41f77aa +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/001_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 ++! ++program main ++ integer(8) :: my_x(2) = 1 ++ interface ++ subroutine c_func(b) ++ integer(8) :: b(2) ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main020.f90 b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main020.f90 +new file mode 100644 +index 0000000..3a48805 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/001_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 ++! ++program main ++ integer(8) :: my_x(2) = 1 ++ interface ++ subroutine c_func(b) ++ integer(8) :: b(2) ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main021.f90 b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main021.f90 +new file mode 100644 +index 0000000..86a9cf5 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/001_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 ++ real(4) :: my_x(2) = 12345678.7654321 ++ interface ++ subroutine c_func(b) ++ real(4) :: b(2) ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main022.f90 b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main022.f90 +new file mode 100644 +index 0000000..ad70ca5 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/001_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 ++ real(8) :: my_x(2) = 12345678.7654321 ++ interface ++ subroutine c_func(b) ++ real(8) :: b(2) ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main023.f90 b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main023.f90 +new file mode 100644 +index 0000000..e44608b +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main023.f90 +@@ -0,0 +1,14 @@ ++! Test fortran call c for the array type and the array type is ++! long double ++! ++program main ++ integer, parameter :: K = selected_real_kind(16) ++ real(K) :: my_x(2) = 12345678.7654321 ++ interface ++ subroutine c_func(b) ++ 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_fortran_call_c_array/001_fortran_call_c_array/fortran_main024.f90 b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main024.f90 +new file mode 100644 +index 0000000..19df422 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/001_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 ++ complex(4) :: my_x(2) = (-3.14159265358979, 1) ++ interface ++ subroutine c_func(b) ++ complex(4) :: b(2) ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main025.f90 b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main025.f90 +new file mode 100644 +index 0000000..b335a51 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/001_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 ++ complex(8) :: my_x(2) = (-3.14159265358979, 1) ++ interface ++ subroutine c_func(b) ++ complex(8) :: b(2) ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main026.f90 b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main026.f90 +new file mode 100644 +index 0000000..7482ce8 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main026.f90 +@@ -0,0 +1,14 @@ ++! Test fortran call c for the array type and the array type is ++! long double _Complex ++! ++program main ++ integer, parameter :: K = selected_real_kind(16) ++ complex(K) :: my_x(2) = (-3.14159265358979, 1) ++ interface ++ subroutine c_func(b) ++ 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_fortran_call_c_array/001_fortran_call_c_array/fortran_main027.f90 b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main027.f90 +new file mode 100644 +index 0000000..d3249d1 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/001_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 ++ logical(1) :: my_x(2) = .TRUE. ++ interface ++ subroutine c_func(b) ++ logical(1) :: b(2) ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main028.f90 b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main028.f90 +new file mode 100644 +index 0000000..a854e09 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/001_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 ++ character(1) :: my_x(2) = 'a' ++ interface ++ subroutine c_func(b) ++ character(1) :: b(2) ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/result.md b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/result.md +new file mode 100644 +index 0000000..f15fe53 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/result.md +@@ -0,0 +1,29 @@ ++ | test | gfortran | flang | nvfortran| ++ | 001 | PASS | PASS | PASS | ++ | 002 | PASS | PASS | PASS | ++ | 003 | PASS | PASS | PASS | ++ | 004 | PASS | PASS | PASS | ++ | 005 | PASS | PASS | PASS | ++ | 006 | PASS | PASS | PASS | ++ | 007 | PASS | PASS | PASS | ++ | 008 | PASS | PASS | PASS | ++ | 009 | PASS | PASS | PASS | ++ | 010 | PASS | PASS | PASS | ++ | 011 | PASS | PASS | PASS | ++ | 012 | PASS | PASS | PASS | ++ | 013 | PASS | PASS | PASS | ++ | 014 | PASS | PASS | PASS | ++ | 015 | PASS | PASS | PASS | ++ | 016 | PASS | PASS | PASS | ++ | 017 | PASS | PASS | PASS | ++ | 018 | PASS | PASS | PASS | ++ | 019 | PASS | PASS | PASS | ++ | 020 | PASS | PASS | PASS | ++ | 021 | PASS | PASS | PASS | ++ | 022 | PASS | PASS | PASS | ++ | 023 | PASS | PASS | ERROR | ++ | 024 | PASS | PASS | PASS | ++ | 025 | PASS | PASS | PASS | ++ | 026 | PASS | PASS | ERROR | ++ | 027 | PASS | PASS | PASS | ++ | 028 | PASS | PASS | PASS | +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/run.sh b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/run.sh +new file mode 100644 +index 0000000..dbbd62f +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/run.sh +@@ -0,0 +1,22 @@ ++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 ++echo "----- nvfortran result : " ++clang c_func$i.c -c -o c-test.o ++nvfortran fortran_main$i.f90 -c -o fortran-test.o ++nvfortran 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_array/002_fortran_call_c_array_iso_c_binding/c_func001.c b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func001.c +new file mode 100644 +index 0000000..c7cf73f +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/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_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func002.c b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func002.c +new file mode 100644 +index 0000000..010cdf7 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func002.c +@@ -0,0 +1,6 @@ ++#include ++#include ++void c_func_(short *a) { ++ printf("%hd\n", a[0]); ++ printf("%hd\n", a[1]); ++} +diff --git a/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func003.c b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func003.c +new file mode 100644 +index 0000000..5e69081 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func003.c +@@ -0,0 +1,6 @@ ++#include ++#include ++void c_func_(long *a) { ++ printf("%ld\n", a[0]); ++ printf("%ld\n", a[1]); ++} +diff --git a/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func004.c b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func004.c +new file mode 100644 +index 0000000..3f74c8e +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func004.c +@@ -0,0 +1,6 @@ ++#include ++#include ++void c_func_(long long *a) { ++ printf("%lld\n", a[0]); ++ printf("%lld\n", a[1]); ++} +diff --git a/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func005.c b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func005.c +new file mode 100644 +index 0000000..77794d4 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/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_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func006.c b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func006.c +new file mode 100644 +index 0000000..27c475f +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func006.c +@@ -0,0 +1,6 @@ ++#include ++#include ++void c_func_(size_t *a) { ++ printf("%ld\n", a[0]); ++ printf("%ld\n", a[1]); ++} +diff --git a/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func007.c b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func007.c +new file mode 100644 +index 0000000..f7c4384 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func007.c +@@ -0,0 +1,6 @@ ++#include ++#include ++void c_func_(int8_t *a) { ++ printf("%hhd\n", a[0]); ++ printf("%hhd\n", a[1]); ++} +diff --git a/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func008.c b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func008.c +new file mode 100644 +index 0000000..e29971f +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func008.c +@@ -0,0 +1,6 @@ ++#include ++#include ++void c_func_(int16_t *a) { ++ printf("%hd\n", a[0]); ++ printf("%hd\n", a[1]); ++} +diff --git a/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func009.c b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func009.c +new file mode 100644 +index 0000000..3b84c1a +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func009.c +@@ -0,0 +1,6 @@ ++#include ++#include ++void c_func_(int32_t *a) { ++ printf("%d\n", a[0]); ++ printf("%d\n", a[1]); ++} +diff --git a/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func010.c b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func010.c +new file mode 100644 +index 0000000..11ca3e1 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func010.c +@@ -0,0 +1,6 @@ ++#include ++#include ++void c_func_(int64_t *a) { ++ printf("%ld\n", a[0]); ++ printf("%ld\n", a[1]); ++} +diff --git a/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func011.c b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func011.c +new file mode 100644 +index 0000000..f830d74 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func011.c +@@ -0,0 +1,6 @@ ++#include ++#include ++void c_func_(int_least8_t *a) { ++ printf("%hhd\n", a[0]); ++ printf("%hhd\n", a[1]); ++} +diff --git a/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func012.c b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func012.c +new file mode 100644 +index 0000000..6ffd7e3 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func012.c +@@ -0,0 +1,6 @@ ++#include ++#include ++void c_func_(int_least16_t *a) { ++ printf("%hd\n", a[0]); ++ printf("%hd\n", a[1]); ++} +diff --git a/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func013.c b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func013.c +new file mode 100644 +index 0000000..4b367cb +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func013.c +@@ -0,0 +1,6 @@ ++#include ++#include ++void c_func_(int_least32_t *a) { ++ printf("%d\n", a[0]); ++ printf("%d\n", a[1]); ++} +diff --git a/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func014.c b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func014.c +new file mode 100644 +index 0000000..6b2d5b3 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func014.c +@@ -0,0 +1,6 @@ ++#include ++#include ++void c_func_(int_least64_t *a) { ++ printf("%ld\n", a[0]); ++ printf("%ld\n", a[1]); ++} +diff --git a/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func015.c b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func015.c +new file mode 100644 +index 0000000..81d223a +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func015.c +@@ -0,0 +1,6 @@ ++#include ++#include ++void c_func_(int_fast8_t *a) { ++ printf("%hhd\n", a[0]); ++ printf("%hhd\n", a[1]); ++} +diff --git a/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func016.c b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func016.c +new file mode 100644 +index 0000000..297be3a +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func016.c +@@ -0,0 +1,6 @@ ++#include ++#include ++void c_func_(int_fast16_t *a) { ++ printf("%ld\n", a[0]); ++ printf("%ld\n", a[1]); ++} +diff --git a/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func017.c b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func017.c +new file mode 100644 +index 0000000..8eb5818 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func017.c +@@ -0,0 +1,6 @@ ++#include ++#include ++void c_func_(int_fast32_t *a) { ++ printf("%ld\n", a[0]); ++ printf("%ld\n", a[1]); ++} +diff --git a/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func018.c b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func018.c +new file mode 100644 +index 0000000..030b1f7 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func018.c +@@ -0,0 +1,6 @@ ++#include ++#include ++void c_func_(int_fast64_t *a) { ++ printf("%ld\n", a[0]); ++ printf("%ld\n", a[1]); ++} +diff --git a/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func019.c b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func019.c +new file mode 100644 +index 0000000..babfc75 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func019.c +@@ -0,0 +1,6 @@ ++#include ++#include ++void c_func_(intmax_t *a) { ++ printf("%ld\n", a[0]); ++ printf("%ld\n", a[1]); ++} +diff --git a/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func020.c b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func020.c +new file mode 100644 +index 0000000..26c7726 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func020.c +@@ -0,0 +1,6 @@ ++#include ++#include ++void c_func_(intptr_t *a) { ++ printf("%ld\n", a[0]); ++ printf("%ld\n", a[1]); ++} +diff --git a/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func021.c b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func021.c +new file mode 100644 +index 0000000..a73f11b +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/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_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func022.c b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func022.c +new file mode 100644 +index 0000000..b600f94 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/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]); ++} +diff --git a/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func023.c b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func023.c +new file mode 100644 +index 0000000..b34c388 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func023.c +@@ -0,0 +1,5 @@ ++#include ++void c_func_(long double *a) { ++ printf("%.20Lf\n", a[0]); ++ printf("%.20Lf\n", a[1]); ++} +diff --git a/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func024.c b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func024.c +new file mode 100644 +index 0000000..1d34f02 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func024.c +@@ -0,0 +1,6 @@ ++#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])); ++} +diff --git a/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func025.c b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func025.c +new file mode 100644 +index 0000000..582096e +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/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])); ++} +diff --git a/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func026.c b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func026.c +new file mode 100644 +index 0000000..b665220 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/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])); ++} +diff --git a/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func027.c b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func027.c +new file mode 100644 +index 0000000..91a49b5 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/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_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func028.c b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func028.c +new file mode 100644 +index 0000000..9335307 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/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_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main001.f90 b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main001.f90 +new file mode 100644 +index 0000000..c1c866f +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/002_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 ++ use iso_c_binding ++ integer(C_INT) :: my_x(2) = 1 ++ interface ++ subroutine c_func(b) ++ use iso_c_binding ++ integer(C_INT) :: b(2) ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main002.f90 b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main002.f90 +new file mode 100644 +index 0000000..cb9976e +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/002_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 ++ use iso_c_binding ++ integer(C_SHORT) :: my_x(2) = 1 ++ interface ++ subroutine c_func(b) ++ use iso_c_binding ++ integer(C_SHORT) :: b(2) ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main003.f90 b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main003.f90 +new file mode 100644 +index 0000000..fd935af +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/002_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 ++ use iso_c_binding ++ integer(C_LONG) :: my_x(2) = 1 ++ interface ++ subroutine c_func(b) ++ use iso_c_binding ++ integer(C_LONG) :: b(2) ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main004.f90 b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main004.f90 +new file mode 100644 +index 0000000..fd72ea7 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/002_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 ++ use iso_c_binding ++ integer(C_LONG_LONG) :: my_x(2) = 1 ++ interface ++ subroutine c_func(b) ++ use iso_c_binding ++ integer(C_LONG_LONG) :: b(2) ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main005.f90 b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main005.f90 +new file mode 100644 +index 0000000..f6e923d +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/002_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 ++ use iso_c_binding ++ integer(C_SIGNED_CHAR) :: my_x(2) = 65 ++ interface ++ subroutine c_func(b) ++ use iso_c_binding ++ integer(C_SIGNED_CHAR) :: b(2) ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main006.f90 b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main006.f90 +new file mode 100644 +index 0000000..421534d +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/002_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 ++ use iso_c_binding ++ integer(C_SIZE_T) :: my_x(2) = 3 ++ interface ++ subroutine c_func(b) ++ use iso_c_binding ++ integer(C_SIZE_T) :: b(2) ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main007.f90 b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main007.f90 +new file mode 100644 +index 0000000..d7b5b93 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/002_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 ++ use iso_c_binding ++ integer(C_INT8_T) :: my_x(2) = 1 ++ interface ++ subroutine c_func(b) ++ use iso_c_binding ++ integer(C_INT8_T) :: b(2) ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main008.f90 b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main008.f90 +new file mode 100644 +index 0000000..d7f7492 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/002_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 ++ use iso_c_binding ++ integer(C_INT16_T) :: my_x(2) = 1 ++ interface ++ subroutine c_func(b) ++ use iso_c_binding ++ integer(C_INT16_T) :: b(2) ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main009.f90 b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main009.f90 +new file mode 100644 +index 0000000..35233f5 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/002_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 ++ use iso_c_binding ++ integer(C_INT32_T) :: my_x(2) = 1 ++ interface ++ subroutine c_func(b) ++ use iso_c_binding ++ integer(C_INT32_T) :: b(2) ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main010.f90 b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main010.f90 +new file mode 100644 +index 0000000..f0c5cb2 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/002_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 ++ use iso_c_binding ++ integer(C_INT64_T) :: my_x(2) = 1 ++ interface ++ subroutine c_func(b) ++ use iso_c_binding ++ integer(C_INT64_T) :: b(2) ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main011.f90 b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main011.f90 +new file mode 100644 +index 0000000..9b6e534 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/002_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 ++ use iso_c_binding ++ integer(C_INT_LEAST8_T) :: my_x(2) = 1 ++ interface ++ subroutine c_func(b) ++ use iso_c_binding ++ integer(C_INT_LEAST8_T) :: b(2) ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main012.f90 b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main012.f90 +new file mode 100644 +index 0000000..d0b4d29 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/002_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 ++ use iso_c_binding ++ integer(C_INT_LEAST16_T) :: my_x(2) = 1 ++ interface ++ subroutine c_func(b) ++ use iso_c_binding ++ integer(C_INT_LEAST16_T) :: b(2) ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main013.f90 b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main013.f90 +new file mode 100644 +index 0000000..74e2a82 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/002_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 ++ use iso_c_binding ++ integer(C_INT_LEAST32_T) :: my_x(2) = 1 ++ interface ++ subroutine c_func(b) ++ use iso_c_binding ++ integer(C_INT_LEAST32_T) :: b(2) ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main014.f90 b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main014.f90 +new file mode 100644 +index 0000000..09830a3 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/002_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 ++ use iso_c_binding ++ integer(C_INT_LEAST64_T) :: my_x(2) = 1 ++ interface ++ subroutine c_func(b) ++ use iso_c_binding ++ integer(C_INT_LEAST64_T) :: b(2) ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main015.f90 b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main015.f90 +new file mode 100644 +index 0000000..0663936 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/002_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 ++ use iso_c_binding ++ integer(C_INT_FAST8_T) :: my_x(2) = 1 ++ interface ++ subroutine c_func(b) ++ use iso_c_binding ++ integer(C_INT_FAST8_T) :: b(2) ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main016.f90 b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main016.f90 +new file mode 100644 +index 0000000..3ed798b +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/002_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 ++ use iso_c_binding ++ integer(C_INT_FAST16_T) :: my_x(2) = 1 ++ interface ++ subroutine c_func(b) ++ use iso_c_binding ++ integer(C_INT_FAST16_T) :: b(2) ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main017.f90 b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main017.f90 +new file mode 100644 +index 0000000..ad04f7a +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/002_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 ++ use iso_c_binding ++ integer(C_INT_FAST32_T) :: my_x(2) = 1 ++ interface ++ subroutine c_func(b) ++ use iso_c_binding ++ integer(C_INT_FAST32_T) :: b(2) ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main018.f90 b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main018.f90 +new file mode 100644 +index 0000000..21bccab +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/002_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 ++ use iso_c_binding ++ integer(C_INT_FAST64_T) :: my_x(2) = 1 ++ interface ++ subroutine c_func(b) ++ use iso_c_binding ++ integer(C_INT_FAST64_T) :: b(2) ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main019.f90 b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main019.f90 +new file mode 100644 +index 0000000..0ec82b6 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/002_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 ++ use iso_c_binding ++ integer(C_INTMAX_T) :: my_x(2) = 1 ++ interface ++ subroutine c_func(b) ++ use iso_c_binding ++ integer(C_INTMAX_T) :: b(2) ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main020.f90 b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main020.f90 +new file mode 100644 +index 0000000..dabd45d +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/002_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 ++ use iso_c_binding ++ integer(C_INTPTR_T) :: my_x(2) = 1 ++ interface ++ subroutine c_func(b) ++ use iso_c_binding ++ integer(C_INTPTR_T) :: b(2) ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main021.f90 b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main021.f90 +new file mode 100644 +index 0000000..e0b4407 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/002_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 ++ use iso_c_binding ++ real(C_FLOAT) :: my_x(2) = 12345678.7654321 ++ interface ++ subroutine c_func(b) ++ use iso_c_binding ++ real(C_FLOAT) :: b(2) ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main022.f90 b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main022.f90 +new file mode 100644 +index 0000000..453383e +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/002_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 ++ use iso_c_binding ++ real(C_DOUBLE) :: my_x(2) = 3.14159265358979 ++ interface ++ subroutine c_func(b) ++ use iso_c_binding ++ real(C_DOUBLE) :: b(2) ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main023.f90 b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main023.f90 +new file mode 100644 +index 0000000..527cb8a +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/002_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 ++ use iso_c_binding ++ real(C_LONG_DOUBLE) :: my_x(2) = 3.14159265358979 ++ interface ++ subroutine c_func(b) ++ use iso_c_binding ++ real(C_LONG_DOUBLE) :: b(2) ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main024.f90 b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main024.f90 +new file mode 100644 +index 0000000..a1d726f +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/002_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 ++ use iso_c_binding ++ complex(C_FLOAT_COMPLEX) :: my_x(2) = (-12345678.7654321, 1) ++ interface ++ subroutine c_func(b) ++ use iso_c_binding ++ complex(C_FLOAT_COMPLEX) :: b(2) ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main025.f90 b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main025.f90 +new file mode 100644 +index 0000000..d8e8d58 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/002_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 ++ use iso_c_binding ++ complex(C_DOUBLE_COMPLEX) :: my_x(2) = (-3.14159265358979, 1) ++ interface ++ subroutine c_func(b) ++ use iso_c_binding ++ complex(C_DOUBLE_COMPLEX) :: b(2) ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main026.f90 b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main026.f90 +new file mode 100644 +index 0000000..b90c2ce +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/002_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 ++ use iso_c_binding ++ complex(C_LONG_DOUBLE_COMPLEX) :: my_x(2) = (-3.14159265358979, 1) ++ interface ++ subroutine c_func(b) ++ use iso_c_binding ++ complex(C_LONG_DOUBLE_COMPLEX) :: b(2) ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main027.f90 b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main027.f90 +new file mode 100644 +index 0000000..ad4ac52 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/002_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 ++! ++program main ++ use iso_c_binding ++ logical(C_BOOL) :: my_x(2) = .FALSE. ++ interface ++ subroutine c_func(b) ++ use iso_c_binding ++ logical(C_BOOL) :: b(2) ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main028.f90 b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main028.f90 +new file mode 100644 +index 0000000..d7a220b +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/002_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 ++ use iso_c_binding ++ character(C_CHAR) :: my_x(2) = 'a' ++ interface ++ subroutine c_func(b) ++ use iso_c_binding ++ character(C_CHAR) :: b(2) ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/result.md b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/result.md +new file mode 100644 +index 0000000..0499a78 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/result.md +@@ -0,0 +1,29 @@ ++ | test | gfortran | flang | nvfortran| ++ | 001 | PASS | PASS | PASS | ++ | 002 | PASS | PASS | PASS | ++ | 003 | PASS | PASS | PASS | ++ | 004 | PASS | PASS | PASS | ++ | 005 | PASS | PASS | PASS | ++ | 006 | PASS | PASS | PASS | ++ | 007 | PASS | PASS | PASS | ++ | 008 | PASS | PASS | PASS | ++ | 009 | PASS | PASS | PASS | ++ | 010 | PASS | PASS | PASS | ++ | 011 | PASS | PASS | PASS | ++ | 012 | PASS | PASS | PASS | ++ | 013 | PASS | PASS | PASS | ++ | 014 | PASS | PASS | PASS | ++ | 015 | PASS | PASS | PASS | ++ | 016 | PASS | ERROR | PASS | ++ | 017 | PASS | ERROR | PASS | ++ | 018 | PASS | PASS | PASS | ++ | 019 | PASS | ERROR | PASS | ++ | 020 | PASS | PASS | PASS | ++ | 021 | PASS | PASS | PASS | ++ | 022 | PASS | PASS | PASS | ++ | 023 | PASS | ERROR | ERROR | ++ | 024 | PASS | PASS | PASS | ++ | 025 | PASS | PASS | PASS | ++ | 026 | PASS | ERROR | ERROR | ++ | 027 | PASS | PASS | PASS | ++ | 028 | PASS | PASS | PASS | +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/run.sh b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/run.sh +new file mode 100644 +index 0000000..dbbd62f +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/run.sh +@@ -0,0 +1,22 @@ ++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 ++echo "----- nvfortran result : " ++clang c_func$i.c -c -o c-test.o ++nvfortran fortran_main$i.f90 -c -o fortran-test.o ++nvfortran 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_array/003_fortran_call_c_array_bindc/c_func001.c b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func001.c +new file mode 100644 +index 0000000..c7cf73f +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/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_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func002.c b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func002.c +new file mode 100644 +index 0000000..010cdf7 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func002.c +@@ -0,0 +1,6 @@ ++#include ++#include ++void c_func_(short *a) { ++ printf("%hd\n", a[0]); ++ printf("%hd\n", a[1]); ++} +diff --git a/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func003.c b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func003.c +new file mode 100644 +index 0000000..5e69081 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func003.c +@@ -0,0 +1,6 @@ ++#include ++#include ++void c_func_(long *a) { ++ printf("%ld\n", a[0]); ++ printf("%ld\n", a[1]); ++} +diff --git a/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func004.c b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func004.c +new file mode 100644 +index 0000000..3f74c8e +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func004.c +@@ -0,0 +1,6 @@ ++#include ++#include ++void c_func_(long long *a) { ++ printf("%lld\n", a[0]); ++ printf("%lld\n", a[1]); ++} +diff --git a/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func005.c b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func005.c +new file mode 100644 +index 0000000..77794d4 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/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_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func006.c b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func006.c +new file mode 100644 +index 0000000..27c475f +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func006.c +@@ -0,0 +1,6 @@ ++#include ++#include ++void c_func_(size_t *a) { ++ printf("%ld\n", a[0]); ++ printf("%ld\n", a[1]); ++} +diff --git a/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func007.c b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func007.c +new file mode 100644 +index 0000000..f7c4384 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func007.c +@@ -0,0 +1,6 @@ ++#include ++#include ++void c_func_(int8_t *a) { ++ printf("%hhd\n", a[0]); ++ printf("%hhd\n", a[1]); ++} +diff --git a/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func008.c b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func008.c +new file mode 100644 +index 0000000..e29971f +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func008.c +@@ -0,0 +1,6 @@ ++#include ++#include ++void c_func_(int16_t *a) { ++ printf("%hd\n", a[0]); ++ printf("%hd\n", a[1]); ++} +diff --git a/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func009.c b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func009.c +new file mode 100644 +index 0000000..3b84c1a +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func009.c +@@ -0,0 +1,6 @@ ++#include ++#include ++void c_func_(int32_t *a) { ++ printf("%d\n", a[0]); ++ printf("%d\n", a[1]); ++} +diff --git a/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func010.c b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func010.c +new file mode 100644 +index 0000000..11ca3e1 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func010.c +@@ -0,0 +1,6 @@ ++#include ++#include ++void c_func_(int64_t *a) { ++ printf("%ld\n", a[0]); ++ printf("%ld\n", a[1]); ++} +diff --git a/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func011.c b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func011.c +new file mode 100644 +index 0000000..f830d74 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func011.c +@@ -0,0 +1,6 @@ ++#include ++#include ++void c_func_(int_least8_t *a) { ++ printf("%hhd\n", a[0]); ++ printf("%hhd\n", a[1]); ++} +diff --git a/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func012.c b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func012.c +new file mode 100644 +index 0000000..6ffd7e3 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func012.c +@@ -0,0 +1,6 @@ ++#include ++#include ++void c_func_(int_least16_t *a) { ++ printf("%hd\n", a[0]); ++ printf("%hd\n", a[1]); ++} +diff --git a/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func013.c b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func013.c +new file mode 100644 +index 0000000..4b367cb +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func013.c +@@ -0,0 +1,6 @@ ++#include ++#include ++void c_func_(int_least32_t *a) { ++ printf("%d\n", a[0]); ++ printf("%d\n", a[1]); ++} +diff --git a/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func014.c b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func014.c +new file mode 100644 +index 0000000..6b2d5b3 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func014.c +@@ -0,0 +1,6 @@ ++#include ++#include ++void c_func_(int_least64_t *a) { ++ printf("%ld\n", a[0]); ++ printf("%ld\n", a[1]); ++} +diff --git a/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func015.c b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func015.c +new file mode 100644 +index 0000000..81d223a +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func015.c +@@ -0,0 +1,6 @@ ++#include ++#include ++void c_func_(int_fast8_t *a) { ++ printf("%hhd\n", a[0]); ++ printf("%hhd\n", a[1]); ++} +diff --git a/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func016.c b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func016.c +new file mode 100644 +index 0000000..297be3a +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func016.c +@@ -0,0 +1,6 @@ ++#include ++#include ++void c_func_(int_fast16_t *a) { ++ printf("%ld\n", a[0]); ++ printf("%ld\n", a[1]); ++} +diff --git a/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func017.c b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func017.c +new file mode 100644 +index 0000000..8eb5818 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func017.c +@@ -0,0 +1,6 @@ ++#include ++#include ++void c_func_(int_fast32_t *a) { ++ printf("%ld\n", a[0]); ++ printf("%ld\n", a[1]); ++} +diff --git a/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func018.c b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func018.c +new file mode 100644 +index 0000000..030b1f7 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func018.c +@@ -0,0 +1,6 @@ ++#include ++#include ++void c_func_(int_fast64_t *a) { ++ printf("%ld\n", a[0]); ++ printf("%ld\n", a[1]); ++} +diff --git a/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func019.c b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func019.c +new file mode 100644 +index 0000000..babfc75 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func019.c +@@ -0,0 +1,6 @@ ++#include ++#include ++void c_func_(intmax_t *a) { ++ printf("%ld\n", a[0]); ++ printf("%ld\n", a[1]); ++} +diff --git a/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func020.c b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func020.c +new file mode 100644 +index 0000000..26c7726 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func020.c +@@ -0,0 +1,6 @@ ++#include ++#include ++void c_func_(intptr_t *a) { ++ printf("%ld\n", a[0]); ++ printf("%ld\n", a[1]); ++} +diff --git a/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func021.c b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func021.c +new file mode 100644 +index 0000000..a73f11b +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/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_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func022.c b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func022.c +new file mode 100644 +index 0000000..688f3c0 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func022.c +@@ -0,0 +1,5 @@ ++#include ++void c_func_(double *a) { ++ printf("%20lf\n", a[0]); ++ printf("%20lf\n", a[1]); ++} +diff --git a/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func023.c b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func023.c +new file mode 100644 +index 0000000..af86ba3 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func023.c +@@ -0,0 +1,5 @@ ++#include ++void c_func_(long double *a) { ++ printf("%20Lf\n", a[0]); ++ printf("%20Lf\n", a[1]); ++} +diff --git a/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func024.c b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func024.c +new file mode 100644 +index 0000000..1d34f02 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func024.c +@@ -0,0 +1,6 @@ ++#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])); ++} +diff --git a/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func025.c b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func025.c +new file mode 100644 +index 0000000..12b9abb +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func025.c +@@ -0,0 +1,6 @@ ++#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])); ++} +diff --git a/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func026.c b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func026.c +new file mode 100644 +index 0000000..78011d4 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func026.c +@@ -0,0 +1,6 @@ ++#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])); ++} +diff --git a/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func027.c b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func027.c +new file mode 100644 +index 0000000..91a49b5 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/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_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func028.c b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func028.c +new file mode 100644 +index 0000000..9335307 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/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_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main001.f90 b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main001.f90 +new file mode 100644 +index 0000000..de41e30 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/003_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 ++ integer :: my_x(2) = 1 ++ interface ++ subroutine c_func(b) bind(c, name = "c_func_") ++ integer :: b(2) ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main002.f90 b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main002.f90 +new file mode 100644 +index 0000000..5cbfa78 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/003_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 ++ integer(2) :: my_x(2) = 1 ++ interface ++ subroutine c_func(b) bind(c, name = "c_func_") ++ integer(2) :: b(2) ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main003.f90 b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main003.f90 +new file mode 100644 +index 0000000..d7c5825 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/003_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 ++ integer(8) :: my_x(2) = 1 ++ interface ++ subroutine c_func(b) bind(c, name = "c_func_") ++ integer(8) :: b(2) ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main004.f90 b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main004.f90 +new file mode 100644 +index 0000000..6f54746 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/003_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 ++ integer(8) :: my_x(2) = 1 ++ interface ++ subroutine c_func(b) bind(c, name = "c_func_") ++ integer(8) :: b(2) ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main005.f90 b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main005.f90 +new file mode 100644 +index 0000000..14607e5 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/003_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 ++ integer(1) :: my_x(2) = 65 ++ interface ++ subroutine c_func(b) bind(c, name = "c_func_") ++ integer(1) :: b(2) ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main006.f90 b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main006.f90 +new file mode 100644 +index 0000000..56d0f08 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/003_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 ++ integer(8) :: my_x(2) = 3 ++ interface ++ subroutine c_func(b) bind(c, name = "c_func_") ++ integer(8) :: b(2) ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main007.f90 b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main007.f90 +new file mode 100644 +index 0000000..73dd12f +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/003_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 ++ integer(1) :: my_x(2) = 1 ++ interface ++ subroutine c_func(b) bind(c, name = "c_func_") ++ integer(1) :: b(2) ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main008.f90 b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main008.f90 +new file mode 100644 +index 0000000..c496284 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/003_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 ++ integer(2) :: my_x(2) = 1 ++ interface ++ subroutine c_func(b) bind(c, name = "c_func_") ++ integer(2) :: b(2) ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main009.f90 b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main009.f90 +new file mode 100644 +index 0000000..aad0c4a +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/003_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 ++ integer(4) :: my_x(2) = 1 ++ interface ++ subroutine c_func(b) bind(c, name = "c_func_") ++ integer(4) :: b(2) ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main010.f90 b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main010.f90 +new file mode 100644 +index 0000000..495b43a +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/003_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 ++ integer(8) :: my_x(2) = 1 ++ interface ++ subroutine c_func(b) bind(c, name = "c_func_") ++ integer(8) :: b(2) ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main011.f90 b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main011.f90 +new file mode 100644 +index 0000000..dcde21c +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/003_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 ++ integer(1) :: my_x(2) = 1 ++ interface ++ subroutine c_func(b) bind(c, name = "c_func_") ++ integer(1) :: b(2) ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main012.f90 b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main012.f90 +new file mode 100644 +index 0000000..6399871 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/003_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 ++ integer(2) :: my_x(2) = 1 ++ interface ++ subroutine c_func(b) bind(c, name = "c_func_") ++ integer(2) :: b(2) ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main013.f90 b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main013.f90 +new file mode 100644 +index 0000000..b49842e +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/003_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 ++ integer(4) :: my_x(2) = 1 ++ interface ++ subroutine c_func(b) bind(c, name = "c_func_") ++ integer(4) :: b(2) ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main014.f90 b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main014.f90 +new file mode 100644 +index 0000000..66fe325 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/003_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 ++ integer(8) :: my_x(2) = 1 ++ interface ++ subroutine c_func(b) bind(c, name = "c_func_") ++ integer(8) :: b(2) ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main015.f90 b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main015.f90 +new file mode 100644 +index 0000000..bfcf6a3 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/003_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 ++ integer(1) :: my_x(2) = 1 ++ interface ++ subroutine c_func(b) bind(c, name = "c_func_") ++ integer(1) :: b(2) ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main016.f90 b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main016.f90 +new file mode 100644 +index 0000000..f9eef1c +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/003_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 ++ integer(8) :: my_x(2) = 1 ++ interface ++ subroutine c_func(b) bind(c, name = "c_func_") ++ integer(8) :: b(2) ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main017.f90 b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main017.f90 +new file mode 100644 +index 0000000..8f293c1 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/003_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 ++ integer(8) :: my_x(2) = 1 ++ interface ++ subroutine c_func(b) bind(c, name = "c_func_") ++ integer(8) :: b(2) ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main018.f90 b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main018.f90 +new file mode 100644 +index 0000000..8f01271 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/003_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 ++ integer(8) :: my_x(2) = 1 ++ interface ++ subroutine c_func(b) bind(c, name = "c_func_") ++ integer(8) :: b(2) ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main019.f90 b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main019.f90 +new file mode 100644 +index 0000000..1102216 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/003_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 ++ integer(8) :: my_x(2) = 1 ++ interface ++ subroutine c_func(b) bind(c, name = "c_func_") ++ integer(8) :: b(2) ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main020.f90 b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main020.f90 +new file mode 100644 +index 0000000..8976d63 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/003_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 ++ integer(8) :: my_x(2) = 1 ++ interface ++ subroutine c_func(b) bind(c, name = "c_func_") ++ integer(8) :: b(2) ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main021.f90 b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main021.f90 +new file mode 100644 +index 0000000..ae733f9 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/003_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 ++ real(4) :: my_x(2) = 12345678.7654321 ++ interface ++ subroutine c_func(b) bind(c, name = "c_func_") ++ real(4) :: b(2) ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main022.f90 b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main022.f90 +new file mode 100644 +index 0000000..319d83a +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/003_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 ++ real(8) :: my_x(2) = 12345678.7654321 ++ interface ++ subroutine c_func(b) bind(c, name = "c_func_") ++ real(8) :: b(2) ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main023.f90 b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main023.f90 +new file mode 100644 +index 0000000..9aad10e +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/003_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) ++ real(K) :: my_x(2) = 12345678.7654321 ++ interface ++ 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_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main024.f90 b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main024.f90 +new file mode 100644 +index 0000000..47bdc29 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/003_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 ++ complex(4) :: my_x(2) = (-3.14159265358979, 1) ++ interface ++ subroutine c_func(b) bind(c, name = "c_func_") ++ complex(4) :: b(2) ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main025.f90 b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main025.f90 +new file mode 100644 +index 0000000..9390897 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/003_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 ++ complex(8) :: my_x(2) = (-3.14159265358979, 1) ++ interface ++ subroutine c_func(b) bind(c, name = "c_func_") ++ complex(8) :: b(2) ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main026.f90 b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main026.f90 +new file mode 100644 +index 0000000..e07c0ae +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/003_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) ++ complex(K) :: my_x(2) = (-3.14159265358979, 1) ++ interface ++ 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_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main027.f90 b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main027.f90 +new file mode 100644 +index 0000000..7a89da0 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/003_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 ++ logical(1) :: my_x(2) = .TRUE. ++ interface ++ subroutine c_func(b) bind(c, name = "c_func_") ++ logical(1) :: b(2) ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main028.f90 b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main028.f90 +new file mode 100644 +index 0000000..b4fd1ba +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/003_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 ++ character(1) :: my_x(2) = 'a' ++ interface ++ subroutine c_func(b) bind(c, name = "c_func_") ++ character(1) :: b(2) ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/result.md b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/result.md +new file mode 100644 +index 0000000..f15fe53 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/result.md +@@ -0,0 +1,29 @@ ++ | test | gfortran | flang | nvfortran| ++ | 001 | PASS | PASS | PASS | ++ | 002 | PASS | PASS | PASS | ++ | 003 | PASS | PASS | PASS | ++ | 004 | PASS | PASS | PASS | ++ | 005 | PASS | PASS | PASS | ++ | 006 | PASS | PASS | PASS | ++ | 007 | PASS | PASS | PASS | ++ | 008 | PASS | PASS | PASS | ++ | 009 | PASS | PASS | PASS | ++ | 010 | PASS | PASS | PASS | ++ | 011 | PASS | PASS | PASS | ++ | 012 | PASS | PASS | PASS | ++ | 013 | PASS | PASS | PASS | ++ | 014 | PASS | PASS | PASS | ++ | 015 | PASS | PASS | PASS | ++ | 016 | PASS | PASS | PASS | ++ | 017 | PASS | PASS | PASS | ++ | 018 | PASS | PASS | PASS | ++ | 019 | PASS | PASS | PASS | ++ | 020 | PASS | PASS | PASS | ++ | 021 | PASS | PASS | PASS | ++ | 022 | PASS | PASS | PASS | ++ | 023 | PASS | PASS | ERROR | ++ | 024 | PASS | PASS | PASS | ++ | 025 | PASS | PASS | PASS | ++ | 026 | PASS | PASS | ERROR | ++ | 027 | PASS | PASS | PASS | ++ | 028 | PASS | PASS | PASS | +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/run.sh b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/run.sh +new file mode 100644 +index 0000000..dbbd62f +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/run.sh +@@ -0,0 +1,22 @@ ++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 ++echo "----- nvfortran result : " ++clang c_func$i.c -c -o c-test.o ++nvfortran fortran_main$i.f90 -c -o fortran-test.o ++nvfortran 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_array/004_fortran_call_c_allocatable/c_func001.c b/test/interoperability_with_c_fortran_call_c_array/004_fortran_call_c_allocatable/c_func001.c +new file mode 100644 +index 0000000..6c2e3c9 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/004_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_array/004_fortran_call_c_allocatable/c_func002.c b/test/interoperability_with_c_fortran_call_c_array/004_fortran_call_c_allocatable/c_func002.c +new file mode 100644 +index 0000000..366ed68 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/004_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_array/004_fortran_call_c_allocatable/fortran_main001.f90 b/test/interoperability_with_c_fortran_call_c_array/004_fortran_call_c_allocatable/fortran_main001.f90 +new file mode 100644 +index 0000000..0832e9c +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/004_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_array/004_fortran_call_c_allocatable/fortran_main002.f90 b/test/interoperability_with_c_fortran_call_c_array/004_fortran_call_c_allocatable/fortran_main002.f90 +new file mode 100644 +index 0000000..89e27a6 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/004_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_array/004_fortran_call_c_allocatable/result.md b/test/interoperability_with_c_fortran_call_c_array/004_fortran_call_c_allocatable/result.md +new file mode 100644 +index 0000000..555c792 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/004_fortran_call_c_allocatable/result.md +@@ -0,0 +1,3 @@ ++ | test | gfortran | flang | nvfortran| ++ | 001 | PASS | PASS | PASS | ++ | 002 | PASS | PASS | PASS | +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_array/004_fortran_call_c_allocatable/run.sh b/test/interoperability_with_c_fortran_call_c_array/004_fortran_call_c_allocatable/run.sh +new file mode 100644 +index 0000000..8b4b5b9 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/004_fortran_call_c_allocatable/run.sh +@@ -0,0 +1,22 @@ ++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 ++echo "----- nvfortran result : " ++clang c_func$i.c -c -o c-test.o ++nvfortran fortran_main$i.f90 -c -o fortran-test.o ++nvfortran 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_array/005_fortran_call_c_string/c_func001.c b/test/interoperability_with_c_fortran_call_c_array/005_fortran_call_c_string/c_func001.c +new file mode 100644 +index 0000000..8df9e4b +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/005_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_array/005_fortran_call_c_string/c_func002.c b/test/interoperability_with_c_fortran_call_c_array/005_fortran_call_c_string/c_func002.c +new file mode 100644 +index 0000000..22ed279 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/005_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_array/005_fortran_call_c_string/c_func003.c b/test/interoperability_with_c_fortran_call_c_array/005_fortran_call_c_string/c_func003.c +new file mode 100644 +index 0000000..6d6d589 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/005_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_array/005_fortran_call_c_string/c_func004.c b/test/interoperability_with_c_fortran_call_c_array/005_fortran_call_c_string/c_func004.c +new file mode 100644 +index 0000000..6d7781a +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/005_fortran_call_c_string/c_func004.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_array/005_fortran_call_c_string/fortran_main001.f90 b/test/interoperability_with_c_fortran_call_c_array/005_fortran_call_c_string/fortran_main001.f90 +new file mode 100644 +index 0000000..aa23d5d +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/005_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_array/005_fortran_call_c_string/fortran_main002.f90 b/test/interoperability_with_c_fortran_call_c_array/005_fortran_call_c_string/fortran_main002.f90 +new file mode 100644 +index 0000000..e9f831e +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/005_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_array/005_fortran_call_c_string/fortran_main003.f90 b/test/interoperability_with_c_fortran_call_c_array/005_fortran_call_c_string/fortran_main003.f90 +new file mode 100644 +index 0000000..105de51 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/005_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_array/005_fortran_call_c_string/fortran_main004.f90 b/test/interoperability_with_c_fortran_call_c_array/005_fortran_call_c_string/fortran_main004.f90 +new file mode 100644 +index 0000000..46b8a73 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/005_fortran_call_c_string/fortran_main004.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_array/005_fortran_call_c_string/result.md b/test/interoperability_with_c_fortran_call_c_array/005_fortran_call_c_string/result.md +new file mode 100644 +index 0000000..206c907 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/005_fortran_call_c_string/result.md +@@ -0,0 +1,5 @@ ++ | test | gfortran | flang | nvfortran| ++ | 001 | PASS | PASS | PASS | ++ | 002 | PASS | PASS | PASS | ++ | 003 | PASS | PASS | PASS | ++ | 004 | PASS | PASS | PASS | +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_array/005_fortran_call_c_string/run.sh b/test/interoperability_with_c_fortran_call_c_array/005_fortran_call_c_string/run.sh +new file mode 100644 +index 0000000..45c6bb0 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_array/005_fortran_call_c_string/run.sh +@@ -0,0 +1,22 @@ ++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 ++echo "----- nvfortran result : " ++clang c_func$i.c -c -o c-test.o ++nvfortran fortran_main$i.f90 -c -o fortran-test.o ++nvfortran c-test.o fortran-test.o ++./a.out ++rm *.o a.out ++done +\ No newline at end of file +-- +2.25.1 + diff --git a/9-test-interoperability-with-c-fortran-call-c-function.patch b/9-test-interoperability-with-c-fortran-call-c-function.patch new file mode 100644 index 0000000..4239fd5 --- /dev/null +++ b/9-test-interoperability-with-c-fortran-call-c-function.patch @@ -0,0 +1,7770 @@ +From 67de0ab8c92f170c4e758430393c1bd2ccf29c5f Mon Sep 17 00:00:00 2001 +From: xieyihui +Date: Fri, 18 Nov 2022 12:41:41 +0800 +Subject: [PATCH] Add new test cases about function for interoperability with C + about fortran call C + +diff --git a/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func001.c b/test/interoperability_with_c_fortran_call_c_function/001_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_function/001_fortran_call_c_function_ptr/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_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func002.c b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func002.c +new file mode 100644 +index 0000000..6c172b6 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func002.c +@@ -0,0 +1,5 @@ ++#include ++short* c_func_(short *a) { ++ printf("%5d\n", *a); ++ return a; ++} +diff --git a/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func003.c b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func003.c +new file mode 100644 +index 0000000..b1b4838 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/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_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func004.c b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func004.c +new file mode 100644 +index 0000000..90896f0 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/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_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func005.c b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func005.c +new file mode 100644 +index 0000000..91e7d0d +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/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_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func006.c b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func006.c +new file mode 100644 +index 0000000..13ec31a +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/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_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func007.c b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func007.c +new file mode 100644 +index 0000000..e883fd3 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/001_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_function/001_fortran_call_c_function_ptr/c_func008.c b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func008.c +new file mode 100644 +index 0000000..a8a3209 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func008.c +@@ -0,0 +1,6 @@ ++#include ++#include ++int16_t* c_func_(int16_t *a) { ++ printf("%5hd\n", *a); ++ return a; ++} +diff --git a/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func009.c b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func009.c +new file mode 100644 +index 0000000..9ad7e76 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func009.c +@@ -0,0 +1,6 @@ ++#include ++#include ++int32_t* c_func_(int32_t *a) { ++ printf("%5d\n", *a); ++ return a; ++} +diff --git a/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func010.c b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func010.c +new file mode 100644 +index 0000000..6bff1b5 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func010.c +@@ -0,0 +1,6 @@ ++#include ++#include ++int64_t* c_func_(int64_t *a) { ++ printf("%5ld\n", *a); ++ return a; ++} +diff --git a/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func011.c b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func011.c +new file mode 100644 +index 0000000..4a5970a +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func011.c +@@ -0,0 +1,6 @@ ++#include ++#include ++int_least8_t* c_func_(int_least8_t *a) { ++ printf("%5hhd\n", *a); ++ return a; ++} +diff --git a/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func012.c b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func012.c +new file mode 100644 +index 0000000..72ac1a4 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func012.c +@@ -0,0 +1,6 @@ ++#include ++#include ++int_least16_t* c_func_(int_least16_t *a) { ++ printf("%5hd\n", *a); ++ return a; ++} +diff --git a/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func013.c b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func013.c +new file mode 100644 +index 0000000..771e48b +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func013.c +@@ -0,0 +1,6 @@ ++#include ++#include ++int_least32_t* c_func_(int_least32_t *a) { ++ printf("%d\n", *a); ++ return a; ++} +diff --git a/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func014.c b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func014.c +new file mode 100644 +index 0000000..c782984 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func014.c +@@ -0,0 +1,6 @@ ++#include ++#include ++int_least64_t* c_func_(int_least64_t *a) { ++ printf("%5ld\n", *a); ++ return a; ++} +diff --git a/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func015.c b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func015.c +new file mode 100644 +index 0000000..96452b1 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func015.c +@@ -0,0 +1,6 @@ ++#include ++#include ++int_fast8_t* c_func_(int_fast8_t *a) { ++ printf("%5hhd\n", *a); ++ return a; ++} +diff --git a/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func016.c b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func016.c +new file mode 100644 +index 0000000..27bac38 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func016.c +@@ -0,0 +1,6 @@ ++#include ++#include ++int_fast16_t* c_func_(int_fast16_t *a) { ++ printf("%5ld\n", *a); ++ return a; ++} +diff --git a/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func017.c b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func017.c +new file mode 100644 +index 0000000..f4e0e76 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func017.c +@@ -0,0 +1,6 @@ ++#include ++#include ++int_fast32_t* c_func_(int_fast32_t *a) { ++ printf("%ld\n", *a); ++ return a; ++} +diff --git a/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func018.c b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func018.c +new file mode 100644 +index 0000000..ee80d9a +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func018.c +@@ -0,0 +1,6 @@ ++#include ++#include ++int_fast64_t* c_func_(int_fast64_t *a) { ++ printf("%5ld\n", *a); ++ return a; ++} +diff --git a/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func019.c b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func019.c +new file mode 100644 +index 0000000..a6205df +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func019.c +@@ -0,0 +1,6 @@ ++#include ++#include ++intmax_t* c_func_(intmax_t *a) { ++ printf("%5ld\n", *a); ++ return a; ++} +diff --git a/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func020.c b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func020.c +new file mode 100644 +index 0000000..3fc6c40 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func020.c +@@ -0,0 +1,6 @@ ++#include ++#include ++intptr_t* c_func_(intptr_t *a) { ++ printf("%5ld\n", *a); ++ return a; ++} +diff --git a/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func021.c b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func021.c +new file mode 100644 +index 0000000..4584a17 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/001_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_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func022.c b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func022.c +new file mode 100644 +index 0000000..6c20627 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/001_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_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func023.c b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func023.c +new file mode 100644 +index 0000000..4067c00 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/001_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_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func024.c b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func024.c +new file mode 100644 +index 0000000..8d5cbd6 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func024.c +@@ -0,0 +1,6 @@ ++#include ++#include ++float _Complex* c_func_(float _Complex *t) { ++ printf("%0.20f + %0.20fi\n", creal(*t), cimag(*t)); ++ return t; ++} +diff --git a/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func025.c b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func025.c +new file mode 100644 +index 0000000..2cc6c66 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func025.c +@@ -0,0 +1,6 @@ ++#include ++#include ++double _Complex* c_func_(double _Complex *t) { ++ printf("%0.20lf + %0.20lfi\n", creal(*t), cimag(*t)); ++ return t; ++} +diff --git a/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func026.c b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func026.c +new file mode 100644 +index 0000000..4cd06f9 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func026.c +@@ -0,0 +1,6 @@ ++#include ++#include ++long double _Complex* c_func_(long double _Complex *t) { ++ printf("%0.20f + %0.20fi\n", creal(*t), cimag(*t)); ++ return t; ++} +diff --git a/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func027.c b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func027.c +new file mode 100644 +index 0000000..d576c9e +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/001_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_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func028.c b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func028.c +new file mode 100644 +index 0000000..6024629 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func028.c +@@ -0,0 +1,5 @@ ++#include ++char* c_func_(char *t) { ++ printf("%c\n", *t); ++ return t; ++} +diff --git a/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main001.f90 b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main001.f90 +new file mode 100644 +index 0000000..0162f22 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/001_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 ++! ++program main ++ integer :: my_x = 1 ++ interface ++ 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_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main002.f90 b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main002.f90 +new file mode 100644 +index 0000000..9398800 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/001_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) ++ integer(2) :: b ++ integer(2), pointer :: res ++ end ++ end interface ++ print '(I5)', c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main003.f90 b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main003.f90 +new file mode 100644 +index 0000000..8905eab +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/001_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) ++ integer(8) :: b ++ integer(8), pointer :: res ++ end ++ end interface ++ print '(I5)', c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main004.f90 b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main004.f90 +new file mode 100644 +index 0000000..6ce9768 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/001_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) ++ integer(8) :: b ++ integer(8), pointer :: res ++ end ++ end interface ++ print '(I5)', c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main005.f90 b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main005.f90 +new file mode 100644 +index 0000000..9445938 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/001_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 ++! ++program main ++ integer(1) :: my_x = 65 ++ interface ++ 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_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main006.f90 b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main006.f90 +new file mode 100644 +index 0000000..7ead44f +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/001_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) ++ integer(8) :: b ++ integer(8), pointer :: res ++ end ++ end interface ++ print '(I5)', c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main007.f90 b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main007.f90 +new file mode 100644 +index 0000000..4a80499 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/001_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) ++ integer(1) :: b ++ integer(1), pointer :: res ++ end ++ end interface ++ print '(I5)', c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main008.f90 b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main008.f90 +new file mode 100644 +index 0000000..d85e1bb +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/001_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) ++ integer(2) :: b ++ integer(2), pointer :: res ++ end ++ end interface ++ print '(I5)', c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main009.f90 b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main009.f90 +new file mode 100644 +index 0000000..a613e46 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/001_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) ++ integer(4) :: b ++ integer(4), pointer :: res ++ end ++ end interface ++ print '(I5)', c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main010.f90 b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main010.f90 +new file mode 100644 +index 0000000..c300630 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/001_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) ++ integer(8) :: b ++ integer(8), pointer :: res ++ end ++ end interface ++ print '(I5)', c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main011.f90 b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main011.f90 +new file mode 100644 +index 0000000..c5b3ec4 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/001_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 ++! ++program main ++ integer(1) :: my_x = 1 ++ interface ++ 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_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main012.f90 b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main012.f90 +new file mode 100644 +index 0000000..50d736a +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/001_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 ++! ++program main ++ integer(2) :: my_x = 1 ++ interface ++ 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_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main013.f90 b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main013.f90 +new file mode 100644 +index 0000000..f1ed742 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/001_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 ++! ++program main ++ integer(4) :: my_x = 1 ++ interface ++ 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_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main014.f90 b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main014.f90 +new file mode 100644 +index 0000000..d508d97 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/001_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 ++! ++program main ++ integer(8) :: my_x = 1 ++ interface ++ 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_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main015.f90 b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main015.f90 +new file mode 100644 +index 0000000..626f02a +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/001_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 ++! ++program main ++ integer(1) :: my_x = 1 ++ interface ++ 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_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main016.f90 b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main016.f90 +new file mode 100644 +index 0000000..2a41aa9 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/001_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 ++! ++program main ++ integer(8) :: my_x = 1 ++ interface ++ 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_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main017.f90 b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main017.f90 +new file mode 100644 +index 0000000..1f4ae6a +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/001_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 ++! ++program main ++ integer(8) :: my_x = 1 ++ interface ++ 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_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main018.f90 b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main018.f90 +new file mode 100644 +index 0000000..9c99b13 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/001_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 ++! ++program main ++ integer(8) :: my_x = 1 ++ interface ++ 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_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main019.f90 b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main019.f90 +new file mode 100644 +index 0000000..4bdcd0c +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/001_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) ++ integer(8) :: b ++ integer(8), pointer :: res ++ end ++ end interface ++ print *, c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main020.f90 b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main020.f90 +new file mode 100644 +index 0000000..80b302e +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/001_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) ++ integer(8) :: b ++ integer(8), pointer :: res ++ end ++ end interface ++ print '(I5)', c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main021.f90 b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main021.f90 +new file mode 100644 +index 0000000..3760036 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/001_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) ++ 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_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main022.f90 b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main022.f90 +new file mode 100644 +index 0000000..491887f +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/001_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) ++ 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_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main023.f90 b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main023.f90 +new file mode 100644 +index 0000000..a8861c9 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/001_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 ++! ++program main ++ integer, parameter :: K = selected_real_kind(16) ++ real(K) :: my_x = 3.1415926535 ++ interface ++ function c_func(b) result(res) ++ integer, parameter :: K = selected_real_kind(16) ++ real(K) :: b ++ real(K), pointer :: res ++ end ++ end interface ++ print '(F20.10)', c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main024.f90 b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main024.f90 +new file mode 100644 +index 0000000..2a49f2a +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/001_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 ++! ++program main ++ complex(4) :: my_x = (3.1415926535, 1) ++ interface ++ 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_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main025.f90 b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main025.f90 +new file mode 100644 +index 0000000..e329c2a +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/001_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 ++! ++program main ++ complex(8) :: my_x = (3.1415926535, 1) ++ interface ++ 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_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main026.f90 b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main026.f90 +new file mode 100644 +index 0000000..6b2b0a2 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/001_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 ++! ++program main ++ integer, parameter :: K = selected_real_kind(16) ++ complex(K) :: my_x = (3.1415926535, 1) ++ interface ++ function c_func(b) result(res) ++ integer, parameter :: K = selected_real_kind(16) ++ complex(K) :: b ++ complex(K), pointer :: res ++ end ++ end interface ++ print '(F20.10)', c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main027.f90 b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main027.f90 +new file mode 100644 +index 0000000..28efc8d +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/001_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) ++ logical(1) :: b ++ logical(1), pointer :: res ++ end ++ end interface ++ print *, c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main028.f90 b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main028.f90 +new file mode 100644 +index 0000000..37a0198 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/001_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) ++ character(1) :: b ++ character(1), pointer :: res ++ end ++ end interface ++ print *, c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/result.md b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/result.md +new file mode 100644 +index 0000000..8facd6e +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/result.md +@@ -0,0 +1,29 @@ ++ | test | gfortran | flang | nvfortran| ++ | 001 | PASS | ERROR | ERROR | ++ | 002 | PASS | ERROR | ERROR | ++ | 003 | PASS | ERROR | ERROR | ++ | 004 | PASS | ERROR | ERROR | ++ | 005 | PASS | ERROR | ERROR | ++ | 006 | PASS | ERROR | ERROR | ++ | 007 | PASS | ERROR | ERROR | ++ | 008 | PASS | ERROR | ERROR | ++ | 009 | PASS | ERROR | ERROR | ++ | 010 | PASS | ERROR | ERROR | ++ | 011 | PASS | ERROR | ERROR | ++ | 012 | PASS | ERROR | ERROR | ++ | 013 | PASS | ERROR | ERROR | ++ | 014 | PASS | ERROR | ERROR | ++ | 015 | PASS | ERROR | ERROR | ++ | 016 | PASS | ERROR | ERROR | ++ | 017 | PASS | ERROR | ERROR | ++ | 018 | PASS | ERROR | ERROR | ++ | 019 | PASS | ERROR | ERROR | ++ | 020 | PASS | ERROR | ERROR | ++ | 021 | PASS | ERROR | ERROR | ++ | 022 | PASS | ERROR | ERROR | ++ | 023 | PASS | ERROR | ERROR | ++ | 024 | PASS | ERROR | ERROR | ++ | 025 | PASS | ERROR | ERROR | ++ | 026 | PASS | ERROR | ERROR | ++ | 027 | PASS | ERROR | PASS | ++ | 028 | ERROR | ERROR | ERROR | +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/run.sh b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/run.sh +new file mode 100644 +index 0000000..dbbd62f +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/run.sh +@@ -0,0 +1,22 @@ ++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 ++echo "----- nvfortran result : " ++clang c_func$i.c -c -o c-test.o ++nvfortran fortran_main$i.f90 -c -o fortran-test.o ++nvfortran 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_function/002_fortran_call_c_function_ptr_bindc/c_func001.c b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func001.c +new file mode 100644 +index 0000000..89defd9 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/002_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_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func002.c b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func002.c +new file mode 100644 +index 0000000..6c172b6 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func002.c +@@ -0,0 +1,5 @@ ++#include ++short* c_func_(short *a) { ++ printf("%5d\n", *a); ++ return a; ++} +diff --git a/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func003.c b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func003.c +new file mode 100644 +index 0000000..b1b4838 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/002_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_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func004.c b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func004.c +new file mode 100644 +index 0000000..90896f0 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/002_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_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func005.c b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func005.c +new file mode 100644 +index 0000000..91e7d0d +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/002_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_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func006.c b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func006.c +new file mode 100644 +index 0000000..13ec31a +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/002_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_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func007.c b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func007.c +new file mode 100644 +index 0000000..e883fd3 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/002_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_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func008.c b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func008.c +new file mode 100644 +index 0000000..a8a3209 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func008.c +@@ -0,0 +1,6 @@ ++#include ++#include ++int16_t* c_func_(int16_t *a) { ++ printf("%5hd\n", *a); ++ return a; ++} +diff --git a/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func009.c b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func009.c +new file mode 100644 +index 0000000..9ad7e76 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func009.c +@@ -0,0 +1,6 @@ ++#include ++#include ++int32_t* c_func_(int32_t *a) { ++ printf("%5d\n", *a); ++ return a; ++} +diff --git a/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func010.c b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func010.c +new file mode 100644 +index 0000000..6bff1b5 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func010.c +@@ -0,0 +1,6 @@ ++#include ++#include ++int64_t* c_func_(int64_t *a) { ++ printf("%5ld\n", *a); ++ return a; ++} +diff --git a/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func011.c b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func011.c +new file mode 100644 +index 0000000..4a5970a +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_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; ++} +diff --git a/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func012.c b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func012.c +new file mode 100644 +index 0000000..72ac1a4 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_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; ++} +diff --git a/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func013.c b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func013.c +new file mode 100644 +index 0000000..771e48b +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_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; ++} +diff --git a/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func014.c b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func014.c +new file mode 100644 +index 0000000..c782984 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_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; ++} +diff --git a/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func015.c b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func015.c +new file mode 100644 +index 0000000..96452b1 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_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; ++} +diff --git a/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func016.c b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func016.c +new file mode 100644 +index 0000000..27bac38 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_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; ++} +diff --git a/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func017.c b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func017.c +new file mode 100644 +index 0000000..f4e0e76 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_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; ++} +diff --git a/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func018.c b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func018.c +new file mode 100644 +index 0000000..ee80d9a +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_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; ++} +diff --git a/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func019.c b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func019.c +new file mode 100644 +index 0000000..a6205df +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func019.c +@@ -0,0 +1,6 @@ ++#include ++#include ++intmax_t* c_func_(intmax_t *a) { ++ printf("%5ld\n", *a); ++ return a; ++} +diff --git a/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func020.c b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func020.c +new file mode 100644 +index 0000000..3fc6c40 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func020.c +@@ -0,0 +1,6 @@ ++#include ++#include ++intptr_t* c_func_(intptr_t *a) { ++ printf("%5ld\n", *a); ++ return a; ++} +diff --git a/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func021.c b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func021.c +new file mode 100644 +index 0000000..4584a17 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/002_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_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func022.c b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func022.c +new file mode 100644 +index 0000000..6c20627 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/002_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_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func023.c b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func023.c +new file mode 100644 +index 0000000..4067c00 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/002_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_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func024.c b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func024.c +new file mode 100644 +index 0000000..8d5cbd6 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func024.c +@@ -0,0 +1,6 @@ ++#include ++#include ++float _Complex* c_func_(float _Complex *t) { ++ printf("%0.20f + %0.20fi\n", creal(*t), cimag(*t)); ++ return t; ++} +diff --git a/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func025.c b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func025.c +new file mode 100644 +index 0000000..2cc6c66 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func025.c +@@ -0,0 +1,6 @@ ++#include ++#include ++double _Complex* c_func_(double _Complex *t) { ++ printf("%0.20lf + %0.20lfi\n", creal(*t), cimag(*t)); ++ return t; ++} +diff --git a/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func026.c b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func026.c +new file mode 100644 +index 0000000..4cd06f9 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func026.c +@@ -0,0 +1,6 @@ ++#include ++#include ++long double _Complex* c_func_(long double _Complex *t) { ++ printf("%0.20f + %0.20fi\n", creal(*t), cimag(*t)); ++ return t; ++} +diff --git a/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func027.c b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func027.c +new file mode 100644 +index 0000000..d576c9e +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/002_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_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func028.c b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func028.c +new file mode 100644 +index 0000000..6024629 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func028.c +@@ -0,0 +1,5 @@ ++#include ++char* c_func_(char *t) { ++ printf("%c\n", *t); ++ return t; ++} +diff --git a/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main001.f90 b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main001.f90 +new file mode 100644 +index 0000000..eea8ab6 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/002_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 with bindc ++! ++program main ++ integer :: my_x = 1 ++ interface ++ 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_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main002.f90 b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main002.f90 +new file mode 100644 +index 0000000..75ae05d +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/002_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) 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_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main003.f90 b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main003.f90 +new file mode 100644 +index 0000000..0ddcedf +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/002_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) 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_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main004.f90 b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main004.f90 +new file mode 100644 +index 0000000..7383644 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/002_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) 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_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main005.f90 b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main005.f90 +new file mode 100644 +index 0000000..641ec2f +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/002_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) 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_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main006.f90 b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main006.f90 +new file mode 100644 +index 0000000..f5776ff +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/002_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) 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_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main007.f90 b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main007.f90 +new file mode 100644 +index 0000000..9c8f25b +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/002_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) 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_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main008.f90 b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main008.f90 +new file mode 100644 +index 0000000..e057058 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/002_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) 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_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main009.f90 b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main009.f90 +new file mode 100644 +index 0000000..e9c35c1 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/002_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) 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_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main010.f90 b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main010.f90 +new file mode 100644 +index 0000000..d52b3f0 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/002_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) 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_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main011.f90 b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main011.f90 +new file mode 100644 +index 0000000..8427950 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/002_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) 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_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main012.f90 b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main012.f90 +new file mode 100644 +index 0000000..123a9b1 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/002_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) 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_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main013.f90 b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main013.f90 +new file mode 100644 +index 0000000..a8586ed +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/002_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) 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_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main014.f90 b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main014.f90 +new file mode 100644 +index 0000000..6634cd9 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/002_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) 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_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main015.f90 b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main015.f90 +new file mode 100644 +index 0000000..007d56d +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/002_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) 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_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main016.f90 b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main016.f90 +new file mode 100644 +index 0000000..58c20b5 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/002_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) 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_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main017.f90 b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main017.f90 +new file mode 100644 +index 0000000..64ed1d0 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/002_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) 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_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main018.f90 b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main018.f90 +new file mode 100644 +index 0000000..b7ad882 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/002_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) 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_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main019.f90 b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main019.f90 +new file mode 100644 +index 0000000..1197ccb +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/002_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) 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_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main020.f90 b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main020.f90 +new file mode 100644 +index 0000000..9bf210b +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/002_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) 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_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main021.f90 b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main021.f90 +new file mode 100644 +index 0000000..debcb13 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/002_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) 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_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main022.f90 b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main022.f90 +new file mode 100644 +index 0000000..20c50dc +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/002_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) 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_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main023.f90 b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main023.f90 +new file mode 100644 +index 0000000..db15fba +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/002_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) bind(c, name = "c_func_") ++ integer, parameter :: K = selected_real_kind(16) ++ real(K) :: b ++ real(K), pointer :: res ++ end ++ end interface ++ print '(F20.10)', c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main024.f90 b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main024.f90 +new file mode 100644 +index 0000000..418f3ef +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/002_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) 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_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main025.f90 b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main025.f90 +new file mode 100644 +index 0000000..d895ead +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/002_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 with bindc ++! ++program main ++ complex(8) :: my_x = (3.1415926535, 1) ++ interface ++ 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_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main026.f90 b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main026.f90 +new file mode 100644 +index 0000000..4a70cfe +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/002_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 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) bind(c, name = "c_func_") ++ integer, parameter :: K = selected_real_kind(16) ++ complex(K) :: b ++ complex(K), pointer :: res ++ end ++ end interface ++ print '(F20.10)', c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main027.f90 b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main027.f90 +new file mode 100644 +index 0000000..7a59b51 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/002_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) 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_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main028.f90 b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main028.f90 +new file mode 100644 +index 0000000..c76780f +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/002_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) 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_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/result.md b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/result.md +new file mode 100644 +index 0000000..c1f2643 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/result.md +@@ -0,0 +1,29 @@ ++ | test | gfortran | flang | nvfortran| ++ | 001 | PASS | ERROR | ERROR | ++ | 002 | PASS | ERROR | ERROR | ++ | 003 | PASS | ERROR | ERROR | ++ | 004 | PASS | ERROR | ERROR | ++ | 005 | PASS | ERROR | ERROR | ++ | 006 | PASS | ERROR | ERROR | ++ | 007 | PASS | ERROR | ERROR | ++ | 008 | PASS | ERROR | ERROR | ++ | 009 | PASS | ERROR | ERROR | ++ | 010 | PASS | ERROR | ERROR | ++ | 011 | PASS | ERROR | ERROR | ++ | 012 | PASS | ERROR | ERROR | ++ | 013 | PASS | ERROR | ERROR | ++ | 014 | PASS | ERROR | ERROR | ++ | 015 | PASS | ERROR | ERROR | ++ | 016 | PASS | ERROR | ERROR | ++ | 017 | PASS | ERROR | ERROR | ++ | 018 | PASS | ERROR | ERROR | ++ | 019 | PASS | ERROR | ERROR | ++ | 020 | PASS | ERROR | ERROR | ++ | 021 | PASS | ERROR | ERROR | ++ | 022 | PASS | ERROR | ERROR | ++ | 023 | PASS | ERROR | ERROR | ++ | 024 | PASS | ERROR | ERROR | ++ | 025 | PASS | ERROR | ERROR | ++ | 026 | PASS | ERROR | ERROR | ++ | 027 | PASS | ERROR | PASS | ++ | 028 | PASS | ERROR | ERROR | +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/run.sh b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/run.sh +new file mode 100644 +index 0000000..dbbd62f +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/run.sh +@@ -0,0 +1,22 @@ ++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 ++echo "----- nvfortran result : " ++clang c_func$i.c -c -o c-test.o ++nvfortran fortran_main$i.f90 -c -o fortran-test.o ++nvfortran 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_function/003_fortran_call_c_function_value/c_func001.c b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func001.c +new file mode 100644 +index 0000000..92427a4 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/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_fortran_call_c_function/003_fortran_call_c_function_value/c_func002.c b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func002.c +new file mode 100644 +index 0000000..54747f2 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/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_fortran_call_c_function/003_fortran_call_c_function_value/c_func003.c b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func003.c +new file mode 100644 +index 0000000..a9fde92 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/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_fortran_call_c_function/003_fortran_call_c_function_value/c_func004.c b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func004.c +new file mode 100644 +index 0000000..2131b04 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/003_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; ++} +diff --git a/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func005.c b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func005.c +new file mode 100644 +index 0000000..309b9d0 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/003_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; ++} +diff --git a/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func006.c b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func006.c +new file mode 100644 +index 0000000..73982d0 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/003_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; ++} +diff --git a/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func007.c b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func007.c +new file mode 100644 +index 0000000..efaee56 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/003_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; ++} +diff --git a/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func008.c b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func008.c +new file mode 100644 +index 0000000..5a57718 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/003_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; ++} +diff --git a/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func009.c b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func009.c +new file mode 100644 +index 0000000..e076c57 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/003_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; ++} +diff --git a/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func010.c b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func010.c +new file mode 100644 +index 0000000..197e12b +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/003_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; ++} +diff --git a/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func011.c b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func011.c +new file mode 100644 +index 0000000..cc67a34 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/003_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; ++} +diff --git a/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func012.c b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func012.c +new file mode 100644 +index 0000000..484de62 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/003_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; ++} +diff --git a/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func013.c b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func013.c +new file mode 100644 +index 0000000..7a1973e +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/003_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; ++} +diff --git a/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func014.c b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func014.c +new file mode 100644 +index 0000000..d535c60 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/003_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; ++} +diff --git a/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func015.c b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func015.c +new file mode 100644 +index 0000000..cb1989f +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/003_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; ++} +diff --git a/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func016.c b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func016.c +new file mode 100644 +index 0000000..df1b16b +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/003_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; ++} +diff --git a/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func017.c b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func017.c +new file mode 100644 +index 0000000..6070d3e +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/003_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; ++} +diff --git a/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func018.c b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func018.c +new file mode 100644 +index 0000000..18b6494 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/003_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; ++} +diff --git a/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func019.c b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func019.c +new file mode 100644 +index 0000000..b0a0b6f +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/003_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; ++} +diff --git a/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func020.c b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func020.c +new file mode 100644 +index 0000000..071f5c5 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/003_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; ++} +diff --git a/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func021.c b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func021.c +new file mode 100644 +index 0000000..2dee5f2 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/003_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; ++} +diff --git a/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func022.c b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func022.c +new file mode 100644 +index 0000000..a2a9843 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/003_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; ++} +diff --git a/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func023.c b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func023.c +new file mode 100644 +index 0000000..c762a0a +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/003_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; ++} +diff --git a/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func024.c b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func024.c +new file mode 100644 +index 0000000..87b3e4c +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func024.c +@@ -0,0 +1,6 @@ ++#include ++#include ++float _Complex c_func_(float _Complex *t) { ++ printf("%0.20f + %0.20fi\n", creal(*t), cimag(*t)); ++ return *t; ++} +diff --git a/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func025.c b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func025.c +new file mode 100644 +index 0000000..2d7b33f +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func025.c +@@ -0,0 +1,6 @@ ++#include ++#include ++double _Complex c_func_(double _Complex *t) { ++ printf("%0.20lf + %0.20lfi\n", creal(*t), cimag(*t)); ++ return *t; ++} +diff --git a/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func026.c b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func026.c +new file mode 100644 +index 0000000..78f93c9 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func026.c +@@ -0,0 +1,6 @@ ++#include ++#include ++long double _Complex c_func_(long double _Complex *t) { ++ printf("%0.20f + %0.20fi\n", creal(*t), cimag(*t)); ++ return *t; ++} +diff --git a/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func027.c b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func027.c +new file mode 100644 +index 0000000..2bf5cce +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/003_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_fortran_call_c_function/003_fortran_call_c_function_value/c_func028.c b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func028.c +new file mode 100644 +index 0000000..197c9b6 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func028.c +@@ -0,0 +1,6 @@ ++#include ++#include ++char c_func_(char *t) { ++ printf("%c\n", *t); ++ return *t; ++} +diff --git a/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main001.f90 b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main001.f90 +new file mode 100644 +index 0000000..833d15b +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/003_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) result(res) ++ integer :: b ++ integer :: res ++ end ++ end interface ++ print '(I5)', c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main002.f90 b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main002.f90 +new file mode 100644 +index 0000000..f3bf45c +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/003_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) result(res) ++ integer(2) :: b ++ integer(2) :: res ++ end ++ end interface ++ print '(I5)', c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main003.f90 b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main003.f90 +new file mode 100644 +index 0000000..be25937 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/003_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) result(res) ++ integer(8) :: b ++ integer(8) :: res ++ end ++ end interface ++ print '(I5)', c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main004.f90 b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main004.f90 +new file mode 100644 +index 0000000..f5a5c25 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/003_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) result(res) ++ integer(8) :: b ++ integer(8) :: res ++ end ++ end interface ++ print '(I5)', c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main005.f90 b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main005.f90 +new file mode 100644 +index 0000000..ce67996 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/003_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) result(res) ++ integer(1) :: b ++ integer(1) :: res ++ end ++ end interface ++ print '(I5)', c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main006.f90 b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main006.f90 +new file mode 100644 +index 0000000..a334489 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/003_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) result(res) ++ integer(8) :: b ++ integer(8) :: res ++ end ++ end interface ++ print '(I5)', c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main007.f90 b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main007.f90 +new file mode 100644 +index 0000000..11b1e27 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/003_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) result(res) ++ integer(1) :: b ++ integer(1) :: res ++ end ++ end interface ++ print '(I5)', c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main008.f90 b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main008.f90 +new file mode 100644 +index 0000000..6addc84 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/003_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) result(res) ++ integer(2) :: b ++ integer(2) :: res ++ end ++ end interface ++ print '(I5)', c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main009.f90 b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main009.f90 +new file mode 100644 +index 0000000..20d49b4 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/003_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) result(res) ++ integer(4) :: b ++ integer(4) :: res ++ end ++ end interface ++ print '(I5)', c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main010.f90 b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main010.f90 +new file mode 100644 +index 0000000..363fa19 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/003_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) result(res) ++ integer(8) :: b ++ integer(8) :: res ++ end ++ end interface ++ print '(I5)', c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main011.f90 b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main011.f90 +new file mode 100644 +index 0000000..6e95d17 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/003_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) result(res) ++ integer(1) :: b ++ integer(1) :: res ++ end ++ end interface ++ print '(I5)', c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main012.f90 b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main012.f90 +new file mode 100644 +index 0000000..b8b3c12 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/003_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) result(res) ++ integer(2) :: b ++ integer(2) :: res ++ end ++ end interface ++ print '(I5)', c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main013.f90 b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main013.f90 +new file mode 100644 +index 0000000..1eb9429 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main013.f90 +@@ -0,0 +1,13 @@ ++! 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) result(res) ++ integer(4) :: b ++ integer(4) :: res ++ end ++ end interface ++ print '(I5)', c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main014.f90 b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main014.f90 +new file mode 100644 +index 0000000..0d6fba6 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main014.f90 +@@ -0,0 +1,13 @@ ++! 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) result(res) ++ integer(8) :: b ++ integer(8) :: res ++ end ++ end interface ++ print '(I5)', c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main015.f90 b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main015.f90 +new file mode 100644 +index 0000000..78dd147 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/003_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) result(res) ++ integer(1) :: b ++ integer(1) :: res ++ end ++ end interface ++ print '(I5)', c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main016.f90 b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main016.f90 +new file mode 100644 +index 0000000..a12f03e +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/003_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) result(res) ++ integer(8) :: b ++ integer(8) :: res ++ end ++ end interface ++ print '(I5)', c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main017.f90 b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main017.f90 +new file mode 100644 +index 0000000..392a401 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/003_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) result(res) ++ integer(8) :: b ++ integer(8) :: res ++ end ++ end interface ++ print '(I5)', c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main018.f90 b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main018.f90 +new file mode 100644 +index 0000000..c24ad39 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/003_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) result(res) ++ integer(8) :: b ++ integer(8) :: res ++ end ++ end interface ++ print '(I5)', c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main019.f90 b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main019.f90 +new file mode 100644 +index 0000000..db38e53 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/003_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) result(res) ++ integer(8) :: b ++ integer(8) :: res ++ end ++ end interface ++ print *, c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main020.f90 b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main020.f90 +new file mode 100644 +index 0000000..d99e3d0 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/003_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) result(res) ++ integer(8) :: b ++ integer(8) :: res ++ end ++ end interface ++ print '(I5)', c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main021.f90 b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main021.f90 +new file mode 100644 +index 0000000..c61c8f1 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/003_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) result(res) ++ real(4) :: b ++ real(4) :: res ++ end ++ end interface ++ print '(F20.10)', c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main022.f90 b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main022.f90 +new file mode 100644 +index 0000000..b5f5dd9 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/003_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) result(res) ++ real(8) :: b ++ real(8) :: res ++ end ++ end interface ++ print '(F20.10)', c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main023.f90 b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main023.f90 +new file mode 100644 +index 0000000..0dd6d35 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/003_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) result(res) ++ integer, parameter :: K = selected_real_kind(16) ++ real(K) :: b ++ real(K) :: res ++ end ++ end interface ++ print '(F20.10)', c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main024.f90 b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main024.f90 +new file mode 100644 +index 0000000..6af3f75 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main024.f90 +@@ -0,0 +1,13 @@ ++! 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) result(res) ++ complex(4) :: b ++ complex(4) :: res ++ end ++ end interface ++ print '(F20.10)', c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main025.f90 b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main025.f90 +new file mode 100644 +index 0000000..5c7a953 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main025.f90 +@@ -0,0 +1,13 @@ ++! 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) result(res) ++ complex(8) :: b ++ complex(8) :: res ++ end ++ end interface ++ print '(F20.10)', c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main026.f90 b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main026.f90 +new file mode 100644 +index 0000000..14ec793 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main026.f90 +@@ -0,0 +1,15 @@ ++! 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) result(res) ++ integer, parameter :: K = selected_real_kind(16) ++ complex(K) :: b ++ complex(K) :: res ++ end ++ end interface ++ print '(F20.10)', c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main027.f90 b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main027.f90 +new file mode 100644 +index 0000000..203901c +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/003_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) result(res) ++ logical(1) :: b ++ logical(1) :: res ++ end ++ end interface ++ print *, c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main028.f90 b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main028.f90 +new file mode 100644 +index 0000000..537c6cb +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/003_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) result(res) ++ character(1) :: b ++ character(1) :: res ++ end ++ end interface ++ print *, c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/result.md b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/result.md +new file mode 100644 +index 0000000..ce2fc5b +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/result.md +@@ -0,0 +1,29 @@ ++ | test | gfortran | flang | nvfortran| ++ | 001 | PASS | PASS | PASS | ++ | 002 | PASS | PASS | PASS | ++ | 003 | PASS | PASS | PASS | ++ | 004 | PASS | PASS | PASS | ++ | 005 | PASS | PASS | PASS | ++ | 006 | PASS | PASS | PASS | ++ | 007 | PASS | PASS | PASS | ++ | 008 | PASS | PASS | PASS | ++ | 009 | PASS | PASS | PASS | ++ | 010 | PASS | PASS | PASS | ++ | 011 | PASS | PASS | PASS | ++ | 012 | PASS | PASS | PASS | ++ | 013 | PASS | PASS | PASS | ++ | 014 | PASS | PASS | PASS | ++ | 015 | PASS | PASS | PASS | ++ | 016 | PASS | PASS | PASS | ++ | 017 | PASS | PASS | PASS | ++ | 018 | PASS | PASS | PASS | ++ | 019 | PASS | PASS | PASS | ++ | 020 | PASS | PASS | PASS | ++ | 021 | PASS | PASS | PASS | ++ | 022 | PASS | PASS | PASS | ++ | 023 | PASS | PASS | ERROR | ++ | 024 | PASS | PASS | ERROR | ++ | 025 | PASS | PASS | ERROR | ++ | 026 | PASS | ERROR | ERROR | ++ | 027 | PASS | PASS | PASS | ++ | 028 | ERROR | ERROR | ERROR | +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/run.sh b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/run.sh +new file mode 100644 +index 0000000..dbbd62f +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/run.sh +@@ -0,0 +1,22 @@ ++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 ++echo "----- nvfortran result : " ++clang c_func$i.c -c -o c-test.o ++nvfortran fortran_main$i.f90 -c -o fortran-test.o ++nvfortran 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_function/004_fortran_call_c_function_value_bindc/c_func001.c b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func001.c +new file mode 100644 +index 0000000..92427a4 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/004_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; ++} +diff --git a/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func002.c b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func002.c +new file mode 100644 +index 0000000..54747f2 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/004_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; ++} +diff --git a/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func003.c b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func003.c +new file mode 100644 +index 0000000..a9fde92 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/004_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; ++} +diff --git a/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func004.c b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func004.c +new file mode 100644 +index 0000000..2131b04 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/004_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; ++} +diff --git a/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func005.c b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func005.c +new file mode 100644 +index 0000000..309b9d0 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/004_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; ++} +diff --git a/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func006.c b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func006.c +new file mode 100644 +index 0000000..73982d0 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/004_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; ++} +diff --git a/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func007.c b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func007.c +new file mode 100644 +index 0000000..efaee56 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/004_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; ++} +diff --git a/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func008.c b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func008.c +new file mode 100644 +index 0000000..5a57718 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/004_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; ++} +diff --git a/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func009.c b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func009.c +new file mode 100644 +index 0000000..e076c57 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/004_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; ++} +diff --git a/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func010.c b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func010.c +new file mode 100644 +index 0000000..197e12b +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/004_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; ++} +diff --git a/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func011.c b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func011.c +new file mode 100644 +index 0000000..cc67a34 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/004_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; ++} +diff --git a/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func012.c b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func012.c +new file mode 100644 +index 0000000..484de62 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/004_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; ++} +diff --git a/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func013.c b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func013.c +new file mode 100644 +index 0000000..7a1973e +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/004_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; ++} +diff --git a/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func014.c b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func014.c +new file mode 100644 +index 0000000..d535c60 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/004_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; ++} +diff --git a/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func015.c b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func015.c +new file mode 100644 +index 0000000..cb1989f +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/004_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; ++} +diff --git a/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func016.c b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func016.c +new file mode 100644 +index 0000000..df1b16b +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/004_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; ++} +diff --git a/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func017.c b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func017.c +new file mode 100644 +index 0000000..6070d3e +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/004_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; ++} +diff --git a/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func018.c b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func018.c +new file mode 100644 +index 0000000..18b6494 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/004_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; ++} +diff --git a/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func019.c b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func019.c +new file mode 100644 +index 0000000..b0a0b6f +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/004_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; ++} +diff --git a/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func020.c b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func020.c +new file mode 100644 +index 0000000..071f5c5 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/004_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; ++} +diff --git a/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func021.c b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func021.c +new file mode 100644 +index 0000000..2dee5f2 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/004_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; ++} +diff --git a/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func022.c b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func022.c +new file mode 100644 +index 0000000..a2a9843 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/004_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; ++} +diff --git a/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func023.c b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func023.c +new file mode 100644 +index 0000000..c762a0a +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/004_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; ++} +diff --git a/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func024.c b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func024.c +new file mode 100644 +index 0000000..87b3e4c +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func024.c +@@ -0,0 +1,6 @@ ++#include ++#include ++float _Complex c_func_(float _Complex *t) { ++ printf("%0.20f + %0.20fi\n", creal(*t), cimag(*t)); ++ return *t; ++} +diff --git a/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func025.c b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func025.c +new file mode 100644 +index 0000000..2d7b33f +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func025.c +@@ -0,0 +1,6 @@ ++#include ++#include ++double _Complex c_func_(double _Complex *t) { ++ printf("%0.20lf + %0.20lfi\n", creal(*t), cimag(*t)); ++ return *t; ++} +diff --git a/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func026.c b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func026.c +new file mode 100644 +index 0000000..78f93c9 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func026.c +@@ -0,0 +1,6 @@ ++#include ++#include ++long double _Complex c_func_(long double _Complex *t) { ++ printf("%0.20f + %0.20fi\n", creal(*t), cimag(*t)); ++ return *t; ++} +diff --git a/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func027.c b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func027.c +new file mode 100644 +index 0000000..2bf5cce +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/004_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_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func028.c b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func028.c +new file mode 100644 +index 0000000..197c9b6 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func028.c +@@ -0,0 +1,6 @@ ++#include ++#include ++char c_func_(char *t) { ++ printf("%c\n", *t); ++ return *t; ++} +diff --git a/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main001.f90 b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main001.f90 +new file mode 100644 +index 0000000..f7e19f7 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/004_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) result(res) bind(c, name = "c_func_") ++ integer :: b ++ integer :: res ++ end ++ end interface ++ print '(I5)', c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main002.f90 b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main002.f90 +new file mode 100644 +index 0000000..b7b2ab4 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/004_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) result(res) bind(c, name = "c_func_") ++ integer(2) :: b ++ integer(2) :: res ++ end ++ end interface ++ print '(I5)', c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main003.f90 b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main003.f90 +new file mode 100644 +index 0000000..7fea817 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/004_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) result(res) bind(c, name = "c_func_") ++ integer(8) :: b ++ integer(8) :: res ++ end ++ end interface ++ print '(I5)', c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main004.f90 b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main004.f90 +new file mode 100644 +index 0000000..c62ea01 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/004_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) result(res) bind(c, name = "c_func_") ++ integer(8) :: b ++ integer(8) :: res ++ end ++ end interface ++ print '(I5)', c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main005.f90 b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main005.f90 +new file mode 100644 +index 0000000..6c3185c +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/004_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) result(res) bind(c, name = "c_func_") ++ integer(1) :: b ++ integer(1) :: res ++ end ++ end interface ++ print '(I5)', c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main006.f90 b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main006.f90 +new file mode 100644 +index 0000000..8be1fe5 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/004_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) result(res) bind(c, name = "c_func_") ++ integer(8) :: b ++ integer(8) :: res ++ end ++ end interface ++ print '(I5)', c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main007.f90 b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main007.f90 +new file mode 100644 +index 0000000..5d909b1 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/004_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) result(res) bind(c, name = "c_func_") ++ integer(1) :: b ++ integer(1) :: res ++ end ++ end interface ++ print '(I5)', c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main008.f90 b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main008.f90 +new file mode 100644 +index 0000000..fbbfc82 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/004_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) result(res) bind(c, name = "c_func_") ++ integer(2) :: b ++ integer(2) :: res ++ end ++ end interface ++ print '(I5)', c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main009.f90 b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main009.f90 +new file mode 100644 +index 0000000..9cd04c3 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/004_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) result(res) bind(c, name = "c_func_") ++ integer(4) :: b ++ integer(4) :: res ++ end ++ end interface ++ print '(I5)', c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main010.f90 b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main010.f90 +new file mode 100644 +index 0000000..620d195 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/004_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) result(res) bind(c, name = "c_func_") ++ integer(8) :: b ++ integer(8) :: res ++ end ++ end interface ++ print '(I5)', c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main011.f90 b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main011.f90 +new file mode 100644 +index 0000000..c933b43 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main011.f90 +@@ -0,0 +1,13 @@ ++! 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) result(res) bind(c, name = "c_func_") ++ integer(1) :: b ++ integer(1) :: res ++ end ++ end interface ++ print '(I5)', c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main012.f90 b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main012.f90 +new file mode 100644 +index 0000000..35da307 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main012.f90 +@@ -0,0 +1,13 @@ ++! 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) result(res) bind(c, name = "c_func_") ++ integer(2) :: b ++ integer(2) :: res ++ end ++ end interface ++ print '(I5)', c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main013.f90 b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main013.f90 +new file mode 100644 +index 0000000..38eb044 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main013.f90 +@@ -0,0 +1,13 @@ ++! 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) result(res) bind(c, name = "c_func_") ++ integer(4) :: b ++ integer(4) :: res ++ end ++ end interface ++ print '(I5)', c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main014.f90 b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main014.f90 +new file mode 100644 +index 0000000..e7a3281 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main014.f90 +@@ -0,0 +1,13 @@ ++! 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) result(res) bind(c, name = "c_func_") ++ integer(8) :: b ++ integer(8) :: res ++ end ++ end interface ++ print '(I5)', c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main015.f90 b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main015.f90 +new file mode 100644 +index 0000000..6f41989 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main015.f90 +@@ -0,0 +1,12 @@ ++! 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) result(res) bind(c, name = "c_func_") ++ integer(1) :: b ++ integer(1) :: res ++ end ++ end interface ++ print '(I5)', c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main016.f90 b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main016.f90 +new file mode 100644 +index 0000000..8776c5f +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main016.f90 +@@ -0,0 +1,13 @@ ++! 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) result(res) bind(c, name = "c_func_") ++ integer(8) :: b ++ integer(8) :: res ++ end ++ end interface ++ print '(I5)', c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main017.f90 b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main017.f90 +new file mode 100644 +index 0000000..1e153ae +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main017.f90 +@@ -0,0 +1,13 @@ ++! 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) result(res) bind(c, name = "c_func_") ++ integer(8) :: b ++ integer(8) :: res ++ end ++ end interface ++ print '(I5)', c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main018.f90 b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main018.f90 +new file mode 100644 +index 0000000..210678d +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main018.f90 +@@ -0,0 +1,13 @@ ++! 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) result(res) bind(c, name = "c_func_") ++ integer(8) :: b ++ integer(8) :: res ++ end ++ end interface ++ print '(I5)', c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main019.f90 b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main019.f90 +new file mode 100644 +index 0000000..46677d3 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/004_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) result(res) bind(c, name = "c_func_") ++ integer(8) :: b ++ integer(8) :: res ++ end ++ end interface ++ print *, c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main020.f90 b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main020.f90 +new file mode 100644 +index 0000000..e5044e4 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/004_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) result(res) bind(c, name = "c_func_") ++ integer(8) :: b ++ integer(8) :: res ++ end ++ end interface ++ print '(I5)', c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main021.f90 b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main021.f90 +new file mode 100644 +index 0000000..0e2a2c5 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/004_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) result(res) bind(c, name = "c_func_") ++ real(4) :: b ++ real(4) :: res ++ end ++ end interface ++ print '(F20.10)', c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main022.f90 b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main022.f90 +new file mode 100644 +index 0000000..5ba9920 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/004_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) result(res) bind(c, name = "c_func_") ++ real(8) :: b ++ real(8) :: res ++ end ++ end interface ++ print '(F20.10)', c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main023.f90 b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main023.f90 +new file mode 100644 +index 0000000..cd87fb6 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/004_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) result(res) bind(c, name = "c_func_") ++ integer, parameter :: K = selected_real_kind(16) ++ real(K) :: b ++ real(K) :: res ++ end ++ end interface ++ print '(F20.10)', c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main024.f90 b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main024.f90 +new file mode 100644 +index 0000000..890bd95 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main024.f90 +@@ -0,0 +1,13 @@ ++! 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) result(res) bind(c, name = "c_func_") ++ complex(4) :: b ++ complex(4) :: res ++ end ++ end interface ++ print '(F20.10)', c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main025.f90 b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main025.f90 +new file mode 100644 +index 0000000..39ba319 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main025.f90 +@@ -0,0 +1,13 @@ ++! 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) result(res) bind(c, name = "c_func_") ++ complex(8) :: b ++ complex(8) :: res ++ end ++ end interface ++ print '(F20.10)', c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main026.f90 b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main026.f90 +new file mode 100644 +index 0000000..5e7b4c5 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main026.f90 +@@ -0,0 +1,15 @@ ++! 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) result(res) bind(c, name = "c_func_") ++ integer, parameter :: K = selected_real_kind(16) ++ complex(K) :: b ++ complex(K) :: res ++ end ++ end interface ++ print '(F20.10)', c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main027.f90 b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main027.f90 +new file mode 100644 +index 0000000..08b2d11 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/004_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) result(res) bind(c, name = "c_func_") ++ logical(1) :: b ++ logical(1) :: res ++ end ++ end interface ++ print *, c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main028.f90 b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main028.f90 +new file mode 100644 +index 0000000..8174ac5 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/004_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) result(res) bind(c, name = "c_func_") ++ character(1) :: b ++ character(1) :: res ++ end ++ end interface ++ print *, c_func(my_x) ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/result.md b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/result.md +new file mode 100644 +index 0000000..fb1d886 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/result.md +@@ -0,0 +1,29 @@ ++ | test | gfortran | flang | nvfortran| ++ | 001 | PASS | PASS | PASS | ++ | 002 | PASS | PASS | PASS | ++ | 003 | PASS | PASS | PASS | ++ | 004 | PASS | PASS | PASS | ++ | 005 | PASS | PASS | PASS | ++ | 006 | PASS | PASS | PASS | ++ | 007 | PASS | PASS | PASS | ++ | 008 | PASS | PASS | PASS | ++ | 009 | PASS | PASS | PASS | ++ | 010 | PASS | PASS | PASS | ++ | 011 | PASS | PASS | PASS | ++ | 012 | PASS | PASS | PASS | ++ | 013 | PASS | PASS | PASS | ++ | 014 | PASS | PASS | PASS | ++ | 015 | PASS | PASS | PASS | ++ | 016 | PASS | PASS | PASS | ++ | 017 | PASS | PASS | PASS | ++ | 018 | PASS | PASS | PASS | ++ | 019 | PASS | PASS | PASS | ++ | 020 | PASS | PASS | PASS | ++ | 021 | PASS | PASS | PASS | ++ | 022 | PASS | PASS | PASS | ++ | 023 | PASS | PASS | ERROR | ++ | 024 | PASS | PASS | PASS | ++ | 025 | PASS | PASS | PASS | ++ | 026 | PASS | ERROR | ERROR | ++ | 027 | PASS | PASS | PASS | ++ | 028 | PASS | ERROR | ERROR | +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/run.sh b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/run.sh +new file mode 100644 +index 0000000..dbbd62f +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/run.sh +@@ -0,0 +1,22 @@ ++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 ++echo "----- nvfortran result : " ++clang c_func$i.c -c -o c-test.o ++nvfortran fortran_main$i.f90 -c -o fortran-test.o ++nvfortran 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_function/005_fortran_call_c_function_array/c_func001.c b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func001.c +new file mode 100644 +index 0000000..5fc1da0 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func001.c +@@ -0,0 +1,8 @@ ++#include ++int* c_func_(int *s) ++{ ++ for(int i = 0; i < 4; i++) { ++ *(s + i) = i + 10; ++ } ++ return s; ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func002.c b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func002.c +new file mode 100644 +index 0000000..0adaedc +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func002.c +@@ -0,0 +1,8 @@ ++#include ++short* c_func_(short *s) ++{ ++ for(int i = 0; i < 4; i++) { ++ *(s + i) = i + 10; ++ } ++ return s; ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func003.c b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func003.c +new file mode 100644 +index 0000000..9e25ad4 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func003.c +@@ -0,0 +1,8 @@ ++#include ++long* c_func_(long *s) ++{ ++ for(int i = 0; i < 4; i++) { ++ *(s + i) = i + 10; ++ } ++ return s; ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func004.c b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func004.c +new file mode 100644 +index 0000000..224a535 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func004.c +@@ -0,0 +1,8 @@ ++#include ++long long* c_func_(long long *s) ++{ ++ for(int i = 0; i < 4; i++) { ++ *(s + i) = i + 10; ++ } ++ return s; ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func005.c b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func005.c +new file mode 100644 +index 0000000..ee7dadf +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func005.c +@@ -0,0 +1,8 @@ ++#include ++signed char* c_func_(signed char *s) ++{ ++ for(int i = 0; i < 4; i++) { ++ *(s + i) = i + 10; ++ } ++ return s; ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func006.c b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func006.c +new file mode 100644 +index 0000000..d1a350e +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func006.c +@@ -0,0 +1,8 @@ ++#include ++size_t* c_func_(size_t *s) ++{ ++ for(int i = 0; i < 4; i++) { ++ *(s + i) = i + 10; ++ } ++ return s; ++} +diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func007.c b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func007.c +new file mode 100644 +index 0000000..8418d36 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func007.c +@@ -0,0 +1,9 @@ ++#include ++#include ++int8_t* c_func_(int8_t *s) ++{ ++ for(int i = 0; i < 4; i++) { ++ *(s + i) = i + 10; ++ } ++ return s; ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func008.c b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func008.c +new file mode 100644 +index 0000000..63df945 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func008.c +@@ -0,0 +1,9 @@ ++#include ++#include ++int16_t* c_func_(int16_t *s) ++{ ++ for(int i = 0; i < 4; i++) { ++ *(s + i) = i + 10; ++ } ++ return s; ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func009.c b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func009.c +new file mode 100644 +index 0000000..ee3be43 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func009.c +@@ -0,0 +1,9 @@ ++#include ++#include ++int32_t* c_func_(int32_t *s) ++{ ++ for(int i = 0; i < 4; i++) { ++ *(s + i) = i + 10; ++ } ++ return s; ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func010.c b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func010.c +new file mode 100644 +index 0000000..464e81c +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func010.c +@@ -0,0 +1,9 @@ ++#include ++#include ++int64_t* c_func_(int64_t *s) ++{ ++ for(int i = 0; i < 4; i++) { ++ *(s + i) = i + 10; ++ } ++ return s; ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func011.c b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func011.c +new file mode 100644 +index 0000000..aff58ed +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func011.c +@@ -0,0 +1,9 @@ ++#include ++#include ++int_least8_t* c_func_(int_least8_t *s) ++{ ++ for(int i = 0; i < 4; i++) { ++ *(s + i) = i + 10; ++ } ++ return s; ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func012.c b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func012.c +new file mode 100644 +index 0000000..446f20c +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func012.c +@@ -0,0 +1,9 @@ ++#include ++#include ++int_least16_t* c_func_(int_least16_t *s) ++{ ++ for(int i = 0; i < 4; i++) { ++ *(s + i) = i + 10; ++ } ++ return s; ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func013.c b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func013.c +new file mode 100644 +index 0000000..976133d +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func013.c +@@ -0,0 +1,9 @@ ++#include ++#include ++int_least32_t* c_func_(int_least32_t *s) ++{ ++ for(int i = 0; i < 4; i++) { ++ *(s + i) = i + 10; ++ } ++ return s; ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func014.c b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func014.c +new file mode 100644 +index 0000000..4358884 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func014.c +@@ -0,0 +1,9 @@ ++#include ++#include ++int_least64_t* c_func_(int_least64_t *s) ++{ ++ for(int i = 0; i < 4; i++) { ++ *(s + i) = i + 10; ++ } ++ return s; ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func015.c b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func015.c +new file mode 100644 +index 0000000..fea3e63 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func015.c +@@ -0,0 +1,9 @@ ++#include ++#include ++int_fast8_t* c_func_(int_fast8_t *s) ++{ ++ for(int i = 0; i < 4; i++) { ++ *(s + i) = i + 10; ++ } ++ return s; ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func016.c b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func016.c +new file mode 100644 +index 0000000..659acf6 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func016.c +@@ -0,0 +1,9 @@ ++#include ++#include ++int_fast16_t* c_func_(int_fast16_t *s) ++{ ++ for(int i = 0; i < 4; i++) { ++ *(s + i) = i + 10; ++ } ++ return s; ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func017.c b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func017.c +new file mode 100644 +index 0000000..f8834b4 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func017.c +@@ -0,0 +1,9 @@ ++#include ++#include ++int_fast32_t* c_func_(int_fast32_t *s) ++{ ++ for(int i = 0; i < 4; i++) { ++ *(s + i) = i + 10; ++ } ++ return s; ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func018.c b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func018.c +new file mode 100644 +index 0000000..f06b163 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func018.c +@@ -0,0 +1,9 @@ ++#include ++#include ++int_fast64_t* c_func_(int_fast64_t *s) ++{ ++ for(int i = 0; i < 4; i++) { ++ *(s + i) = i + 10; ++ } ++ return s; ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func019.c b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func019.c +new file mode 100644 +index 0000000..6e1ea95 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func019.c +@@ -0,0 +1,9 @@ ++#include ++#include ++intmax_t* c_func_(intmax_t *s) ++{ ++ for(int i = 0; i < 4; i++) { ++ *(s + i) = i + 10; ++ } ++ return s; ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func020.c b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func020.c +new file mode 100644 +index 0000000..d5b3db7 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func020.c +@@ -0,0 +1,9 @@ ++#include ++#include ++intptr_t* c_func_(intptr_t *s) ++{ ++ for(int i = 0; i < 4; i++) { ++ *(s + i) = i + 10; ++ } ++ return s; ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func021.c b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func021.c +new file mode 100644 +index 0000000..8aa0811 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func021.c +@@ -0,0 +1,8 @@ ++#include ++float* c_func_(float *s) ++{ ++ for(int i = 0; i < 4; i++) { ++ *(s + i) = i + 0.1314159265358979; ++ } ++ return s; ++} +diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func022.c b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func022.c +new file mode 100644 +index 0000000..ec9fbf0 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func022.c +@@ -0,0 +1,8 @@ ++#include ++double* c_func_(double *s) ++{ ++ for(int i = 0; i < 4; i++) { ++ *(s + i) = i + 0.1314159265358979; ++ } ++ return s; ++} +diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func023.c b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func023.c +new file mode 100644 +index 0000000..64d1980 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func023.c +@@ -0,0 +1,8 @@ ++#include ++long double* c_func_(long double *s) ++{ ++ for(int i = 0; i < 4; i++) { ++ *(s + i) = i + 0.1314159265358979; ++ } ++ return s; ++} +diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func024.c b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func024.c +new file mode 100644 +index 0000000..63426c5 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func024.c +@@ -0,0 +1,6 @@ ++#include ++#include ++float _Complex* c_func_(float _Complex *s) ++{ ++ return s; ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func025.c b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func025.c +new file mode 100644 +index 0000000..8357f17 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func025.c +@@ -0,0 +1,6 @@ ++#include ++#include ++double _Complex* c_func_(double _Complex *s) ++{ ++ return s; ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func026.c b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func026.c +new file mode 100644 +index 0000000..f5871a9 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func026.c +@@ -0,0 +1,6 @@ ++#include ++#include ++long double _Complex* c_func_(long double _Complex *s) ++{ ++ return s; ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func027.c b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func027.c +new file mode 100644 +index 0000000..69cde43 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func027.c +@@ -0,0 +1,8 @@ ++#include ++_Bool* c_func_(_Bool *s) ++{ ++ for(int i = 0; i < 4; i++) { ++ *(s + i) = 1; ++ } ++ return s; ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func028.c b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func028.c +new file mode 100644 +index 0000000..25b531b +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func028.c +@@ -0,0 +1,8 @@ ++#include ++char* c_func_(char *s) ++{ ++ for(int i = 0; i < 4; i++) { ++ *(s + i) = 'a' + i; ++ } ++ return s; ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func029.c b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func029.c +new file mode 100644 +index 0000000..30526c7 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func029.c +@@ -0,0 +1,8 @@ ++#include ++int* c_func_(int *s) ++{ ++ for(int i = 0; i < 3; i++) { ++ *(s + i) = i + 10; ++ } ++ return s; ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func030.c b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func030.c +new file mode 100644 +index 0000000..542897f +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func030.c +@@ -0,0 +1,8 @@ ++#include ++int* c_func_(int *s) ++{ ++ for(int i = 0; i < 5; i++) { ++ *(s + i) = i + 10; ++ } ++ return s; ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func031.c b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func031.c +new file mode 100644 +index 0000000..8f4f7db +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func031.c +@@ -0,0 +1,8 @@ ++#include ++int* c_func_(int *s) ++{ ++ for(int i = 0; i < 6; i++) { ++ *(s + i) = i + 10; ++ } ++ return s; ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func032.c b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func032.c +new file mode 100644 +index 0000000..2f457db +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func032.c +@@ -0,0 +1,8 @@ ++#include ++int* c_func_(int *s) ++{ ++ for(int i = 0; i < 7; i++) { ++ *(s + i) = i + 10; ++ } ++ return s; ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func033.c b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func033.c +new file mode 100644 +index 0000000..f4d27c8 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func033.c +@@ -0,0 +1,8 @@ ++#include ++int* c_func_(int *s) ++{ ++ for(int i = 0; i < 8; i++) { ++ *(s + i) = i + 10; ++ } ++ return s; ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func034.c b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func034.c +new file mode 100644 +index 0000000..2cadd95 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func034.c +@@ -0,0 +1,8 @@ ++#include ++int* c_func_(int *s) ++{ ++ for(int i = 0; i < 26; i++) { ++ *(s + i) = i + 10; ++ } ++ return s; ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func035.c b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func035.c +new file mode 100644 +index 0000000..4d12dea +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func035.c +@@ -0,0 +1,8 @@ ++#include ++int* c_func_(int *s) ++{ ++ for(int i = 0; i < 100; i++) { ++ *(s + i) = i + 10; ++ } ++ return s; ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main001.f90 b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main001.f90 +new file mode 100644 +index 0000000..09110c3 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main001.f90 +@@ -0,0 +1,14 @@ ++! Test fortran call c for the return type is array of type int ++! ++program main ++ integer :: my_x(4) ++ integer :: r(4) ++ interface ++ function c_func(b) result(res) ++ integer :: b(4) ++ integer :: res(4) ++ end ++ end interface ++ r = c_func(my_x) ++ print *, r ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main002.f90 b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main002.f90 +new file mode 100644 +index 0000000..aef86db +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main002.f90 +@@ -0,0 +1,14 @@ ++! Test fortran call c for the return type is array of type short ++! ++program main ++ integer(2) :: my_x(4) ++ integer(2) :: r(4) ++ interface ++ function c_func(b) result(res) ++ integer(2) :: b(4) ++ integer(2) :: res(4) ++ end ++ end interface ++ r = c_func(my_x) ++ print *, r ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main003.f90 b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main003.f90 +new file mode 100644 +index 0000000..ff59211 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main003.f90 +@@ -0,0 +1,14 @@ ++! Test fortran call c for the return type is array of type long ++! ++program main ++ integer(8) :: my_x(4) ++ integer(8) :: r(4) ++ interface ++ function c_func(b) result(res) ++ integer(8) :: b(4) ++ integer(8) :: res(4) ++ end ++ end interface ++ r = c_func(my_x) ++ print *, r ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main004.f90 b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main004.f90 +new file mode 100644 +index 0000000..7663281 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main004.f90 +@@ -0,0 +1,14 @@ ++! Test fortran call c for the return type is array of type long long ++! ++program main ++ integer(8) :: my_x(4) ++ integer(8) :: r(4) ++ interface ++ function c_func(b) result(res) ++ integer(8) :: b(4) ++ integer(8) :: res(4) ++ end ++ end interface ++ r = c_func(my_x) ++ print *, r ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main005.f90 b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main005.f90 +new file mode 100644 +index 0000000..ff162cd +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main005.f90 +@@ -0,0 +1,14 @@ ++! Test fortran call c for the return type is array of type signed char ++! ++program main ++ integer(1) :: my_x(4) ++ integer(1) :: r(4) ++ interface ++ function c_func(b) result(res) ++ integer(1) :: b(4) ++ integer(1) :: res(4) ++ end ++ end interface ++ r = c_func(my_x) ++ print *, r ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main006.f90 b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main006.f90 +new file mode 100644 +index 0000000..625924f +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main006.f90 +@@ -0,0 +1,14 @@ ++! Test fortran call c for the return type is array of type size_t ++! ++program main ++ integer(8) :: my_x(4) ++ integer(8) :: r(4) ++ interface ++ function c_func(b) result(res) ++ integer(8) :: b(4) ++ integer(8) :: res(4) ++ end ++ end interface ++ r = c_func(my_x) ++ print *, r ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main007.f90 b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main007.f90 +new file mode 100644 +index 0000000..e4a94ae +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main007.f90 +@@ -0,0 +1,14 @@ ++! Test fortran call c for the return type is array of type int8_t ++! ++program main ++ integer(1) :: my_x(4) ++ integer(1) :: r(4) ++ interface ++ function c_func(b) result(res) ++ integer(1) :: b(4) ++ integer(1) :: res(4) ++ end ++ end interface ++ r = c_func(my_x) ++ print *, r ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main008.f90 b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main008.f90 +new file mode 100644 +index 0000000..ea46cec +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main008.f90 +@@ -0,0 +1,14 @@ ++! Test fortran call c for the return type is array of type int16_t ++! ++program main ++ integer(2) :: my_x(4) ++ integer(2) :: r(4) ++ interface ++ function c_func(b) result(res) ++ integer(2) :: b(4) ++ integer(2) :: res(4) ++ end ++ end interface ++ r = c_func(my_x) ++ print *, r ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main009.f90 b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main009.f90 +new file mode 100644 +index 0000000..b4550ad +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main009.f90 +@@ -0,0 +1,14 @@ ++! Test fortran call c for the return type is array of type int32_t ++! ++program main ++ integer(4) :: my_x(4) ++ integer(4) :: r(4) ++ interface ++ function c_func(b) result(res) ++ integer(4) :: b(4) ++ integer(4) :: res(4) ++ end ++ end interface ++ r = c_func(my_x) ++ print *, r ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main010.f90 b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main010.f90 +new file mode 100644 +index 0000000..cbd8cce +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main010.f90 +@@ -0,0 +1,14 @@ ++! Test fortran call c for the return type is array of type int64_t ++! ++program main ++ integer(8) :: my_x(4) ++ integer(8) :: r(4) ++ interface ++ function c_func(b) result(res) ++ integer(8) :: b(4) ++ integer(8) :: res(4) ++ end ++ end interface ++ r = c_func(my_x) ++ print *, r ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main011.f90 b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main011.f90 +new file mode 100644 +index 0000000..f5d1730 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main011.f90 +@@ -0,0 +1,14 @@ ++! Test fortran call c for the return type is array of type int_least8_t ++! ++program main ++ integer(1) :: my_x(4) ++ integer(1) :: r(4) ++ interface ++ function c_func(b) result(res) ++ integer(1) :: b(4) ++ integer(1) :: res(4) ++ end ++ end interface ++ r = c_func(my_x) ++ print *, r ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main012.f90 b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main012.f90 +new file mode 100644 +index 0000000..2965f6a +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main012.f90 +@@ -0,0 +1,15 @@ ++! Test fortran call c for the return type is array of type ++! int_least16_t ++! ++program main ++ integer(2) :: my_x(4) ++ integer(2) :: r(4) ++ interface ++ function c_func(b) result(res) ++ integer(2) :: b(4) ++ integer(2) :: res(4) ++ end ++ end interface ++ r = c_func(my_x) ++ print *, r ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main013.f90 b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main013.f90 +new file mode 100644 +index 0000000..f2e9721 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main013.f90 +@@ -0,0 +1,15 @@ ++! Test fortran call c for the return type is array of type ++! int_least32_t ++! ++program main ++ integer(4) :: my_x(4) ++ integer(4) :: r(4) ++ interface ++ function c_func(b) result(res) ++ integer(4) :: b(4) ++ integer(4) :: res(4) ++ end ++ end interface ++ r = c_func(my_x) ++ print *, r ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main014.f90 b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main014.f90 +new file mode 100644 +index 0000000..9178983 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main014.f90 +@@ -0,0 +1,15 @@ ++! Test fortran call c for the return type is array of type ++! int_least64_t ++! ++program main ++ integer(8) :: my_x(4) ++ integer(8) :: r(4) ++ interface ++ function c_func(b) result(res) ++ integer(8) :: b(4) ++ integer(8) :: res(4) ++ end ++ end interface ++ r = c_func(my_x) ++ print *, r ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main015.f90 b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main015.f90 +new file mode 100644 +index 0000000..8c1c6b2 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main015.f90 +@@ -0,0 +1,14 @@ ++! Test fortran call c for the return type is array of type int_fast8_t ++! ++program main ++ integer(1) :: my_x(4) ++ integer(1) :: r(4) ++ interface ++ function c_func(b) result(res) ++ integer(1) :: b(4) ++ integer(1) :: res(4) ++ end ++ end interface ++ r = c_func(my_x) ++ print *, r ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main016.f90 b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main016.f90 +new file mode 100644 +index 0000000..9aae6b6 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main016.f90 +@@ -0,0 +1,14 @@ ++! Test fortran call c for the return type is array of type int_fast16_t ++! ++program main ++ integer(8) :: my_x(4) ++ integer(8) :: r(4) ++ interface ++ function c_func(b) result(res) ++ integer(8) :: b(4) ++ integer(8) :: res(4) ++ end ++ end interface ++ r = c_func(my_x) ++ print *, r ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main017.f90 b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main017.f90 +new file mode 100644 +index 0000000..c8c463f +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main017.f90 +@@ -0,0 +1,14 @@ ++! Test fortran call c for the return type is array of type int_fast32_t ++! ++program main ++ integer(8) :: my_x(4) ++ integer(8) :: r(4) ++ interface ++ function c_func(b) result(res) ++ integer(8) :: b(4) ++ integer(8) :: res(4) ++ end ++ end interface ++ r = c_func(my_x) ++ print *, r ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main018.f90 b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main018.f90 +new file mode 100644 +index 0000000..3b6119b +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main018.f90 +@@ -0,0 +1,14 @@ ++! Test fortran call c for the return type is array of type int_fast64_t ++! ++program main ++ integer(8) :: my_x(4) ++ integer(8) :: r(4) ++ interface ++ function c_func(b) result(res) ++ integer(8) :: b(4) ++ integer(8) :: res(4) ++ end ++ end interface ++ r = c_func(my_x) ++ print *, r ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main019.f90 b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main019.f90 +new file mode 100644 +index 0000000..8a6f8db +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main019.f90 +@@ -0,0 +1,14 @@ ++! Test fortran call c for the return type is array of type intmax_t ++! ++program main ++ integer(8) :: my_x(4) ++ integer(8) :: r(4) ++ interface ++ function c_func(b) result(res) ++ integer(8) :: b(4) ++ integer(8) :: res(4) ++ end ++ end interface ++ r = c_func(my_x) ++ print *, r ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main020.f90 b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main020.f90 +new file mode 100644 +index 0000000..43a77aa +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main020.f90 +@@ -0,0 +1,14 @@ ++! Test fortran call c for the return type is array of type intptr_t ++! ++program main ++ integer(8) :: my_x(4) ++ integer(8) :: r(4) ++ interface ++ function c_func(b) result(res) ++ integer(8) :: b(4) ++ integer(8) :: res(4) ++ end ++ end interface ++ r = c_func(my_x) ++ print *, r ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main021.f90 b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main021.f90 +new file mode 100644 +index 0000000..5c61f78 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main021.f90 +@@ -0,0 +1,14 @@ ++! Test fortran call c for the return type is array of type float ++! ++program main ++ real(4) :: my_x(4) ++ real(4) :: r(4) ++ interface ++ function c_func(b) result(res) ++ real(4) :: b(4) ++ real(4) :: res(4) ++ end ++ end interface ++ r = c_func(my_x) ++ print *, r ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main022.f90 b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main022.f90 +new file mode 100644 +index 0000000..ed540c4 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main022.f90 +@@ -0,0 +1,14 @@ ++! Test fortran call c for the return type is array of type double ++! ++program main ++ real(8) :: my_x(4) ++ real(8) :: r(4) ++ interface ++ function c_func(b) result(res) ++ real(8) :: b(4) ++ real(8) :: res(4) ++ end ++ end interface ++ r = c_func(my_x) ++ print *, r ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main023.f90 b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main023.f90 +new file mode 100644 +index 0000000..e549baa +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main023.f90 +@@ -0,0 +1,16 @@ ++! Test fortran call c for the return type is array of type long double ++! ++program main ++ integer, parameter :: K = selected_real_kind(16) ++ real(K) :: my_x(4) ++ real(K) :: r(4) ++ interface ++ function c_func(b) result(res) ++ integer, parameter :: K = selected_real_kind(16) ++ real(K) :: b(4) ++ real(K) :: res(4) ++ end ++ end interface ++ r = c_func(my_x) ++ print *, r ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main024.f90 b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main024.f90 +new file mode 100644 +index 0000000..96804fa +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main024.f90 +@@ -0,0 +1,15 @@ ++! Test fortran call c for the return type is array of type float ++! _Complex ++! ++program main ++ complex(4) :: my_x(4) = (-3.14159265358979, 1) ++ complex(4) :: r(4) ++ interface ++ function c_func(b) ++ complex(4) :: b(4) ++ complex(4) :: c_func(4) ++ end ++ end interface ++ r = c_func(my_x) ++ print *, r ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main025.f90 b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main025.f90 +new file mode 100644 +index 0000000..64768de +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main025.f90 +@@ -0,0 +1,16 @@ ++! Test fortran call c for the return type is array of type double ++! _Complex ++! ++program main ++ complex(8) :: my_x(4) = (-3.14159265358979, 1) ++ complex(8) :: r(4) ++ interface ++ function c_func(b) result(res) ++ complex(8) :: b(4) ++ complex(8) :: res(4) ++ end ++ end interface ++ r = c_func(my_x) ++ print *, r ++end ++ +diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main026.f90 b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main026.f90 +new file mode 100644 +index 0000000..f501e62 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main026.f90 +@@ -0,0 +1,18 @@ ++! Test fortran call c for the return type is array of type long double ++! _Complex ++! ++program main ++ integer, parameter :: K = selected_real_kind(16) ++ complex(K) :: my_x(4) = (-3.14159265358979, 1) ++ complex(K) :: r(4) ++ interface ++ function c_func(b) ++ integer, parameter :: K = selected_real_kind(16) ++ complex(K) :: b(4) ++ complex(K) :: c_func(4) ++ end ++ end interface ++ r = c_func(my_x) ++ print *, r ++end ++ +diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main027.f90 b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main027.f90 +new file mode 100644 +index 0000000..136e6ff +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main027.f90 +@@ -0,0 +1,14 @@ ++! Test fortran call c for the return type is array of type bool ++! ++program main ++ logical(1) :: my_x(4) = .False. ++ logical(1) :: r(4) ++ interface ++ function c_func(b) result(res) ++ logical(1) :: b(4) ++ logical(1) :: res(4) ++ end ++ end interface ++ r = c_func(my_x) ++ print *, r ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main028.f90 b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main028.f90 +new file mode 100644 +index 0000000..257cc07 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main028.f90 +@@ -0,0 +1,14 @@ ++! Test fortran call c for the return type is array of type char ++! ++program main ++ character(1) :: my_x(4) ++ character(1) :: r(4) ++ interface ++ function c_func(b) result(res) ++ character(1) :: b(4) ++ character(1) :: res(4) ++ end ++ end interface ++ r = c_func(my_x) ++ print *, r ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main029.f90 b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main029.f90 +new file mode 100644 +index 0000000..d681390 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main029.f90 +@@ -0,0 +1,14 @@ ++! Test fortran call c for the return type is array of different sizes ++! ++program main ++ integer :: my_x(3) ++ integer :: r(3) ++ interface ++ function c_func(b) result(res) ++ integer :: b(3) ++ integer :: res(3) ++ end ++ end interface ++ r = c_func(my_x) ++ print *, r ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main030.f90 b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main030.f90 +new file mode 100644 +index 0000000..ded2f28 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main030.f90 +@@ -0,0 +1,14 @@ ++! Test fortran call c for the return type is array of different sizes ++! ++program main ++ integer :: my_x(5) ++ integer :: r(5) ++ interface ++ function c_func(b) result(res) ++ integer :: b(5) ++ integer :: res(5) ++ end ++ end interface ++ r = c_func(my_x) ++ print *, r ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main031.f90 b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main031.f90 +new file mode 100644 +index 0000000..7705bf5 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main031.f90 +@@ -0,0 +1,14 @@ ++! Test fortran call c for the return type is array of different sizes ++! ++program main ++ integer :: my_x(6) ++ integer :: r(6) ++ interface ++ function c_func(b) result(res) ++ integer :: b(6) ++ integer :: res(6) ++ end ++ end interface ++ r = c_func(my_x) ++ print *, r ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main032.f90 b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main032.f90 +new file mode 100644 +index 0000000..21e1dfe +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main032.f90 +@@ -0,0 +1,14 @@ ++! Test fortran call c for the return type is array of different sizes ++! ++program main ++ integer :: my_x(7) ++ integer :: r(7) ++ interface ++ function c_func(b) result(res) ++ integer :: b(7) ++ integer :: res(7) ++ end ++ end interface ++ r = c_func(my_x) ++ print *, r ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main033.f90 b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main033.f90 +new file mode 100644 +index 0000000..82f2a25 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main033.f90 +@@ -0,0 +1,14 @@ ++! Test fortran call c for the return type is array of different sizes ++! ++program main ++ integer :: my_x(8) ++ integer :: r(8) ++ interface ++ function c_func(b) result(res) ++ integer :: b(8) ++ integer :: res(8) ++ end ++ end interface ++ r = c_func(my_x) ++ print *, r ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main034.f90 b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main034.f90 +new file mode 100644 +index 0000000..29275a0 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main034.f90 +@@ -0,0 +1,14 @@ ++! Test fortran call c for the return type is array of different sizes ++! ++program main ++ integer :: my_x(26) ++ integer :: r(26) ++ interface ++ function c_func(b) result(res) ++ integer :: b(26) ++ integer :: res(26) ++ end ++ end interface ++ r = c_func(my_x) ++ print *, r ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main035.f90 b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main035.f90 +new file mode 100644 +index 0000000..99e3c90 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main035.f90 +@@ -0,0 +1,14 @@ ++! Test fortran call c for the return type is array of different sizes ++! ++program main ++ integer :: my_x(100) ++ integer :: r(100) ++ interface ++ function c_func(b) result(res) ++ integer :: b(100) ++ integer :: res(100) ++ end ++ end interface ++ r = c_func(my_x) ++ print *, r ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/result.md b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/result.md +new file mode 100644 +index 0000000..b7353ca +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/result.md +@@ -0,0 +1,36 @@ ++ | test | gfortran | flang | nvfortran| ++ | 001 | ERROR | PASS | PASS | ++ | 002 | ERROR | PASS | PASS | ++ | 003 | ERROR | PASS | PASS | ++ | 004 | ERROR | PASS | PASS | ++ | 005 | ERROR | PASS | PASS | ++ | 006 | ERROR | PASS | PASS | ++ | 007 | ERROR | PASS | PASS | ++ | 008 | ERROR | PASS | PASS | ++ | 009 | ERROR | PASS | PASS | ++ | 010 | ERROR | PASS | PASS | ++ | 011 | ERROR | PASS | PASS | ++ | 012 | ERROR | PASS | PASS | ++ | 013 | ERROR | PASS | PASS | ++ | 014 | ERROR | PASS | PASS | ++ | 015 | ERROR | PASS | PASS | ++ | 016 | ERROR | PASS | PASS | ++ | 017 | ERROR | PASS | PASS | ++ | 018 | ERROR | PASS | PASS | ++ | 019 | ERROR | PASS | PASS | ++ | 020 | ERROR | PASS | PASS | ++ | 021 | ERROR | PASS | PASS | ++ | 022 | ERROR | PASS | PASS | ++ | 023 | ERROR | PASS | ERROR | ++ | 024 | ERROR | ERROR | ERROR | ++ | 025 | ERROR | ERROR | ERROR | ++ | 026 | ERROR | ERROR | ERROR | ++ | 027 | PASS | PASS | PASS | ++ | 028 | ERROR | PASS | PASS | ++ | 029 | ERROR | PASS | PASS | ++ | 030 | ERROR | PASS | PASS | ++ | 031 | ERROR | PASS | PASS | ++ | 032 | ERROR | PASS | PASS | ++ | 033 | ERROR | PASS | PASS | ++ | 034 | ERROR | PASS | PASS | ++ | 035 | ERROR | PASS | PASS | +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/run.sh b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/run.sh +new file mode 100644 +index 0000000..27162b7 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/run.sh +@@ -0,0 +1,22 @@ ++for i in {001..035} ++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 ++echo "----- nvfortran result : " ++clang c_func$i.c -c -o c-test.o ++nvfortran fortran_main$i.f90 -c -o fortran-test.o ++nvfortran 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_function/006_fortran_call_c_function_array_bindc/c_func001.c b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func001.c +new file mode 100644 +index 0000000..5fc1da0 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func001.c +@@ -0,0 +1,8 @@ ++#include ++int* c_func_(int *s) ++{ ++ for(int i = 0; i < 4; i++) { ++ *(s + i) = i + 10; ++ } ++ return s; ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func002.c b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func002.c +new file mode 100644 +index 0000000..0adaedc +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func002.c +@@ -0,0 +1,8 @@ ++#include ++short* c_func_(short *s) ++{ ++ for(int i = 0; i < 4; i++) { ++ *(s + i) = i + 10; ++ } ++ return s; ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func003.c b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func003.c +new file mode 100644 +index 0000000..9e25ad4 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func003.c +@@ -0,0 +1,8 @@ ++#include ++long* c_func_(long *s) ++{ ++ for(int i = 0; i < 4; i++) { ++ *(s + i) = i + 10; ++ } ++ return s; ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func004.c b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func004.c +new file mode 100644 +index 0000000..224a535 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func004.c +@@ -0,0 +1,8 @@ ++#include ++long long* c_func_(long long *s) ++{ ++ for(int i = 0; i < 4; i++) { ++ *(s + i) = i + 10; ++ } ++ return s; ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func005.c b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func005.c +new file mode 100644 +index 0000000..ee7dadf +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func005.c +@@ -0,0 +1,8 @@ ++#include ++signed char* c_func_(signed char *s) ++{ ++ for(int i = 0; i < 4; i++) { ++ *(s + i) = i + 10; ++ } ++ return s; ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func006.c b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func006.c +new file mode 100644 +index 0000000..d1a350e +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func006.c +@@ -0,0 +1,8 @@ ++#include ++size_t* c_func_(size_t *s) ++{ ++ for(int i = 0; i < 4; i++) { ++ *(s + i) = i + 10; ++ } ++ return s; ++} +diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func007.c b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func007.c +new file mode 100644 +index 0000000..8418d36 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func007.c +@@ -0,0 +1,9 @@ ++#include ++#include ++int8_t* c_func_(int8_t *s) ++{ ++ for(int i = 0; i < 4; i++) { ++ *(s + i) = i + 10; ++ } ++ return s; ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func008.c b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func008.c +new file mode 100644 +index 0000000..63df945 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func008.c +@@ -0,0 +1,9 @@ ++#include ++#include ++int16_t* c_func_(int16_t *s) ++{ ++ for(int i = 0; i < 4; i++) { ++ *(s + i) = i + 10; ++ } ++ return s; ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func009.c b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func009.c +new file mode 100644 +index 0000000..ee3be43 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func009.c +@@ -0,0 +1,9 @@ ++#include ++#include ++int32_t* c_func_(int32_t *s) ++{ ++ for(int i = 0; i < 4; i++) { ++ *(s + i) = i + 10; ++ } ++ return s; ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func010.c b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func010.c +new file mode 100644 +index 0000000..464e81c +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func010.c +@@ -0,0 +1,9 @@ ++#include ++#include ++int64_t* c_func_(int64_t *s) ++{ ++ for(int i = 0; i < 4; i++) { ++ *(s + i) = i + 10; ++ } ++ return s; ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func011.c b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func011.c +new file mode 100644 +index 0000000..aff58ed +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func011.c +@@ -0,0 +1,9 @@ ++#include ++#include ++int_least8_t* c_func_(int_least8_t *s) ++{ ++ for(int i = 0; i < 4; i++) { ++ *(s + i) = i + 10; ++ } ++ return s; ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func012.c b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func012.c +new file mode 100644 +index 0000000..446f20c +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func012.c +@@ -0,0 +1,9 @@ ++#include ++#include ++int_least16_t* c_func_(int_least16_t *s) ++{ ++ for(int i = 0; i < 4; i++) { ++ *(s + i) = i + 10; ++ } ++ return s; ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func013.c b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func013.c +new file mode 100644 +index 0000000..976133d +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func013.c +@@ -0,0 +1,9 @@ ++#include ++#include ++int_least32_t* c_func_(int_least32_t *s) ++{ ++ for(int i = 0; i < 4; i++) { ++ *(s + i) = i + 10; ++ } ++ return s; ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func014.c b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func014.c +new file mode 100644 +index 0000000..4358884 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func014.c +@@ -0,0 +1,9 @@ ++#include ++#include ++int_least64_t* c_func_(int_least64_t *s) ++{ ++ for(int i = 0; i < 4; i++) { ++ *(s + i) = i + 10; ++ } ++ return s; ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func015.c b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func015.c +new file mode 100644 +index 0000000..fea3e63 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func015.c +@@ -0,0 +1,9 @@ ++#include ++#include ++int_fast8_t* c_func_(int_fast8_t *s) ++{ ++ for(int i = 0; i < 4; i++) { ++ *(s + i) = i + 10; ++ } ++ return s; ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func016.c b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func016.c +new file mode 100644 +index 0000000..659acf6 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func016.c +@@ -0,0 +1,9 @@ ++#include ++#include ++int_fast16_t* c_func_(int_fast16_t *s) ++{ ++ for(int i = 0; i < 4; i++) { ++ *(s + i) = i + 10; ++ } ++ return s; ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func017.c b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func017.c +new file mode 100644 +index 0000000..f8834b4 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func017.c +@@ -0,0 +1,9 @@ ++#include ++#include ++int_fast32_t* c_func_(int_fast32_t *s) ++{ ++ for(int i = 0; i < 4; i++) { ++ *(s + i) = i + 10; ++ } ++ return s; ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func018.c b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func018.c +new file mode 100644 +index 0000000..f06b163 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func018.c +@@ -0,0 +1,9 @@ ++#include ++#include ++int_fast64_t* c_func_(int_fast64_t *s) ++{ ++ for(int i = 0; i < 4; i++) { ++ *(s + i) = i + 10; ++ } ++ return s; ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func019.c b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func019.c +new file mode 100644 +index 0000000..6e1ea95 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func019.c +@@ -0,0 +1,9 @@ ++#include ++#include ++intmax_t* c_func_(intmax_t *s) ++{ ++ for(int i = 0; i < 4; i++) { ++ *(s + i) = i + 10; ++ } ++ return s; ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func020.c b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func020.c +new file mode 100644 +index 0000000..d5b3db7 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func020.c +@@ -0,0 +1,9 @@ ++#include ++#include ++intptr_t* c_func_(intptr_t *s) ++{ ++ for(int i = 0; i < 4; i++) { ++ *(s + i) = i + 10; ++ } ++ return s; ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func021.c b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func021.c +new file mode 100644 +index 0000000..8aa0811 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func021.c +@@ -0,0 +1,8 @@ ++#include ++float* c_func_(float *s) ++{ ++ for(int i = 0; i < 4; i++) { ++ *(s + i) = i + 0.1314159265358979; ++ } ++ return s; ++} +diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func022.c b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func022.c +new file mode 100644 +index 0000000..ec9fbf0 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func022.c +@@ -0,0 +1,8 @@ ++#include ++double* c_func_(double *s) ++{ ++ for(int i = 0; i < 4; i++) { ++ *(s + i) = i + 0.1314159265358979; ++ } ++ return s; ++} +diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func023.c b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func023.c +new file mode 100644 +index 0000000..64d1980 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func023.c +@@ -0,0 +1,8 @@ ++#include ++long double* c_func_(long double *s) ++{ ++ for(int i = 0; i < 4; i++) { ++ *(s + i) = i + 0.1314159265358979; ++ } ++ return s; ++} +diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func024.c b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func024.c +new file mode 100644 +index 0000000..63426c5 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func024.c +@@ -0,0 +1,6 @@ ++#include ++#include ++float _Complex* c_func_(float _Complex *s) ++{ ++ return s; ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func025.c b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func025.c +new file mode 100644 +index 0000000..8357f17 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func025.c +@@ -0,0 +1,6 @@ ++#include ++#include ++double _Complex* c_func_(double _Complex *s) ++{ ++ return s; ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func026.c b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func026.c +new file mode 100644 +index 0000000..f5871a9 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func026.c +@@ -0,0 +1,6 @@ ++#include ++#include ++long double _Complex* c_func_(long double _Complex *s) ++{ ++ return s; ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func027.c b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func027.c +new file mode 100644 +index 0000000..69cde43 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func027.c +@@ -0,0 +1,8 @@ ++#include ++_Bool* c_func_(_Bool *s) ++{ ++ for(int i = 0; i < 4; i++) { ++ *(s + i) = 1; ++ } ++ return s; ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func028.c b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func028.c +new file mode 100644 +index 0000000..25b531b +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func028.c +@@ -0,0 +1,8 @@ ++#include ++char* c_func_(char *s) ++{ ++ for(int i = 0; i < 4; i++) { ++ *(s + i) = 'a' + i; ++ } ++ return s; ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func029.c b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func029.c +new file mode 100644 +index 0000000..30526c7 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func029.c +@@ -0,0 +1,8 @@ ++#include ++int* c_func_(int *s) ++{ ++ for(int i = 0; i < 3; i++) { ++ *(s + i) = i + 10; ++ } ++ return s; ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func030.c b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func030.c +new file mode 100644 +index 0000000..542897f +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func030.c +@@ -0,0 +1,8 @@ ++#include ++int* c_func_(int *s) ++{ ++ for(int i = 0; i < 5; i++) { ++ *(s + i) = i + 10; ++ } ++ return s; ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func031.c b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func031.c +new file mode 100644 +index 0000000..8f4f7db +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func031.c +@@ -0,0 +1,8 @@ ++#include ++int* c_func_(int *s) ++{ ++ for(int i = 0; i < 6; i++) { ++ *(s + i) = i + 10; ++ } ++ return s; ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func032.c b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func032.c +new file mode 100644 +index 0000000..2f457db +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func032.c +@@ -0,0 +1,8 @@ ++#include ++int* c_func_(int *s) ++{ ++ for(int i = 0; i < 7; i++) { ++ *(s + i) = i + 10; ++ } ++ return s; ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func033.c b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func033.c +new file mode 100644 +index 0000000..f4d27c8 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func033.c +@@ -0,0 +1,8 @@ ++#include ++int* c_func_(int *s) ++{ ++ for(int i = 0; i < 8; i++) { ++ *(s + i) = i + 10; ++ } ++ return s; ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func034.c b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func034.c +new file mode 100644 +index 0000000..2cadd95 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func034.c +@@ -0,0 +1,8 @@ ++#include ++int* c_func_(int *s) ++{ ++ for(int i = 0; i < 26; i++) { ++ *(s + i) = i + 10; ++ } ++ return s; ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func035.c b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func035.c +new file mode 100644 +index 0000000..4d12dea +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func035.c +@@ -0,0 +1,8 @@ ++#include ++int* c_func_(int *s) ++{ ++ for(int i = 0; i < 100; i++) { ++ *(s + i) = i + 10; ++ } ++ return s; ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main001.f90 b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main001.f90 +new file mode 100644 +index 0000000..86e491b +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main001.f90 +@@ -0,0 +1,14 @@ ++! Test fortran call c for the return type is array of type int ++! ++program main ++ integer :: my_x(4) ++ integer :: r(4) ++ interface ++ function c_func(b) result(res) bind(c, name = "c_func_") ++ integer :: b(4) ++ integer :: res(4) ++ end ++ end interface ++ r = c_func(my_x) ++ print *, r ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main002.f90 b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main002.f90 +new file mode 100644 +index 0000000..4aa33cc +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main002.f90 +@@ -0,0 +1,14 @@ ++! Test fortran call c for the return type is array of type short ++! ++program main ++ integer(2) :: my_x(4) ++ integer(2) :: r(4) ++ interface ++ function c_func(b) result(res) bind(c, name = "c_func_") ++ integer(2) :: b(4) ++ integer(2) :: res(4) ++ end ++ end interface ++ r = c_func(my_x) ++ print *, r ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main003.f90 b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main003.f90 +new file mode 100644 +index 0000000..fe26878 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main003.f90 +@@ -0,0 +1,14 @@ ++! Test fortran call c for the return type is array of type long ++! ++program main ++ integer(8) :: my_x(4) ++ integer(8) :: r(4) ++ interface ++ function c_func(b) result(res) bind(c, name = "c_func_") ++ integer(8) :: b(4) ++ integer(8) :: res(4) ++ end ++ end interface ++ r = c_func(my_x) ++ print *, r ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main004.f90 b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main004.f90 +new file mode 100644 +index 0000000..a6df6b7 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main004.f90 +@@ -0,0 +1,14 @@ ++! Test fortran call c for the return type is array of type long long ++! ++program main ++ integer(8) :: my_x(4) ++ integer(8) :: r(4) ++ interface ++ function c_func(b) result(res) bind(c, name = "c_func_") ++ integer(8) :: b(4) ++ integer(8) :: res(4) ++ end ++ end interface ++ r = c_func(my_x) ++ print *, r ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main005.f90 b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main005.f90 +new file mode 100644 +index 0000000..989272a +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main005.f90 +@@ -0,0 +1,14 @@ ++! Test fortran call c for the return type is array of type signed char ++! ++program main ++ integer(1) :: my_x(4) ++ integer(1) :: r(4) ++ interface ++ function c_func(b) result(res) bind(c, name = "c_func_") ++ integer(1) :: b(4) ++ integer(1) :: res(4) ++ end ++ end interface ++ r = c_func(my_x) ++ print *, r ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main006.f90 b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main006.f90 +new file mode 100644 +index 0000000..232ad83 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main006.f90 +@@ -0,0 +1,14 @@ ++! Test fortran call c for the return type is array of type size_t ++! ++program main ++ integer(8) :: my_x(4) ++ integer(8) :: r(4) ++ interface ++ function c_func(b) result(res) bind(c, name = "c_func_") ++ integer(8) :: b(4) ++ integer(8) :: res(4) ++ end ++ end interface ++ r = c_func(my_x) ++ print *, r ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main007.f90 b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main007.f90 +new file mode 100644 +index 0000000..87d03be +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main007.f90 +@@ -0,0 +1,14 @@ ++! Test fortran call c for the return type is array of type int8_t ++! ++program main ++ integer(1) :: my_x(4) ++ integer(1) :: r(4) ++ interface ++ function c_func(b) result(res) bind(c, name = "c_func_") ++ integer(1) :: b(4) ++ integer(1) :: res(4) ++ end ++ end interface ++ r = c_func(my_x) ++ print *, r ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main008.f90 b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main008.f90 +new file mode 100644 +index 0000000..e083e4e +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main008.f90 +@@ -0,0 +1,14 @@ ++! Test fortran call c for the return type is array of type int16_t ++! ++program main ++ integer(2) :: my_x(4) ++ integer(2) :: r(4) ++ interface ++ function c_func(b) result(res) bind(c, name = "c_func_") ++ integer(2) :: b(4) ++ integer(2) :: res(4) ++ end ++ end interface ++ r = c_func(my_x) ++ print *, r ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main009.f90 b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main009.f90 +new file mode 100644 +index 0000000..2f5daea +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main009.f90 +@@ -0,0 +1,14 @@ ++! Test fortran call c for the return type is array of type int32_t ++! ++program main ++ integer(4) :: my_x(4) ++ integer(4) :: r(4) ++ interface ++ function c_func(b) result(res) bind(c, name = "c_func_") ++ integer(4) :: b(4) ++ integer(4) :: res(4) ++ end ++ end interface ++ r = c_func(my_x) ++ print *, r ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main010.f90 b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main010.f90 +new file mode 100644 +index 0000000..32cd91a +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main010.f90 +@@ -0,0 +1,14 @@ ++! Test fortran call c for the return type is array of type int64_t ++! ++program main ++ integer(8) :: my_x(4) ++ integer(8) :: r(4) ++ interface ++ function c_func(b) result(res) bind(c, name = "c_func_") ++ integer(8) :: b(4) ++ integer(8) :: res(4) ++ end ++ end interface ++ r = c_func(my_x) ++ print *, r ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main011.f90 b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main011.f90 +new file mode 100644 +index 0000000..909ae51 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main011.f90 +@@ -0,0 +1,14 @@ ++! Test fortran call c for the return type is array of type int_least8_t ++! ++program main ++ integer(1) :: my_x(4) ++ integer(1) :: r(4) ++ interface ++ function c_func(b) result(res) bind(c, name = "c_func_") ++ integer(1) :: b(4) ++ integer(1) :: res(4) ++ end ++ end interface ++ r = c_func(my_x) ++ print *, r ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main012.f90 b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main012.f90 +new file mode 100644 +index 0000000..6c0eaa0 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main012.f90 +@@ -0,0 +1,15 @@ ++! Test fortran call c for the return type is array of type ++! int_least16_t ++! ++program main ++ integer(2) :: my_x(4) ++ integer(2) :: r(4) ++ interface ++ function c_func(b) result(res) bind(c, name = "c_func_") ++ integer(2) :: b(4) ++ integer(2) :: res(4) ++ end ++ end interface ++ r = c_func(my_x) ++ print *, r ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main013.f90 b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main013.f90 +new file mode 100644 +index 0000000..2b85f87 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main013.f90 +@@ -0,0 +1,15 @@ ++! Test fortran call c for the return type is array of type ++! int_least32_t ++! ++program main ++ integer(4) :: my_x(4) ++ integer(4) :: r(4) ++ interface ++ function c_func(b) result(res) bind(c, name = "c_func_") ++ integer(4) :: b(4) ++ integer(4) :: res(4) ++ end ++ end interface ++ r = c_func(my_x) ++ print *, r ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main014.f90 b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main014.f90 +new file mode 100644 +index 0000000..2ab17c7 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main014.f90 +@@ -0,0 +1,15 @@ ++! Test fortran call c for the return type is array of type ++! int_least64_t ++! ++program main ++ integer(8) :: my_x(4) ++ integer(8) :: r(4) ++ interface ++ function c_func(b) result(res) bind(c, name = "c_func_") ++ integer(8) :: b(4) ++ integer(8) :: res(4) ++ end ++ end interface ++ r = c_func(my_x) ++ print *, r ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main015.f90 b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main015.f90 +new file mode 100644 +index 0000000..8f8fdb0 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main015.f90 +@@ -0,0 +1,14 @@ ++! Test fortran call c for the return type is array of type int_fast8_t ++! ++program main ++ integer(1) :: my_x(4) ++ integer(1) :: r(4) ++ interface ++ function c_func(b) result(res) bind(c, name = "c_func_") ++ integer(1) :: b(4) ++ integer(1) :: res(4) ++ end ++ end interface ++ r = c_func(my_x) ++ print *, r ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main016.f90 b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main016.f90 +new file mode 100644 +index 0000000..2e55344 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main016.f90 +@@ -0,0 +1,14 @@ ++! Test fortran call c for the return type is array of type int_fast16_t ++! ++program main ++ integer(8) :: my_x(4) ++ integer(8) :: r(4) ++ interface ++ function c_func(b) result(res) bind(c, name = "c_func_") ++ integer(8) :: b(4) ++ integer(8) :: res(4) ++ end ++ end interface ++ r = c_func(my_x) ++ print *, r ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main017.f90 b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main017.f90 +new file mode 100644 +index 0000000..78f9802 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main017.f90 +@@ -0,0 +1,14 @@ ++! Test fortran call c for the return type is array of type int_fast32_t ++! ++program main ++ integer(8) :: my_x(4) ++ integer(8) :: r(4) ++ interface ++ function c_func(b) result(res) bind(c, name = "c_func_") ++ integer(8) :: b(4) ++ integer(8) :: res(4) ++ end ++ end interface ++ r = c_func(my_x) ++ print *, r ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main018.f90 b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main018.f90 +new file mode 100644 +index 0000000..a7208b8 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main018.f90 +@@ -0,0 +1,14 @@ ++! Test fortran call c for the return type is array of type int_fast64_t ++! ++program main ++ integer(8) :: my_x(4) ++ integer(8) :: r(4) ++ interface ++ function c_func(b) result(res) bind(c, name = "c_func_") ++ integer(8) :: b(4) ++ integer(8) :: res(4) ++ end ++ end interface ++ r = c_func(my_x) ++ print *, r ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main019.f90 b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main019.f90 +new file mode 100644 +index 0000000..95df634 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main019.f90 +@@ -0,0 +1,14 @@ ++! Test fortran call c for the return type is array of type intmax_t ++! ++program main ++ integer(8) :: my_x(4) ++ integer(8) :: r(4) ++ interface ++ function c_func(b) result(res) bind(c, name = "c_func_") ++ integer(8) :: b(4) ++ integer(8) :: res(4) ++ end ++ end interface ++ r = c_func(my_x) ++ print *, r ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main020.f90 b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main020.f90 +new file mode 100644 +index 0000000..a4220c2 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main020.f90 +@@ -0,0 +1,14 @@ ++! Test fortran call c for the return type is array of type intptr_t ++! ++program main ++ integer(8) :: my_x(4) ++ integer(8) :: r(4) ++ interface ++ function c_func(b) result(res) bind(c, name = "c_func_") ++ integer(8) :: b(4) ++ integer(8) :: res(4) ++ end ++ end interface ++ r = c_func(my_x) ++ print *, r ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main021.f90 b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main021.f90 +new file mode 100644 +index 0000000..b08d517 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main021.f90 +@@ -0,0 +1,14 @@ ++! Test fortran call c for the return type is array of type float ++! ++program main ++ real(4) :: my_x(4) ++ real(4) :: r(4) ++ interface ++ function c_func(b) result(res) bind(c, name = "c_func_") ++ real(4) :: b(4) ++ real(4) :: res(4) ++ end ++ end interface ++ r = c_func(my_x) ++ print *, r ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main022.f90 b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main022.f90 +new file mode 100644 +index 0000000..d47918e +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main022.f90 +@@ -0,0 +1,14 @@ ++! Test fortran call c for the return type is array of type double ++! ++program main ++ real(8) :: my_x(4) ++ real(8) :: r(4) ++ interface ++ function c_func(b) result(res) bind(c, name = "c_func_") ++ real(8) :: b(4) ++ real(8) :: res(4) ++ end ++ end interface ++ r = c_func(my_x) ++ print *, r ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main023.f90 b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main023.f90 +new file mode 100644 +index 0000000..a0d0575 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main023.f90 +@@ -0,0 +1,16 @@ ++! Test fortran call c for the return type is array of type long double ++! ++program main ++ integer, parameter :: K = selected_real_kind(16) ++ real(K) :: my_x(4) ++ real(K) :: r(4) ++ interface ++ function c_func(b) result(res) bind(c, name = "c_func_") ++ integer, parameter :: K = selected_real_kind(16) ++ real(K) :: b(4) ++ real(K) :: res(4) ++ end ++ end interface ++ r = c_func(my_x) ++ print *, r ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main024.f90 b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main024.f90 +new file mode 100644 +index 0000000..07685eb +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main024.f90 +@@ -0,0 +1,15 @@ ++! Test fortran call c for the return type is array of type float ++! _Complex ++! ++program main ++ complex(4) :: my_x(4) = (-3.14159265358979, 1) ++ complex(4) :: r(4) ++ interface ++ function c_func(b) bind(c, name = "c_func_") ++ complex(4) :: b(4) ++ complex(4) :: c_func(4) ++ end ++ end interface ++ r = c_func(my_x) ++ print *, r ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main025.f90 b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main025.f90 +new file mode 100644 +index 0000000..9e5457f +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main025.f90 +@@ -0,0 +1,16 @@ ++! Test fortran call c for the return type is array of type double ++! _Complex ++! ++program main ++ complex(8) :: my_x(4) = (-3.14159265358979, 1) ++ complex(8) :: r(4) ++ interface ++ function c_func(b) result(res) bind(c, name = "c_func_") ++ complex(8) :: b(4) ++ complex(8) :: res(4) ++ end ++ end interface ++ r = c_func(my_x) ++ print *, r ++end ++ +diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main026.f90 b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main026.f90 +new file mode 100644 +index 0000000..72412b2 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main026.f90 +@@ -0,0 +1,18 @@ ++! Test fortran call c for the return type is array of type long double ++! _Complex ++! ++program main ++ integer, parameter :: K = selected_real_kind(16) ++ complex(K) :: my_x(4) = (-3.14159265358979, 1) ++ complex(K) :: r(4) ++ interface ++ function c_func(b) bind(c, name = "c_func_") ++ integer, parameter :: K = selected_real_kind(16) ++ complex(K) :: b(4) ++ complex(K) :: c_func(4) ++ end ++ end interface ++ r = c_func(my_x) ++ print *, r ++end ++ +diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main027.f90 b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main027.f90 +new file mode 100644 +index 0000000..16dfa87 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main027.f90 +@@ -0,0 +1,14 @@ ++! Test fortran call c for the return type is array of type bool ++! ++program main ++ logical(1) :: my_x(4) = .False. ++ logical(1) :: r(4) ++ interface ++ function c_func(b) result(res) bind(c, name = "c_func_") ++ logical(1) :: b(4) ++ logical(1) :: res(4) ++ end ++ end interface ++ r = c_func(my_x) ++ print *, r ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main028.f90 b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main028.f90 +new file mode 100644 +index 0000000..8616ed4 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main028.f90 +@@ -0,0 +1,14 @@ ++! Test fortran call c for the return type is array of type char ++! ++program main ++ character(1) :: my_x(4) ++ character(1) :: r(4) ++ interface ++ function c_func(b) result(res) bind(c, name = "c_func_") ++ character(1) :: b(4) ++ character(1) :: res(4) ++ end ++ end interface ++ r = c_func(my_x) ++ print *, r ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main029.f90 b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main029.f90 +new file mode 100644 +index 0000000..a5a7bd8 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main029.f90 +@@ -0,0 +1,14 @@ ++! Test fortran call c for the return type is array of different sizes ++! ++program main ++ integer :: my_x(3) ++ integer :: r(3) ++ interface ++ function c_func(b) result(res) bind(c, name = "c_func_") ++ integer :: b(3) ++ integer :: res(3) ++ end ++ end interface ++ r = c_func(my_x) ++ print *, r ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main030.f90 b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main030.f90 +new file mode 100644 +index 0000000..186f3d9 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main030.f90 +@@ -0,0 +1,14 @@ ++! Test fortran call c for the return type is array of different sizes ++! ++program main ++ integer :: my_x(5) ++ integer :: r(5) ++ interface ++ function c_func(b) result(res) bind(c, name = "c_func_") ++ integer :: b(5) ++ integer :: res(5) ++ end ++ end interface ++ r = c_func(my_x) ++ print *, r ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main031.f90 b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main031.f90 +new file mode 100644 +index 0000000..8ccc524 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main031.f90 +@@ -0,0 +1,14 @@ ++! Test fortran call c for the return type is array of different sizes ++! ++program main ++ integer :: my_x(6) ++ integer :: r(6) ++ interface ++ function c_func(b) result(res) bind(c, name = "c_func_") ++ integer :: b(6) ++ integer :: res(6) ++ end ++ end interface ++ r = c_func(my_x) ++ print *, r ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main032.f90 b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main032.f90 +new file mode 100644 +index 0000000..8884e3a +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main032.f90 +@@ -0,0 +1,14 @@ ++! Test fortran call c for the return type is array of different sizes ++! ++program main ++ integer :: my_x(7) ++ integer :: r(7) ++ interface ++ function c_func(b) result(res) bind(c, name = "c_func_") ++ integer :: b(7) ++ integer :: res(7) ++ end ++ end interface ++ r = c_func(my_x) ++ print *, r ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main033.f90 b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main033.f90 +new file mode 100644 +index 0000000..e2b6170 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main033.f90 +@@ -0,0 +1,14 @@ ++! Test fortran call c for the return type is array of different sizes ++! ++program main ++ integer :: my_x(8) ++ integer :: r(8) ++ interface ++ function c_func(b) result(res) bind(c, name = "c_func_") ++ integer :: b(8) ++ integer :: res(8) ++ end ++ end interface ++ r = c_func(my_x) ++ print *, r ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main034.f90 b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main034.f90 +new file mode 100644 +index 0000000..31fd7ed +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main034.f90 +@@ -0,0 +1,14 @@ ++! Test fortran call c for the return type is array of different sizes ++! ++program main ++ integer :: my_x(26) ++ integer :: r(26) ++ interface ++ function c_func(b) result(res) bind(c, name = "c_func_") ++ integer :: b(26) ++ integer :: res(26) ++ end ++ end interface ++ r = c_func(my_x) ++ print *, r ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main035.f90 b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main035.f90 +new file mode 100644 +index 0000000..99e3c90 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main035.f90 +@@ -0,0 +1,14 @@ ++! Test fortran call c for the return type is array of different sizes ++! ++program main ++ integer :: my_x(100) ++ integer :: r(100) ++ interface ++ function c_func(b) result(res) ++ integer :: b(100) ++ integer :: res(100) ++ end ++ end interface ++ r = c_func(my_x) ++ print *, r ++end +diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/result.md b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/result.md +new file mode 100644 +index 0000000..54fff94 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/result.md +@@ -0,0 +1,36 @@ ++ | test | gfortran | flang | nvfortran| ++ | 001 | ERROR | PASS | PASS | ++ | 002 | ERROR | PASS | PASS | ++ | 003 | ERROR | PASS | PASS | ++ | 004 | ERROR | PASS | PASS | ++ | 005 | ERROR | PASS | PASS | ++ | 006 | ERROR | PASS | PASS | ++ | 007 | ERROR | PASS | PASS | ++ | 008 | ERROR | PASS | PASS | ++ | 009 | ERROR | PASS | PASS | ++ | 010 | ERROR | PASS | PASS | ++ | 011 | ERROR | PASS | PASS | ++ | 012 | ERROR | PASS | PASS | ++ | 013 | ERROR | PASS | PASS | ++ | 014 | ERROR | PASS | PASS | ++ | 015 | ERROR | PASS | PASS | ++ | 016 | ERROR | PASS | PASS | ++ | 017 | ERROR | PASS | PASS | ++ | 018 | ERROR | PASS | PASS | ++ | 019 | ERROR | PASS | PASS | ++ | 020 | ERROR | PASS | PASS | ++ | 021 | ERROR | PASS | PASS | ++ | 022 | ERROR | PASS | PASS | ++ | 023 | ERROR | PASS | ERROR | ++ | 024 | ERROR | ERROR | ERROR | ++ | 025 | ERROR | ERROR | ERROR | ++ | 026 | ERROR | ERROR | ERROR | ++ | 027 | ERROR | PASS | PASS | ++ | 028 | ERROR | PASS | PASS | ++ | 029 | ERROR | PASS | PASS | ++ | 030 | ERROR | PASS | PASS | ++ | 031 | ERROR | PASS | PASS | ++ | 032 | ERROR | PASS | PASS | ++ | 033 | ERROR | PASS | PASS | ++ | 034 | ERROR | PASS | PASS | ++ | 035 | ERROR | PASS | PASS | +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/run.sh b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/run.sh +new file mode 100644 +index 0000000..2316030 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/run.sh +@@ -0,0 +1,22 @@ ++for i in {001..035} ++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 ++echo "----- nvfortran result : " ++clang c_func$i.c -c -o c-test.o ++nvfortran fortran_main$i.f90 -c -o fortran-test.o ++nvfortran 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_function/007_fortran_call_c_function_struct_ptr/c_func001.c b/test/interoperability_with_c_fortran_call_c_function/007_fortran_call_c_function_struct_ptr/c_func001.c +new file mode 100644 +index 0000000..4129bb3 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/007_fortran_call_c_function_struct_ptr/c_func001.c +@@ -0,0 +1,7 @@ ++struct t1 { ++ int n; ++}t; ++struct t1 *c_func_(struct t1 *x) { ++ x->n = 1; ++ return x; ++} +diff --git a/test/interoperability_with_c_fortran_call_c_function/007_fortran_call_c_function_struct_ptr/c_func002.c b/test/interoperability_with_c_fortran_call_c_function/007_fortran_call_c_function_struct_ptr/c_func002.c +new file mode 100644 +index 0000000..e71f527 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/007_fortran_call_c_function_struct_ptr/c_func002.c +@@ -0,0 +1,10 @@ ++#include ++struct t1 { ++ int16_t n2; ++ int8_t n; ++}t; ++struct t1 *c_func_(struct t1 *x) { ++ x->n = 1; ++ x->n2 = 2; ++ return x; ++} +diff --git a/test/interoperability_with_c_fortran_call_c_function/007_fortran_call_c_function_struct_ptr/c_func003.c b/test/interoperability_with_c_fortran_call_c_function/007_fortran_call_c_function_struct_ptr/c_func003.c +new file mode 100644 +index 0000000..e7d056a +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/007_fortran_call_c_function_struct_ptr/c_func003.c +@@ -0,0 +1,12 @@ ++#include ++struct t1 { ++ int32_t n3; ++ int16_t n2; ++ int8_t n; ++}t; ++struct t1 *c_func_(struct t1 *x) { ++ x->n = 1; ++ x->n2 = 2; ++ x->n3 = 3; ++ return x; ++} +diff --git a/test/interoperability_with_c_fortran_call_c_function/007_fortran_call_c_function_struct_ptr/c_func004.c b/test/interoperability_with_c_fortran_call_c_function/007_fortran_call_c_function_struct_ptr/c_func004.c +new file mode 100644 +index 0000000..93641b3 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/007_fortran_call_c_function_struct_ptr/c_func004.c +@@ -0,0 +1,14 @@ ++#include ++struct t1 { ++ int64_t n4; ++ int32_t n3; ++ int16_t n2; ++ int8_t n; ++}t; ++struct t1 *c_func_(struct t1 *x) { ++ x->n = 1; ++ x->n2 = 2; ++ x->n3 = 3; ++ x->n4 = 4; ++ return x; ++} +diff --git a/test/interoperability_with_c_fortran_call_c_function/007_fortran_call_c_function_struct_ptr/c_func005.c b/test/interoperability_with_c_fortran_call_c_function/007_fortran_call_c_function_struct_ptr/c_func005.c +new file mode 100644 +index 0000000..b751e28 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/007_fortran_call_c_function_struct_ptr/c_func005.c +@@ -0,0 +1,17 @@ ++#include ++struct t1 { ++ int64_t n5[2]; ++ int64_t n4; ++ int32_t n3; ++ int16_t n2; ++ int8_t n; ++}t; ++struct t1 *c_func_(struct t1 *x) { ++ x->n = 1; ++ x->n2 = 2; ++ x->n3 = 3; ++ x->n4 = 4; ++ x->n5[1] = 0; ++ x->n5[0] = 5; ++ return x; ++} +diff --git a/test/interoperability_with_c_fortran_call_c_function/007_fortran_call_c_function_struct_ptr/c_func006.c b/test/interoperability_with_c_fortran_call_c_function/007_fortran_call_c_function_struct_ptr/c_func006.c +new file mode 100644 +index 0000000..6ce4085 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/007_fortran_call_c_function_struct_ptr/c_func006.c +@@ -0,0 +1,16 @@ ++#include ++struct t1 { ++ int64_t n4[2]; ++ int32_t n3[2]; ++ int16_t n2[2]; ++ int8_t n[2]; ++}t; ++struct t1 *c_func_(struct t1 *x) { ++ for(int i = 0; i < 2; i++) { ++ x->n[i] = 1; ++ x->n2[i] = 2; ++ x->n3[i] = 3; ++ x->n4[i] = 4; ++ } ++ return x; ++} +diff --git a/test/interoperability_with_c_fortran_call_c_function/007_fortran_call_c_function_struct_ptr/c_func007.c b/test/interoperability_with_c_fortran_call_c_function/007_fortran_call_c_function_struct_ptr/c_func007.c +new file mode 100644 +index 0000000..8ba94e3 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/007_fortran_call_c_function_struct_ptr/c_func007.c +@@ -0,0 +1,16 @@ ++#include ++struct t1 { ++ int64_t n4; ++ int32_t n3; ++ int16_t n2; ++ int8_t n; ++}t; ++struct t1 *c_func_(struct t1 *x) { ++ for(int i = 0; i < 4; i++) { ++ x[i].n = 1; ++ x[i].n2 = 2; ++ x[i].n3 = 3; ++ x[i].n4 = 4; ++ } ++ return x; ++} +diff --git a/test/interoperability_with_c_fortran_call_c_function/007_fortran_call_c_function_struct_ptr/fortran_main001.f90 b/test/interoperability_with_c_fortran_call_c_function/007_fortran_call_c_function_struct_ptr/fortran_main001.f90 +new file mode 100644 +index 0000000..6517e69 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/007_fortran_call_c_function_struct_ptr/fortran_main001.f90 +@@ -0,0 +1,18 @@ ++! test fortran call C for function return pointer of struct ++! ++program main ++ type t ++ integer :: n ++ end type t ++ interface ++ function c_func(x) ++ import :: t ++ type(t) :: x ++ type(t), pointer :: c_func ++ end ++ end interface ++ type(t) :: my_x ++ type(t) :: res ++ res = c_func(my_x) ++ print *, res ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_function/007_fortran_call_c_function_struct_ptr/fortran_main002.f90 b/test/interoperability_with_c_fortran_call_c_function/007_fortran_call_c_function_struct_ptr/fortran_main002.f90 +new file mode 100644 +index 0000000..5c6f2ca +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/007_fortran_call_c_function_struct_ptr/fortran_main002.f90 +@@ -0,0 +1,19 @@ ++! test fortran call C for function return pointer of struct ++! ++program main ++ type t ++ integer(2) :: n2 ++ integer(1) :: n ++ end type t ++ interface ++ function c_func(x) ++ import :: t ++ type(t) :: x ++ type(t), pointer :: c_func ++ end ++ end interface ++ type(t) :: my_x ++ type(t) :: res ++ res = c_func(my_x) ++ print *, res ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_function/007_fortran_call_c_function_struct_ptr/fortran_main003.f90 b/test/interoperability_with_c_fortran_call_c_function/007_fortran_call_c_function_struct_ptr/fortran_main003.f90 +new file mode 100644 +index 0000000..7e1aae2 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/007_fortran_call_c_function_struct_ptr/fortran_main003.f90 +@@ -0,0 +1,20 @@ ++! test fortran call C for function return pointer of struct ++! ++program main ++ type t ++ integer(4) :: n3 ++ integer(2) :: n2 ++ integer(1) :: n ++ end type t ++ interface ++ function c_func(x) ++ import :: t ++ type(t) :: x ++ type(t), pointer :: c_func ++ end ++ end interface ++ type(t) :: my_x ++ type(t) :: res ++ res = c_func(my_x) ++ print *, res ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_function/007_fortran_call_c_function_struct_ptr/fortran_main004.f90 b/test/interoperability_with_c_fortran_call_c_function/007_fortran_call_c_function_struct_ptr/fortran_main004.f90 +new file mode 100644 +index 0000000..7197fd2 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/007_fortran_call_c_function_struct_ptr/fortran_main004.f90 +@@ -0,0 +1,21 @@ ++! test fortran call C for function return pointer of struct ++! ++program main ++ type t ++ integer(8) :: n4 ++ integer(4) :: n3 ++ integer(2) :: n2 ++ integer(1) :: n ++ end type t ++ interface ++ function c_func(x) ++ import :: t ++ type(t) :: x ++ type(t), pointer :: c_func ++ end ++ end interface ++ type(t) :: my_x ++ type(t) :: res ++ res = c_func(my_x) ++ print *, res ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_function/007_fortran_call_c_function_struct_ptr/fortran_main005.f90 b/test/interoperability_with_c_fortran_call_c_function/007_fortran_call_c_function_struct_ptr/fortran_main005.f90 +new file mode 100644 +index 0000000..0e5301d +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/007_fortran_call_c_function_struct_ptr/fortran_main005.f90 +@@ -0,0 +1,22 @@ ++! test fortran call C for function return pointer of struct ++! ++program main ++ type t ++ integer(16) :: n5 ++ integer(8) :: n4 ++ integer(4) :: n3 ++ integer(2) :: n2 ++ integer(1) :: n ++ end type t ++ interface ++ function c_func(x) ++ import :: t ++ type(t) :: x ++ type(t), pointer :: c_func ++ end ++ end interface ++ type(t) :: my_x ++ type(t) :: res ++ res = c_func(my_x) ++ print *, res ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_function/007_fortran_call_c_function_struct_ptr/fortran_main006.f90 b/test/interoperability_with_c_fortran_call_c_function/007_fortran_call_c_function_struct_ptr/fortran_main006.f90 +new file mode 100644 +index 0000000..5339b10 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/007_fortran_call_c_function_struct_ptr/fortran_main006.f90 +@@ -0,0 +1,21 @@ ++! test fortran call C for function return pointer of struct ++! ++program main ++ type t ++ integer(8) :: n4(2) ++ integer(4) :: n3(2) ++ integer(2) :: n2(2) ++ integer(1) :: n(2) ++ end type t ++ interface ++ function c_func(x) ++ import :: t ++ type(t) :: x ++ type(t), pointer :: c_func ++ end ++ end interface ++ type(t) :: my_x ++ type(t) :: res ++ res = c_func(my_x) ++ print *, res ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_function/007_fortran_call_c_function_struct_ptr/fortran_main007.f90 b/test/interoperability_with_c_fortran_call_c_function/007_fortran_call_c_function_struct_ptr/fortran_main007.f90 +new file mode 100644 +index 0000000..a3d193e +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/007_fortran_call_c_function_struct_ptr/fortran_main007.f90 +@@ -0,0 +1,21 @@ ++! test fortran call C for function return array of struct ++! ++program main ++ type t ++ integer(8) :: n4 ++ integer(4) :: n3 ++ integer(2) :: n2 ++ integer(1) :: n ++ end type t ++ interface ++ function c_func(x) ++ import :: t ++ type(t) :: x(4) ++ type(t) :: c_func(4) ++ end ++ end interface ++ type(t) :: my_x(4) ++ type(t) :: res(4) ++ res = c_func(my_x) ++ print *, res ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_function/007_fortran_call_c_function_struct_ptr/result.md b/test/interoperability_with_c_fortran_call_c_function/007_fortran_call_c_function_struct_ptr/result.md +new file mode 100644 +index 0000000..0721a01 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/007_fortran_call_c_function_struct_ptr/result.md +@@ -0,0 +1,8 @@ ++ | test | gfortran | flang | nvfortran| ++ | 001 | PASS | ERROR | ERROR | ++ | 002 | PASS | ERROR | ERROR | ++ | 003 | PASS | ERROR | ERROR | ++ | 004 | PASS | ERROR | ERROR | ++ | 005 | PASS | ERROR | ERROR | ++ | 006 | PASS | ERROR | ERROR | ++ | 007 | ERROR | PASS | PASS | +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_function/007_fortran_call_c_function_struct_ptr/run.sh b/test/interoperability_with_c_fortran_call_c_function/007_fortran_call_c_function_struct_ptr/run.sh +new file mode 100644 +index 0000000..d26dcea +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/007_fortran_call_c_function_struct_ptr/run.sh +@@ -0,0 +1,22 @@ ++for i in {001..007} ++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 ++echo "----- nvfortran result : " ++clang c_func$i.c -c -o c-test.o ++nvfortran fortran_main$i.f90 -c -o fortran-test.o ++nvfortran 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_function/008_fortran_call_c_function_struct_ptr_bindc/c_func001.c b/test/interoperability_with_c_fortran_call_c_function/008_fortran_call_c_function_struct_ptr_bindc/c_func001.c +new file mode 100644 +index 0000000..4129bb3 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/008_fortran_call_c_function_struct_ptr_bindc/c_func001.c +@@ -0,0 +1,7 @@ ++struct t1 { ++ int n; ++}t; ++struct t1 *c_func_(struct t1 *x) { ++ x->n = 1; ++ return x; ++} +diff --git a/test/interoperability_with_c_fortran_call_c_function/008_fortran_call_c_function_struct_ptr_bindc/c_func002.c b/test/interoperability_with_c_fortran_call_c_function/008_fortran_call_c_function_struct_ptr_bindc/c_func002.c +new file mode 100644 +index 0000000..e71f527 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/008_fortran_call_c_function_struct_ptr_bindc/c_func002.c +@@ -0,0 +1,10 @@ ++#include ++struct t1 { ++ int16_t n2; ++ int8_t n; ++}t; ++struct t1 *c_func_(struct t1 *x) { ++ x->n = 1; ++ x->n2 = 2; ++ return x; ++} +diff --git a/test/interoperability_with_c_fortran_call_c_function/008_fortran_call_c_function_struct_ptr_bindc/c_func003.c b/test/interoperability_with_c_fortran_call_c_function/008_fortran_call_c_function_struct_ptr_bindc/c_func003.c +new file mode 100644 +index 0000000..e7d056a +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/008_fortran_call_c_function_struct_ptr_bindc/c_func003.c +@@ -0,0 +1,12 @@ ++#include ++struct t1 { ++ int32_t n3; ++ int16_t n2; ++ int8_t n; ++}t; ++struct t1 *c_func_(struct t1 *x) { ++ x->n = 1; ++ x->n2 = 2; ++ x->n3 = 3; ++ return x; ++} +diff --git a/test/interoperability_with_c_fortran_call_c_function/008_fortran_call_c_function_struct_ptr_bindc/c_func004.c b/test/interoperability_with_c_fortran_call_c_function/008_fortran_call_c_function_struct_ptr_bindc/c_func004.c +new file mode 100644 +index 0000000..93641b3 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/008_fortran_call_c_function_struct_ptr_bindc/c_func004.c +@@ -0,0 +1,14 @@ ++#include ++struct t1 { ++ int64_t n4; ++ int32_t n3; ++ int16_t n2; ++ int8_t n; ++}t; ++struct t1 *c_func_(struct t1 *x) { ++ x->n = 1; ++ x->n2 = 2; ++ x->n3 = 3; ++ x->n4 = 4; ++ return x; ++} +diff --git a/test/interoperability_with_c_fortran_call_c_function/008_fortran_call_c_function_struct_ptr_bindc/c_func005.c b/test/interoperability_with_c_fortran_call_c_function/008_fortran_call_c_function_struct_ptr_bindc/c_func005.c +new file mode 100644 +index 0000000..b751e28 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/008_fortran_call_c_function_struct_ptr_bindc/c_func005.c +@@ -0,0 +1,17 @@ ++#include ++struct t1 { ++ int64_t n5[2]; ++ int64_t n4; ++ int32_t n3; ++ int16_t n2; ++ int8_t n; ++}t; ++struct t1 *c_func_(struct t1 *x) { ++ x->n = 1; ++ x->n2 = 2; ++ x->n3 = 3; ++ x->n4 = 4; ++ x->n5[1] = 0; ++ x->n5[0] = 5; ++ return x; ++} +diff --git a/test/interoperability_with_c_fortran_call_c_function/008_fortran_call_c_function_struct_ptr_bindc/c_func006.c b/test/interoperability_with_c_fortran_call_c_function/008_fortran_call_c_function_struct_ptr_bindc/c_func006.c +new file mode 100644 +index 0000000..6ce4085 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/008_fortran_call_c_function_struct_ptr_bindc/c_func006.c +@@ -0,0 +1,16 @@ ++#include ++struct t1 { ++ int64_t n4[2]; ++ int32_t n3[2]; ++ int16_t n2[2]; ++ int8_t n[2]; ++}t; ++struct t1 *c_func_(struct t1 *x) { ++ for(int i = 0; i < 2; i++) { ++ x->n[i] = 1; ++ x->n2[i] = 2; ++ x->n3[i] = 3; ++ x->n4[i] = 4; ++ } ++ return x; ++} +diff --git a/test/interoperability_with_c_fortran_call_c_function/008_fortran_call_c_function_struct_ptr_bindc/c_func007.c b/test/interoperability_with_c_fortran_call_c_function/008_fortran_call_c_function_struct_ptr_bindc/c_func007.c +new file mode 100644 +index 0000000..8ba94e3 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/008_fortran_call_c_function_struct_ptr_bindc/c_func007.c +@@ -0,0 +1,16 @@ ++#include ++struct t1 { ++ int64_t n4; ++ int32_t n3; ++ int16_t n2; ++ int8_t n; ++}t; ++struct t1 *c_func_(struct t1 *x) { ++ for(int i = 0; i < 4; i++) { ++ x[i].n = 1; ++ x[i].n2 = 2; ++ x[i].n3 = 3; ++ x[i].n4 = 4; ++ } ++ return x; ++} +diff --git a/test/interoperability_with_c_fortran_call_c_function/008_fortran_call_c_function_struct_ptr_bindc/fortran_main001.f90 b/test/interoperability_with_c_fortran_call_c_function/008_fortran_call_c_function_struct_ptr_bindc/fortran_main001.f90 +new file mode 100644 +index 0000000..047bfcb +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/008_fortran_call_c_function_struct_ptr_bindc/fortran_main001.f90 +@@ -0,0 +1,18 @@ ++! test fortran call C for function return pointer of struct with bindc ++! ++program main ++ type, bind(c) :: t ++ integer :: n ++ end type t ++ interface ++ function c_func(x) bind(c, name = "c_func_") result(res) ++ import :: t ++ type(t) :: x ++ type(t), pointer :: res ++ end ++ end interface ++ type(t) :: my_x ++ type(t) :: res ++ res = c_func(my_x) ++ print *, res ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_function/008_fortran_call_c_function_struct_ptr_bindc/fortran_main002.f90 b/test/interoperability_with_c_fortran_call_c_function/008_fortran_call_c_function_struct_ptr_bindc/fortran_main002.f90 +new file mode 100644 +index 0000000..0bb349a +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/008_fortran_call_c_function_struct_ptr_bindc/fortran_main002.f90 +@@ -0,0 +1,19 @@ ++! test fortran call C for function return pointer of struct with bindc ++! ++program main ++ type, bind(c) :: t ++ integer(2) :: n2 ++ integer(1) :: n ++ end type t ++ interface ++ function c_func(x) bind(c, name = "c_func_") result(res) ++ import :: t ++ type(t) :: x ++ type(t), pointer :: res ++ end ++ end interface ++ type(t) :: my_x ++ type(t) :: res ++ res = c_func(my_x) ++ print *, res ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_function/008_fortran_call_c_function_struct_ptr_bindc/fortran_main003.f90 b/test/interoperability_with_c_fortran_call_c_function/008_fortran_call_c_function_struct_ptr_bindc/fortran_main003.f90 +new file mode 100644 +index 0000000..f5b716a +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/008_fortran_call_c_function_struct_ptr_bindc/fortran_main003.f90 +@@ -0,0 +1,20 @@ ++! test fortran call C for function return pointer of struct with bindc ++! ++program main ++ type, bind(c) :: t ++ integer(4) :: n3 ++ integer(2) :: n2 ++ integer(1) :: n ++ end type t ++ interface ++ function c_func(x) bind(c, name = "c_func_") result(res) ++ import :: t ++ type(t) :: x ++ type(t), pointer :: res ++ end ++ end interface ++ type(t) :: my_x ++ type(t) :: res ++ res = c_func(my_x) ++ print *, res ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_function/008_fortran_call_c_function_struct_ptr_bindc/fortran_main004.f90 b/test/interoperability_with_c_fortran_call_c_function/008_fortran_call_c_function_struct_ptr_bindc/fortran_main004.f90 +new file mode 100644 +index 0000000..f5da393 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/008_fortran_call_c_function_struct_ptr_bindc/fortran_main004.f90 +@@ -0,0 +1,21 @@ ++! test fortran call C for function return pointer of struct with bindc ++! ++program main ++ type, bind(c) :: t ++ integer(8) :: n4 ++ integer(4) :: n3 ++ integer(2) :: n2 ++ integer(1) :: n ++ end type t ++ interface ++ function c_func(x) bind(c, name = "c_func_") result(res) ++ import :: t ++ type(t) :: x ++ type(t), pointer :: res ++ end ++ end interface ++ type(t) :: my_x ++ type(t) :: res ++ res = c_func(my_x) ++ print *, res ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_function/008_fortran_call_c_function_struct_ptr_bindc/fortran_main005.f90 b/test/interoperability_with_c_fortran_call_c_function/008_fortran_call_c_function_struct_ptr_bindc/fortran_main005.f90 +new file mode 100644 +index 0000000..631a3f8 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/008_fortran_call_c_function_struct_ptr_bindc/fortran_main005.f90 +@@ -0,0 +1,22 @@ ++! test fortran call C for function return pointer of struct with bindc ++! ++program main ++ type, bind(c) :: t ++ integer(16) :: n5 ++ integer(8) :: n4 ++ integer(4) :: n3 ++ integer(2) :: n2 ++ integer(1) :: n ++ end type t ++ interface ++ function c_func(x) bind(c, name = "c_func_") result(res) ++ import :: t ++ type(t) :: x ++ type(t), pointer :: res ++ end ++ end interface ++ type(t) :: my_x ++ type(t) :: res ++ res = c_func(my_x) ++ print *, res ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_function/008_fortran_call_c_function_struct_ptr_bindc/fortran_main006.f90 b/test/interoperability_with_c_fortran_call_c_function/008_fortran_call_c_function_struct_ptr_bindc/fortran_main006.f90 +new file mode 100644 +index 0000000..d1e9eed +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/008_fortran_call_c_function_struct_ptr_bindc/fortran_main006.f90 +@@ -0,0 +1,21 @@ ++! test fortran call C for function return pointer of struct with bindc ++! ++program main ++ type, bind(c) :: t ++ integer(8) :: n4(2) ++ integer(4) :: n3(2) ++ integer(2) :: n2(2) ++ integer(1) :: n(2) ++ end type t ++ interface ++ function c_func(x) bind(c, name = "c_func_") result(res) ++ import :: t ++ type(t) :: x ++ type(t), pointer :: res ++ end ++ end interface ++ type(t) :: my_x ++ type(t) :: res ++ res = c_func(my_x) ++ print *, res ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_function/008_fortran_call_c_function_struct_ptr_bindc/fortran_main007.f90 b/test/interoperability_with_c_fortran_call_c_function/008_fortran_call_c_function_struct_ptr_bindc/fortran_main007.f90 +new file mode 100644 +index 0000000..e47d3f2 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/008_fortran_call_c_function_struct_ptr_bindc/fortran_main007.f90 +@@ -0,0 +1,21 @@ ++! test fortran call C for function return array of struct with bindc ++! ++program main ++ type, bind(c) :: t ++ integer(8) :: n4 ++ integer(4) :: n3 ++ integer(2) :: n2 ++ integer(1) :: n ++ end type t ++ interface ++ function c_func(x) bind(c, name = "c_func_") result(res) ++ import :: t ++ type(t) :: x(4) ++ type(t) :: res(4) ++ end ++ end interface ++ type(t) :: my_x(4) ++ type(t) :: res(4) ++ res = c_func(my_x) ++ print *, res ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_function/008_fortran_call_c_function_struct_ptr_bindc/result.md b/test/interoperability_with_c_fortran_call_c_function/008_fortran_call_c_function_struct_ptr_bindc/result.md +new file mode 100644 +index 0000000..0721a01 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/008_fortran_call_c_function_struct_ptr_bindc/result.md +@@ -0,0 +1,8 @@ ++ | test | gfortran | flang | nvfortran| ++ | 001 | PASS | ERROR | ERROR | ++ | 002 | PASS | ERROR | ERROR | ++ | 003 | PASS | ERROR | ERROR | ++ | 004 | PASS | ERROR | ERROR | ++ | 005 | PASS | ERROR | ERROR | ++ | 006 | PASS | ERROR | ERROR | ++ | 007 | ERROR | PASS | PASS | +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_function/008_fortran_call_c_function_struct_ptr_bindc/run.sh b/test/interoperability_with_c_fortran_call_c_function/008_fortran_call_c_function_struct_ptr_bindc/run.sh +new file mode 100644 +index 0000000..d26dcea +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/008_fortran_call_c_function_struct_ptr_bindc/run.sh +@@ -0,0 +1,22 @@ ++for i in {001..007} ++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 ++echo "----- nvfortran result : " ++clang c_func$i.c -c -o c-test.o ++nvfortran fortran_main$i.f90 -c -o fortran-test.o ++nvfortran 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_function/009_fortran_call_c_function_struct_value/c_func001.c b/test/interoperability_with_c_fortran_call_c_function/009_fortran_call_c_function_struct_value/c_func001.c +new file mode 100644 +index 0000000..4e3db6b +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/009_fortran_call_c_function_struct_value/c_func001.c +@@ -0,0 +1,7 @@ ++struct t1 { ++ int n; ++}t; ++struct t1 c_func_(struct t1 *x) { ++ x->n = 1; ++ return *x; ++} +diff --git a/test/interoperability_with_c_fortran_call_c_function/009_fortran_call_c_function_struct_value/c_func002.c b/test/interoperability_with_c_fortran_call_c_function/009_fortran_call_c_function_struct_value/c_func002.c +new file mode 100644 +index 0000000..c92ad00 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/009_fortran_call_c_function_struct_value/c_func002.c +@@ -0,0 +1,10 @@ ++#include ++struct t1 { ++ int16_t n2; ++ int8_t n; ++}t; ++struct t1 c_func_(struct t1 *x) { ++ x->n = 1; ++ x->n2 = 2; ++ return *x; ++} +diff --git a/test/interoperability_with_c_fortran_call_c_function/009_fortran_call_c_function_struct_value/c_func003.c b/test/interoperability_with_c_fortran_call_c_function/009_fortran_call_c_function_struct_value/c_func003.c +new file mode 100644 +index 0000000..fa9fc83 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/009_fortran_call_c_function_struct_value/c_func003.c +@@ -0,0 +1,12 @@ ++#include ++struct t1 { ++ int32_t n3; ++ int16_t n2; ++ int8_t n; ++}t; ++struct t1 c_func_(struct t1 *x) { ++ x->n = 1; ++ x->n2 = 2; ++ x->n3 = 3; ++ return *x; ++} +diff --git a/test/interoperability_with_c_fortran_call_c_function/009_fortran_call_c_function_struct_value/c_func004.c b/test/interoperability_with_c_fortran_call_c_function/009_fortran_call_c_function_struct_value/c_func004.c +new file mode 100644 +index 0000000..5ba556b +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/009_fortran_call_c_function_struct_value/c_func004.c +@@ -0,0 +1,14 @@ ++#include ++struct t1 { ++ int64_t n4; ++ int32_t n3; ++ int16_t n2; ++ int8_t n; ++}t; ++struct t1 c_func_(struct t1 *x) { ++ x->n = 1; ++ x->n2 = 2; ++ x->n3 = 3; ++ x->n4 = 4; ++ return *x; ++} +diff --git a/test/interoperability_with_c_fortran_call_c_function/009_fortran_call_c_function_struct_value/c_func005.c b/test/interoperability_with_c_fortran_call_c_function/009_fortran_call_c_function_struct_value/c_func005.c +new file mode 100644 +index 0000000..8561efe +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/009_fortran_call_c_function_struct_value/c_func005.c +@@ -0,0 +1,17 @@ ++#include ++struct t1 { ++ int64_t n5[2]; ++ int64_t n4; ++ int32_t n3; ++ int16_t n2; ++ int8_t n; ++}t; ++struct t1 c_func_(struct t1 *x) { ++ x->n = 1; ++ x->n2 = 2; ++ x->n3 = 3; ++ x->n4 = 4; ++ x->n5[1] = 0; ++ x->n5[0] = 5; ++ return *x; ++} +diff --git a/test/interoperability_with_c_fortran_call_c_function/009_fortran_call_c_function_struct_value/c_func006.c b/test/interoperability_with_c_fortran_call_c_function/009_fortran_call_c_function_struct_value/c_func006.c +new file mode 100644 +index 0000000..8400cce +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/009_fortran_call_c_function_struct_value/c_func006.c +@@ -0,0 +1,16 @@ ++#include ++struct t1 { ++ int64_t n4[2]; ++ int32_t n3[2]; ++ int16_t n2[2]; ++ int8_t n[2]; ++}t; ++struct t1 c_func_(struct t1 *x) { ++ for(int i = 0; i < 2; i++) { ++ x->n[i] = 1; ++ x->n2[i] = 2; ++ x->n3[i] = 3; ++ x->n4[i] = 4; ++ } ++ return *x; ++} +diff --git a/test/interoperability_with_c_fortran_call_c_function/009_fortran_call_c_function_struct_value/c_func007.c b/test/interoperability_with_c_fortran_call_c_function/009_fortran_call_c_function_struct_value/c_func007.c +new file mode 100644 +index 0000000..8ba94e3 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/009_fortran_call_c_function_struct_value/c_func007.c +@@ -0,0 +1,16 @@ ++#include ++struct t1 { ++ int64_t n4; ++ int32_t n3; ++ int16_t n2; ++ int8_t n; ++}t; ++struct t1 *c_func_(struct t1 *x) { ++ for(int i = 0; i < 4; i++) { ++ x[i].n = 1; ++ x[i].n2 = 2; ++ x[i].n3 = 3; ++ x[i].n4 = 4; ++ } ++ return x; ++} +diff --git a/test/interoperability_with_c_fortran_call_c_function/009_fortran_call_c_function_struct_value/fortran_main001.f90 b/test/interoperability_with_c_fortran_call_c_function/009_fortran_call_c_function_struct_value/fortran_main001.f90 +new file mode 100644 +index 0000000..a377e57 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/009_fortran_call_c_function_struct_value/fortran_main001.f90 +@@ -0,0 +1,18 @@ ++! test fortran call C for function return value of struct ++! ++program main ++ type t ++ integer :: n ++ end type t ++ interface ++ function c_func(x) ++ import :: t ++ type(t) :: x ++ type(t) :: c_func ++ end ++ end interface ++ type(t) :: my_x ++ type(t) :: res ++ res = c_func(my_x) ++ print *, res ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_function/009_fortran_call_c_function_struct_value/fortran_main002.f90 b/test/interoperability_with_c_fortran_call_c_function/009_fortran_call_c_function_struct_value/fortran_main002.f90 +new file mode 100644 +index 0000000..b7fb3a2 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/009_fortran_call_c_function_struct_value/fortran_main002.f90 +@@ -0,0 +1,19 @@ ++! test fortran call C for function return value of struct ++! ++program main ++ type t ++ integer(2) :: n2 ++ integer(1) :: n ++ end type t ++ interface ++ function c_func(x) ++ import :: t ++ type(t) :: x ++ type(t) :: c_func ++ end ++ end interface ++ type(t) :: my_x ++ type(t) :: res ++ res = c_func(my_x) ++ print *, res ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_function/009_fortran_call_c_function_struct_value/fortran_main003.f90 b/test/interoperability_with_c_fortran_call_c_function/009_fortran_call_c_function_struct_value/fortran_main003.f90 +new file mode 100644 +index 0000000..606c4b8 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/009_fortran_call_c_function_struct_value/fortran_main003.f90 +@@ -0,0 +1,20 @@ ++! test fortran call C for function return value of struct ++! ++program main ++ type t ++ integer(4) :: n3 ++ integer(2) :: n2 ++ integer(1) :: n ++ end type t ++ interface ++ function c_func(x) ++ import :: t ++ type(t) :: x ++ type(t) :: c_func ++ end ++ end interface ++ type(t) :: my_x ++ type(t) :: res ++ res = c_func(my_x) ++ print *, res ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_function/009_fortran_call_c_function_struct_value/fortran_main004.f90 b/test/interoperability_with_c_fortran_call_c_function/009_fortran_call_c_function_struct_value/fortran_main004.f90 +new file mode 100644 +index 0000000..4fd8721 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/009_fortran_call_c_function_struct_value/fortran_main004.f90 +@@ -0,0 +1,21 @@ ++! test fortran call C for function return value of struct ++! ++program main ++ type t ++ integer(8) :: n4 ++ integer(4) :: n3 ++ integer(2) :: n2 ++ integer(1) :: n ++ end type t ++ interface ++ function c_func(x) ++ import :: t ++ type(t) :: x ++ type(t) :: c_func ++ end ++ end interface ++ type(t) :: my_x ++ type(t) :: res ++ res = c_func(my_x) ++ print *, res ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_function/009_fortran_call_c_function_struct_value/fortran_main005.f90 b/test/interoperability_with_c_fortran_call_c_function/009_fortran_call_c_function_struct_value/fortran_main005.f90 +new file mode 100644 +index 0000000..3811bf4 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/009_fortran_call_c_function_struct_value/fortran_main005.f90 +@@ -0,0 +1,22 @@ ++! test fortran call C for function return value of struct ++! ++program main ++ type t ++ integer(16) :: n5 ++ integer(8) :: n4 ++ integer(4) :: n3 ++ integer(2) :: n2 ++ integer(1) :: n ++ end type t ++ interface ++ function c_func(x) ++ import :: t ++ type(t) :: x ++ type(t) :: c_func ++ end ++ end interface ++ type(t) :: my_x ++ type(t) :: res ++ res = c_func(my_x) ++ print *, res ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_function/009_fortran_call_c_function_struct_value/fortran_main006.f90 b/test/interoperability_with_c_fortran_call_c_function/009_fortran_call_c_function_struct_value/fortran_main006.f90 +new file mode 100644 +index 0000000..a61bff9 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/009_fortran_call_c_function_struct_value/fortran_main006.f90 +@@ -0,0 +1,21 @@ ++! test fortran call C for function return value of struct ++! ++program main ++ type t ++ integer(8) :: n4(2) ++ integer(4) :: n3(2) ++ integer(2) :: n2(2) ++ integer(1) :: n(2) ++ end type t ++ interface ++ function c_func(x) ++ import :: t ++ type(t) :: x ++ type(t) :: c_func ++ end ++ end interface ++ type(t) :: my_x ++ type(t) :: res ++ res = c_func(my_x) ++ print *, res ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_function/009_fortran_call_c_function_struct_value/fortran_main007.f90 b/test/interoperability_with_c_fortran_call_c_function/009_fortran_call_c_function_struct_value/fortran_main007.f90 +new file mode 100644 +index 0000000..a3d193e +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/009_fortran_call_c_function_struct_value/fortran_main007.f90 +@@ -0,0 +1,21 @@ ++! test fortran call C for function return array of struct ++! ++program main ++ type t ++ integer(8) :: n4 ++ integer(4) :: n3 ++ integer(2) :: n2 ++ integer(1) :: n ++ end type t ++ interface ++ function c_func(x) ++ import :: t ++ type(t) :: x(4) ++ type(t) :: c_func(4) ++ end ++ end interface ++ type(t) :: my_x(4) ++ type(t) :: res(4) ++ res = c_func(my_x) ++ print *, res ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_function/009_fortran_call_c_function_struct_value/result.md b/test/interoperability_with_c_fortran_call_c_function/009_fortran_call_c_function_struct_value/result.md +new file mode 100644 +index 0000000..70c861c +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/009_fortran_call_c_function_struct_value/result.md +@@ -0,0 +1,8 @@ ++ | test | gfortran | flang | nvfortran| ++ | 001 | PASS | PASS | PASS | ++ | 002 | PASS | PASS | PASS | ++ | 003 | PASS | PASS | PASS | ++ | 004 | PASS | PASS | PASS | ++ | 005 | PASS | PASS | ERROR | ++ | 006 | PASS | PASS | PASS | ++ | 007 | ERROR | PASS | PASS | +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_function/009_fortran_call_c_function_struct_value/run.sh b/test/interoperability_with_c_fortran_call_c_function/009_fortran_call_c_function_struct_value/run.sh +new file mode 100644 +index 0000000..d26dcea +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/009_fortran_call_c_function_struct_value/run.sh +@@ -0,0 +1,22 @@ ++for i in {001..007} ++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 ++echo "----- nvfortran result : " ++clang c_func$i.c -c -o c-test.o ++nvfortran fortran_main$i.f90 -c -o fortran-test.o ++nvfortran 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_function/010_fortran_call_c_function_struct_value_bindc/c_func001.c b/test/interoperability_with_c_fortran_call_c_function/010_fortran_call_c_function_struct_value_bindc/c_func001.c +new file mode 100644 +index 0000000..4e3db6b +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/010_fortran_call_c_function_struct_value_bindc/c_func001.c +@@ -0,0 +1,7 @@ ++struct t1 { ++ int n; ++}t; ++struct t1 c_func_(struct t1 *x) { ++ x->n = 1; ++ return *x; ++} +diff --git a/test/interoperability_with_c_fortran_call_c_function/010_fortran_call_c_function_struct_value_bindc/c_func002.c b/test/interoperability_with_c_fortran_call_c_function/010_fortran_call_c_function_struct_value_bindc/c_func002.c +new file mode 100644 +index 0000000..c92ad00 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/010_fortran_call_c_function_struct_value_bindc/c_func002.c +@@ -0,0 +1,10 @@ ++#include ++struct t1 { ++ int16_t n2; ++ int8_t n; ++}t; ++struct t1 c_func_(struct t1 *x) { ++ x->n = 1; ++ x->n2 = 2; ++ return *x; ++} +diff --git a/test/interoperability_with_c_fortran_call_c_function/010_fortran_call_c_function_struct_value_bindc/c_func003.c b/test/interoperability_with_c_fortran_call_c_function/010_fortran_call_c_function_struct_value_bindc/c_func003.c +new file mode 100644 +index 0000000..fa9fc83 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/010_fortran_call_c_function_struct_value_bindc/c_func003.c +@@ -0,0 +1,12 @@ ++#include ++struct t1 { ++ int32_t n3; ++ int16_t n2; ++ int8_t n; ++}t; ++struct t1 c_func_(struct t1 *x) { ++ x->n = 1; ++ x->n2 = 2; ++ x->n3 = 3; ++ return *x; ++} +diff --git a/test/interoperability_with_c_fortran_call_c_function/010_fortran_call_c_function_struct_value_bindc/c_func004.c b/test/interoperability_with_c_fortran_call_c_function/010_fortran_call_c_function_struct_value_bindc/c_func004.c +new file mode 100644 +index 0000000..5ba556b +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/010_fortran_call_c_function_struct_value_bindc/c_func004.c +@@ -0,0 +1,14 @@ ++#include ++struct t1 { ++ int64_t n4; ++ int32_t n3; ++ int16_t n2; ++ int8_t n; ++}t; ++struct t1 c_func_(struct t1 *x) { ++ x->n = 1; ++ x->n2 = 2; ++ x->n3 = 3; ++ x->n4 = 4; ++ return *x; ++} +diff --git a/test/interoperability_with_c_fortran_call_c_function/010_fortran_call_c_function_struct_value_bindc/c_func005.c b/test/interoperability_with_c_fortran_call_c_function/010_fortran_call_c_function_struct_value_bindc/c_func005.c +new file mode 100644 +index 0000000..8561efe +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/010_fortran_call_c_function_struct_value_bindc/c_func005.c +@@ -0,0 +1,17 @@ ++#include ++struct t1 { ++ int64_t n5[2]; ++ int64_t n4; ++ int32_t n3; ++ int16_t n2; ++ int8_t n; ++}t; ++struct t1 c_func_(struct t1 *x) { ++ x->n = 1; ++ x->n2 = 2; ++ x->n3 = 3; ++ x->n4 = 4; ++ x->n5[1] = 0; ++ x->n5[0] = 5; ++ return *x; ++} +diff --git a/test/interoperability_with_c_fortran_call_c_function/010_fortran_call_c_function_struct_value_bindc/c_func006.c b/test/interoperability_with_c_fortran_call_c_function/010_fortran_call_c_function_struct_value_bindc/c_func006.c +new file mode 100644 +index 0000000..8400cce +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/010_fortran_call_c_function_struct_value_bindc/c_func006.c +@@ -0,0 +1,16 @@ ++#include ++struct t1 { ++ int64_t n4[2]; ++ int32_t n3[2]; ++ int16_t n2[2]; ++ int8_t n[2]; ++}t; ++struct t1 c_func_(struct t1 *x) { ++ for(int i = 0; i < 2; i++) { ++ x->n[i] = 1; ++ x->n2[i] = 2; ++ x->n3[i] = 3; ++ x->n4[i] = 4; ++ } ++ return *x; ++} +diff --git a/test/interoperability_with_c_fortran_call_c_function/010_fortran_call_c_function_struct_value_bindc/c_func007.c b/test/interoperability_with_c_fortran_call_c_function/010_fortran_call_c_function_struct_value_bindc/c_func007.c +new file mode 100644 +index 0000000..8ba94e3 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/010_fortran_call_c_function_struct_value_bindc/c_func007.c +@@ -0,0 +1,16 @@ ++#include ++struct t1 { ++ int64_t n4; ++ int32_t n3; ++ int16_t n2; ++ int8_t n; ++}t; ++struct t1 *c_func_(struct t1 *x) { ++ for(int i = 0; i < 4; i++) { ++ x[i].n = 1; ++ x[i].n2 = 2; ++ x[i].n3 = 3; ++ x[i].n4 = 4; ++ } ++ return x; ++} +diff --git a/test/interoperability_with_c_fortran_call_c_function/010_fortran_call_c_function_struct_value_bindc/fortran_main001.f90 b/test/interoperability_with_c_fortran_call_c_function/010_fortran_call_c_function_struct_value_bindc/fortran_main001.f90 +new file mode 100644 +index 0000000..c2fa9a1 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/010_fortran_call_c_function_struct_value_bindc/fortran_main001.f90 +@@ -0,0 +1,18 @@ ++! test fortran call C for function return value of struct with bindc ++! ++program main ++ type, bind(c) :: t ++ integer :: n ++ end type t ++ interface ++ function c_func(x) bind(c, name = "c_func_") ++ import :: t ++ type(t) :: x ++ type(t) :: c_func ++ end ++ end interface ++ type(t) :: my_x ++ type(t) :: res ++ res = c_func(my_x) ++ print *, res ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_function/010_fortran_call_c_function_struct_value_bindc/fortran_main002.f90 b/test/interoperability_with_c_fortran_call_c_function/010_fortran_call_c_function_struct_value_bindc/fortran_main002.f90 +new file mode 100644 +index 0000000..5130268 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/010_fortran_call_c_function_struct_value_bindc/fortran_main002.f90 +@@ -0,0 +1,19 @@ ++! test fortran call C for function return value of struct with bindc ++! ++program main ++ type, bind(c) :: t ++ integer(2) :: n2 ++ integer(1) :: n ++ end type t ++ interface ++ function c_func(x) bind(c, name = "c_func_") ++ import :: t ++ type(t) :: x ++ type(t) :: c_func ++ end ++ end interface ++ type(t) :: my_x ++ type(t) :: res ++ res = c_func(my_x) ++ print *, res ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_function/010_fortran_call_c_function_struct_value_bindc/fortran_main003.f90 b/test/interoperability_with_c_fortran_call_c_function/010_fortran_call_c_function_struct_value_bindc/fortran_main003.f90 +new file mode 100644 +index 0000000..de19bad +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/010_fortran_call_c_function_struct_value_bindc/fortran_main003.f90 +@@ -0,0 +1,20 @@ ++! test fortran call C for function return value of struct with bindc ++! ++program main ++ type, bind(c) :: t ++ integer(4) :: n3 ++ integer(2) :: n2 ++ integer(1) :: n ++ end type t ++ interface ++ function c_func(x) bind(c, name = "c_func_") ++ import :: t ++ type(t) :: x ++ type(t) :: c_func ++ end ++ end interface ++ type(t) :: my_x ++ type(t) :: res ++ res = c_func(my_x) ++ print *, res ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_function/010_fortran_call_c_function_struct_value_bindc/fortran_main004.f90 b/test/interoperability_with_c_fortran_call_c_function/010_fortran_call_c_function_struct_value_bindc/fortran_main004.f90 +new file mode 100644 +index 0000000..835bd34 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/010_fortran_call_c_function_struct_value_bindc/fortran_main004.f90 +@@ -0,0 +1,21 @@ ++! test fortran call C for function return value of struct with bindc ++! ++program main ++ type, bind(c) :: t ++ integer(8) :: n4 ++ integer(4) :: n3 ++ integer(2) :: n2 ++ integer(1) :: n ++ end type t ++ interface ++ function c_func(x) bind(c, name = "c_func_") ++ import :: t ++ type(t) :: x ++ type(t) :: c_func ++ end ++ end interface ++ type(t) :: my_x ++ type(t) :: res ++ res = c_func(my_x) ++ print *, res ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_function/010_fortran_call_c_function_struct_value_bindc/fortran_main005.f90 b/test/interoperability_with_c_fortran_call_c_function/010_fortran_call_c_function_struct_value_bindc/fortran_main005.f90 +new file mode 100644 +index 0000000..27e0c78 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/010_fortran_call_c_function_struct_value_bindc/fortran_main005.f90 +@@ -0,0 +1,22 @@ ++! test fortran call C for function return value of struct with bindc ++! ++program main ++ type, bind(c) :: t ++ integer(16) :: n5 ++ integer(8) :: n4 ++ integer(4) :: n3 ++ integer(2) :: n2 ++ integer(1) :: n ++ end type t ++ interface ++ function c_func(x) bind(c, name = "c_func_") ++ import :: t ++ type(t) :: x ++ type(t) :: c_func ++ end ++ end interface ++ type(t) :: my_x ++ type(t) :: res ++ res = c_func(my_x) ++ print *, res ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_function/010_fortran_call_c_function_struct_value_bindc/fortran_main006.f90 b/test/interoperability_with_c_fortran_call_c_function/010_fortran_call_c_function_struct_value_bindc/fortran_main006.f90 +new file mode 100644 +index 0000000..e48cbdb +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/010_fortran_call_c_function_struct_value_bindc/fortran_main006.f90 +@@ -0,0 +1,21 @@ ++! test fortran call C for function return value of struct with bindc ++! ++program main ++ type, bind(c) :: t ++ integer(8) :: n4(2) ++ integer(4) :: n3(2) ++ integer(2) :: n2(2) ++ integer(1) :: n(2) ++ end type t ++ interface ++ function c_func(x) bind(c, name = "c_func_") ++ import :: t ++ type(t) :: x ++ type(t) :: c_func ++ end ++ end interface ++ type(t) :: my_x ++ type(t) :: res ++ res = c_func(my_x) ++ print *, res ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_function/010_fortran_call_c_function_struct_value_bindc/fortran_main007.f90 b/test/interoperability_with_c_fortran_call_c_function/010_fortran_call_c_function_struct_value_bindc/fortran_main007.f90 +new file mode 100644 +index 0000000..e47d3f2 +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/010_fortran_call_c_function_struct_value_bindc/fortran_main007.f90 +@@ -0,0 +1,21 @@ ++! test fortran call C for function return array of struct with bindc ++! ++program main ++ type, bind(c) :: t ++ integer(8) :: n4 ++ integer(4) :: n3 ++ integer(2) :: n2 ++ integer(1) :: n ++ end type t ++ interface ++ function c_func(x) bind(c, name = "c_func_") result(res) ++ import :: t ++ type(t) :: x(4) ++ type(t) :: res(4) ++ end ++ end interface ++ type(t) :: my_x(4) ++ type(t) :: res(4) ++ res = c_func(my_x) ++ print *, res ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_function/010_fortran_call_c_function_struct_value_bindc/result.md b/test/interoperability_with_c_fortran_call_c_function/010_fortran_call_c_function_struct_value_bindc/result.md +new file mode 100644 +index 0000000..70c861c +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/010_fortran_call_c_function_struct_value_bindc/result.md +@@ -0,0 +1,8 @@ ++ | test | gfortran | flang | nvfortran| ++ | 001 | PASS | PASS | PASS | ++ | 002 | PASS | PASS | PASS | ++ | 003 | PASS | PASS | PASS | ++ | 004 | PASS | PASS | PASS | ++ | 005 | PASS | PASS | ERROR | ++ | 006 | PASS | PASS | PASS | ++ | 007 | ERROR | PASS | PASS | +\ No newline at end of file +diff --git a/test/interoperability_with_c_fortran_call_c_function/010_fortran_call_c_function_struct_value_bindc/run.sh b/test/interoperability_with_c_fortran_call_c_function/010_fortran_call_c_function_struct_value_bindc/run.sh +new file mode 100644 +index 0000000..d26dcea +--- /dev/null ++++ b/test/interoperability_with_c_fortran_call_c_function/010_fortran_call_c_function_struct_value_bindc/run.sh +@@ -0,0 +1,22 @@ ++for i in {001..007} ++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 ++echo "----- nvfortran result : " ++clang c_func$i.c -c -o c-test.o ++nvfortran fortran_main$i.f90 -c -o fortran-test.o ++nvfortran c-test.o fortran-test.o ++./a.out ++rm *.o a.out ++done +\ No newline at end of file +-- +2.25.1 + diff --git a/flang.spec b/flang.spec index 330967d..cbb9aa1 100644 --- a/flang.spec +++ b/flang.spec @@ -2,7 +2,7 @@ Name: flang Version: flang_20210324 -Release: 13 +Release: 14 Summary: Fortran language compiler targeting LLVM License: Apache-2.0 @@ -13,11 +13,17 @@ BuildRequires: gcc Requires: gcc >= 9.3.0 Patch0: 1-flang-runtime-inline.patch Patch1: 2-inline_f90_str_copy_klen.patch -Patch2: 3-test-for-interoperability-with-c-fortran-call-c.patch +Patch2: 3-test-interoperability-with-c-fortran-call-c-scalar.patch Patch3: 4-add-test-cases-for-openmp-optimization.patch -Patch4: 5-test-for-interoperability-with-c-c-call-fortran.patch +Patch4: 5-test-interoperability-with-c-c-call-fortran-scalar.patch Patch5: 6-Add-test-cases-for-types.patch Patch6: 7-add-test-cases-for-attribute-declarations-and-specifications.patch +Patch7: 8-test-interoperability-with-c-fortran-call-c-array.patch +Patch8: 9-test-interoperability-with-c-fortran-call-c-function.patch +Patch9: 10-test-interoperability-with-c-fortran-call-c-global-and-struct.patch +Patch10: 11-test-interoperability-with-c-c-call-fortran-array.patch +Patch11: 12-test-interoperability-with-c-c-call-fortran-function.patch +Patch12: 13-test-interoperability-with-c-c-call-fortran-global-and-struct.patch %description Flang depends on a fork of the LLVM project (https://github.com/flang-compiler/classic-flang-llvm-project). The fork made some changes to the upstream LLVM project to support Flang toolchain. Flang cannot build independently for now. @@ -39,6 +45,9 @@ TODO: support build Flang. %changelog +* Fri Nov 18 2022 xieyihui - flang_20210324-14 +- Add test cases for procedure pointer, function about array and global and split patches about interoperability with C + * Fri Nov 4 2022 xieyihui - flang_20210324-13 - Fix 4-add-test-cases-for-openmp-optimization.patch for add new test cases for OpenMP optimization -- Gitee