From 9897e51b0a9ba97057aa83debbd993f9cfb7a932 Mon Sep 17 00:00:00 2001 From: xieyihui Date: Sun, 16 Oct 2022 23:06:36 +0800 Subject: [PATCH] Add patch for add test cases for interoperability with C about C call fortran --- ...teroperability-with-c-c-call-fortran.patch | 11788 ++++++++++++++++ flang.spec | 6 +- 2 files changed, 11793 insertions(+), 1 deletion(-) create mode 100644 5-test-for-interoperability-with-c-c-call-fortran.patch diff --git a/5-test-for-interoperability-with-c-c-call-fortran.patch b/5-test-for-interoperability-with-c-c-call-fortran.patch new file mode 100644 index 0000000..a54e42d --- /dev/null +++ b/5-test-for-interoperability-with-c-c-call-fortran.patch @@ -0,0 +1,11788 @@ +From 394858d91d11d06457a7c63685d3cedf066daf34 Mon Sep 17 00:00:00 2001 +From: xieyihui +Date: Sun, 16 Oct 2022 23:00:30 +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..f6f089a +--- /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..f6f089a +--- /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..f6f089a +--- /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..f6f089a +--- /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..f6f089a +--- /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..f6f089a +--- /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..f6f089a +--- /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..f6f089a +--- /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..f6f089a +--- /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..4c1d7aa +--- /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/c_main001.c b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main001.c +new file mode 100644 +index 0000000..8889aba +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main001.c +@@ -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/c_main002.c b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main002.c +new file mode 100644 +index 0000000..7ee12cd +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/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/011_c_call_fortran_function/c_main003.c b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main003.c +new file mode 100644 +index 0000000..e9aff63 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/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/011_c_call_fortran_function/c_main004.c b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main004.c +new file mode 100644 +index 0000000..5e48491 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/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/011_c_call_fortran_function/c_main005.c b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main005.c +new file mode 100644 +index 0000000..558c28f +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/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/011_c_call_fortran_function/c_main006.c b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main006.c +new file mode 100644 +index 0000000..b8f248c +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/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/011_c_call_fortran_function/c_main007.c b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main007.c +new file mode 100644 +index 0000000..38589ce +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/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/011_c_call_fortran_function/c_main008.c b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main008.c +new file mode 100644 +index 0000000..913e417 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/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/011_c_call_fortran_function/c_main009.c b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main009.c +new file mode 100644 +index 0000000..f76b36e +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/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/011_c_call_fortran_function/c_main010.c b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main010.c +new file mode 100644 +index 0000000..b843a6a +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/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/011_c_call_fortran_function/c_main011.c b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main011.c +new file mode 100644 +index 0000000..2ff6688 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main011.c +@@ -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/c_main012.c b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main012.c +new file mode 100644 +index 0000000..c332da0 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main012.c +@@ -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/c_main013.c b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main013.c +new file mode 100644 +index 0000000..f72441e +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main013.c +@@ -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/c_main014.c b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main014.c +new file mode 100644 +index 0000000..4d98217 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main014.c +@@ -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/c_main015.c b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main015.c +new file mode 100644 +index 0000000..dd99955 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main015.c +@@ -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/c_main016.c b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main016.c +new file mode 100644 +index 0000000..c8ca6e2 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main016.c +@@ -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/c_main017.c b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main017.c +new file mode 100644 +index 0000000..d5dbfa1 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main017.c +@@ -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/c_main018.c b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main018.c +new file mode 100644 +index 0000000..11536d8 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main018.c +@@ -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/c_main019.c b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main019.c +new file mode 100644 +index 0000000..c5c0ac0 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main019.c +@@ -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/c_main020.c b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main020.c +new file mode 100644 +index 0000000..3985c08 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main020.c +@@ -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/c_main021.c b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main021.c +new file mode 100644 +index 0000000..e260dd4 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main021.c +@@ -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/c_main022.c b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main022.c +new file mode 100644 +index 0000000..1e9fdd4 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main022.c +@@ -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/c_main023.c b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main023.c +new file mode 100644 +index 0000000..8b1d692 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main023.c +@@ -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/c_main024.c b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main024.c +new file mode 100644 +index 0000000..350055a +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main024.c +@@ -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/c_main025.c b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main025.c +new file mode 100644 +index 0000000..b81188d +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main025.c +@@ -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/c_main026.c b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main026.c +new file mode 100644 +index 0000000..630ab26 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main026.c +@@ -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/c_main027.c b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main027.c +new file mode 100644 +index 0000000..dd95917 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main027.c +@@ -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/c_main028.c b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/c_main028.c +new file mode 100644 +index 0000000..1cbcc50 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/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", i); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func001.f90 b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func001.f90 +new file mode 100644 +index 0000000..8809b59 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func001.f90 +@@ -0,0 +1,4 @@ ++integer function f_func(i) ++ integer :: i ++ f_func = 10 + i ++end +diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func002.f90 b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func002.f90 +new file mode 100644 +index 0000000..91a5d95 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func002.f90 +@@ -0,0 +1,4 @@ ++integer function f_func(i) ++ integer(2) :: i ++ f_func = 10 + i ++end +diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func003.f90 b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func003.f90 +new file mode 100644 +index 0000000..d91ed67 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func003.f90 +@@ -0,0 +1,4 @@ ++integer function f_func(i) ++ integer(8) :: i ++ f_func = 10 + i ++end +diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func004.f90 b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func004.f90 +new file mode 100644 +index 0000000..d91ed67 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func004.f90 +@@ -0,0 +1,4 @@ ++integer function f_func(i) ++ integer(8) :: i ++ f_func = 10 + i ++end +diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func005.f90 b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func005.f90 +new file mode 100644 +index 0000000..bd7b3fc +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func005.f90 +@@ -0,0 +1,4 @@ ++integer function f_func(i) ++ integer(1) :: i ++ f_func = 10 + i ++end +diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func006.f90 b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func006.f90 +new file mode 100644 +index 0000000..d91ed67 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func006.f90 +@@ -0,0 +1,4 @@ ++integer function f_func(i) ++ integer(8) :: i ++ f_func = 10 + i ++end +diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func007.f90 b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func007.f90 +new file mode 100644 +index 0000000..bd7b3fc +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func007.f90 +@@ -0,0 +1,4 @@ ++integer function f_func(i) ++ integer(1) :: i ++ f_func = 10 + i ++end +diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func008.f90 b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func008.f90 +new file mode 100644 +index 0000000..91a5d95 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func008.f90 +@@ -0,0 +1,4 @@ ++integer function f_func(i) ++ integer(2) :: i ++ f_func = 10 + i ++end +diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func009.f90 b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func009.f90 +new file mode 100644 +index 0000000..c386948 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func009.f90 +@@ -0,0 +1,4 @@ ++integer function f_func(i) ++ integer(4) :: i ++ f_func = 10 + i ++end +diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func010.f90 b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func010.f90 +new file mode 100644 +index 0000000..d91ed67 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func010.f90 +@@ -0,0 +1,4 @@ ++integer function f_func(i) ++ integer(8) :: i ++ f_func = 10 + i ++end +diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func011.f90 b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func011.f90 +new file mode 100644 +index 0000000..bd7b3fc +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func011.f90 +@@ -0,0 +1,4 @@ ++integer function f_func(i) ++ integer(1) :: i ++ f_func = 10 + i ++end +diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func012.f90 b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func012.f90 +new file mode 100644 +index 0000000..91a5d95 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func012.f90 +@@ -0,0 +1,4 @@ ++integer function f_func(i) ++ integer(2) :: i ++ f_func = 10 + i ++end +diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func013.f90 b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func013.f90 +new file mode 100644 +index 0000000..c386948 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func013.f90 +@@ -0,0 +1,4 @@ ++integer function f_func(i) ++ integer(4) :: i ++ f_func = 10 + i ++end +diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func014.f90 b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func014.f90 +new file mode 100644 +index 0000000..d91ed67 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func014.f90 +@@ -0,0 +1,4 @@ ++integer function f_func(i) ++ integer(8) :: i ++ f_func = 10 + i ++end +diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func015.f90 b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func015.f90 +new file mode 100644 +index 0000000..bd7b3fc +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func015.f90 +@@ -0,0 +1,4 @@ ++integer function f_func(i) ++ integer(1) :: i ++ f_func = 10 + i ++end +diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func016.f90 b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func016.f90 +new file mode 100644 +index 0000000..d91ed67 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func016.f90 +@@ -0,0 +1,4 @@ ++integer function f_func(i) ++ integer(8) :: i ++ f_func = 10 + i ++end +diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func017.f90 b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func017.f90 +new file mode 100644 +index 0000000..d91ed67 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func017.f90 +@@ -0,0 +1,4 @@ ++integer function f_func(i) ++ integer(8) :: i ++ f_func = 10 + i ++end +diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func018.f90 b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func018.f90 +new file mode 100644 +index 0000000..d91ed67 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func018.f90 +@@ -0,0 +1,4 @@ ++integer function f_func(i) ++ integer(8) :: i ++ f_func = 10 + i ++end +diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func019.f90 b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func019.f90 +new file mode 100644 +index 0000000..d91ed67 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func019.f90 +@@ -0,0 +1,4 @@ ++integer function f_func(i) ++ integer(8) :: i ++ f_func = 10 + i ++end +diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func020.f90 b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func020.f90 +new file mode 100644 +index 0000000..d91ed67 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func020.f90 +@@ -0,0 +1,4 @@ ++integer function f_func(i) ++ integer(8) :: i ++ f_func = 10 + i ++end +diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func021.f90 b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func021.f90 +new file mode 100644 +index 0000000..27c8008 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func021.f90 +@@ -0,0 +1,4 @@ ++real function f_func(i) ++ real(4) :: i ++ f_func = i + 0.1 ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func022.f90 b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func022.f90 +new file mode 100644 +index 0000000..b862910 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func022.f90 +@@ -0,0 +1,4 @@ ++real(8) function f_func(i) ++ real(8) :: i ++ f_func = i + 0.1 ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func023.f90 b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func023.f90 +new file mode 100644 +index 0000000..5a24ed7 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func023.f90 +@@ -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/fortran_func024.f90 b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func024.f90 +new file mode 100644 +index 0000000..e158cce +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func024.f90 +@@ -0,0 +1,4 @@ ++complex(4) function f_func(i) ++ complex(4) :: i ++ f_func = (-12345678.7654321, 1) ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func025.f90 b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func025.f90 +new file mode 100644 +index 0000000..3cd9e4e +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func025.f90 +@@ -0,0 +1,4 @@ ++complex(8) function f_func(i) ++ complex(8) :: i ++ f_func = (-12345678.7654321, 1) ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func026.f90 b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func026.f90 +new file mode 100644 +index 0000000..fb3c477 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func026.f90 +@@ -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/fortran_func027.f90 b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func027.f90 +new file mode 100644 +index 0000000..f331e96 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func027.f90 +@@ -0,0 +1,4 @@ ++logical function f_func(i) ++ logical(1) :: i ++ f_func = .TRUE. ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func028.f90 b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func028.f90 +new file mode 100644 +index 0000000..c7b4c7e +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/fortran_func028.f90 +@@ -0,0 +1,4 @@ ++character function f_func(i) ++ character(1) :: i ++ f_func = 'a' ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/run.sh b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/run.sh +new file mode 100644 +index 0000000..f6f089a +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/011_c_call_fortran_function/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_bindc/c_main001.c b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main001.c +new file mode 100644 +index 0000000..750e07c +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main001.c +@@ -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_bindc/c_main002.c b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main002.c +new file mode 100644 +index 0000000..801bbd9 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main002.c +@@ -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_bindc/c_main003.c b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main003.c +new file mode 100644 +index 0000000..d141bc0 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main003.c +@@ -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_bindc/c_main004.c b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main004.c +new file mode 100644 +index 0000000..447e373 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main004.c +@@ -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_bindc/c_main005.c b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main005.c +new file mode 100644 +index 0000000..2f680d5 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main005.c +@@ -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_bindc/c_main006.c b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main006.c +new file mode 100644 +index 0000000..47eec77 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main006.c +@@ -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_bindc/c_main007.c b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main007.c +new file mode 100644 +index 0000000..7e39eb4 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main007.c +@@ -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_bindc/c_main008.c b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main008.c +new file mode 100644 +index 0000000..5a96518 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main008.c +@@ -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_bindc/c_main009.c b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main009.c +new file mode 100644 +index 0000000..61b0a1c +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main009.c +@@ -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_bindc/c_main010.c b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main010.c +new file mode 100644 +index 0000000..f74292e +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main010.c +@@ -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_bindc/c_main011.c b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main011.c +new file mode 100644 +index 0000000..034044f +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main011.c +@@ -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_bindc/c_main012.c b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main012.c +new file mode 100644 +index 0000000..1597575 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main012.c +@@ -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_bindc/c_main013.c b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main013.c +new file mode 100644 +index 0000000..dc2226d +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main013.c +@@ -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_bindc/c_main014.c b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main014.c +new file mode 100644 +index 0000000..b935d4a +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main014.c +@@ -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_bindc/c_main015.c b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main015.c +new file mode 100644 +index 0000000..ce49dad +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main015.c +@@ -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_bindc/c_main016.c b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main016.c +new file mode 100644 +index 0000000..9f0bef4 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main016.c +@@ -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_bindc/c_main017.c b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main017.c +new file mode 100644 +index 0000000..8ab1c0a +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main017.c +@@ -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_bindc/c_main018.c b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main018.c +new file mode 100644 +index 0000000..9310bfa +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main018.c +@@ -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_bindc/c_main019.c b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main019.c +new file mode 100644 +index 0000000..af4c9c7 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main019.c +@@ -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_bindc/c_main020.c b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main020.c +new file mode 100644 +index 0000000..f3fbe2f +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main020.c +@@ -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_bindc/c_main021.c b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main021.c +new file mode 100644 +index 0000000..850d4ad +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main021.c +@@ -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_bindc/c_main022.c b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main022.c +new file mode 100644 +index 0000000..6340c04 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main022.c +@@ -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_bindc/c_main023.c b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main023.c +new file mode 100644 +index 0000000..66a84a1 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main023.c +@@ -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_bindc/c_main024.c b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main024.c +new file mode 100644 +index 0000000..c508d13 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main024.c +@@ -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_bindc/c_main025.c b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main025.c +new file mode 100644 +index 0000000..cae3878 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main025.c +@@ -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_bindc/c_main026.c b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main026.c +new file mode 100644 +index 0000000..b1aabf8 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main026.c +@@ -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_bindc/c_main027.c b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main027.c +new file mode 100644 +index 0000000..e90c830 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main027.c +@@ -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_bindc/c_main028.c b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/c_main028.c +new file mode 100644 +index 0000000..5bf1ef5 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_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", i); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func001.f90 b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func001.f90 +new file mode 100644 +index 0000000..97fc0ff +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func001.f90 +@@ -0,0 +1,4 @@ ++integer function f_func(i) bind(c, name = "f_func_") ++ integer :: i ++ f_func = 10 + i ++end +diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func002.f90 b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func002.f90 +new file mode 100644 +index 0000000..a92967c +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func002.f90 +@@ -0,0 +1,4 @@ ++integer function f_func(i) bind(c, name = "f_func_") ++ integer(2) :: i ++ f_func = 10 + i ++end +diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func003.f90 b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func003.f90 +new file mode 100644 +index 0000000..0003034 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func003.f90 +@@ -0,0 +1,4 @@ ++integer function f_func(i) bind(c, name = "f_func_") ++ integer(8) :: i ++ f_func = 10 + i ++end +diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func004.f90 b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func004.f90 +new file mode 100644 +index 0000000..0003034 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func004.f90 +@@ -0,0 +1,4 @@ ++integer function f_func(i) bind(c, name = "f_func_") ++ integer(8) :: i ++ f_func = 10 + i ++end +diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func005.f90 b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func005.f90 +new file mode 100644 +index 0000000..4a50645 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func005.f90 +@@ -0,0 +1,4 @@ ++integer function f_func(i) bind(c, name = "f_func_") ++ integer(1) :: i ++ f_func = 10 + i ++end +diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func006.f90 b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func006.f90 +new file mode 100644 +index 0000000..0003034 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func006.f90 +@@ -0,0 +1,4 @@ ++integer function f_func(i) bind(c, name = "f_func_") ++ integer(8) :: i ++ f_func = 10 + i ++end +diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func007.f90 b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func007.f90 +new file mode 100644 +index 0000000..4a50645 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func007.f90 +@@ -0,0 +1,4 @@ ++integer function f_func(i) bind(c, name = "f_func_") ++ integer(1) :: i ++ f_func = 10 + i ++end +diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func008.f90 b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func008.f90 +new file mode 100644 +index 0000000..a92967c +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func008.f90 +@@ -0,0 +1,4 @@ ++integer function f_func(i) bind(c, name = "f_func_") ++ integer(2) :: i ++ f_func = 10 + i ++end +diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func009.f90 b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func009.f90 +new file mode 100644 +index 0000000..fbe023b +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func009.f90 +@@ -0,0 +1,4 @@ ++integer function f_func(i) bind(c, name = "f_func_") ++ integer(4) :: i ++ f_func = 10 + i ++end +diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func010.f90 b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func010.f90 +new file mode 100644 +index 0000000..0003034 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func010.f90 +@@ -0,0 +1,4 @@ ++integer function f_func(i) bind(c, name = "f_func_") ++ integer(8) :: i ++ f_func = 10 + i ++end +diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func011.f90 b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func011.f90 +new file mode 100644 +index 0000000..4a50645 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func011.f90 +@@ -0,0 +1,4 @@ ++integer function f_func(i) bind(c, name = "f_func_") ++ integer(1) :: i ++ f_func = 10 + i ++end +diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func012.f90 b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func012.f90 +new file mode 100644 +index 0000000..a92967c +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func012.f90 +@@ -0,0 +1,4 @@ ++integer function f_func(i) bind(c, name = "f_func_") ++ integer(2) :: i ++ f_func = 10 + i ++end +diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func013.f90 b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func013.f90 +new file mode 100644 +index 0000000..fbe023b +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func013.f90 +@@ -0,0 +1,4 @@ ++integer function f_func(i) bind(c, name = "f_func_") ++ integer(4) :: i ++ f_func = 10 + i ++end +diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func014.f90 b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func014.f90 +new file mode 100644 +index 0000000..0003034 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func014.f90 +@@ -0,0 +1,4 @@ ++integer function f_func(i) bind(c, name = "f_func_") ++ integer(8) :: i ++ f_func = 10 + i ++end +diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func015.f90 b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func015.f90 +new file mode 100644 +index 0000000..4a50645 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func015.f90 +@@ -0,0 +1,4 @@ ++integer function f_func(i) bind(c, name = "f_func_") ++ integer(1) :: i ++ f_func = 10 + i ++end +diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func016.f90 b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func016.f90 +new file mode 100644 +index 0000000..0003034 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func016.f90 +@@ -0,0 +1,4 @@ ++integer function f_func(i) bind(c, name = "f_func_") ++ integer(8) :: i ++ f_func = 10 + i ++end +diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func017.f90 b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func017.f90 +new file mode 100644 +index 0000000..0003034 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func017.f90 +@@ -0,0 +1,4 @@ ++integer function f_func(i) bind(c, name = "f_func_") ++ integer(8) :: i ++ f_func = 10 + i ++end +diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func018.f90 b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func018.f90 +new file mode 100644 +index 0000000..0003034 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func018.f90 +@@ -0,0 +1,4 @@ ++integer function f_func(i) bind(c, name = "f_func_") ++ integer(8) :: i ++ f_func = 10 + i ++end +diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func019.f90 b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func019.f90 +new file mode 100644 +index 0000000..0003034 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func019.f90 +@@ -0,0 +1,4 @@ ++integer function f_func(i) bind(c, name = "f_func_") ++ integer(8) :: i ++ f_func = 10 + i ++end +diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func020.f90 b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func020.f90 +new file mode 100644 +index 0000000..0003034 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func020.f90 +@@ -0,0 +1,4 @@ ++integer function f_func(i) bind(c, name = "f_func_") ++ integer(8) :: i ++ f_func = 10 + i ++end +diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func021.f90 b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func021.f90 +new file mode 100644 +index 0000000..830bae6 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func021.f90 +@@ -0,0 +1,4 @@ ++real function f_func(i) bind(c, name = "f_func_") ++ real(4) :: i ++ f_func = i + 0.1 ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func022.f90 b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func022.f90 +new file mode 100644 +index 0000000..5e78483 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func022.f90 +@@ -0,0 +1,4 @@ ++real(8) function f_func(i) bind(c, name = "f_func_") ++ real(8) :: i ++ f_func = i + 0.1 ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func023.f90 b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func023.f90 +new file mode 100644 +index 0000000..af3887a +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func023.f90 +@@ -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_bindc/fortran_func024.f90 b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func024.f90 +new file mode 100644 +index 0000000..62de96e +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func024.f90 +@@ -0,0 +1,4 @@ ++complex(4) function f_func(i) bind(c, name = "f_func_") ++ complex(4) :: i ++ f_func = (-12345678.7654321, 1) ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func025.f90 b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func025.f90 +new file mode 100644 +index 0000000..9474d00 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func025.f90 +@@ -0,0 +1,4 @@ ++complex(8) function f_func(i) bind(c, name = "f_func_") ++ complex(8) :: i ++ f_func = (-12345678.7654321, 1) ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func026.f90 b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func026.f90 +new file mode 100644 +index 0000000..4221aff +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func026.f90 +@@ -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_bindc/fortran_func027.f90 b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func027.f90 +new file mode 100644 +index 0000000..d6a9631 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func027.f90 +@@ -0,0 +1,4 @@ ++logical function f_func(i) bind(c, name = "f_func_") ++ logical(1) :: i ++ f_func = .TRUE. ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func028.f90 b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func028.f90 +new file mode 100644 +index 0000000..6eb68f1 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/fortran_func028.f90 +@@ -0,0 +1,4 @@ ++character function f_func(i) bind(c, name = "f_func_") ++ character(1) :: i ++ f_func = 'a' ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/run.sh b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_bindc/run.sh +new file mode 100644 +index 0000000..f6f089a +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/012_c_call_fortran_function_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_value/c_main001.c b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main001.c +new file mode 100644 +index 0000000..4ce0401 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main001.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for the return type is int passing parameter ++// with value attribute ++// ++#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_value/c_main002.c b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main002.c +new file mode 100644 +index 0000000..84a0c5c +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main002.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for the return type is short passing parameter ++// with value attribute ++// ++#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_value/c_main003.c b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main003.c +new file mode 100644 +index 0000000..e961466 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main003.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for the return type is long passing parameter ++// with value attribute ++// ++#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_value/c_main004.c b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main004.c +new file mode 100644 +index 0000000..87f258d +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main004.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for the return type is long long passing ++// parameter with value attribute ++// ++#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_value/c_main005.c b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main005.c +new file mode 100644 +index 0000000..ac31b35 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main005.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for the return type is signed char passing ++// parameter with value attribute ++// ++#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_value/c_main006.c b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main006.c +new file mode 100644 +index 0000000..dbf6aac +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main006.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for the return type is size_t passing parameter ++// with value attribute ++// ++#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_value/c_main007.c b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main007.c +new file mode 100644 +index 0000000..0694bbc +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main007.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for the return type is int8_t passing parameter ++// with value attribute ++// ++#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_value/c_main008.c b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main008.c +new file mode 100644 +index 0000000..a01796a +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main008.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for the return type is int16_t passing parameter ++// with value attribute ++// ++#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_value/c_main009.c b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main009.c +new file mode 100644 +index 0000000..54eeffe +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main009.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for the return type is int32_t passing parameter ++// with value attribute ++// ++#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_value/c_main010.c b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main010.c +new file mode 100644 +index 0000000..17c1e77 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main010.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for the return type is int64_t passing parameter ++// with value attribute ++// ++#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_value/c_main011.c b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main011.c +new file mode 100644 +index 0000000..fa29ef8 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main011.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for the return type is int_least8_t passing ++// parameter with value attribute ++// ++#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_value/c_main012.c b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main012.c +new file mode 100644 +index 0000000..c6482e8 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main012.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for the return type is int_least16_t passing ++// parameter with value attribute ++// ++#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_value/c_main013.c b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main013.c +new file mode 100644 +index 0000000..8143ab1 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main013.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for the return type is int_least32_t passing ++// parameter with value attribute ++// ++#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_value/c_main014.c b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main014.c +new file mode 100644 +index 0000000..9576f28 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main014.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for the return type is int_least64_t passing ++// parameter with value attribute ++// ++#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_value/c_main015.c b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main015.c +new file mode 100644 +index 0000000..9b00c68 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main015.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for the return type is int_fast8_t passing ++// parameter with value attribute ++// ++#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_value/c_main016.c b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main016.c +new file mode 100644 +index 0000000..c040563 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main016.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for the return type is int_fast16_t passing ++// parameter with value attribute ++// ++#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_value/c_main017.c b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main017.c +new file mode 100644 +index 0000000..cd6baca +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main017.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for the return type is int_fast32_t passing ++// parameter with value attribute ++// ++#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_value/c_main018.c b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main018.c +new file mode 100644 +index 0000000..e353616 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main018.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for the return type is int_fast64_t passing ++// parameter with value attribute ++// ++#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_value/c_main019.c b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main019.c +new file mode 100644 +index 0000000..ab3aaca +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main019.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for the return type is intmax_t passing ++// parameter with value attribute ++// ++#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_value/c_main020.c b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main020.c +new file mode 100644 +index 0000000..78d4a42 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main020.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for the return type is intptr_t passing ++// parameter with value attribute ++// ++#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_value/c_main021.c b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main021.c +new file mode 100644 +index 0000000..192a0a3 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main021.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for the return type is float passing parameter ++// with value attribute ++// ++#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_value/c_main022.c b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main022.c +new file mode 100644 +index 0000000..5d25cfa +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main022.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for the return type is double passing parameter ++// with value attribute ++// ++#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_value/c_main023.c b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main023.c +new file mode 100644 +index 0000000..683adbb +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main023.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for the return type is long double passing ++// parameter with value attribute ++// ++#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_value/c_main024.c b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main024.c +new file mode 100644 +index 0000000..8b43b9f +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main024.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for the return type is float _Complex passing ++// parameter with value attribute ++// ++#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_value/c_main025.c b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main025.c +new file mode 100644 +index 0000000..b1de661 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main025.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for the return type is double _Complex passing ++// parameter with value attribute ++// ++#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_value/c_main026.c b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main026.c +new file mode 100644 +index 0000000..cf21cc9 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main026.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for the return type is long double _Complex ++// passing parameter with value attribute ++// ++#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_value/c_main027.c b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main027.c +new file mode 100644 +index 0000000..a42293f +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main027.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for the return type is _Bool passing parameter ++// with value attribute ++// ++#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_value/c_main028.c b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main028.c +new file mode 100644 +index 0000000..424281c +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/c_main028.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for the return type is char passing parameter ++// with value attribute ++// ++#include ++#include ++extern char f_func_(char i); ++int main() { ++ char i; ++ char res = f_func_(i); ++ printf("%c\n", i); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func001.f90 b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func001.f90 +new file mode 100644 +index 0000000..60747b4 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func001.f90 +@@ -0,0 +1,4 @@ ++integer function f_func(i) ++ integer, value :: i ++ f_func = 10 + i ++end +diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func002.f90 b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func002.f90 +new file mode 100644 +index 0000000..453e214 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func002.f90 +@@ -0,0 +1,4 @@ ++integer function f_func(i) ++ integer(2), value :: i ++ f_func = 10 + i ++end +diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func003.f90 b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func003.f90 +new file mode 100644 +index 0000000..ca583ef +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func003.f90 +@@ -0,0 +1,4 @@ ++integer function f_func(i) ++ integer(8), value :: i ++ f_func = 10 + i ++end +diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func004.f90 b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func004.f90 +new file mode 100644 +index 0000000..ca583ef +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func004.f90 +@@ -0,0 +1,4 @@ ++integer function f_func(i) ++ integer(8), value :: i ++ f_func = 10 + i ++end +diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func005.f90 b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func005.f90 +new file mode 100644 +index 0000000..69c38fa +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func005.f90 +@@ -0,0 +1,4 @@ ++integer function f_func(i) ++ integer(1), value :: i ++ f_func = 10 + i ++end +diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func006.f90 b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func006.f90 +new file mode 100644 +index 0000000..ca583ef +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func006.f90 +@@ -0,0 +1,4 @@ ++integer function f_func(i) ++ integer(8), value :: i ++ f_func = 10 + i ++end +diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func007.f90 b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func007.f90 +new file mode 100644 +index 0000000..69c38fa +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func007.f90 +@@ -0,0 +1,4 @@ ++integer function f_func(i) ++ integer(1), value :: i ++ f_func = 10 + i ++end +diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func008.f90 b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func008.f90 +new file mode 100644 +index 0000000..453e214 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func008.f90 +@@ -0,0 +1,4 @@ ++integer function f_func(i) ++ integer(2), value :: i ++ f_func = 10 + i ++end +diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func009.f90 b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func009.f90 +new file mode 100644 +index 0000000..55301e2 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func009.f90 +@@ -0,0 +1,4 @@ ++integer function f_func(i) ++ integer(4), value :: i ++ f_func = 10 + i ++end +diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func010.f90 b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func010.f90 +new file mode 100644 +index 0000000..ca583ef +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func010.f90 +@@ -0,0 +1,4 @@ ++integer function f_func(i) ++ integer(8), value :: i ++ f_func = 10 + i ++end +diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func011.f90 b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func011.f90 +new file mode 100644 +index 0000000..69c38fa +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func011.f90 +@@ -0,0 +1,4 @@ ++integer function f_func(i) ++ integer(1), value :: i ++ f_func = 10 + i ++end +diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func012.f90 b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func012.f90 +new file mode 100644 +index 0000000..453e214 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func012.f90 +@@ -0,0 +1,4 @@ ++integer function f_func(i) ++ integer(2), value :: i ++ f_func = 10 + i ++end +diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func013.f90 b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func013.f90 +new file mode 100644 +index 0000000..55301e2 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func013.f90 +@@ -0,0 +1,4 @@ ++integer function f_func(i) ++ integer(4), value :: i ++ f_func = 10 + i ++end +diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func014.f90 b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func014.f90 +new file mode 100644 +index 0000000..ca583ef +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func014.f90 +@@ -0,0 +1,4 @@ ++integer function f_func(i) ++ integer(8), value :: i ++ f_func = 10 + i ++end +diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func015.f90 b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func015.f90 +new file mode 100644 +index 0000000..69c38fa +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func015.f90 +@@ -0,0 +1,4 @@ ++integer function f_func(i) ++ integer(1), value :: i ++ f_func = 10 + i ++end +diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func016.f90 b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func016.f90 +new file mode 100644 +index 0000000..ca583ef +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func016.f90 +@@ -0,0 +1,4 @@ ++integer function f_func(i) ++ integer(8), value :: i ++ f_func = 10 + i ++end +diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func017.f90 b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func017.f90 +new file mode 100644 +index 0000000..ca583ef +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func017.f90 +@@ -0,0 +1,4 @@ ++integer function f_func(i) ++ integer(8), value :: i ++ f_func = 10 + i ++end +diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func018.f90 b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func018.f90 +new file mode 100644 +index 0000000..ca583ef +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func018.f90 +@@ -0,0 +1,4 @@ ++integer function f_func(i) ++ integer(8), value :: i ++ f_func = 10 + i ++end +diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func019.f90 b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func019.f90 +new file mode 100644 +index 0000000..ca583ef +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func019.f90 +@@ -0,0 +1,4 @@ ++integer function f_func(i) ++ integer(8), value :: i ++ f_func = 10 + i ++end +diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func020.f90 b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func020.f90 +new file mode 100644 +index 0000000..ca583ef +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func020.f90 +@@ -0,0 +1,4 @@ ++integer function f_func(i) ++ integer(8), value :: i ++ f_func = 10 + i ++end +diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func021.f90 b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func021.f90 +new file mode 100644 +index 0000000..fa03457 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func021.f90 +@@ -0,0 +1,4 @@ ++real function f_func(i) ++ real(4), value :: i ++ f_func = i + 0.1 ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func022.f90 b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func022.f90 +new file mode 100644 +index 0000000..8970836 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func022.f90 +@@ -0,0 +1,4 @@ ++real(8) function f_func(i) ++ real(8), value :: i ++ f_func = i + 0.1 ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func023.f90 b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func023.f90 +new file mode 100644 +index 0000000..b26dd66 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func023.f90 +@@ -0,0 +1,6 @@ ++function f_func(i) ++ integer, parameter :: K = selected_real_kind(16) ++ real(K), value :: 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/013_c_call_fortran_function_value/fortran_func024.f90 b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func024.f90 +new file mode 100644 +index 0000000..a56a5bb +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func024.f90 +@@ -0,0 +1,4 @@ ++complex(4) function f_func(i) ++ complex(4), value :: i ++ f_func = (-12345678.7654321, 1) ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func025.f90 b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func025.f90 +new file mode 100644 +index 0000000..43cf7ce +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func025.f90 +@@ -0,0 +1,4 @@ ++complex(8) function f_func(i) ++ complex(8), value :: i ++ f_func = (-12345678.7654321, 1) ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func026.f90 b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func026.f90 +new file mode 100644 +index 0000000..45f9458 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func026.f90 +@@ -0,0 +1,6 @@ ++function f_func(i) ++ integer, parameter :: K = selected_real_kind(16) ++ complex(K), value :: 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/013_c_call_fortran_function_value/fortran_func027.f90 b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func027.f90 +new file mode 100644 +index 0000000..3681f81 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func027.f90 +@@ -0,0 +1,4 @@ ++logical function f_func(i) ++ logical(1), value :: i ++ f_func = .TRUE. ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func028.f90 b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func028.f90 +new file mode 100644 +index 0000000..5feadc7 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/fortran_func028.f90 +@@ -0,0 +1,4 @@ ++character(1) function f_func(i) ++ character(1), value :: i ++ f_func = 'a' ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/run.sh b/test/interoperability_with_c_c_call_fortran/013_c_call_fortran_function_value/run.sh +new file mode 100644 +index 0000000..f6f089a +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/013_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/014_c_call_fortran_function_value_bindc/c_main001.c b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main001.c +new file mode 100644 +index 0000000..5b67b09 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main001.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for the return type is int passing parameter ++// with value attribute with bindc ++// ++#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_value_bindc/c_main002.c b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main002.c +new file mode 100644 +index 0000000..d426ee3 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main002.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for the return type is short passing parameter ++// with value attribute with bindc ++// ++#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_value_bindc/c_main003.c b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main003.c +new file mode 100644 +index 0000000..a1b0fd3 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main003.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for the return type is long passing parameter ++// with value attribute with bindc ++// ++#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_value_bindc/c_main004.c b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main004.c +new file mode 100644 +index 0000000..cdcff38 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main004.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for the return type is long long passing ++// parameter with value attribute with bindc ++// ++#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_value_bindc/c_main005.c b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main005.c +new file mode 100644 +index 0000000..8f410ae +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main005.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for the return type is signed char passing ++// parameter with value attribute with bindc ++// ++#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_value_bindc/c_main006.c b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main006.c +new file mode 100644 +index 0000000..1f61ee2 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main006.c +@@ -0,0 +1,10 @@ ++// Test c call fortran for the return type is size_t passing parameter ++// with value attribute with bindc ++// ++#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_value_bindc/c_main007.c b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main007.c +new file mode 100644 +index 0000000..fafb3f5 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main007.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for the return type is int8_t passing parameter ++// with value attribute with bindc ++// ++#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_value_bindc/c_main008.c b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main008.c +new file mode 100644 +index 0000000..eba1d6b +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main008.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for the return type is int16_t passing parameter ++// with value attribute with bindc ++// ++#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_value_bindc/c_main009.c b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main009.c +new file mode 100644 +index 0000000..6f67907 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main009.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for the return type is int32_t passing parameter ++// with value attribute with bindc ++// ++#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_value_bindc/c_main010.c b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main010.c +new file mode 100644 +index 0000000..72cc1d3 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main010.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for the return type is int64_t passing parameter ++// with value attribute with bindc ++// ++#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_value_bindc/c_main011.c b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main011.c +new file mode 100644 +index 0000000..8fa7b7a +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main011.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for the return type is int_least8_t passing ++// parameter with value attribute with bindc ++// ++#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_value_bindc/c_main012.c b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main012.c +new file mode 100644 +index 0000000..54e6c51 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main012.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for the return type is int_least16_t passing ++// parameter with value attribute with bindc ++// ++#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_value_bindc/c_main013.c b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main013.c +new file mode 100644 +index 0000000..f3b3ba5 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main013.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for the return type is int_least32_t passing ++// parameter with value attribute with bindc ++// ++#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_value_bindc/c_main014.c b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main014.c +new file mode 100644 +index 0000000..e0b8e4f +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main014.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for the return type is int_least64_t passing ++// parameter with value attribute with bindc ++// ++#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_value_bindc/c_main015.c b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main015.c +new file mode 100644 +index 0000000..de6777f +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main015.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for the return type is int_fast8_t passing ++// parameter with value attribute with bindc ++// ++#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_value_bindc/c_main016.c b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main016.c +new file mode 100644 +index 0000000..b9f7483 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main016.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for the return type is int_fast16_t passing ++// parameter with value attribute with bindc ++// ++#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_value_bindc/c_main017.c b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main017.c +new file mode 100644 +index 0000000..e94b8d9 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main017.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for the return type is int_fast32_t passing ++// parameter with value attribute with bindc ++// ++#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_value_bindc/c_main018.c b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main018.c +new file mode 100644 +index 0000000..93e6508 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main018.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for the return type is int_fast64_t passing ++// parameter with value attribute with bindc ++// ++#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_value_bindc/c_main019.c b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main019.c +new file mode 100644 +index 0000000..719ce04 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main019.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for the return type is intmax_t passing ++// parameter with value attribute with bindc ++// ++#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_value_bindc/c_main020.c b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main020.c +new file mode 100644 +index 0000000..473ddd3 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main020.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for the return type is intptr_t passing ++// parameter with value attribute with bindc ++// ++#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_value_bindc/c_main021.c b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main021.c +new file mode 100644 +index 0000000..93035e6 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main021.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for the return type is float passing parameter ++// with value attribute with bindc ++// ++#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_value_bindc/c_main022.c b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main022.c +new file mode 100644 +index 0000000..4ecfb80 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main022.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for the return type is double passing parameter ++// with value attribute with bindc ++// ++#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_value_bindc/c_main023.c b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main023.c +new file mode 100644 +index 0000000..f9ddfa6 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main023.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for the return type is long double passing ++// parameter with value attribute with bindc ++// ++#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_value_bindc/c_main024.c b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main024.c +new file mode 100644 +index 0000000..0000476 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main024.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for the return type is float _Complex passing ++// parameter with value attribute with bindc ++// ++#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_value_bindc/c_main025.c b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main025.c +new file mode 100644 +index 0000000..6b9c9d9 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main025.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for the return type is double _Complex passing ++// parameter with value attribute with bindc ++// ++#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_value_bindc/c_main026.c b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main026.c +new file mode 100644 +index 0000000..4c442b8 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/014_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 ++// passing parameter with value attribute 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_value_bindc/c_main027.c b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main027.c +new file mode 100644 +index 0000000..ddf8821 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main027.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for the return type is _Bool passing parameter ++// with value attribute with bindc ++// ++#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_value_bindc/c_main028.c b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main028.c +new file mode 100644 +index 0000000..0af1308 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/c_main028.c +@@ -0,0 +1,11 @@ ++// Test c call fortran for the return type is char passing parameter ++// with value attribute with bindc ++// ++#include ++#include ++extern char f_func_(char i); ++int main() { ++ char i; ++ char res = f_func_(i); ++ printf("%c\n", i); ++} +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func001.f90 b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func001.f90 +new file mode 100644 +index 0000000..c4ec5f5 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func001.f90 +@@ -0,0 +1,4 @@ ++integer function f_func(i) bind(c, name = "f_func_") ++ integer, value :: i ++ f_func = 10 + i ++end +diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func002.f90 b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func002.f90 +new file mode 100644 +index 0000000..4ea712c +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func002.f90 +@@ -0,0 +1,4 @@ ++integer function f_func(i) bind(c, name = "f_func_") ++ integer(2), value :: i ++ f_func = 10 + i ++end +diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func003.f90 b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func003.f90 +new file mode 100644 +index 0000000..1d4c1e7 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func003.f90 +@@ -0,0 +1,4 @@ ++integer function f_func(i) bind(c, name = "f_func_") ++ integer(8), value :: i ++ f_func = 10 + i ++end +diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func004.f90 b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func004.f90 +new file mode 100644 +index 0000000..1d4c1e7 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func004.f90 +@@ -0,0 +1,4 @@ ++integer function f_func(i) bind(c, name = "f_func_") ++ integer(8), value :: i ++ f_func = 10 + i ++end +diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func005.f90 b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func005.f90 +new file mode 100644 +index 0000000..8411259 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func005.f90 +@@ -0,0 +1,4 @@ ++integer function f_func(i) bind(c, name = "f_func_") ++ integer(1), value :: i ++ f_func = 10 + i ++end +diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func006.f90 b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func006.f90 +new file mode 100644 +index 0000000..1d4c1e7 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func006.f90 +@@ -0,0 +1,4 @@ ++integer function f_func(i) bind(c, name = "f_func_") ++ integer(8), value :: i ++ f_func = 10 + i ++end +diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func007.f90 b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func007.f90 +new file mode 100644 +index 0000000..8411259 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func007.f90 +@@ -0,0 +1,4 @@ ++integer function f_func(i) bind(c, name = "f_func_") ++ integer(1), value :: i ++ f_func = 10 + i ++end +diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func008.f90 b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func008.f90 +new file mode 100644 +index 0000000..4ea712c +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func008.f90 +@@ -0,0 +1,4 @@ ++integer function f_func(i) bind(c, name = "f_func_") ++ integer(2), value :: i ++ f_func = 10 + i ++end +diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func009.f90 b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func009.f90 +new file mode 100644 +index 0000000..ff94c2d +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func009.f90 +@@ -0,0 +1,4 @@ ++integer function f_func(i) bind(c, name = "f_func_") ++ integer(4), value :: i ++ f_func = 10 + i ++end +diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func010.f90 b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func010.f90 +new file mode 100644 +index 0000000..1d4c1e7 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func010.f90 +@@ -0,0 +1,4 @@ ++integer function f_func(i) bind(c, name = "f_func_") ++ integer(8), value :: i ++ f_func = 10 + i ++end +diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func011.f90 b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func011.f90 +new file mode 100644 +index 0000000..8411259 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func011.f90 +@@ -0,0 +1,4 @@ ++integer function f_func(i) bind(c, name = "f_func_") ++ integer(1), value :: i ++ f_func = 10 + i ++end +diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func012.f90 b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func012.f90 +new file mode 100644 +index 0000000..4ea712c +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func012.f90 +@@ -0,0 +1,4 @@ ++integer function f_func(i) bind(c, name = "f_func_") ++ integer(2), value :: i ++ f_func = 10 + i ++end +diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func013.f90 b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func013.f90 +new file mode 100644 +index 0000000..ff94c2d +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func013.f90 +@@ -0,0 +1,4 @@ ++integer function f_func(i) bind(c, name = "f_func_") ++ integer(4), value :: i ++ f_func = 10 + i ++end +diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func014.f90 b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func014.f90 +new file mode 100644 +index 0000000..1d4c1e7 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func014.f90 +@@ -0,0 +1,4 @@ ++integer function f_func(i) bind(c, name = "f_func_") ++ integer(8), value :: i ++ f_func = 10 + i ++end +diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func015.f90 b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func015.f90 +new file mode 100644 +index 0000000..8411259 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func015.f90 +@@ -0,0 +1,4 @@ ++integer function f_func(i) bind(c, name = "f_func_") ++ integer(1), value :: i ++ f_func = 10 + i ++end +diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func016.f90 b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func016.f90 +new file mode 100644 +index 0000000..1d4c1e7 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func016.f90 +@@ -0,0 +1,4 @@ ++integer function f_func(i) bind(c, name = "f_func_") ++ integer(8), value :: i ++ f_func = 10 + i ++end +diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func017.f90 b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func017.f90 +new file mode 100644 +index 0000000..1d4c1e7 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func017.f90 +@@ -0,0 +1,4 @@ ++integer function f_func(i) bind(c, name = "f_func_") ++ integer(8), value :: i ++ f_func = 10 + i ++end +diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func018.f90 b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func018.f90 +new file mode 100644 +index 0000000..1d4c1e7 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func018.f90 +@@ -0,0 +1,4 @@ ++integer function f_func(i) bind(c, name = "f_func_") ++ integer(8), value :: i ++ f_func = 10 + i ++end +diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func019.f90 b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func019.f90 +new file mode 100644 +index 0000000..1d4c1e7 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func019.f90 +@@ -0,0 +1,4 @@ ++integer function f_func(i) bind(c, name = "f_func_") ++ integer(8), value :: i ++ f_func = 10 + i ++end +diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func020.f90 b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func020.f90 +new file mode 100644 +index 0000000..1d4c1e7 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func020.f90 +@@ -0,0 +1,4 @@ ++integer function f_func(i) bind(c, name = "f_func_") ++ integer(8), value :: i ++ f_func = 10 + i ++end +diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func021.f90 b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func021.f90 +new file mode 100644 +index 0000000..97e2d47 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func021.f90 +@@ -0,0 +1,4 @@ ++real function f_func(i) bind(c, name = "f_func_") ++ real(4), value :: i ++ f_func = i + 0.1 ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func022.f90 b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func022.f90 +new file mode 100644 +index 0000000..2c8deb7 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func022.f90 +@@ -0,0 +1,4 @@ ++real(8) function f_func(i) bind(c, name = "f_func_") ++ real(8), value :: i ++ f_func = i + 0.1 ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func023.f90 b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func023.f90 +new file mode 100644 +index 0000000..61444ce +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func023.f90 +@@ -0,0 +1,6 @@ ++function f_func(i) bind(c, name = "f_func_") ++ integer, parameter :: K = selected_real_kind(16) ++ real(K), value :: 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/014_c_call_fortran_function_value_bindc/fortran_func024.f90 b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func024.f90 +new file mode 100644 +index 0000000..f43c211 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func024.f90 +@@ -0,0 +1,4 @@ ++complex(4) function f_func(i) bind(c, name = "f_func_") ++ complex(4), value :: i ++ f_func = (-12345678.7654321, 1) ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func025.f90 b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func025.f90 +new file mode 100644 +index 0000000..969dee9 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func025.f90 +@@ -0,0 +1,4 @@ ++complex(8) function f_func(i) bind(c, name = "f_func_") ++ complex(8), value :: i ++ f_func = (-12345678.7654321, 1) ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func026.f90 b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func026.f90 +new file mode 100644 +index 0000000..f32d8af +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func026.f90 +@@ -0,0 +1,6 @@ ++function f_func(i) bind(c, name = "f_func_") ++ integer, parameter :: K = selected_real_kind(16) ++ complex(K), value :: 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/014_c_call_fortran_function_value_bindc/fortran_func027.f90 b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func027.f90 +new file mode 100644 +index 0000000..1b39ac6 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func027.f90 +@@ -0,0 +1,4 @@ ++logical function f_func(i) bind(c, name = "f_func_") ++ logical(1), value :: i ++ f_func = .TRUE. ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func028.f90 b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func028.f90 +new file mode 100644 +index 0000000..26832c7 +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/fortran_func028.f90 +@@ -0,0 +1,4 @@ ++character(1) function f_func(i) bind(c, name = "f_func_") ++ character(1), value :: i ++ f_func = 'a' ++end +\ No newline at end of file +diff --git a/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/run.sh b/test/interoperability_with_c_c_call_fortran/014_c_call_fortran_function_value_bindc/run.sh +new file mode 100644 +index 0000000..f6f089a +--- /dev/null ++++ b/test/interoperability_with_c_c_call_fortran/014_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/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..3fe053f +--- /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..3fe053f +--- /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/flang.spec b/flang.spec index 109321e..311a35b 100644 --- a/flang.spec +++ b/flang.spec @@ -2,7 +2,7 @@ Name: flang Version: flang_20210324 -Release: 8 +Release: 9 Summary: Fortran language compiler targeting LLVM License: Apache-2.0 @@ -15,6 +15,7 @@ Patch0: 1-flang-runtime-inline.patch Patch1: 2-inline_f90_str_copy_klen.patch Patch2: 3-add-tests-interoperability-C.patch Patch3: 4-add-test-cases-for-openmp-optimization.patch +Patch4: 5-test-for-interoperability-with-c-c-call-fortran.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. @@ -36,6 +37,9 @@ TODO: support build Flang. %changelog +* Sun Oct 16 2022 xieyihui - flang_20210324-9 +- Add patch for add test cases for interoperability with C about C call fortran + * Mon Sep 19 2022 xieyihui - flang_20210324-8 - Add patch for add test cases for OpenMP optimization -- Gitee