diff --git a/1-flang-runtime-inline.patch b/1-flang-runtime-inline.patch deleted file mode 100644 index 08a0190c2394784fc40f57595510ef8d0f415e10..0000000000000000000000000000000000000000 --- a/1-flang-runtime-inline.patch +++ /dev/null @@ -1,1223 +0,0 @@ -commit fe297c405e2b0cab6dd02c41d8f5889d896a2406 -Author: q00576763 -Date: Fri Jul 8 16:14:21 2022 +0800 - - [Flang2] Create one framework to inline f90-prefix runtime call - - This patch creates one framwork to inline f90-prefix runtime call before - writing out the generated IR. This also implements the inline of - f90_strcmp_klen, which is for the comparison of two strings. - -diff --git a/test/f90_correct/inc/inline_f90_strcmp_klen.mk b/test/f90_correct/inc/inline_f90_strcmp_klen.mk -new file mode 100644 -index 00000000..a2f1f193 ---- /dev/null -+++ b/test/f90_correct/inc/inline_f90_strcmp_klen.mk -@@ -0,0 +1,22 @@ -+# -+# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -+# See https://llvm.org/LICENSE.txt for license information. -+# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -+# -+ -+$(TEST): run -+ -+ -+build: $(SRC)/$(TEST).f90 -+ -$(RM) $(TEST).$(EXESUFFIX) core *.d *.mod FOR*.DAT FTN* ftn* fort.* -+ @echo ------------------------------------ building test $@ -+ -$(FC) -c $(FFLAGS) $(LDFLAGS) $(SRC)/$(TEST).f90 -Mx,218,0x1 -o $(TEST).$(OBJX) -+ -$(FC) $(FFLAGS) $(LDFLAGS) $(TEST).$(OBJX) $(LIBS) -o $(TEST).$(EXESUFFIX) -+ -+ -+run: -+ @echo ------------------------------------ executing test $(TEST) -+ $(TEST).$(EXESUFFIX) -+ -+verify: ; -+ -diff --git a/test/f90_correct/inc/inline_f90_strcmp_klen_2.mk b/test/f90_correct/inc/inline_f90_strcmp_klen_2.mk -new file mode 100644 -index 00000000..a2f1f193 ---- /dev/null -+++ b/test/f90_correct/inc/inline_f90_strcmp_klen_2.mk -@@ -0,0 +1,22 @@ -+# -+# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -+# See https://llvm.org/LICENSE.txt for license information. -+# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -+# -+ -+$(TEST): run -+ -+ -+build: $(SRC)/$(TEST).f90 -+ -$(RM) $(TEST).$(EXESUFFIX) core *.d *.mod FOR*.DAT FTN* ftn* fort.* -+ @echo ------------------------------------ building test $@ -+ -$(FC) -c $(FFLAGS) $(LDFLAGS) $(SRC)/$(TEST).f90 -Mx,218,0x1 -o $(TEST).$(OBJX) -+ -$(FC) $(FFLAGS) $(LDFLAGS) $(TEST).$(OBJX) $(LIBS) -o $(TEST).$(EXESUFFIX) -+ -+ -+run: -+ @echo ------------------------------------ executing test $(TEST) -+ $(TEST).$(EXESUFFIX) -+ -+verify: ; -+ -diff --git a/test/f90_correct/lit/inline_f90_strcmp_klen.sh b/test/f90_correct/lit/inline_f90_strcmp_klen.sh -new file mode 100644 -index 00000000..3880a96e ---- /dev/null -+++ b/test/f90_correct/lit/inline_f90_strcmp_klen.sh -@@ -0,0 +1,9 @@ -+# -+# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -+# See https://llvm.org/LICENSE.txt for license information. -+# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -+ -+# Shared lit script for each tests. Run bash commands that run tests with make. -+ -+# RUN: KEEP_FILES=%keep FLAGS=%flags TEST_SRC=%s MAKE_FILE_DIR=%S/.. bash %S/runmake | tee %t -+# RUN: cat %t | FileCheck %S/runmake -diff --git a/test/f90_correct/lit/inline_f90_strcmp_klen_2.sh b/test/f90_correct/lit/inline_f90_strcmp_klen_2.sh -new file mode 100644 -index 00000000..3880a96e ---- /dev/null -+++ b/test/f90_correct/lit/inline_f90_strcmp_klen_2.sh -@@ -0,0 +1,9 @@ -+# -+# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -+# See https://llvm.org/LICENSE.txt for license information. -+# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -+ -+# Shared lit script for each tests. Run bash commands that run tests with make. -+ -+# RUN: KEEP_FILES=%keep FLAGS=%flags TEST_SRC=%s MAKE_FILE_DIR=%S/.. bash %S/runmake | tee %t -+# RUN: cat %t | FileCheck %S/runmake -diff --git a/test/f90_correct/src/inline_f90_strcmp_klen.f90 b/test/f90_correct/src/inline_f90_strcmp_klen.f90 -new file mode 100644 -index 00000000..c407b901 ---- /dev/null -+++ b/test/f90_correct/src/inline_f90_strcmp_klen.f90 -@@ -0,0 +1,93 @@ -+! Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -+! See https://llvm.org/LICENSE.txt for license information. -+! SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -+ -+! Program to test the inline of f90_strcmp_klen -+ -+program main -+ character(4) :: s4_1, s4_2 -+ character(3) :: s3 -+ character(5) :: s5 -+ -+ s4_1 = "aaab" -+ s4_2 = "aaaa" -+ if (s4_1 <= s4_2 .or. str_le(s4_1, s4_2)) stop 1 -+ -+ s4_1 = "aaab" -+ s4_2 = "aaab" -+ if (s4_1 /= s4_2 .or. str_ne(s4_1, s4_2)) stop 2 -+ -+ s4_1 = "aaab" -+ s4_2 = "aaac" -+ if (s4_1 >= s4_2 .or. str_ge(s4_1, s4_2)) stop 3 -+ -+ s4_1 = "aaba" -+ s3 = "aaa" -+ if (s4_1 <= s3 .or. str_le(s4_1, s3)) stop 4 -+ -+ s4_1 = "aaba" -+ s3 = "aab" -+ if (s4_1 <= s3 .or. str_le(s4_1, s3)) stop 5 -+ -+ s4_1 = "aaba" -+ s3 = "aac" -+ if (s4_1 >= s3 .or. str_ge(s4_1, s3)) stop 6 -+ -+ s4_1 = "aab" -+ s3 = "aab" -+ if (s4_1 >= s3 .or. str_ge(s4_1, s3)) stop 7 -+ -+ s4_1 = "aab " -+ s3 = "aab" -+ if (s4_1 /= s3 .or. str_ne(s4_1, s3)) stop 8 -+ -+ s4_1 = "aaba" -+ s3 = "aab" -+ if (s4_1 <= s3 .or. str_le(s4_1, s3)) stop 9 -+ -+ s3 = "aab" -+ s4_2 = "aaaa" -+ if (s3 <= s4_2 .or. str_le(s3, s4_2)) stop 10 -+ -+ s3 = "aab" -+ s4_2 = "aaba" -+ if (s3 >= s4_2 .or. str_ge(s3, s4_2)) stop 11 -+ -+ s3 = "aab" -+ s4_2 = "aaca" -+ if (s3 >= s4_2 .or. str_ge(s3, s4_2)) stop 12 -+ -+ s3 = "aab" -+ s4_2 = "aab" -+ if (s3 <= s4_2 .or. str_le(s3, s4_2)) stop 13 -+ -+ s3 = "aab" -+ s4_2 = "aab " -+ if (s3 /= s4_2 .or. str_ne(s3, s4_2)) stop 14 -+ -+ s3 = "aab" -+ s4_2 = "aaba" -+ if (s3 >= s4_2 .or. str_ge(s3, s4_2)) stop 15 -+ -+ print *, "PASS" -+ -+contains -+ function str_le(s, t) result(res) -+ character(*) :: s, t -+ logical :: res -+ res = .false. -+ if (s <= t) res = .true. -+ end -+ function str_ge(s, t) result(res) -+ character(*) :: s, t -+ logical :: res -+ res = .false. -+ if (s >= t) res = .true. -+ end -+ function str_ne(s, t) result(res) -+ character(*) :: s, t -+ logical :: res -+ res = .false. -+ if (s /= t) res = .true. -+ end -+end -diff --git a/test/f90_correct/src/inline_f90_strcmp_klen_2.f90 b/test/f90_correct/src/inline_f90_strcmp_klen_2.f90 -new file mode 100644 -index 00000000..49bec361 ---- /dev/null -+++ b/test/f90_correct/src/inline_f90_strcmp_klen_2.f90 -@@ -0,0 +1,23 @@ -+! Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -+! See https://llvm.org/LICENSE.txt for license information. -+! SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -+ -+! Program to test the inline of f90_strcmp_klen when there is no constants -+! in procedure where the string compare exists. -+ -+program main -+ character(len=10):: a, b -+ a = '1111111112' -+ b = '1111 11111' -+ -+ if(func(a, b)) stop 1 -+ -+ print *, "PASS" -+contains -+ function func(a, b) -+ character(len =10) :: a, b -+ logical :: func -+ func = (a <= b) -+ end function -+end -+ -diff --git a/test/llvm_ir_correct/inline_strcmp_klen.f90 b/test/llvm_ir_correct/inline_strcmp_klen.f90 -new file mode 100644 -index 00000000..ca959ca5 ---- /dev/null -+++ b/test/llvm_ir_correct/inline_strcmp_klen.f90 -@@ -0,0 +1,19 @@ -+! -+! Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -+! See https://llvm.org/LICENSE.txt for license information. -+! SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -+! -+ -+! RUN: %flang -S -Mx,218,0x1 -O3 -emit-llvm %s -o - 2>&1 | FileCheck %s -check-prefix=INLINE -+! RUN: %flang -S -O3 -emit-llvm %s -o - 2>&1 | FileCheck %s -check-prefix=NOINLINE -+ -+program t -+ character(2) :: a, b -+ a = "aa" -+ b = "aa" -+ -+ ! INLINE-NOT: f90_strcmp_klen -+ ! NOINLINE: f90_strcmp_klen -+ if (a /= b) stop 1 -+ -+end program -diff --git a/tools/flang2/docs/xflag.n b/tools/flang2/docs/xflag.n -index 4108e594..a821af89 100644 ---- a/tools/flang2/docs/xflag.n -+++ b/tools/flang2/docs/xflag.n -@@ -5508,7 +5508,8 @@ POWER Modifications - Enable auto initialization of stack memory to 64bit signaling NaNs. - - .XF "218:" --reserved -+.XB 0x01: -+Try to inline Fortran runtime calls (functions with f90 prefix). - - .XF "220:" - Enable tuning code for -Minline. -diff --git a/tools/flang2/flang2exe/CMakeLists.txt b/tools/flang2/flang2exe/CMakeLists.txt -index b7c749b1..713c7375 100644 ---- a/tools/flang2/flang2exe/CMakeLists.txt -+++ b/tools/flang2/flang2exe/CMakeLists.txt -@@ -77,6 +77,7 @@ set(SOURCES - verify.cpp - ompaccel.cpp - tgtutil.cpp -+ inline_runtime.cpp - ${UTILS_SYMTAB_BIN_DIR}/symtabdf.cpp - ) - -diff --git a/tools/flang2/flang2exe/cgmain.cpp b/tools/flang2/flang2exe/cgmain.cpp -index 3c08aa26..ac89bf48 100644 ---- a/tools/flang2/flang2exe/cgmain.cpp -+++ b/tools/flang2/flang2exe/cgmain.cpp -@@ -41,6 +41,7 @@ - #include "main.h" - #include "symfun.h" - #include "ilidir.h" -+#include "inline_runtime.h" - - #ifdef OMP_OFFLOAD_LLVM - #include "ompaccel.h" -@@ -389,6 +390,7 @@ static OPERAND *convert_float_size(OPERAND *, LL_Type *); - static int follow_sptr_hashlk(SPTR sptr); - static DTYPE follow_ptr_dtype(DTYPE); - static bool same_op(OPERAND *, OPERAND *); -+static void inline_runtime_calls(); - static void write_instructions(LL_Module *); - static LLIntegerConditionCodes convert_to_llvm_intcc(CC_RELATION cc); - static LLIntegerConditionCodes convert_to_llvm_uintcc(CC_RELATION cc); -@@ -1893,6 +1895,10 @@ restartConcur: - sched_instructions(Instructions); - } - -+ /* Inline f90 runtime calls */ -+ if (XBIT(218, 0x1)) -+ inline_runtime_calls(); -+ - /* print out the instructions */ - write_instructions(current_module); - -@@ -2828,6 +2834,21 @@ should_suppress_debug_loc(INSTR_LIST *instrs) - } - } - -+static void -+inline_runtime_calls() -+{ -+ INSTR_LIST *instr; -+ -+ for (instr = Instructions; instr; instr = instr->next) { -+ if (instr->i_name == I_CALL) { -+ INLINE_RUNTIME_ID inline_runtime_id = get_inline_runtime_id(instr); -+ if (inline_runtime_id != NONE_ID) -+ instr = -+ emit_inline_runtime_call(Instructions, instr, inline_runtime_id); -+ } -+ } -+} -+ - /** - \brief Write the instruction list to the LLVM IR output file - */ -diff --git a/tools/flang2/flang2exe/inline_runtime.cpp b/tools/flang2/flang2exe/inline_runtime.cpp -new file mode 100644 -index 00000000..dc09aa67 ---- /dev/null -+++ b/tools/flang2/flang2exe/inline_runtime.cpp -@@ -0,0 +1,812 @@ -+/* -+ * Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -+ * See https://llvm.org/LICENSE.txt for license information. -+ * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -+ * -+ */ -+ -+/** -+ \file -+ \brief Inline f90 runtime call operations -+ */ -+ -+#include "inline_runtime.h" -+#include -+#include -+#include -+ -+enum OT_CC_NAMES { -+ NONE = 0, -+ OT_EQ, -+ OT_NE, -+ OT_UGT, -+ OT_UGE, -+ OT_ULT, -+ OT_ULE, -+ OT_SGT, -+ OT_SGE, -+ OT_SLT, -+ OT_SLE, -+}; -+ -+static std::unordered_map inline_calls; -+static LL_MDRef dbg_line_op; -+static unsigned int wrap_nmptr = 0; -+static unsigned long long wrap_max_cnt = 0; -+static INSTR_LIST *curr_instr = nullptr; -+static INSTR_LIST *top_instr = nullptr; -+static INSTR_LIST *runtime_instr = nullptr; -+static bool is_initialized_inline_calls = false; -+ -+static SPTR mklabel(const char *nmptr); -+static OPERAND *make_ot_cc_op(OT_CC_NAMES ot_cc); -+static OPERAND *mirror_nontmp_op(OPERAND *oper); -+static void mirror_instr(INSTR_LIST *, INSTR_LIST *); -+static INSTR_LIST *gen_instr(LL_InstrName, LL_Type *, OPERAND *); -+static INSTR_LIST *gen_instr(LL_InstrName, TMPS *, LL_Type *, OPERAND *); -+static INSTR_LIST *gen_new_st(INSTR_LIST *, OPERAND *, OPERAND *); -+static INSTR_LIST *gen_alloca_instr(LL_Type *); -+static INSTR_LIST *gen_new_instr(INSTR_LIST *, LL_InstrName, LL_Type *, -+ OPERAND *, OPERAND *, OPERAND *); -+static void link_instrs(INSTR_LIST *, INSTR_LIST *); -+static void inc_loop_iter(OPERAND *, LL_Type *, OPERAND *); -+static void cmp_two_vars(OPERAND *, OPERAND *, LL_Type *, OT_CC_NAMES); -+static void finalize_bb(SPTR, OPERAND *, LL_Type *); -+static void store_result_bb(SPTR, OPERAND *, OPERAND *, OPERAND *); -+static void process_strlen_lt_zero(OPERAND *); -+static INSTR_LIST *loop_s1_cmp_s2(OPERAND *, OPERAND *, OPERAND *, OPERAND *, -+ int); -+static INSTR_LIST *inline_f90_strcmp_klen(); -+static void init_inline_runtime_call(); -+ -+static SPTR -+mklabel(const char *nm) -+{ -+ SPTR sptr; -+ std::string s = nm; -+ -+ /* The same name may be called multiple times, so wrap the name ptr. */ -+ if (wrap_nmptr == UINT_MAX) { -+ wrap_max_cnt++; -+ wrap_nmptr = 0; -+ } -+ s += std::string("wrap"); -+ for (unsigned long long i = 0; i < wrap_max_cnt; i++) { -+ s += std::to_string(UINT_MAX); -+ s += std::string("wrap"); -+ } -+ s += std::to_string(wrap_nmptr++); -+ const char *nmptr = s.c_str(); -+ -+ sptr = getsym(nmptr, strlen(nmptr)); -+ STYPEP(sptr, ST_LABEL); -+ CCSYMP(sptr, 1); -+ return sptr; -+} -+ -+static OPERAND * -+make_ot_cc_op(OT_CC_NAMES ot_cc) -+{ -+ OPERAND *op; -+ -+ op = make_operand(); -+ op->ot_type = OT_CC; -+ op->ll_type = make_int_lltype(32); -+ op->val.cc = ot_cc; -+ return op; -+} -+ -+static OPERAND * -+mirror_nontmp_op(OPERAND *oper) -+{ -+ OPERAND *op; -+ -+ op = make_operand(); -+ op->ot_type = oper->ot_type; -+ op->ll_type = oper->ll_type; -+ op->val.sptr = oper->val.sptr; -+ return op; -+} -+ -+static void -+mirror_instr(INSTR_LIST *dest_instr, INSTR_LIST *src_instr) -+{ -+ dest_instr->rank = src_instr->rank; -+ dest_instr->i_name = src_instr->i_name; -+ dest_instr->flags = src_instr->flags; -+ dest_instr->ll_type = src_instr->ll_type; -+ dest_instr->operands = src_instr->operands; -+ dest_instr->dbg_line_op = src_instr->dbg_line_op; -+ dest_instr->tmps->info.idef = dest_instr; -+} -+ -+static INSTR_LIST * -+gen_instr(LL_InstrName instr_name, LL_Type *ll_type, OPERAND *operands) -+{ -+ return gen_instr(instr_name, make_tmps(), ll_type, operands); -+} -+ -+static INSTR_LIST * -+gen_instr(LL_InstrName instr_name, TMPS *tmps, LL_Type *ll_type, -+ OPERAND *operands) -+{ -+ INSTR_LIST *iptr; -+ -+ iptr = (INSTR_LIST *)getitem(LLVM_LONGTERM_AREA, sizeof(INSTR_LIST)); -+ memset(iptr, 0, sizeof(INSTR_LIST)); -+ iptr->i_name = instr_name; -+ switch (instr_name) { -+ default: -+ iptr->dbg_line_op = dbg_line_op; -+ break; -+ case I_NONE: -+ case I_DECL: -+ case I_CLEANUP: -+ case I_CATCH: -+ case I_ALLOCA: -+ break; -+ } -+ iptr->tmps = tmps; -+ if (tmps != NULL) -+ iptr->tmps->info.idef = iptr; -+ iptr->ll_type = ll_type; -+ iptr->operands = operands; -+ return iptr; -+} -+ -+static INSTR_LIST * -+gen_alloca_instr(LL_Type *ll_type) -+{ -+ INSTR_LIST *new_instr; -+ OPERAND *opnd = make_tmp_op(ll_type, make_tmps()); -+ new_instr = gen_instr(I_ALLOCA, opnd->tmps, ll_type, NULL); -+ return new_instr; -+} -+ -+static INSTR_LIST * -+gen_new_st(INSTR_LIST *instr, OPERAND *opnd0, OPERAND *opnd1) -+{ -+ INSTR_LIST *new_instr; -+ -+ opnd0->next = opnd1; -+ new_instr = gen_instr(I_STORE, NULL, NULL, opnd0); -+ instr->next = new_instr; -+ new_instr->prev = instr; -+ return new_instr; -+} -+ -+static INSTR_LIST * -+gen_new_instr(INSTR_LIST *instr, LL_InstrName i_name, LL_Type *ll_type, -+ OPERAND *opnd0, OPERAND *opnd1, OPERAND *opnd2) -+{ -+ INSTR_LIST *new_instr; -+ -+ if (opnd1 != NULL) -+ opnd0->next = opnd1; -+ if (opnd2 != NULL) -+ opnd1->next = opnd2; -+ new_instr = gen_instr(i_name, ll_type, opnd0); -+ instr->next = new_instr; -+ new_instr->prev = instr; -+ return new_instr; -+} -+ -+static void -+link_instrs(INSTR_LIST *instr1, INSTR_LIST *instr2) -+{ -+ instr1->next = instr2; -+ instr2->prev = instr1; -+} -+ -+/** -+ \brief Increment the loop iterator by inc_opnd. -+ */ -+static void -+inc_loop_iter(OPERAND *iter_opnd, LL_Type *ll_type, OPERAND *inc_opnd) -+{ -+ OPERAND *curr0_opnd; -+ -+ // %1 = load ll_type, ll_type* iter -+ curr_instr = -+ gen_new_instr(curr_instr, I_LOAD, ll_type, iter_opnd, NULL, NULL); -+ -+ // %2 = add nsw ll_type %1, inc_opnd -+ curr0_opnd = make_tmp_op(ll_type, curr_instr->tmps); -+ curr_instr = -+ gen_new_instr(curr_instr, I_ADD, ll_type, curr0_opnd, inc_opnd, NULL); -+ curr_instr->flags = NOSIGNEDWRAP; -+ -+ // store i64 %2, i64* %iter -+ curr0_opnd = make_tmp_op(ll_type, curr_instr->tmps); -+ curr_instr = gen_new_st(curr_instr, curr0_opnd, iter_opnd); -+} -+ -+/** -+ \brief Compare two variables, which needs to be loaded. -+ */ -+static void -+cmp_two_vars(OPERAND *var1, OPERAND *var2, LL_Type *ll_type, OT_CC_NAMES ot_cc) -+{ -+ INSTR_LIST *cmp1, *cmp2; -+ OPERAND *curr0_opnd, *curr1_opnd, *curr2_opnd; -+ LL_Type *i1_ty = make_int_lltype(1); -+ -+ // %1 = load ll_type, ll_type* var1 -+ curr_instr = -+ gen_new_instr(curr_instr, I_LOAD, ll_type, var1, NULL, NULL); -+ cmp1 = curr_instr; -+ -+ // %2 = load ll_type, ll_type* %var2 -+ curr_instr = -+ gen_new_instr(curr_instr, I_LOAD, ll_type, var2, NULL, NULL); -+ cmp2 = curr_instr; -+ -+ // %3 = icmp ot_cc ll_type %1, %2 -+ curr0_opnd = make_ot_cc_op(ot_cc); -+ curr1_opnd = make_tmp_op(ll_type, cmp1->tmps); -+ curr2_opnd = make_tmp_op(ll_type, cmp2->tmps); -+ curr_instr = gen_new_instr(curr_instr, I_ICMP, i1_ty, curr0_opnd, curr1_opnd, -+ curr2_opnd); -+} -+ -+/** -+ \brief Make the final_bb label and load the return value. -+ */ -+static void -+finalize_bb(SPTR final_bb_label, OPERAND *result, LL_Type *ll_type) -+{ -+ OPERAND *curr0_opnd; -+ -+ curr0_opnd = make_label_op(final_bb_label); -+ curr_instr = gen_new_instr(curr_instr, I_NONE, NULL, curr0_opnd, NULL, NULL); -+ -+ // load ll_type, ll_type* result -+ curr_instr = -+ gen_new_instr(curr_instr, I_LOAD, ll_type, result, NULL, NULL); -+ -+ if (runtime_instr->ll_type != ll_type) { -+ // trunc ll_type result to (target type) -+ curr0_opnd = make_tmp_op(ll_type, curr_instr->tmps); -+ curr_instr = gen_new_instr(curr_instr, I_TRUNC, runtime_instr->ll_type, -+ curr0_opnd, NULL, NULL); -+ } -+} -+ -+/** -+ \brief In \res_label bb, store \value into \result and branch to final bb. -+ */ -+static void -+store_result_bb(SPTR res_label, OPERAND *value, OPERAND *result, -+ OPERAND *final_bb) -+{ -+ OPERAND *curr0_opnd; -+ -+ curr0_opnd = make_label_op(res_label); -+ curr_instr = gen_new_instr(curr_instr, I_NONE, NULL, curr0_opnd, NULL, NULL); -+ -+ // store ll_type value, ll_type* result -+ curr_instr = gen_new_st(curr_instr, value, result); -+ -+ // br label %final_bb -+ curr_instr = gen_new_instr(curr_instr, I_BR, NULL, final_bb, NULL, NULL); -+} -+ -+/** -+ \brief Assign 0 to the string length if it is less than 0. -+ */ -+static void -+process_strlen_lt_zero(OPERAND *strlen_opnd) -+{ -+ OPERAND *curr0_opnd, *curr1_opnd, *curr2_opnd; -+ LL_Type *i1_ty = make_int_lltype(1); -+ LL_Type *i64_ty = make_int_lltype(64); -+ -+ // %1 = load i64, i64* %strlen -+ curr_instr = -+ gen_new_instr(curr_instr, I_LOAD, i64_ty, strlen_opnd, NULL, NULL); -+ -+ // %2 = icmp sge i64 %1, 0 -+ curr0_opnd = make_ot_cc_op(OT_SGE); -+ curr1_opnd = make_tmp_op(i64_ty, curr_instr->tmps); -+ curr2_opnd = make_constval_op(i64_ty, 0, 0); -+ curr_instr = gen_new_instr(curr_instr, I_ICMP, i1_ty, curr0_opnd, curr1_opnd, -+ curr2_opnd); -+ -+ // br i1 %2, label %ahead, label %strlen_zero -+ SPTR ahead = mklabel("ahead"); -+ SPTR strlen_zero = mklabel("strlen_zero"); -+ curr0_opnd = make_tmp_op(i1_ty, curr_instr->tmps); -+ curr1_opnd = make_target_op(ahead); -+ curr2_opnd = make_target_op(strlen_zero); -+ curr_instr = -+ gen_new_instr(curr_instr, I_BR, NULL, curr0_opnd, curr1_opnd, curr2_opnd); -+ -+ // Label strlen_zero -+ curr0_opnd = make_label_op(strlen_zero); -+ curr_instr = gen_new_instr(curr_instr, I_NONE, NULL, curr0_opnd, NULL, NULL); -+ -+ // store i64 0, i64* strlen -+ curr0_opnd = make_constval_op(i64_ty, 0, 0); -+ curr_instr = gen_new_st(curr_instr, curr0_opnd, strlen_opnd); -+ -+ // Label ahead -+ curr0_opnd = make_label_op(ahead); -+ curr_instr = gen_new_instr(curr_instr, I_NONE, NULL, curr0_opnd, NULL, NULL); -+} -+ -+/** -+ \brief Compare the string s1 and s2 character by character. -+ -+ iter_opnd: the loop iteration operand -+ len_opnd: max(length of string s1, length of string s2) -+ mode: 1 when s1 and s2 are not empty; -+ 2 when s2 is empty, and its element is taken as the space character; -+ 3 when s1 is empty, and its element is taken as the space character; -+ */ -+static INSTR_LIST * -+loop_s1_cmp_s2(OPERAND *iter_opnd, OPERAND *len_opnd, OPERAND *result_one_opnd, -+ OPERAND *result_minus_one_opnd, int mode) -+{ -+ INSTR_LIST *cmp1, *cmp2, *save_tmps_instr; -+ OPERAND *curr0_opnd, *curr1_opnd, *curr2_opnd; -+ INSTR_LIST *s1_instr = runtime_instr->operands->next->tmps->info.idef; -+ INSTR_LIST *s2_instr = runtime_instr->operands->next->next->tmps->info.idef; -+ -+ LL_Type *i1_ty = make_int_lltype(1); -+ LL_Type *i8_ty = make_int_lltype(8); -+ LL_Type *i32_ty = make_int_lltype(32); -+ LL_Type *i64_ty = make_int_lltype(64); -+ LL_Type *ptr_i8_ty = make_ptr_lltype(i8_ty); -+ -+ // Label loop_header -+ SPTR loop_header = mklabel("loop_header"); -+ curr0_opnd = make_label_op(loop_header); -+ curr_instr = gen_new_instr(curr_instr, I_NONE, NULL, curr0_opnd, NULL, NULL); -+ -+ // %1 = load i64, i64* %iter -+ curr_instr = gen_new_instr(curr_instr, I_LOAD, i64_ty, iter_opnd, NULL, NULL); -+ cmp1 = curr_instr; -+ -+ // %2 = load i64, i64* %s_len -+ curr_instr = gen_new_instr(curr_instr, I_LOAD, i64_ty, len_opnd, NULL, NULL); -+ cmp2 = curr_instr; -+ -+ // %3 = icmp sle i64 %1, %2 -+ curr0_opnd = make_ot_cc_op(OT_SLE); -+ curr1_opnd = make_tmp_op(i64_ty, cmp1->tmps); -+ curr2_opnd = make_tmp_op(i64_ty, cmp2->tmps); -+ curr_instr = gen_new_instr(curr_instr, I_ICMP, i1_ty, curr0_opnd, curr1_opnd, -+ curr2_opnd); -+ -+ // br i1 %3, label %iter_le_s_len, label %iter_gt_s_len -+ SPTR iter_le_s_len = mklabel("iter_le_s_len"); -+ SPTR iter_gt_s_len = mklabel("iter_gt_s_len"); -+ curr0_opnd = make_tmp_op(i1_ty, curr_instr->tmps); -+ curr1_opnd = make_target_op(iter_le_s_len); -+ curr2_opnd = make_target_op(iter_gt_s_len); -+ curr_instr = -+ gen_new_instr(curr_instr, I_BR, NULL, curr0_opnd, curr1_opnd, curr2_opnd); -+ -+ // -------------------------------------------------------------------- -+ // Label iter_le_s_len -+ curr0_opnd = make_label_op(iter_le_s_len); -+ curr_instr = gen_new_instr(curr_instr, I_NONE, NULL, curr0_opnd, NULL, NULL); -+ -+ // %4 = load i64, i64* %iter -+ curr_instr = gen_new_instr(curr_instr, I_LOAD, i64_ty, iter_opnd, NULL, NULL); -+ -+ // %5 = sub nsw i64 %4, 1 -+ curr0_opnd = make_tmp_op(i64_ty, curr_instr->tmps); -+ curr1_opnd = make_constval_op(i64_ty, 1, 0); -+ curr_instr = -+ gen_new_instr(curr_instr, I_SUB, i64_ty, curr0_opnd, curr1_opnd, NULL); -+ curr_instr->flags = NOSIGNEDWRAP; -+ save_tmps_instr = curr_instr; -+ -+ if (mode == 1 || mode == 2) { -+ // %6 = getelementptr i8, i8* s1_instr, i64 %5 -+ curr0_opnd = make_tmp_op(ptr_i8_ty, s1_instr->tmps); -+ curr1_opnd = make_tmp_op(i64_ty, curr_instr->tmps); -+ curr_instr = gen_new_instr(curr_instr, I_GEP, ptr_i8_ty, curr0_opnd, -+ curr1_opnd, NULL); -+ } else if (mode == 3) { -+ // %6 = bitcast [1 x i8]* "space_sym" to i8* -+ curr0_opnd = make_var_op(getstring(" ", 1)); -+ curr_instr = -+ gen_new_instr(curr_instr, I_BITCAST, ptr_i8_ty, curr0_opnd, NULL, NULL); -+ } -+ -+ // %7 = load volatile i8, i8* %6 -+ curr0_opnd = make_tmp_op(ptr_i8_ty, curr_instr->tmps); -+ curr_instr = gen_new_instr(curr_instr, I_LOAD, i8_ty, curr0_opnd, NULL, NULL); -+ curr_instr->flags = LOOP_BACKEDGE_FLAG; -+ -+ // %8 = zext i8 %7 to i32 -+ curr0_opnd = make_tmp_op(i8_ty, curr_instr->tmps); -+ curr_instr = -+ gen_new_instr(curr_instr, I_ZEXT, i32_ty, curr0_opnd, NULL, NULL); -+ cmp1 = curr_instr; -+ -+ if (mode == 1 || mode == 3) { -+ // %9 = getelementptr i8, i8* s2_instr, i64 %5 -+ curr0_opnd = make_tmp_op(ptr_i8_ty, s2_instr->tmps); -+ curr1_opnd = make_tmp_op(i64_ty, save_tmps_instr->tmps); -+ curr_instr = gen_new_instr(curr_instr, I_GEP, ptr_i8_ty, curr0_opnd, -+ curr1_opnd, NULL); -+ } else if (mode == 2) { -+ // %9 = bitcast [1 x i8]* "space_sym" to i8* -+ curr0_opnd = make_var_op(getstring(" ", 1)); -+ curr_instr = -+ gen_new_instr(curr_instr, I_BITCAST, ptr_i8_ty, curr0_opnd, NULL, NULL); -+ } -+ -+ // %10 = load volatile i8, i8* %9 -+ curr0_opnd = make_tmp_op(ptr_i8_ty, curr_instr->tmps); -+ curr_instr = gen_new_instr(curr_instr, I_LOAD, i8_ty, curr0_opnd, NULL, NULL); -+ curr_instr->flags = LOOP_BACKEDGE_FLAG; -+ -+ // %11 = zext i8 %10 to i32 -+ curr0_opnd = make_tmp_op(i8_ty, curr_instr->tmps); -+ curr_instr = -+ gen_new_instr(curr_instr, I_ZEXT, i32_ty, curr0_opnd, NULL, NULL); -+ cmp2 = curr_instr; -+ -+ // %12 = icmp eq i64 %8, %11 -+ curr0_opnd = make_ot_cc_op(OT_EQ); -+ curr1_opnd = make_tmp_op(i32_ty, cmp1->tmps); -+ curr2_opnd = make_tmp_op(i32_ty, cmp2->tmps); -+ curr_instr = gen_new_instr(curr_instr, I_ICMP, i1_ty, curr0_opnd, curr1_opnd, -+ curr2_opnd); -+ -+ // br i1 %12, label %loop_s1_eq_s2, label %loop_s1_ne_s2 -+ SPTR loop_s1_eq_s2 = mklabel("loop_s1_eq_s2"); -+ SPTR loop_s1_ne_s2 = mklabel("loop_s1_ne_s2"); -+ curr0_opnd = make_tmp_op(i1_ty, curr_instr->tmps); -+ curr1_opnd = make_target_op(loop_s1_eq_s2); -+ curr2_opnd = make_target_op(loop_s1_ne_s2); -+ curr_instr = -+ gen_new_instr(curr_instr, I_BR, NULL, curr0_opnd, curr1_opnd, curr2_opnd); -+ -+ // -------------------------------------------------------------------- -+ // Label loop_s1_ne_s2 -+ curr0_opnd = make_label_op(loop_s1_ne_s2); -+ curr_instr = gen_new_instr(curr_instr, I_NONE, NULL, curr0_opnd, NULL, NULL); -+ -+ // %13 = icmp sgt i64 %8, %11 -+ curr0_opnd = make_ot_cc_op(OT_SGT); -+ curr1_opnd = make_tmp_op(i32_ty, cmp1->tmps); -+ curr2_opnd = make_tmp_op(i32_ty, cmp2->tmps); -+ curr_instr = gen_new_instr(curr_instr, I_ICMP, i1_ty, curr0_opnd, curr1_opnd, -+ curr2_opnd); -+ -+ // br i1 %13, label %loop_s1_gt_s2, label %loop_s1_lt_s2 -+ SPTR loop_s1_gt_s2 = mklabel("loop_s1_gt_s2"); -+ SPTR loop_s1_lt_s2 = mklabel("loop_s1_lt_s2"); -+ curr0_opnd = make_tmp_op(i1_ty, curr_instr->tmps); -+ curr1_opnd = make_target_op(loop_s1_gt_s2); -+ curr2_opnd = make_target_op(loop_s1_lt_s2); -+ curr_instr = -+ gen_new_instr(curr_instr, I_BR, NULL, curr0_opnd, curr1_opnd, curr2_opnd); -+ -+ // -------------------------------------------------------------------- -+ // Label loop_s1_gt_s2 -+ curr0_opnd = make_label_op(loop_s1_gt_s2); -+ curr_instr = gen_new_instr(curr_instr, I_NONE, NULL, curr0_opnd, NULL, NULL); -+ -+ // label %result_one -+ curr_instr = -+ gen_new_instr(curr_instr, I_BR, NULL, result_one_opnd, NULL, NULL); -+ -+ // -------------------------------------------------------------------- -+ // Label loop_s1_lt_s2 -+ curr0_opnd = make_label_op(loop_s1_lt_s2); -+ curr_instr = gen_new_instr(curr_instr, I_NONE, NULL, curr0_opnd, NULL, NULL); -+ -+ // br label %result_minus_one -+ curr_instr = -+ gen_new_instr(curr_instr, I_BR, NULL, result_minus_one_opnd, NULL, NULL); -+ -+ // -------------------------------------------------------------------- -+ // Label loop_s1_eq_s2 -+ curr0_opnd = make_label_op(loop_s1_eq_s2); -+ curr_instr = gen_new_instr(curr_instr, I_NONE, NULL, curr0_opnd, NULL, NULL); -+ -+ curr0_opnd = make_constval_op(i64_ty, 1, 0); -+ inc_loop_iter(iter_opnd, i64_ty, curr0_opnd); -+ -+ // br label %loop_header -+ curr0_opnd = make_target_op(loop_header); -+ curr_instr = gen_new_instr(curr_instr, I_BR, NULL, curr0_opnd, NULL, NULL); -+ -+ // -------------------------------------------------------------------- -+ // Label iter_gt_s_len -+ curr0_opnd = make_label_op(iter_gt_s_len); -+ curr_instr = gen_new_instr(curr_instr, I_NONE, NULL, curr0_opnd, NULL, NULL); -+ -+ return curr_instr; -+} -+ -+static INSTR_LIST * -+inline_f90_strcmp_klen() -+{ -+ dbg_line_op = runtime_instr->dbg_line_op; -+ INSTR_LIST *s1_len, *s2_len, *strcmp_res, *iter; -+ INSTR_LIST *head_instr; -+ INSTR_LIST *cmp1, *cmp2; -+ OPERAND *curr0_opnd, *curr1_opnd, *curr2_opnd, *final_opnd; -+ OPERAND *result_zero_opnd, *result_one_opnd, *result_minus_one_opnd; -+ OPERAND *s1_len_opnd, *s2_len_opnd, *strcmp_res_opnd, *iter_opnd; -+ INSTR_LIST *prev_instr = runtime_instr->prev; -+ TMPS *s1_len_tmps = runtime_instr->operands->next->next->next->tmps; -+ TMPS *s2_len_tmps = runtime_instr->operands->next->next->next->next->tmps; -+ -+ LL_Type *i1_ty = make_int_lltype(1); -+ LL_Type *i64_ty = make_int_lltype(64); -+ LL_Type *ptr_i64_ty = make_ptr_lltype(i64_ty); -+ -+ SPTR final_bb = mklabel("final_bb"); -+ final_opnd = make_target_op(final_bb); -+ SPTR result_zero = mklabel("result_zero"); -+ result_zero_opnd = make_target_op(result_zero); -+ SPTR result_one = mklabel("result_one"); -+ result_one_opnd = make_target_op(result_one); -+ SPTR result_minus_one = mklabel("result_minus_one"); -+ result_minus_one_opnd = make_target_op(result_minus_one); -+ -+ // Allocate space for s1_len, s2_len, strcmp result, loop iterator -+ s1_len = gen_alloca_instr(ptr_i64_ty); -+ s2_len = gen_alloca_instr(ptr_i64_ty); -+ strcmp_res = gen_alloca_instr(ptr_i64_ty); -+ iter = gen_alloca_instr(ptr_i64_ty); -+ // Link allocas instructions -+ link_instrs(s1_len, s2_len); -+ link_instrs(s2_len, strcmp_res); -+ link_instrs(strcmp_res, iter); -+ // Insert allocas -+ link_instrs(iter, top_instr->next); -+ link_instrs(top_instr, s1_len); -+ // Make tmp operands for allocas -+ s1_len_opnd = make_tmp_op(ptr_i64_ty, s1_len->tmps); -+ s2_len_opnd = make_tmp_op(ptr_i64_ty, s2_len->tmps); -+ strcmp_res_opnd = make_tmp_op(ptr_i64_ty, strcmp_res->tmps); -+ iter_opnd = make_tmp_op(ptr_i64_ty, iter->tmps); -+ -+ // First action instruction: store i64 %s1_len_tmps, i64* %s1_len -+ if (s1_len_tmps) -+ curr0_opnd = make_tmp_op(i64_ty, s1_len_tmps); -+ else -+ curr0_opnd = mirror_nontmp_op(runtime_instr->operands->next->next->next); -+ curr0_opnd->next = s1_len_opnd; -+ curr_instr = gen_instr(I_STORE, NULL, NULL, curr0_opnd); -+ head_instr = curr_instr; -+ -+ // store i64 %s2_len_tmps, i64* %s2_len -+ if (s2_len_tmps) -+ curr0_opnd = make_tmp_op(i64_ty, s2_len_tmps); -+ else -+ curr0_opnd = -+ mirror_nontmp_op(runtime_instr->operands->next->next->next->next); -+ curr_instr = gen_new_st(curr_instr, curr0_opnd, s2_len_opnd); -+ -+ process_strlen_lt_zero(s1_len_opnd); -+ process_strlen_lt_zero(s2_len_opnd); -+ -+ // %1 = load i64, i64* %s1_len -+ curr_instr = -+ gen_new_instr(curr_instr, I_LOAD, i64_ty, s1_len_opnd, NULL, NULL); -+ -+ // %2 = icmp ne i64 %1, 0 -+ curr0_opnd = make_ot_cc_op(OT_NE); -+ curr1_opnd = make_tmp_op(i64_ty, curr_instr->tmps); -+ curr2_opnd = make_constval_op(i64_ty, 0, 0); -+ curr_instr = gen_new_instr(curr_instr, I_ICMP, i1_ty, curr0_opnd, curr1_opnd, -+ curr2_opnd); -+ -+ // br i1 %2, label %ahead, label %is_s2_len_zero -+ SPTR ahead = mklabel("ahead"); -+ SPTR is_s2_len_zero = mklabel("is_s2_len_zero"); -+ curr0_opnd = make_tmp_op(i1_ty, curr_instr->tmps); -+ curr1_opnd = make_target_op(ahead); -+ curr2_opnd = make_target_op(is_s2_len_zero); -+ curr_instr = -+ gen_new_instr(curr_instr, I_BR, NULL, curr0_opnd, curr1_opnd, curr2_opnd); -+ -+ // Label is_s2_len_zero -+ curr0_opnd = make_label_op(is_s2_len_zero); -+ curr_instr = gen_new_instr(curr_instr, I_NONE, NULL, curr0_opnd, NULL, NULL); -+ -+ // %3 = load i64, i64* %s2_len -+ curr_instr = -+ gen_new_instr(curr_instr, I_LOAD, i64_ty, s2_len_opnd, NULL, NULL); -+ -+ // %4 = icmp ne i64 %3, 0 -+ curr0_opnd = make_ot_cc_op(OT_NE); -+ curr1_opnd = make_tmp_op(i64_ty, curr_instr->tmps); -+ curr2_opnd = make_constval_op(i64_ty, 0, 0); -+ curr_instr = gen_new_instr(curr_instr, I_ICMP, i1_ty, curr0_opnd, curr1_opnd, -+ curr2_opnd); -+ -+ // br i1 %4, label %ahead, label %result_zero -+ curr0_opnd = make_tmp_op(i1_ty, curr_instr->tmps); -+ curr1_opnd = make_target_op(ahead); -+ curr2_opnd = result_zero_opnd; -+ curr_instr = -+ gen_new_instr(curr_instr, I_BR, NULL, curr0_opnd, curr1_opnd, curr2_opnd); -+ -+ // Label ahead -+ curr0_opnd = make_label_op(ahead); -+ curr_instr = gen_new_instr(curr_instr, I_NONE, NULL, curr0_opnd, NULL, NULL); -+ -+ // -------------------------------------------------------------------- -+ // %5 = load i64, i64* %s1_len -+ curr_instr = -+ gen_new_instr(curr_instr, I_LOAD, i64_ty, s1_len_opnd, NULL, NULL); -+ cmp1 = curr_instr; -+ -+ // %6 = load i64, i64* %s2_len -+ curr_instr = -+ gen_new_instr(curr_instr, I_LOAD, i64_ty, s2_len_opnd, NULL, NULL); -+ cmp2 = curr_instr; -+ -+ // %7 = icmp eq i64 %5, %6 -+ curr0_opnd = make_ot_cc_op(OT_EQ); -+ curr1_opnd = make_tmp_op(i64_ty, cmp1->tmps); -+ curr2_opnd = make_tmp_op(i64_ty, cmp2->tmps); -+ curr_instr = gen_new_instr(curr_instr, I_ICMP, i1_ty, curr0_opnd, curr1_opnd, -+ curr2_opnd); -+ -+ // br i1 %7, label %s1_len_eq_s2_len, label %s1_len_ne_s2_len -+ SPTR s1_len_eq_s2_len = mklabel("s1_len_eq_s2_len"); -+ SPTR s1_len_ne_s2_len = mklabel("s1_len_ne_s2_len"); -+ curr0_opnd = make_tmp_op(i1_ty, curr_instr->tmps); -+ curr1_opnd = make_target_op(s1_len_eq_s2_len); -+ curr2_opnd = make_target_op(s1_len_ne_s2_len); -+ curr_instr = -+ gen_new_instr(curr_instr, I_BR, NULL, curr0_opnd, curr1_opnd, curr2_opnd); -+ -+ // -------------------------------------------------------------------- -+ // Label s1_len_eq_s2_len -+ curr0_opnd = make_label_op(s1_len_eq_s2_len); -+ curr_instr = gen_new_instr(curr_instr, I_NONE, NULL, curr0_opnd, NULL, NULL); -+ -+ // store i64 1, i64* iter_opnd -+ curr0_opnd = make_constval_op(i64_ty, 1, 0); -+ curr_instr = gen_new_st(curr_instr, curr0_opnd, iter_opnd); -+ -+ curr_instr = loop_s1_cmp_s2(iter_opnd, s1_len_opnd, result_one_opnd, -+ result_minus_one_opnd, 1); -+ -+ // br label %result_zero -+ curr_instr = -+ gen_new_instr(curr_instr, I_BR, NULL, result_zero_opnd, NULL, NULL); -+ -+ // -------------------------------------------------------------------- -+ // Label s1_len_ne_s2_len -+ curr0_opnd = make_label_op(s1_len_ne_s2_len); -+ curr_instr = gen_new_instr(curr_instr, I_NONE, NULL, curr0_opnd, NULL, NULL); -+ -+ cmp_two_vars(s1_len_opnd, s2_len_opnd, i64_ty, OT_SGT); -+ -+ // br i1 %8, label %s1_len_gt_s2_len, label %s1_len_le_s2_len -+ SPTR s1_len_gt_s2_len = mklabel("s1_len_gt_s2_len"); -+ SPTR s1_len_lt_s2_len = mklabel("s1_len_lt_s2_len"); -+ curr0_opnd = make_tmp_op(i1_ty, curr_instr->tmps); -+ curr1_opnd = make_target_op(s1_len_gt_s2_len); -+ curr2_opnd = make_target_op(s1_len_lt_s2_len); -+ curr_instr = -+ gen_new_instr(curr_instr, I_BR, NULL, curr0_opnd, curr1_opnd, curr2_opnd); -+ -+ // -------------------------------------------------------------------- -+ // Label s1_len_gt_s2_len -+ curr0_opnd = make_label_op(s1_len_gt_s2_len); -+ curr_instr = gen_new_instr(curr_instr, I_NONE, NULL, curr0_opnd, NULL, NULL); -+ -+ // store i64 1, i64* iter_opnd -+ curr0_opnd = make_constval_op(i64_ty, 1, 0); -+ curr_instr = gen_new_st(curr_instr, curr0_opnd, iter_opnd); -+ -+ curr_instr = loop_s1_cmp_s2(iter_opnd, s2_len_opnd, result_one_opnd, -+ result_minus_one_opnd, 1); -+ -+ curr_instr = loop_s1_cmp_s2(iter_opnd, s1_len_opnd, result_one_opnd, -+ result_minus_one_opnd, 2); -+ -+ // br label %result_zero -+ curr_instr = -+ gen_new_instr(curr_instr, I_BR, NULL, result_zero_opnd, NULL, NULL); -+ -+ // -------------------------------------------------------------------- -+ // Label s1_len_lt_s2_len -+ curr0_opnd = make_label_op(s1_len_lt_s2_len); -+ curr_instr = gen_new_instr(curr_instr, I_NONE, NULL, curr0_opnd, NULL, NULL); -+ -+ // store i64 1, i64* iter_opnd -+ curr0_opnd = make_constval_op(i64_ty, 1, 0); -+ curr_instr = gen_new_st(curr_instr, curr0_opnd, iter_opnd); -+ -+ curr_instr = loop_s1_cmp_s2(iter_opnd, s1_len_opnd, result_one_opnd, -+ result_minus_one_opnd, 1); -+ -+ curr_instr = loop_s1_cmp_s2(iter_opnd, s2_len_opnd, result_one_opnd, -+ result_minus_one_opnd, 3); -+ -+ // br label %result_zero -+ curr_instr = -+ gen_new_instr(curr_instr, I_BR, NULL, result_zero_opnd, NULL, NULL); -+ -+ // -------------------------------------------------------------------- -+ // Label %result_zero: store i64 0, i64* strcmp_res -+ curr0_opnd = make_constval_op(i64_ty, 0, 0); -+ store_result_bb(result_zero, curr0_opnd, strcmp_res_opnd, final_opnd); -+ -+ // Label %result_one: store i64 1, i64* strcmp_res -+ curr0_opnd = make_constval_op(i64_ty, 1, 0); -+ store_result_bb(result_one, curr0_opnd, strcmp_res_opnd, final_opnd); -+ -+ // Label %result_minus_one: store i64 -1, i64* strcmp_res -+ curr0_opnd = make_constval_op(i64_ty, -1, 0); -+ store_result_bb(result_minus_one, curr0_opnd, strcmp_res_opnd, final_opnd); -+ -+ // -------------------------------------------------------------------- -+ // Label %final_bb -+ finalize_bb(final_bb, strcmp_res_opnd, i64_ty); -+ -+ mirror_instr(runtime_instr, curr_instr); -+ -+ link_instrs(prev_instr, head_instr); -+ link_instrs(curr_instr->prev, runtime_instr); -+ return runtime_instr; -+} -+ -+INSTR_LIST * -+emit_inline_runtime_call(INSTR_LIST *top, INSTR_LIST *instr, -+ INLINE_RUNTIME_ID inline_runtime_id) -+{ -+ INSTR_LIST *prev_instr = nullptr; -+ top_instr = top; -+ runtime_instr = instr; -+ switch (inline_runtime_id) { -+ case NONE_ID: -+ assert(false, "runtime call is not inlinable", 0, ERR_Fatal); -+ break; -+ case F90_STRCMP_KLEN: -+ prev_instr = inline_f90_strcmp_klen(); -+ break; -+ } -+ -+ return prev_instr; -+} -+ -+static void -+init_inline_runtime_call() -+{ -+ std::string f90_strcmp_klen = "@f90_strcmp_klen"; -+ inline_calls[f90_strcmp_klen] = F90_STRCMP_KLEN; -+} -+ -+INLINE_RUNTIME_ID -+get_inline_runtime_id(INSTR_LIST *instr) -+{ -+ assert(instr->i_name == I_CALL, "instr must be call instruction", 0, -+ ERR_Fatal); -+ -+ if (!is_initialized_inline_calls) { -+ init_inline_runtime_call(); -+ is_initialized_inline_calls = true; -+ } -+ -+ if (instr->operands) { -+ OPERAND *call_name_op = instr->operands; -+ if (call_name_op->ot_type == OT_TMP && call_name_op->tmps && -+ call_name_op->tmps->info.idef) { -+ INSTR_LIST *call_iface_instr = call_name_op->tmps->info.idef; -+ if (call_iface_instr->i_name == I_BITCAST && call_iface_instr->operands) { -+ const char *call_name = call_iface_instr->operands->string; -+ if (call_name && -+ inline_calls.find(std::string(call_name)) != inline_calls.end()) -+ return inline_calls[std::string(call_name)]; -+ } -+ } -+ } -+ return NONE_ID; -+} -diff --git a/tools/flang2/flang2exe/inline_runtime.h b/tools/flang2/flang2exe/inline_runtime.h -new file mode 100644 -index 00000000..79ca0a66 ---- /dev/null -+++ b/tools/flang2/flang2exe/inline_runtime.h -@@ -0,0 +1,25 @@ -+/* -+ * Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -+ * See https://llvm.org/LICENSE.txt for license information. -+ * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -+ * -+ */ -+ -+#ifndef INLINE_RUNTIME_H_ -+#define INLINE_RUNTIME_H_ -+ -+#include "gbldefs.h" -+#include "global.h" -+#include "llutil.h" -+#include "symtab.h" -+ -+enum INLINE_RUNTIME_ID { -+ NONE_ID = 0, -+ F90_STRCMP_KLEN, -+}; -+ -+INLINE_RUNTIME_ID get_inline_runtime_id(INSTR_LIST *instrs); -+INSTR_LIST *emit_inline_runtime_call(INSTR_LIST *, INSTR_LIST *, -+ INLINE_RUNTIME_ID); -+ -+#endif -diff --git a/tools/flang2/flang2exe/llassem.cpp b/tools/flang2/flang2exe/llassem.cpp -index ef0440eb..7153a331 100644 ---- a/tools/flang2/flang2exe/llassem.cpp -+++ b/tools/flang2/flang2exe/llassem.cpp -@@ -1224,6 +1224,7 @@ write_consts(void) - { - if (gbl.consts > NOSYM) { - SPTR sptr; -+ SPTR space_sptr = getstring(" ", 1); - for (sptr = gbl.consts; sptr > NOSYM; sptr = SYMLKG(sptr)) { - DTYPE dtype = DTYPEG(sptr); - if (DTY(dtype) == TY_CHAR) { -@@ -1249,6 +1250,21 @@ write_consts(void) - } - fputc('\n', ASMFIL); - } -+ /* Mark the space_sptr as NME_NULL when the space symbol is already -+ * written out if the program uses the space symbol. -+ */ -+ if (XBIT(218, 0x1) && sptr == space_sptr) -+ space_sptr = SPTR_NULL; -+ } -+ if (XBIT(218, 0x1) && space_sptr != SPTR_NULL) { -+ /* Write out the space symbol if it is not written out. The space symbol -+ * is used for inlining Fortran runtime calls enabled by XBIT(218, 0x1). -+ * Specifically, for string comparision which uses f90_strcmp_klen call, -+ * the string element is taken as space symbol if not assigned one value -+ * in user code (see function loop_s1_cmp_s2 in inline_runtime.cpp). -+ */ -+ put_fstr(space_sptr, XBIT(124, 0x8000)); -+ fputc('\n', ASMFIL); - } - if (flg.smp || XBIT(34, 0x200 || gbl.usekmpc)) { - SPTR tsptr = SPTR_NULL; -@@ -1260,6 +1276,11 @@ write_consts(void) - if (tsptr) - SYMLKP(tsptr, SPTR_NULL); - } -+ } else if (XBIT(218, 0x1)) { -+ /* Write out the space symbol if there is no const in current procedure. */ -+ SPTR space_sptr = getstring(" ", 1); -+ put_fstr(space_sptr, XBIT(124, 0x8000)); -+ fputc('\n', ASMFIL); - } - gbl.consts = NOSYM; - } diff --git a/10-test-interoperability-with-c-fortran-call-c-global-and-struct.patch b/10-test-interoperability-with-c-fortran-call-c-global-and-struct.patch deleted file mode 100644 index 622a3a3056bd55a227db8feb6109096621265c71..0000000000000000000000000000000000000000 --- a/10-test-interoperability-with-c-fortran-call-c-global-and-struct.patch +++ /dev/null @@ -1,9955 +0,0 @@ -From 46a782f947ae3de0bdb1aeabde50dfdd3585b64d Mon Sep 17 00:00:00 2001 -From: xieyihui -Date: Fri, 18 Nov 2022 12:40:12 +0800 -Subject: [PATCH] Add new test cases about global and struct for - interoperability with C about fortran call C - -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func001.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func001.c -new file mode 100755 -index 0000000..0da9335 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func001.c -@@ -0,0 +1,15 @@ -+#include -+struct BaseTy { -+ int j[2]; -+}; -+struct Ty { -+ struct BaseTy bt; -+ int x, y; -+}; -+void c_func_(struct Ty *t, int *a) { -+ printf("%d\t", t->bt.j[0]); -+ printf("%d\t", t->bt.j[1]); -+ printf("%d\t", t->x); -+ printf("%d\t", t->y); -+ printf("%d\n", *a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func002.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func002.c -new file mode 100755 -index 0000000..d43d87c ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func002.c -@@ -0,0 +1,15 @@ -+#include -+struct BaseTy { -+ short j[2]; -+}; -+struct Ty { -+ struct BaseTy bt; -+ short x, y; -+}; -+void c_func_(struct Ty *t, short *a) { -+ printf("%hd\t", t->bt.j[0]); -+ printf("%hd\t", t->bt.j[1]); -+ printf("%hd\t", t->x); -+ printf("%hd\t", t->y); -+ printf("%hd\n", *a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func003.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func003.c -new file mode 100755 -index 0000000..7901c06 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func003.c -@@ -0,0 +1,15 @@ -+#include -+struct BaseTy { -+ long j[2]; -+}; -+struct Ty { -+ struct BaseTy bt; -+ long x, y; -+}; -+void c_func_(struct Ty *t, long *a) { -+ printf("%ld\t", t->bt.j[0]); -+ printf("%ld\t", t->bt.j[1]); -+ printf("%ld\t", t->x); -+ printf("%ld\t", t->y); -+ printf("%ld\n", *a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func004.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func004.c -new file mode 100755 -index 0000000..061fcfa ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func004.c -@@ -0,0 +1,15 @@ -+#include -+struct BaseTy { -+ long long int j[2]; -+}; -+struct Ty { -+ struct BaseTy bt; -+ long long int x, y; -+}; -+void c_func_(struct Ty *t, long long int *a) { -+ printf("%lld\t", t->bt.j[0]); -+ printf("%lld\t", t->bt.j[1]); -+ printf("%lld\t", t->x); -+ printf("%lld\t", t->y); -+ printf("%lld\n", *a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func005.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func005.c -new file mode 100755 -index 0000000..ca651e3 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func005.c -@@ -0,0 +1,15 @@ -+#include -+struct BaseTy { -+ signed char j[2]; -+}; -+struct Ty { -+ struct BaseTy bt; -+ signed char x, y; -+}; -+void c_func_(struct Ty *t, signed char *a) { -+ printf("%c\t", t->bt.j[0]); -+ printf("%c\t", t->bt.j[1]); -+ printf("%c\t", t->x); -+ printf("%c\t", t->y); -+ printf("%c\n", *a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func006.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func006.c -new file mode 100755 -index 0000000..56c7f41 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func006.c -@@ -0,0 +1,15 @@ -+#include -+struct BaseTy { -+ size_t j[2]; -+}; -+struct Ty { -+ struct BaseTy bt; -+ size_t x, y; -+}; -+void c_func_(struct Ty *t, size_t *a) { -+ printf("%lu\t", t->bt.j[0]); -+ printf("%lu\t", t->bt.j[1]); -+ printf("%lu\t", t->x); -+ printf("%lu\t", t->y); -+ printf("%lu\n", *a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func007.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func007.c -new file mode 100755 -index 0000000..2a8eaa8 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func007.c -@@ -0,0 +1,16 @@ -+#include -+#include -+struct BaseTy { -+ int8_t j[2]; -+}; -+struct Ty { -+ struct BaseTy bt; -+ int8_t x, y; -+}; -+void c_func_(struct Ty *t, int8_t *a) { -+ printf("%hhd\t", t->bt.j[0]); -+ printf("%hhd\t", t->bt.j[1]); -+ printf("%hhd\t", t->x); -+ printf("%hhd\t", t->y); -+ printf("%hhd\n", *a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func008.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func008.c -new file mode 100755 -index 0000000..f45f58e ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func008.c -@@ -0,0 +1,16 @@ -+#include -+#include -+struct BaseTy { -+ int16_t j[2]; -+}; -+struct Ty { -+ struct BaseTy bt; -+ int16_t x, y; -+}; -+void c_func_(struct Ty *t, int16_t *a) { -+ printf("%hd\t", t->bt.j[0]); -+ printf("%hd\t", t->bt.j[1]); -+ printf("%hd\t", t->x); -+ printf("%hd\t", t->y); -+ printf("%hd\n", *a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func009.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func009.c -new file mode 100755 -index 0000000..01ad489 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func009.c -@@ -0,0 +1,16 @@ -+#include -+#include -+struct BaseTy { -+ int32_t j[2]; -+}; -+struct Ty { -+ struct BaseTy bt; -+ int32_t x, y; -+}; -+void c_func_(struct Ty *t, int32_t *a) { -+ printf("%d\t", t->bt.j[0]); -+ printf("%d\t", t->bt.j[1]); -+ printf("%d\t", t->x); -+ printf("%d\t", t->y); -+ printf("%d\n", *a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func010.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func010.c -new file mode 100755 -index 0000000..105ad9a ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func010.c -@@ -0,0 +1,16 @@ -+#include -+#include -+struct BaseTy { -+ int64_t j[2]; -+}; -+struct Ty { -+ struct BaseTy bt; -+ int64_t x, y; -+}; -+void c_func_(struct Ty *t, int64_t *a) { -+ printf("%ld\t", t->bt.j[0]); -+ printf("%ld\t", t->bt.j[1]); -+ printf("%ld\t", t->x); -+ printf("%ld\t", t->y); -+ printf("%ld\n", *a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func011.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func011.c -new file mode 100755 -index 0000000..e19a9f0 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func011.c -@@ -0,0 +1,16 @@ -+#include -+#include -+struct BaseTy { -+ int_least8_t j[2]; -+}; -+struct Ty { -+ struct BaseTy bt; -+ int_least8_t x, y; -+}; -+void c_func_(struct Ty *t, int_least8_t *a) { -+ printf("%hhd\t", t->bt.j[0]); -+ printf("%hhd\t", t->bt.j[1]); -+ printf("%hhd\t", t->x); -+ printf("%hhd\t", t->y); -+ printf("%hhd\n", *a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func012.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func012.c -new file mode 100755 -index 0000000..1b9064b ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func012.c -@@ -0,0 +1,16 @@ -+#include -+#include -+struct BaseTy { -+ int_least16_t j[2]; -+}; -+struct Ty { -+ struct BaseTy bt; -+ int_least16_t x, y; -+}; -+void c_func_(struct Ty *t, int_least16_t *a) { -+ printf("%hd\t", t->bt.j[0]); -+ printf("%hd\t", t->bt.j[1]); -+ printf("%hd\t", t->x); -+ printf("%hd\t", t->y); -+ printf("%hd\n", *a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func013.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func013.c -new file mode 100755 -index 0000000..9ab4390 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func013.c -@@ -0,0 +1,16 @@ -+#include -+#include -+struct BaseTy { -+ int_least32_t j[2]; -+}; -+struct Ty { -+ struct BaseTy bt; -+ int_least32_t x, y; -+}; -+void c_func_(struct Ty *t, int_least32_t *a) { -+ printf("%d\t", t->bt.j[0]); -+ printf("%d\t", t->bt.j[1]); -+ printf("%d\t", t->x); -+ printf("%d\t", t->y); -+ printf("%d\n", *a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func014.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func014.c -new file mode 100755 -index 0000000..82bd2a2 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func014.c -@@ -0,0 +1,16 @@ -+#include -+#include -+struct BaseTy { -+ int_least64_t j[2]; -+}; -+struct Ty { -+ struct BaseTy bt; -+ int_least64_t x, y; -+}; -+void c_func_(struct Ty *t, int_least64_t *a) { -+ printf("%ld\t", t->bt.j[0]); -+ printf("%ld\t", t->bt.j[1]); -+ printf("%ld\t", t->x); -+ printf("%ld\t", t->y); -+ printf("%ld\n", *a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func015.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func015.c -new file mode 100755 -index 0000000..b2a9da9 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func015.c -@@ -0,0 +1,16 @@ -+#include -+#include -+struct BaseTy { -+ int_fast8_t j[2]; -+}; -+struct Ty { -+ struct BaseTy bt; -+ int_fast8_t x, y; -+}; -+void c_func_(struct Ty *t, int_fast8_t *a) { -+ printf("%hhd\t", t->bt.j[0]); -+ printf("%hhd\t", t->bt.j[1]); -+ printf("%hhd\t", t->x); -+ printf("%hhd\t", t->y); -+ printf("%hhd\n", *a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func016.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func016.c -new file mode 100755 -index 0000000..f35b45c ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func016.c -@@ -0,0 +1,16 @@ -+#include -+#include -+struct BaseTy { -+ int_fast16_t j[2]; -+}; -+struct Ty { -+ struct BaseTy bt; -+ int_fast16_t x, y; -+}; -+void c_func_(struct Ty *t, int_fast16_t *a) { -+ printf("%ld\t", t->bt.j[0]); -+ printf("%ld\t", t->bt.j[1]); -+ printf("%ld\t", t->x); -+ printf("%ld\t", t->y); -+ printf("%ld\n", *a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func017.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func017.c -new file mode 100755 -index 0000000..4d6e335 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func017.c -@@ -0,0 +1,16 @@ -+#include -+#include -+struct BaseTy { -+ int_fast32_t j[2]; -+}; -+struct Ty { -+ struct BaseTy bt; -+ int_fast32_t x, y; -+}; -+void c_func_(struct Ty *t, int_fast32_t *a) { -+ printf("%ld\t", t->bt.j[0]); -+ printf("%ld\t", t->bt.j[1]); -+ printf("%ld\t", t->x); -+ printf("%ld\t", t->y); -+ printf("%ld\n", *a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func018.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func018.c -new file mode 100755 -index 0000000..86d6afa ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func018.c -@@ -0,0 +1,16 @@ -+#include -+#include -+struct BaseTy { -+ int_fast64_t j[2]; -+}; -+struct Ty { -+ struct BaseTy bt; -+ int_fast64_t x, y; -+}; -+void c_func_(struct Ty *t, int_fast64_t *a) { -+ printf("%ld\t", t->bt.j[0]); -+ printf("%ld\t", t->bt.j[1]); -+ printf("%ld\t", t->x); -+ printf("%ld\t", t->y); -+ printf("%ld\n", *a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func019.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func019.c -new file mode 100755 -index 0000000..48600a8 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func019.c -@@ -0,0 +1,16 @@ -+#include -+#include -+struct BaseTy { -+ intmax_t j[2]; -+}; -+struct Ty { -+ struct BaseTy bt; -+ intmax_t x, y; -+}; -+void c_func_(struct Ty *t, intmax_t *a) { -+ printf("%ld\t", t->bt.j[0]); -+ printf("%ld\t", t->bt.j[1]); -+ printf("%ld\t", t->x); -+ printf("%ld\t", t->y); -+ printf("%ld\n", *a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func020.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func020.c -new file mode 100755 -index 0000000..88cb6d9 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func020.c -@@ -0,0 +1,16 @@ -+#include -+#include -+struct BaseTy { -+ intptr_t j[2]; -+}; -+struct Ty { -+ struct BaseTy bt; -+ intptr_t x, y; -+}; -+void c_func_(struct Ty *t, intptr_t *a) { -+ printf("%ld\t", t->bt.j[0]); -+ printf("%ld\t", t->bt.j[1]); -+ printf("%ld\t", t->x); -+ printf("%ld\t", t->y); -+ printf("%ld\n", *a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func021.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func021.c -new file mode 100755 -index 0000000..4ef4c87 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func021.c -@@ -0,0 +1,15 @@ -+#include -+#include -+struct BaseTy { -+ float j[2]; -+}; -+struct Ty { -+ struct BaseTy bt; -+ float x, y; -+}; -+void c_func_(struct Ty *t) { -+ printf("%.2f\t", t->bt.j[0]); -+ printf("%.2f\t", t->bt.j[1]); -+ printf("%.2f\t", t->x); -+ printf("%.2f\n", t->y); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func022.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func022.c -new file mode 100755 -index 0000000..6a17869 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func022.c -@@ -0,0 +1,15 @@ -+#include -+#include -+struct BaseTy { -+ double j[2]; -+}; -+struct Ty { -+ struct BaseTy bt; -+ double x, y; -+}; -+void c_func_(struct Ty *t) { -+ printf("%.6lf\t", t->bt.j[0]); -+ printf("%.6lf\t", t->bt.j[1]); -+ printf("%.6lf\t", t->x); -+ printf("%.6lf\n", t->y); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func023.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func023.c -new file mode 100755 -index 0000000..ce676c0 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func023.c -@@ -0,0 +1,15 @@ -+#include -+#include -+struct BaseTy { -+ long double j[2]; -+}; -+struct Ty { -+ struct BaseTy bt; -+ long double x, y; -+}; -+void c_func_(struct Ty *t) { -+ printf("%.6Lf\t", t->bt.j[0]); -+ printf("%.6Lf\t", t->bt.j[1]); -+ printf("%.6Lf\t", t->x); -+ printf("%.6Lf\n", t->y); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func024.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func024.c -new file mode 100755 -index 0000000..65f9cd3 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func024.c -@@ -0,0 +1,15 @@ -+#include -+#include -+struct BaseTy { -+ float _Complex j[2]; -+}; -+struct Ty { -+ struct BaseTy bt; -+ float _Complex x, y; -+}; -+void c_func_(struct Ty *t) { -+ printf("%f + %fi\n", creal(t->bt.j[0]), cimag(t->bt.j[0])); -+ printf("%f + %fi\n", creal(t->bt.j[1]), cimag(t->bt.j[1])); -+ printf("%f + %fi\n", creal(t->x), cimag(t->x)); -+ printf("%f + %fi\n", creal(t->y), cimag(t->y)); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func025.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func025.c -new file mode 100755 -index 0000000..5a508d3 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func025.c -@@ -0,0 +1,15 @@ -+#include -+#include -+struct BaseTy { -+ double _Complex j[2]; -+}; -+struct Ty { -+ struct BaseTy bt; -+ double _Complex x, y; -+}; -+void c_func_(struct Ty *t) { -+ printf("%lf + %lfi\n", creal(t->bt.j[0]), cimag(t->bt.j[0])); -+ printf("%lf + %lfi\n", creal(t->bt.j[1]), cimag(t->bt.j[1])); -+ printf("%lf + %lfi\n", creal(t->x), cimag(t->x)); -+ printf("%lf + %lfi\n", creal(t->y), cimag(t->y)); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func026.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func026.c -new file mode 100755 -index 0000000..3969809 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func026.c -@@ -0,0 +1,15 @@ -+#include -+#include -+struct BaseTy { -+ long double _Complex j[2]; -+}; -+struct Ty { -+ struct BaseTy bt; -+ long double _Complex x, y; -+}; -+void c_func_(struct Ty *t) { -+ printf("%f + %fi\n", creal(t->bt.j[0]), cimag(t->bt.j[0])); -+ printf("%f + %fi\n", creal(t->bt.j[1]), cimag(t->bt.j[1])); -+ printf("%f + %fi\n", creal(t->x), cimag(t->x)); -+ printf("%f + %fi\n", creal(t->y), cimag(t->y)); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func027.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func027.c -new file mode 100755 -index 0000000..8847072 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func027.c -@@ -0,0 +1,15 @@ -+#include -+struct BaseTy { -+ _Bool j[2]; -+}; -+struct Ty { -+ struct BaseTy bt; -+ _Bool x, y; -+}; -+void c_func_(struct Ty *t, _Bool *a) { -+ printf("%d\t", t->bt.j[0]); -+ printf("%d\t", t->bt.j[1]); -+ printf("%d\t", t->x); -+ printf("%d\t", t->y); -+ printf("%d\n", *a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func028.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func028.c -new file mode 100755 -index 0000000..988b739 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/c_func028.c -@@ -0,0 +1,15 @@ -+#include -+struct BaseTy { -+ char j[2]; -+}; -+struct Ty { -+ struct BaseTy bt; -+ char x, y; -+}; -+void c_func_(struct Ty *t, int *a) { -+ printf("%c\t", t->bt.j[0]); -+ printf("%c\t", t->bt.j[1]); -+ printf("%c\t", t->x); -+ printf("%c\t", t->y); -+ printf("%c\n", *a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/fortran_main001.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/fortran_main001.f90 -new file mode 100755 -index 0000000..37bfd33 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/fortran_main001.f90 -@@ -0,0 +1,26 @@ -+! Test fortran call c for the derived type and the derived type has -+! multiple components and one component is the derived type. remaining -+! components are mixed type int_t -+! -+program main -+ use iso_c_binding -+ type, bind(c) :: base -+ integer(C_INT) :: j(2) = -2 -+ end type base -+ type, bind(c) :: t -+ type(base) :: bt -+ integer(C_INT) :: x = -2147483647 -+ integer(4) :: y = 2147483647 -+ end type t -+ type(t) :: my_t -+ integer(C_INT) :: my_x = 3 -+ interface -+ subroutine c_func(a, b) -+ use iso_c_binding -+ import :: t -+ type(t) :: a -+ integer(C_INT) :: b -+ end -+ end interface -+ call c_func(my_t, my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/fortran_main002.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/fortran_main002.f90 -new file mode 100755 -index 0000000..ad07ec8 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/fortran_main002.f90 -@@ -0,0 +1,26 @@ -+! Test fortran call c for the derived type and the derived type has -+! multiple components and one component is the derived type. remaining -+! components are mixed type short -+! -+program main -+ use iso_c_binding -+ type, bind(c) :: base -+ integer(C_SHORT) :: j(2) = -2 -+ end type base -+ type, bind(c) :: t -+ type(base) :: bt -+ integer(C_SHORT) :: x = -32768 -+ integer(2) :: y = 32767 -+ end type t -+ type(t) :: my_t -+ integer(C_SHORT) :: my_x = 3 -+ interface -+ subroutine c_func(a, b) -+ use iso_c_binding -+ import :: t -+ type(t) :: a -+ integer(C_SHORT) :: b -+ end -+ end interface -+ call c_func(my_t, my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/fortran_main003.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/fortran_main003.f90 -new file mode 100755 -index 0000000..4b182aa ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/fortran_main003.f90 -@@ -0,0 +1,26 @@ -+! Test fortran call c for the derived type and the derived type has -+! multiple components and one component is the derived type. remaining -+! components are mixed type long -+! -+program main -+ use iso_c_binding -+ type, bind(c) :: base -+ integer(C_LONG) :: j(2) = -2 -+ end type base -+ type, bind(c) :: t -+ type(base) :: bt -+ integer(C_LONG) :: x = -2147483647 -+ integer(8) :: y = 2147483647 -+ end type t -+ type(t) :: my_t -+ integer(C_LONG) :: my_x = 3 -+ interface -+ subroutine c_func(a, b) -+ use iso_c_binding -+ import :: t -+ type(t) :: a -+ integer(C_LONG) :: b -+ end -+ end interface -+ call c_func(my_t, my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/fortran_main004.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/fortran_main004.f90 -new file mode 100755 -index 0000000..7a1d67a ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/fortran_main004.f90 -@@ -0,0 +1,26 @@ -+! Test fortran call c for the derived type and the derived type has -+! multiple components and one component is the derived type. remaining -+! components are mixed type long long -+! -+program main -+ use iso_c_binding -+ type, bind(c) :: base -+ integer(C_LONG_LONG) :: j(2) = -2 -+ end type base -+ type, bind(c) :: t -+ type(base) :: bt -+ integer(C_LONG_LONG) :: x = -9223372036854775807 -+ integer(8) :: y = 9223372036854775807 -+ end type t -+ type(t) :: my_t -+ integer(C_LONG_LONG) :: my_x = 3 -+ interface -+ subroutine c_func(a, b) -+ use iso_c_binding -+ import :: t -+ type(t) :: a -+ integer(C_LONG_LONG) :: b -+ end -+ end interface -+ call c_func(my_t, my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/fortran_main005.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/fortran_main005.f90 -new file mode 100755 -index 0000000..5fa4d83 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/fortran_main005.f90 -@@ -0,0 +1,26 @@ -+! Test fortran call c for the derived type and the derived type has -+! multiple components and one component is the derived type. remaining -+! components are mixed type signed char -+! -+program main -+ use iso_c_binding -+ type, bind(c) :: base -+ integer(C_SIGNED_CHAR) :: j(2) = 65 -+ end type base -+ type, bind(c) :: t -+ type(base) :: bt -+ integer(C_SIGNED_CHAR) :: x = 66 -+ integer(1) :: y = 67 -+ end type t -+ type(t) :: my_t -+ integer(C_SIGNED_CHAR) :: my_x = 68 -+ interface -+ subroutine c_func(a, b) -+ use iso_c_binding -+ import :: t -+ type(t) :: a -+ integer(C_SIGNED_CHAR) :: b -+ end -+ end interface -+ call c_func(my_t, my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/fortran_main006.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/fortran_main006.f90 -new file mode 100755 -index 0000000..1ef89d9 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/fortran_main006.f90 -@@ -0,0 +1,26 @@ -+! Test fortran call c for the derived type and the derived type has -+! multiple components and one component is the derived type. remaining -+! components are mixed type size_t -+! -+program main -+ use iso_c_binding -+ type, bind(c) :: base -+ integer(C_SIZE_T) :: j(2) = 2 -+ end type base -+ type, bind(c) :: t -+ type(base) :: bt -+ integer(C_SIZE_T) :: x = 9223372036854775807 -+ integer(8) :: y = 0 -+ end type t -+ type(t) :: my_t -+ integer(C_SIZE_T) :: my_x = 3 -+ interface -+ subroutine c_func(a, b) -+ use iso_c_binding -+ import :: t -+ type(t) :: a -+ integer(C_SIZE_T) :: b -+ end -+ end interface -+ call c_func(my_t, my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/fortran_main007.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/fortran_main007.f90 -new file mode 100755 -index 0000000..56e5341 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/fortran_main007.f90 -@@ -0,0 +1,26 @@ -+! Test fortran call c for the derived type and the derived type has -+! multiple components and one component is the derived type. remaining -+! components are mixed type int8_t -+! -+program main -+ use iso_c_binding -+ type, bind(c) :: base -+ integer(C_INT8_T) :: j(2) = -2 -+ end type base -+ type, bind(c) :: t -+ type(base) :: bt -+ integer(C_INT8_T) :: x = -128 -+ integer(1) :: y = 127 -+ end type t -+ type(t) :: my_t -+ integer(C_INT8_T) :: my_x = 3 -+ interface -+ subroutine c_func(a, b) -+ use iso_c_binding -+ import :: t -+ type(t) :: a -+ integer(C_INT8_T) :: b -+ end -+ end interface -+ call c_func(my_t, my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/fortran_main008.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/fortran_main008.f90 -new file mode 100755 -index 0000000..8b5a4ce ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/fortran_main008.f90 -@@ -0,0 +1,26 @@ -+! Test fortran call c for the derived type and the derived type has -+! multiple components and one component is the derived type. remaining -+! components are mixed type int16_t -+! -+program main -+ use iso_c_binding -+ type, bind(c) :: base -+ integer(C_INT16_T) :: j(2) = -2 -+ end type base -+ type, bind(c) :: t -+ type(base) :: bt -+ integer(C_INT16_T) :: x = -32768 -+ integer(2) :: y = 32767 -+ end type t -+ type(t) :: my_t -+ integer(C_INT16_T) :: my_x = 3 -+ interface -+ subroutine c_func(a, b) -+ use iso_c_binding -+ import :: t -+ type(t) :: a -+ integer(C_INT16_T) :: b -+ end -+ end interface -+ call c_func(my_t, my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/fortran_main009.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/fortran_main009.f90 -new file mode 100755 -index 0000000..2674ede ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/fortran_main009.f90 -@@ -0,0 +1,26 @@ -+! Test fortran call c for the derived type and the derived type has -+! multiple components and one component is the derived type. remaining -+! components are mixed type int32_t -+! -+program main -+ use iso_c_binding -+ type, bind(c) :: base -+ integer(C_INT32_T) :: j(2) = -2 -+ end type base -+ type, bind(c) :: t -+ type(base) :: bt -+ integer(C_INT32_T) :: x = -2147483647 -+ integer(4) :: y = 2147483647 -+ end type t -+ type(t) :: my_t -+ integer(C_INT32_T) :: my_x = 3 -+ interface -+ subroutine c_func(a, b) -+ use iso_c_binding -+ import :: t -+ type(t) :: a -+ integer(C_INT32_T) :: b -+ end -+ end interface -+ call c_func(my_t, my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/fortran_main010.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/fortran_main010.f90 -new file mode 100755 -index 0000000..9d50708 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/fortran_main010.f90 -@@ -0,0 +1,26 @@ -+! Test fortran call c for the derived type and the derived type has -+! multiple components and one component is the derived type. remaining -+! components are mixed type int64_t -+! -+program main -+ use iso_c_binding -+ type, bind(c) :: base -+ integer(C_INT64_T) :: j(2) = -2 -+ end type base -+ type, bind(c) :: t -+ type(base) :: bt -+ integer(C_INT64_T) :: x = -9223372036854775807 -+ integer(8) :: y = 9223372036854775807 -+ end type t -+ type(t) :: my_t -+ integer(C_INT64_T) :: my_x = 3 -+ interface -+ subroutine c_func(a, b) -+ use iso_c_binding -+ import :: t -+ type(t) :: a -+ integer(C_INT64_T) :: b -+ end -+ end interface -+ call c_func(my_t, my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/fortran_main011.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/fortran_main011.f90 -new file mode 100755 -index 0000000..3e895fc ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/fortran_main011.f90 -@@ -0,0 +1,26 @@ -+! Test fortran call c for the derived type and the derived type has -+! multiple components and one component is the derived type. remaining -+! components are mixed type int_least8_t -+! -+program main -+ use iso_c_binding -+ type, bind(c) :: base -+ integer(C_INT_LEAST8_T) :: j(2) = -2 -+ end type base -+ type, bind(c) :: t -+ type(base) :: bt -+ integer(C_INT_LEAST8_T) :: x = -128 -+ integer(1) :: y = 127 -+ end type t -+ type(t) :: my_t -+ integer(C_INT_LEAST8_T) :: my_x = 3 -+ interface -+ subroutine c_func(a, b) -+ use iso_c_binding -+ import :: t -+ type(t) :: a -+ integer(C_INT_LEAST8_T) :: b -+ end -+ end interface -+ call c_func(my_t, my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/fortran_main012.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/fortran_main012.f90 -new file mode 100755 -index 0000000..a8b0ef5 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/fortran_main012.f90 -@@ -0,0 +1,26 @@ -+! Test fortran call c for the derived type and the derived type has -+! multiple components and one component is the derived type. remaining -+! components are mixed type int_least16_t -+! -+program main -+ use iso_c_binding -+ type, bind(c) :: base -+ integer(C_INT_LEAST16_T) :: j(2) = -2 -+ end type base -+ type, bind(c) :: t -+ type(base) :: bt -+ integer(C_INT_LEAST16_T) :: x = -32768 -+ integer(2) :: y = 32767 -+ end type t -+ type(t) :: my_t -+ integer(C_INT_LEAST16_T) :: my_x = 3 -+ interface -+ subroutine c_func(a, b) -+ use iso_c_binding -+ import :: t -+ type(t) :: a -+ integer(C_INT_LEAST16_T) :: b -+ end -+ end interface -+ call c_func(my_t, my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/fortran_main013.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/fortran_main013.f90 -new file mode 100755 -index 0000000..62e8b11 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/fortran_main013.f90 -@@ -0,0 +1,26 @@ -+! Test fortran call c for the derived type and the derived type has -+! multiple components and one component is the derived type. remaining -+! components are mixed type int_least32_t -+! -+program main -+ use iso_c_binding -+ type, bind(c) :: base -+ integer(C_INT_LEAST32_T) :: j(2) = -2 -+ end type base -+ type, bind(c) :: t -+ type(base) :: bt -+ integer(C_INT_LEAST32_T) :: x = -2147483647 -+ integer(4) :: y = 2147483647 -+ end type t -+ type(t) :: my_t -+ integer(C_INT_LEAST32_T) :: my_x = 3 -+ interface -+ subroutine c_func(a, b) -+ use iso_c_binding -+ import :: t -+ type(t) :: a -+ integer(C_INT_LEAST32_T) :: b -+ end -+ end interface -+ call c_func(my_t, my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/fortran_main014.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/fortran_main014.f90 -new file mode 100755 -index 0000000..1b0aa8e ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/fortran_main014.f90 -@@ -0,0 +1,26 @@ -+! Test fortran call ! Test fortran call c for the derived type and the derived type has -+! multiple components and one component is the derived type. remaining -+! components are mixed type int_least64_t -+! -+program main -+ use iso_c_binding -+ type, bind(c) :: base -+ integer(C_INT_LEAST64_T) :: j(2) = -2 -+ end type base -+ type, bind(c) :: t -+ type(base) :: bt -+ integer(C_INT_LEAST64_T) :: x = -9223372036854775807 -+ integer(8) :: y = 9223372036854775807 -+ end type t -+ type(t) :: my_t -+ integer(C_INT_LEAST64_T) :: my_x = 3 -+ interface -+ subroutine c_func(a, b) -+ use iso_c_binding -+ import :: t -+ type(t) :: a -+ integer(C_INT_LEAST64_T) :: b -+ end -+ end interface -+ call c_func(my_t, my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/fortran_main015.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/fortran_main015.f90 -new file mode 100755 -index 0000000..52d7e1d ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/fortran_main015.f90 -@@ -0,0 +1,26 @@ -+! Test fortran call c for the derived type and the derived type has -+! multiple components and one component is the derived type. remaining -+! components are mixed type int_fast8_t -+! -+program main -+ use iso_c_binding -+ type, bind(c) :: base -+ integer(C_INT_FAST8_T) :: j(2) = -2 -+ end type base -+ type, bind(c) :: t -+ type(base) :: bt -+ integer(C_INT_FAST8_T) :: x = -128 -+ integer(1) :: y = 127 -+ end type t -+ type(t) :: my_t -+ integer(C_INT_FAST8_T) :: my_x = 3 -+ interface -+ subroutine c_func(a, b) -+ use iso_c_binding -+ import :: t -+ type(t) :: a -+ integer(C_INT_FAST8_T) :: b -+ end -+ end interface -+ call c_func(my_t, my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/fortran_main016.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/fortran_main016.f90 -new file mode 100755 -index 0000000..05bd335 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/fortran_main016.f90 -@@ -0,0 +1,26 @@ -+! Test fortran call c for the derived type and the derived type has -+! multiple components and one component is the derived type. remaining -+! components are mixed type int_fast16_t -+! -+program main -+ use iso_c_binding -+ type, bind(c) :: base -+ integer(C_INT_FAST16_T) :: j(2) = -2 -+ end type base -+ type, bind(c) :: t -+ type(base) :: bt -+ integer(C_INT_FAST16_T) :: x = -32768 -+ integer(8) :: y = 32767 -+ end type t -+ type(t) :: my_t -+ integer(C_INT_FAST16_T) :: my_x = 3 -+ interface -+ subroutine c_func(a, b) -+ use iso_c_binding -+ import :: t -+ type(t) :: a -+ integer(C_INT_FAST16_T) :: b -+ end -+ end interface -+ call c_func(my_t, my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/fortran_main017.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/fortran_main017.f90 -new file mode 100755 -index 0000000..0a648b4 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/fortran_main017.f90 -@@ -0,0 +1,26 @@ -+! Test fortran call c for the derived type and the derived type has -+! multiple components and one component is the derived type. remaining -+! components are mixed type int_fast32_t -+! -+program main -+ use iso_c_binding -+ type, bind(c) :: base -+ integer(C_INT_FAST32_T) :: j(2) = -2 -+ end type base -+ type, bind(c) :: t -+ type(base) :: bt -+ integer(C_INT_FAST32_T) :: x = -2147483647 -+ integer(8) :: y = 2147483647 -+ end type t -+ type(t) :: my_t -+ integer(C_INT_FAST32_T) :: my_x = 3 -+ interface -+ subroutine c_func(a, b) -+ use iso_c_binding -+ import :: t -+ type(t) :: a -+ integer(C_INT_FAST32_T) :: b -+ end -+ end interface -+ call c_func(my_t, my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/fortran_main018.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/fortran_main018.f90 -new file mode 100755 -index 0000000..34fd6b2 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/fortran_main018.f90 -@@ -0,0 +1,26 @@ -+! Test fortran call c for the derived type and the derived type has -+! multiple components and one component is the derived type. remaining -+! components are mixed type int_fast64_t -+! -+program main -+ use iso_c_binding -+ type, bind(c) :: base -+ integer(C_INT_FAST64_T) :: j(2) = -2 -+ end type base -+ type, bind(c) :: t -+ type(base) :: bt -+ integer(C_INT_FAST64_T) :: x = -9223372036854775807 -+ integer(8) :: y = 9223372036854775807 -+ end type t -+ type(t) :: my_t -+ integer(C_INT_FAST64_T) :: my_x = 3 -+ interface -+ subroutine c_func(a, b) -+ use iso_c_binding -+ import :: t -+ type(t) :: a -+ integer(C_INT_FAST64_T) :: b -+ end -+ end interface -+ call c_func(my_t, my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/fortran_main019.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/fortran_main019.f90 -new file mode 100755 -index 0000000..d18bfaa ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/fortran_main019.f90 -@@ -0,0 +1,26 @@ -+! Test fortran call c for the derived type and the derived type has -+! multiple components and one component is the derived type. remaining -+! components are mixed type int_intmax_t -+! -+program main -+ use iso_c_binding -+ type, bind(c) :: base -+ integer(C_INTMAX_T) :: j(2) = -2 -+ end type base -+ type, bind(c) :: t -+ type(base) :: bt -+ integer(C_INTMAX_T) :: x = 11548694 -+ integer(8) :: y = 916519685 -+ end type t -+ type(t) :: my_t -+ integer(C_INTMAX_T) :: my_x = 3 -+ interface -+ subroutine c_func(a, b) -+ use iso_c_binding -+ import :: t -+ type(t) :: a -+ integer(C_INTMAX_T) :: b -+ end -+ end interface -+ call c_func(my_t, my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/fortran_main020.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/fortran_main020.f90 -new file mode 100755 -index 0000000..849525a ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/fortran_main020.f90 -@@ -0,0 +1,26 @@ -+! Test fortran call c for the derived type and the derived type has -+! multiple components and one component is the derived type. remaining -+! components are mixed type intptr_t -+! -+program main -+ use iso_c_binding -+ type, bind(c) :: base -+ integer(C_INTPTR_T) :: j(2) = -2 -+ end type base -+ type, bind(c) :: t -+ type(base) :: bt -+ integer(C_INTPTR_T) :: x = -922337 -+ integer(8) :: y = 922337 -+ end type t -+ type(t) :: my_t -+ integer(C_INTPTR_T) :: my_x = 3 -+ interface -+ subroutine c_func(a, b) -+ use iso_c_binding -+ import :: t -+ type(t) :: a -+ integer(C_INTPTR_T) :: b -+ end -+ end interface -+ call c_func(my_t, my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/fortran_main021.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/fortran_main021.f90 -new file mode 100755 -index 0000000..ecb0e02 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/fortran_main021.f90 -@@ -0,0 +1,24 @@ -+! Test fortran call c for the derived type and the derived type has -+! multiple components and one component is the derived type. remaining -+! components are mixed type float -+! -+program main -+ use iso_c_binding -+ type, bind(c) :: base -+ real(C_FLOAT) :: j(2) = -2.36 -+ end type base -+ type, bind(c) :: t -+ type(base) :: bt -+ real(C_FLOAT) :: x = -3.14 -+ real(4) :: y = 3.14 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ use iso_c_binding -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/fortran_main022.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/fortran_main022.f90 -new file mode 100755 -index 0000000..7865856 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/fortran_main022.f90 -@@ -0,0 +1,24 @@ -+! Test fortran call c for the derived type and the derived type has -+! multiple components and one component is the derived type. remaining -+! components are mixed type double -+! -+program main -+ use iso_c_binding -+ type, bind(c) :: base -+ real(C_DOUBLE) :: j(2) = 450359962737049.621345 -+ end type base -+ type, bind(c) :: t -+ type(base) :: bt -+ real(C_DOUBLE) :: x = -450359962737049.621113 -+ real(8) :: y = 12345678.7654321 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ use iso_c_binding -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/fortran_main023.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/fortran_main023.f90 -new file mode 100755 -index 0000000..d88c887 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/fortran_main023.f90 -@@ -0,0 +1,25 @@ -+! Test fortran call c for the derived type and the derived type has -+! multiple components and one component is the derived type. remaining -+! components are mixed type long double -+! -+program main -+ use iso_c_binding -+ integer, parameter :: K = selected_real_kind(16) -+ type, bind(c) :: base -+ real(C_LONG_DOUBLE) :: j(2) = 50359534651234685432213246841962737049.621345 -+ end type base -+ type, bind(c) :: t -+ type(base) :: bt -+ real(C_LONG_DOUBLE) :: x = -450359962737049.621113 -+ real(K) :: y = 12345678.7654321 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ use iso_c_binding -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/fortran_main024.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/fortran_main024.f90 -new file mode 100755 -index 0000000..033c05a ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/fortran_main024.f90 -@@ -0,0 +1,24 @@ -+! Test fortran call c for the derived type and the derived type has -+! multiple components and one component is the derived type. remaining -+! components are mixed type float complex -+! -+program main -+ use iso_c_binding -+ type, bind(c) :: base -+ complex(C_FLOAT_COMPLEX) :: j(2) = (1, 2); -+ end type base -+ type, bind(c) :: t -+ type(base) :: bt -+ complex(C_FLOAT_COMPLEX) :: x = (-3, 1) -+ complex(4) :: y = (3, 1) -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ use iso_c_binding -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/fortran_main025.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/fortran_main025.f90 -new file mode 100755 -index 0000000..e03cd28 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/fortran_main025.f90 -@@ -0,0 +1,24 @@ -+! Test fortran call c for the derived type and the derived type has -+! multiple components and one component is the derived type. remaining -+! components are mixed type double complex -+! -+program main -+ use iso_c_binding -+ type, bind(c) :: base -+ complex(C_DOUBLE_COMPLEX) :: j(2) = (4503599.6, 621.345); -+ end type base -+ type, bind(c) :: t -+ type(base) :: bt -+ complex(C_DOUBLE_COMPLEX) :: x = (-3.14159265358979, 1) -+ complex(8) :: y = (3.14159265358979, 1) -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ use iso_c_binding -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/fortran_main026.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/fortran_main026.f90 -new file mode 100755 -index 0000000..a3af173 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/fortran_main026.f90 -@@ -0,0 +1,25 @@ -+! Test fortran call c for the derived type and the derived type has -+! multiple components and one component is the derived type. remaining -+! components are mixed type long double complex -+! -+program main -+ use iso_c_binding -+ integer, parameter :: K = selected_real_kind(16) -+ type, bind(c) :: base -+ complex(C_LONG_DOUBLE_COMPLEX) :: j(2) = (45545204745299.6, 621.345); -+ end type base -+ type, bind(c) :: t -+ type(base) :: bt -+ complex(C_LONG_DOUBLE_COMPLEX) :: x = (-3.14159265358979, 1) -+ complex(K) :: y = (3.14159265358979, 1) -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ use iso_c_binding -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/fortran_main027.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/fortran_main027.f90 -new file mode 100755 -index 0000000..2df1f57 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/fortran_main027.f90 -@@ -0,0 +1,26 @@ -+! Test fortran call c for the derived type and the derived type has -+! multiple components and one component is the derived type. remaining -+! components are mixed type bool -+! -+program main -+ use iso_c_binding -+ type, bind(c) :: base -+ logical(C_BOOL) :: j(2) = .TRUE. -+ end type base -+ type, bind(c) :: t -+ type(base) :: bt -+ logical(C_BOOL) :: x = .FALSE. -+ logical(1) :: y = .TRUE. -+ end type t -+ type(t) :: my_t -+ logical(C_BOOL) :: my_x = .FALSE. -+ interface -+ subroutine c_func(a, b) -+ use iso_c_binding -+ import :: t -+ type(t) :: a -+ logical(C_BOOL) :: b -+ end -+ end interface -+ call c_func(my_t, my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/fortran_main028.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/fortran_main028.f90 -new file mode 100755 -index 0000000..23450cd ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/fortran_main028.f90 -@@ -0,0 +1,26 @@ -+! Test fortran call c for the derived type and the derived type has -+! multiple components and one component is the derived type. remaining -+! components are mixed type char -+! -+program main -+ use iso_c_binding -+ type, bind(c) :: base -+ character(C_CHAR) :: j(2) = 'a' -+ end type base -+ type, bind(c) :: t -+ type(base) :: bt -+ character(C_CHAR) :: x = 'b' -+ character(1) :: y = 'c' -+ end type t -+ type(t) :: my_t -+ character(C_CHAR) :: my_x = 'd' -+ interface -+ subroutine c_func(a, b) -+ use iso_c_binding -+ import :: t -+ type(t) :: a -+ character(C_CHAR) :: b -+ end -+ end interface -+ call c_func(my_t, my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/result.md b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/result.md -new file mode 100644 -index 0000000..a475ebc ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/result.md -@@ -0,0 +1,29 @@ -+ | test | gfortran | flang | nvfortran| -+ | 001 | PASS | PASS | PASS | -+ | 002 | PASS | PASS | PASS | -+ | 003 | PASS | PASS | PASS | -+ | 004 | PASS | PASS | ERROR | -+ | 005 | PASS | PASS | PASS | -+ | 006 | PASS | PASS | ERROR | -+ | 007 | PASS | PASS | PASS | -+ | 008 | PASS | PASS | PASS | -+ | 009 | PASS | PASS | PASS | -+ | 010 | PASS | PASS | ERROR | -+ | 011 | PASS | PASS | PASS | -+ | 012 | PASS | PASS | PASS | -+ | 013 | PASS | PASS | PASS | -+ | 014 | PASS | PASS | ERROR | -+ | 015 | PASS | PASS | PASS | -+ | 016 | PASS | ERROR | PASS | -+ | 017 | PASS | ERROR | PASS | -+ | 018 | PASS | PASS | ERROR | -+ | 019 | PASS | ERROR | PASS | -+ | 020 | PASS | PASS | PASS | -+ | 021 | PASS | PASS | PASS | -+ | 022 | PASS | PASS | PASS | -+ | 023 | PASS | ERROR | ERROR | -+ | 024 | PASS | PASS | PASS | -+ | 025 | PASS | PASS | PASS | -+ | 026 | PASS | ERROR | ERROR | -+ | 027 | PASS | PASS | PASS | -+ | 028 | PASS | PASS | PASS | -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/run.sh b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/run.sh -new file mode 100644 -index 0000000..dbbd62f ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/001_fortran_call_c_mix/run.sh -@@ -0,0 +1,22 @@ -+for i in {001..028} -+do -+echo "------- test $i ------." -+echo "----- gfortran result:" -+gcc c_func$i.c -c -o c-test.o -+gfortran fortran_main$i.f90 -fno-range-check -c -o fortran-test.o -+gfortran c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+echo "----- flang-new result : " -+clang c_func$i.c -c -o c-test.o -+flang-new fortran_main$i.f90 -c -o fortran-test.o -+flang-new -flang-experimental-exec c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+echo "----- nvfortran result : " -+clang c_func$i.c -c -o c-test.o -+nvfortran fortran_main$i.f90 -c -o fortran-test.o -+nvfortran c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+done -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/002_fortran_call_c_special_case/c_func001.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/002_fortran_call_c_special_case/c_func001.c -new file mode 100644 -index 0000000..87c1454 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/002_fortran_call_c_special_case/c_func001.c -@@ -0,0 +1,4 @@ -+#include -+void c_func_(int *a) { -+ printf("ok\n"); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/002_fortran_call_c_special_case/c_func002.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/002_fortran_call_c_special_case/c_func002.c -new file mode 100644 -index 0000000..061affd ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/002_fortran_call_c_special_case/c_func002.c -@@ -0,0 +1,7 @@ -+#include -+struct Ty { -+ int x[0]; -+}; -+void c_func_(struct Ty *t) { -+ printf("ok\n"); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/002_fortran_call_c_special_case/c_func003.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/002_fortran_call_c_special_case/c_func003.c -new file mode 100644 -index 0000000..ed175d9 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/002_fortran_call_c_special_case/c_func003.c -@@ -0,0 +1,12 @@ -+#include -+struct BaseTy { -+}; -+struct Ty { -+ struct BaseTy bt; -+ int x, y; -+}; -+void c_func_(struct Ty *t, int *a) { -+ printf("%d\t", t->x); -+ printf("%d\t", t->y); -+ printf("%d\n", *a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/002_fortran_call_c_special_case/c_func004.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/002_fortran_call_c_special_case/c_func004.c -new file mode 100644 -index 0000000..f35b45c ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/002_fortran_call_c_special_case/c_func004.c -@@ -0,0 +1,16 @@ -+#include -+#include -+struct BaseTy { -+ int_fast16_t j[2]; -+}; -+struct Ty { -+ struct BaseTy bt; -+ int_fast16_t x, y; -+}; -+void c_func_(struct Ty *t, int_fast16_t *a) { -+ printf("%ld\t", t->bt.j[0]); -+ printf("%ld\t", t->bt.j[1]); -+ printf("%ld\t", t->x); -+ printf("%ld\t", t->y); -+ printf("%ld\n", *a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/002_fortran_call_c_special_case/c_func005.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/002_fortran_call_c_special_case/c_func005.c -new file mode 100644 -index 0000000..4d6e335 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/002_fortran_call_c_special_case/c_func005.c -@@ -0,0 +1,16 @@ -+#include -+#include -+struct BaseTy { -+ int_fast32_t j[2]; -+}; -+struct Ty { -+ struct BaseTy bt; -+ int_fast32_t x, y; -+}; -+void c_func_(struct Ty *t, int_fast32_t *a) { -+ printf("%ld\t", t->bt.j[0]); -+ printf("%ld\t", t->bt.j[1]); -+ printf("%ld\t", t->x); -+ printf("%ld\t", t->y); -+ printf("%ld\n", *a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/002_fortran_call_c_special_case/c_func006.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/002_fortran_call_c_special_case/c_func006.c -new file mode 100644 -index 0000000..48600a8 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/002_fortran_call_c_special_case/c_func006.c -@@ -0,0 +1,16 @@ -+#include -+#include -+struct BaseTy { -+ intmax_t j[2]; -+}; -+struct Ty { -+ struct BaseTy bt; -+ intmax_t x, y; -+}; -+void c_func_(struct Ty *t, intmax_t *a) { -+ printf("%ld\t", t->bt.j[0]); -+ printf("%ld\t", t->bt.j[1]); -+ printf("%ld\t", t->x); -+ printf("%ld\t", t->y); -+ printf("%ld\n", *a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/002_fortran_call_c_special_case/fortran_main001.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/002_fortran_call_c_special_case/fortran_main001.f90 -new file mode 100644 -index 0000000..8247452 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/002_fortran_call_c_special_case/fortran_main001.f90 -@@ -0,0 +1,11 @@ -+! Test fortran call c for an array of integer and the array is null -+! -+program main -+ integer :: my_x(0) -+ interface -+ subroutine c_func(b) -+ integer :: b(0) -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/002_fortran_call_c_special_case/fortran_main002.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/002_fortran_call_c_special_case/fortran_main002.f90 -new file mode 100644 -index 0000000..f32f396 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/002_fortran_call_c_special_case/fortran_main002.f90 -@@ -0,0 +1,16 @@ -+! Test fortran call c for the derived type and one component of the -+! derived type is a null array -+! -+program main -+ type, bind(c) :: t -+ integer :: x(0) -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/002_fortran_call_c_special_case/fortran_main003.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/002_fortran_call_c_special_case/fortran_main003.f90 -new file mode 100644 -index 0000000..7130845 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/002_fortran_call_c_special_case/fortran_main003.f90 -@@ -0,0 +1,24 @@ -+! Test fortran call c for the derived type and one component of the -+! derived type is a null derived type -+! -+program main -+ use iso_c_binding -+ type, bind(c) :: base -+ end type base -+ type, bind(c) :: t -+ type(base) :: bt -+ integer(C_INT) :: x = -2147483647 -+ integer(C_INT) :: y = 2147483647 -+ end type t -+ type(t) :: my_t -+ integer(C_INT) :: my_x = 3 -+ interface -+ subroutine c_func(a, b) -+ use iso_c_binding -+ import :: t -+ type(t) :: a -+ integer(C_INT) :: b -+ end -+ end interface -+ call c_func(my_t, my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/002_fortran_call_c_special_case/fortran_main004.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/002_fortran_call_c_special_case/fortran_main004.f90 -new file mode 100644 -index 0000000..2d50b2b ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/002_fortran_call_c_special_case/fortran_main004.f90 -@@ -0,0 +1,24 @@ -+! Test fortran call c for composite scenario of type int_fast16_t -+! -+program main -+ use iso_c_binding -+ type, bind(c) :: base -+ integer(C_INT_FAST16_T) :: j(2) = -2 -+ end type base -+ type, bind(c) :: t -+ type(base) :: bt -+ integer(C_INT_FAST16_T) :: x = -32768 -+ integer(C_INT_FAST16_T) :: y = 32767 -+ end type t -+ type(t) :: my_t -+ integer(C_INT_FAST16_T) :: my_x = 3 -+ interface -+ subroutine c_func(a, b) -+ use iso_c_binding -+ import :: t -+ type(t) :: a -+ integer(C_INT_FAST16_T) :: b -+ end -+ end interface -+ call c_func(my_t, my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/002_fortran_call_c_special_case/fortran_main005.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/002_fortran_call_c_special_case/fortran_main005.f90 -new file mode 100644 -index 0000000..c084956 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/002_fortran_call_c_special_case/fortran_main005.f90 -@@ -0,0 +1,24 @@ -+! Test fortran call c for composite scenario of type int_fast32_t -+! -+program main -+ use iso_c_binding -+ type, bind(c) :: base -+ integer(C_INT_FAST32_T) :: j(2) = -2 -+ end type base -+ type, bind(c) :: t -+ type(base) :: bt -+ integer(C_INT_FAST32_T) :: x = -2147483647 -+ integer(C_INT_FAST32_T) :: y = 2147483647 -+ end type t -+ type(t) :: my_t -+ integer(C_INT_FAST32_T) :: my_x = 3 -+ interface -+ subroutine c_func(a, b) -+ use iso_c_binding -+ import :: t -+ type(t) :: a -+ integer(C_INT_FAST32_T) :: b -+ end -+ end interface -+ call c_func(my_t, my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/002_fortran_call_c_special_case/fortran_main006.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/002_fortran_call_c_special_case/fortran_main006.f90 -new file mode 100644 -index 0000000..681705c ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/002_fortran_call_c_special_case/fortran_main006.f90 -@@ -0,0 +1,24 @@ -+! Test fortran call c for composite scenario of type intmax_t -+! -+program main -+ use iso_c_binding -+ type, bind(c) :: base -+ integer(C_INTMAX_T) :: j(2) = -2 -+ end type base -+ type, bind(c) :: t -+ type(base) :: bt -+ integer(C_INTMAX_T) :: x = -2147483647 -+ integer(C_INTMAX_T) :: y = 2147483647 -+ end type t -+ type(t) :: my_t -+ integer(C_INTMAX_T) :: my_x = 3 -+ interface -+ subroutine c_func(a, b) -+ use iso_c_binding -+ import :: t -+ type(t) :: a -+ integer(C_INTMAX_T) :: b -+ end -+ end interface -+ call c_func(my_t, my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/002_fortran_call_c_special_case/result.md b/test/interoperability_with_c_fortran_call_c_global_and_struct/002_fortran_call_c_special_case/result.md -new file mode 100644 -index 0000000..c8c9bb2 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/002_fortran_call_c_special_case/result.md -@@ -0,0 +1,7 @@ -+ | test | gfortran | flang | nvfortran| -+ | 001 | PASS | PASS | ERROR | -+ | 002 | PASS | PASS | ERROR | -+ | 003 | PASS | PASS | PASS | -+ | 004 | PASS | ERROR | PASS | -+ | 005 | PASS | ERROR | PASS | -+ | 006 | PASS | ERROR | PASS | -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/002_fortran_call_c_special_case/run.sh b/test/interoperability_with_c_fortran_call_c_global_and_struct/002_fortran_call_c_special_case/run.sh -new file mode 100644 -index 0000000..2392045 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/002_fortran_call_c_special_case/run.sh -@@ -0,0 +1,22 @@ -+for i in {001..006} -+do -+echo "------- test $i ------." -+echo "----- gfortran result:" -+gcc c_func$i.c -c -o c-test.o -+gfortran fortran_main$i.f90 -fno-range-check -c -o fortran-test.o -+gfortran c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+echo "----- flang-new result : " -+clang c_func$i.c -c -o c-test.o -+flang-new fortran_main$i.f90 -c -o fortran-test.o -+flang-new -flang-experimental-exec c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+echo "----- nvfortran result : " -+clang c_func$i.c -c -o c-test.o -+nvfortran fortran_main$i.f90 -c -o fortran-test.o -+nvfortran c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+done -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/c_func001.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/c_func001.c -new file mode 100755 -index 0000000..042849e ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/c_func001.c -@@ -0,0 +1,8 @@ -+#include -+struct Ty { -+ int x, y; -+}; -+void c_func_(struct Ty *t) { -+ printf("%d\t", t->x); -+ printf("%d\n", t->y); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/c_func002.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/c_func002.c -new file mode 100755 -index 0000000..ad72ffd ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/c_func002.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ short x, y; -+}; -+void c_func_(struct Ty *t) { -+ printf("%hd\t", t->x); -+ printf("%hd\n", t->y); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/c_func003.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/c_func003.c -new file mode 100755 -index 0000000..78540c0 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/c_func003.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ long x, y; -+}; -+void c_func_(struct Ty *t) { -+ printf("%ld\t", t->x); -+ printf("%ld\n", t->y); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/c_func004.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/c_func004.c -new file mode 100755 -index 0000000..83bc034 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/c_func004.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ long long x, y; -+}; -+void c_func_(struct Ty *t) { -+ printf("%lld\t", t->x); -+ printf("%lld\n", t->y); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/c_func005.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/c_func005.c -new file mode 100755 -index 0000000..f0ec8b1 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/c_func005.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ signed char x, y; -+}; -+void c_func_(struct Ty *t) { -+ printf("%c\t", t->x); -+ printf("%c\n", t->y); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/c_func006.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/c_func006.c -new file mode 100755 -index 0000000..a37766e ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/c_func006.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ size_t x, y; -+}; -+void c_func_(struct Ty *t) { -+ printf("%ld\t", t->x); -+ printf("%ld\n", t->y); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/c_func007.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/c_func007.c -new file mode 100755 -index 0000000..71c4460 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/c_func007.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ int8_t x, y; -+}; -+void c_func_(struct Ty *t) { -+ printf("%hhd\t", t->x); -+ printf("%hhd\n", t->y); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/c_func008.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/c_func008.c -new file mode 100755 -index 0000000..cc4c156 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/c_func008.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ int16_t x, y; -+}; -+void c_func_(struct Ty *t) { -+ printf("%hd\t", t->x); -+ printf("%hd\n", t->y); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/c_func009.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/c_func009.c -new file mode 100755 -index 0000000..81c3db1 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/c_func009.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ int32_t x, y; -+}; -+void c_func_(struct Ty *t) { -+ printf("%d\t", t->x); -+ printf("%d\n", t->y); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/c_func010.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/c_func010.c -new file mode 100755 -index 0000000..0d8b990 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/c_func010.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ int64_t x,y; -+}; -+void c_func_(struct Ty *t) { -+ printf("%ld\t", t->x); -+ printf("%ld\n", t->y); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/c_func011.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/c_func011.c -new file mode 100755 -index 0000000..9d65b2a ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/c_func011.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ int_least8_t x, y; -+}; -+void c_func_(struct Ty *t) { -+ printf("%hhd\t", t->x); -+ printf("%hhd\n", t->y); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/c_func012.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/c_func012.c -new file mode 100755 -index 0000000..e77ab58 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/c_func012.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ int_least16_t x, y; -+}; -+void c_func_(struct Ty *t) { -+ printf("%hd\t", t->x); -+ printf("%hd\n", t->y); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/c_func013.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/c_func013.c -new file mode 100755 -index 0000000..c37c94e ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/c_func013.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ int_least32_t x, y; -+}; -+void c_func_(struct Ty *t) { -+ printf("%d\t", t->x); -+ printf("%d\n", t->y); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/c_func014.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/c_func014.c -new file mode 100755 -index 0000000..6f8a5b4 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/c_func014.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ int_least64_t x, y; -+}; -+void c_func_(struct Ty *t) { -+ printf("%ld\t", t->x); -+ printf("%ld\n", t->y); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/c_func015.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/c_func015.c -new file mode 100755 -index 0000000..9308c5b ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/c_func015.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ int_fast8_t x, y; -+}; -+void c_func_(struct Ty *t) { -+ printf("%hhd\t", t->x); -+ printf("%hhd\n", t->y); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/c_func016.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/c_func016.c -new file mode 100755 -index 0000000..1bdc74a ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/c_func016.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ int_fast16_t x, y; -+}; -+void c_func_(struct Ty *t) { -+ printf("%ld\t", t->x); -+ printf("%ld\n", t->y); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/c_func017.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/c_func017.c -new file mode 100755 -index 0000000..017daeb ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/c_func017.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ int_fast32_t x, y; -+}; -+void c_func_(struct Ty *t) { -+ printf("%ld\t", t->x); -+ printf("%ld\n", t->y); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/c_func018.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/c_func018.c -new file mode 100755 -index 0000000..3ab58e9 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/c_func018.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ int_fast64_t x, y; -+}; -+void c_func_(struct Ty *t) { -+ printf("%ld\t", t->x); -+ printf("%ld\n", t->y); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/c_func019.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/c_func019.c -new file mode 100755 -index 0000000..9c68e8d ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/c_func019.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ intmax_t x, y; -+}; -+void c_func_(struct Ty *t) { -+ printf("%ld\t", t->x); -+ printf("%ld\n", t->y); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/c_func020.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/c_func020.c -new file mode 100755 -index 0000000..9c41124 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/c_func020.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ intptr_t x, y; -+}; -+void c_func_(struct Ty *t) { -+ printf("%ld\t", t->x); -+ printf("%ld\n", t->y); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/c_func021.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/c_func021.c -new file mode 100755 -index 0000000..33704de ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/c_func021.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ float x, y; -+}; -+void c_func_(struct Ty *t) { -+ printf("%f\t", t->x); -+ printf("%f\n", t->y); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/c_func022.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/c_func022.c -new file mode 100755 -index 0000000..e8beea1 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/c_func022.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ double x, y; -+}; -+void c_func_(struct Ty *t) { -+ printf("%0.20lf\t", t->x); -+ printf("%0.20lf\n", t->y); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/c_func023.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/c_func023.c -new file mode 100755 -index 0000000..a735b8d ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/c_func023.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ long double x, y; -+}; -+void c_func_(struct Ty *t) { -+ printf("%0.20Lf\t", t->x); -+ printf("%0.20Lf\n", t->y); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/c_func024.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/c_func024.c -new file mode 100755 -index 0000000..aff5eaf ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/c_func024.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ float _Complex x, y; -+}; -+void c_func_(struct Ty *t) { -+ printf("%f + %fi\n", creal(t->x), cimag(t->x)); -+ printf("%f + %fi\n", creal(t->y), cimag(t->y)); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/c_func025.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/c_func025.c -new file mode 100755 -index 0000000..cac2da2 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/c_func025.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ double _Complex x, y; -+}; -+void c_func_(struct Ty *t) { -+ printf("%lf + %lfi\n", creal(t->x), cimag(t->x)); -+ printf("%lf + %lfi\n", creal(t->y), cimag(t->y)); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/c_func026.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/c_func026.c -new file mode 100755 -index 0000000..886667b ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/c_func026.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ long double _Complex x, y; -+}; -+void c_func_(struct Ty *t) { -+ printf("%f + %fi\n", creal(t->x), cimag(t->x)); -+ printf("%f + %fi\n", creal(t->y), cimag(t->y)); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/c_func027.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/c_func027.c -new file mode 100755 -index 0000000..ef8ac27 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/c_func027.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ _Bool x, y; -+}; -+void c_func_(struct Ty *t) { -+ printf("%d\t", t->x); -+ printf("%d\n", t->y); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/c_func028.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/c_func028.c -new file mode 100755 -index 0000000..1b00b60 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/c_func028.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ char x, y; -+}; -+void c_func_(struct Ty *t) { -+ printf("%c\t", t->x); -+ printf("%c\n", t->y); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/fortran_main001.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/fortran_main001.f90 -new file mode 100755 -index 0000000..908fbdf ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/fortran_main001.f90 -@@ -0,0 +1,17 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type int -+! -+program main -+ type :: t -+ integer :: x = -2147483647 -+ integer :: y = 2147483647 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/fortran_main002.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/fortran_main002.f90 -new file mode 100755 -index 0000000..b42f21e ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/fortran_main002.f90 -@@ -0,0 +1,17 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type short -+! -+program main -+ type :: t -+ integer(2) :: x = -32768 -+ integer(2) :: y = 32767 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/fortran_main003.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/fortran_main003.f90 -new file mode 100755 -index 0000000..4ef184f ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/fortran_main003.f90 -@@ -0,0 +1,17 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type long -+! -+program main -+ type :: t -+ integer(8) :: x = -2147483647 -+ integer(8) :: y = 2147483647 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/fortran_main004.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/fortran_main004.f90 -new file mode 100755 -index 0000000..636140d ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/fortran_main004.f90 -@@ -0,0 +1,17 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type long long -+! -+program main -+ type :: t -+ integer(8) :: x = -9223372036854775807 -+ integer(8) :: y = 9223372036854775807 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/fortran_main005.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/fortran_main005.f90 -new file mode 100755 -index 0000000..220b2c5 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/fortran_main005.f90 -@@ -0,0 +1,17 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type signed char -+! -+program main -+ type :: t -+ integer(1) :: x = 65 -+ integer(1) :: y = 66 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/fortran_main006.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/fortran_main006.f90 -new file mode 100755 -index 0000000..570af7d ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/fortran_main006.f90 -@@ -0,0 +1,17 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type size_t -+! -+program main -+ type :: t -+ integer(8) :: x = 0 -+ integer(8) :: y = 9223372036854775807 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/fortran_main007.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/fortran_main007.f90 -new file mode 100755 -index 0000000..00e3dc9 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/fortran_main007.f90 -@@ -0,0 +1,17 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type int8_t -+! -+program main -+ type :: t -+ integer(1) :: x = -128 -+ integer(1) :: y = 127 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/fortran_main008.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/fortran_main008.f90 -new file mode 100755 -index 0000000..ee668bc ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/fortran_main008.f90 -@@ -0,0 +1,17 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type int16_t -+! -+program main -+ type :: t -+ integer(2) :: x = -32768 -+ integer(2) :: y = 32767 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/fortran_main009.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/fortran_main009.f90 -new file mode 100755 -index 0000000..f2afc38 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/fortran_main009.f90 -@@ -0,0 +1,17 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type int32_t -+! -+program main -+ type :: t -+ integer(4) :: x = -2147483647 -+ integer(4) :: y = 2147483647 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/fortran_main010.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/fortran_main010.f90 -new file mode 100755 -index 0000000..f683925 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/fortran_main010.f90 -@@ -0,0 +1,17 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type int64_t -+! -+program main -+ type :: t -+ integer(8) :: x = -9223372036854775807 -+ integer(8) :: y = 9223372036854775807 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/fortran_main011.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/fortran_main011.f90 -new file mode 100755 -index 0000000..0819311 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/fortran_main011.f90 -@@ -0,0 +1,17 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type int_least8_t -+! -+program main -+ type :: t -+ integer(1) :: x = -128 -+ integer(1) :: y = 127 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/fortran_main012.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/fortran_main012.f90 -new file mode 100755 -index 0000000..86fb06d ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/fortran_main012.f90 -@@ -0,0 +1,17 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type int_least16_t -+! -+program main -+ type :: t -+ integer(2) :: x = -32768 -+ integer(2) :: y = 32767 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/fortran_main013.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/fortran_main013.f90 -new file mode 100755 -index 0000000..a7ad109 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/fortran_main013.f90 -@@ -0,0 +1,17 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type int_least32_t -+! -+program main -+ type :: t -+ integer(4) :: x = -2147483647 -+ integer(4) :: y = 2147483647 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/fortran_main014.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/fortran_main014.f90 -new file mode 100755 -index 0000000..5e38bc1 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/fortran_main014.f90 -@@ -0,0 +1,17 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type int_least64_t -+! -+program main -+ type :: t -+ integer(8) :: x = -9223372036854775807 -+ integer(8) :: y = 9223372036854775807 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/fortran_main015.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/fortran_main015.f90 -new file mode 100755 -index 0000000..f4c1206 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/fortran_main015.f90 -@@ -0,0 +1,17 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type int_fast8_t -+! -+program main -+ type :: t -+ integer(1) :: x = -128 -+ integer(1) :: y = 127 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/fortran_main016.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/fortran_main016.f90 -new file mode 100755 -index 0000000..47b7225 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/fortran_main016.f90 -@@ -0,0 +1,17 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type int_fast16_t -+! -+program main -+ type :: t -+ integer(8) :: x = -32768 -+ integer(8) :: y = 32767 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/fortran_main017.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/fortran_main017.f90 -new file mode 100755 -index 0000000..ae54ebf ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/fortran_main017.f90 -@@ -0,0 +1,17 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type int_fast32_t -+! -+program main -+ type :: t -+ integer(8) :: x = -2147483647 -+ integer(8) :: y = 2147483647 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/fortran_main018.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/fortran_main018.f90 -new file mode 100755 -index 0000000..d483e87 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/fortran_main018.f90 -@@ -0,0 +1,17 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type int_fast64_t -+! -+program main -+ type :: t -+ integer(8) :: x = -9223372036854775807 -+ integer(8) :: y = 9223372036854775807 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/fortran_main019.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/fortran_main019.f90 -new file mode 100755 -index 0000000..87c0877 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/fortran_main019.f90 -@@ -0,0 +1,17 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type intmax_t -+! -+program main -+ type :: t -+ integer(8) :: x = -9223372036854775807 -+ integer(8) :: y = 9223372036854775807 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/fortran_main020.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/fortran_main020.f90 -new file mode 100755 -index 0000000..18d3b49 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/fortran_main020.f90 -@@ -0,0 +1,17 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type intptr_t -+! -+program main -+ type :: t -+ integer(8) :: x = -9223372036854775807 -+ integer(8) :: y = 9223372036854775807 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/fortran_main021.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/fortran_main021.f90 -new file mode 100755 -index 0000000..f28143e ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/fortran_main021.f90 -@@ -0,0 +1,17 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type float -+! -+program main -+ type :: t -+ real(4) :: x = 3.14 -+ real(4) :: y = 12345678.7654321 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/fortran_main022.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/fortran_main022.f90 -new file mode 100755 -index 0000000..cefa8f8 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/fortran_main022.f90 -@@ -0,0 +1,17 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type double -+! -+program main -+ type :: t -+ real(8) :: x = 3.14159265358979626 -+ real(8) :: y = 12345678.7654321 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/fortran_main023.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/fortran_main023.f90 -new file mode 100755 -index 0000000..ca88777 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/fortran_main023.f90 -@@ -0,0 +1,18 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type long double -+! -+program main -+ integer, parameter :: K = selected_real_kind(16) -+ type :: t -+ real(K) :: x = 3.14159265358979626 -+ real(K) :: y = 12345678.7654321 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/fortran_main024.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/fortran_main024.f90 -new file mode 100755 -index 0000000..bb08e74 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/fortran_main024.f90 -@@ -0,0 +1,17 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type float _Complex -+! -+program main -+ type :: t -+ complex(4) :: x = (-3, 1) -+ complex(4) :: y = (3, 1) -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/fortran_main025.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/fortran_main025.f90 -new file mode 100755 -index 0000000..a77c739 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/fortran_main025.f90 -@@ -0,0 +1,17 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type double _Complex -+! -+program main -+ type :: t -+ complex(8) :: x = (-3, 1) -+ complex(8) :: y = (3, 1) -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/fortran_main026.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/fortran_main026.f90 -new file mode 100755 -index 0000000..2cbf480 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/fortran_main026.f90 -@@ -0,0 +1,18 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type long double _Complex -+! -+program main -+ integer, parameter :: K = selected_real_kind(16) -+ type :: t -+ complex(K) :: x = (-3.1415926, 1.654) -+ complex(K) :: y = (3, 1) -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/fortran_main027.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/fortran_main027.f90 -new file mode 100755 -index 0000000..b4f71e1 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/fortran_main027.f90 -@@ -0,0 +1,17 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type bool -+! -+program main -+ type :: t -+ logical(1) :: x = .TRUE. -+ logical(1) :: y = .FALSE. -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/fortran_main028.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/fortran_main028.f90 -new file mode 100755 -index 0000000..b09c1f3 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/fortran_main028.f90 -@@ -0,0 +1,17 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type char -+! -+program main -+ type :: t -+ character(1) :: x = 'b' -+ character(1) :: y = 'c' -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/result.md b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/result.md -new file mode 100644 -index 0000000..5d05d3e ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/result.md -@@ -0,0 +1,29 @@ -+ | test | gfortran | flang | nvfortran| -+ | 001 | PASS | PASS | PASS | -+ | 002 | PASS | PASS | PASS | -+ | 003 | PASS | PASS | PASS | -+ | 004 | PASS | PASS | ERROR | -+ | 005 | PASS | PASS | PASS | -+ | 006 | PASS | PASS | ERROR | -+ | 007 | PASS | PASS | PASS | -+ | 008 | PASS | PASS | PASS | -+ | 009 | PASS | PASS | PASS | -+ | 010 | PASS | PASS | ERROR | -+ | 011 | PASS | PASS | PASS | -+ | 012 | PASS | PASS | PASS | -+ | 013 | PASS | PASS | PASS | -+ | 014 | PASS | PASS | ERROR | -+ | 015 | PASS | PASS | PASS | -+ | 016 | PASS | PASS | PASS | -+ | 017 | PASS | PASS | PASS | -+ | 018 | PASS | PASS | ERROR | -+ | 019 | PASS | PASS | ERROR | -+ | 020 | PASS | PASS | ERROR | -+ | 021 | PASS | PASS | PASS | -+ | 022 | PASS | PASS | PASS | -+ | 023 | PASS | PASS | ERROR | -+ | 024 | PASS | PASS | PASS | -+ | 025 | PASS | PASS | PASS | -+ | 026 | PASS | ERROR | ERROR | -+ | 027 | PASS | PASS | PASS | -+ | 028 | PASS | PASS | PASS | -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/run.sh b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/run.sh -new file mode 100644 -index 0000000..dbbd62f ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/003_fortran_call_c_struct/run.sh -@@ -0,0 +1,22 @@ -+for i in {001..028} -+do -+echo "------- test $i ------." -+echo "----- gfortran result:" -+gcc c_func$i.c -c -o c-test.o -+gfortran fortran_main$i.f90 -fno-range-check -c -o fortran-test.o -+gfortran c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+echo "----- flang-new result : " -+clang c_func$i.c -c -o c-test.o -+flang-new fortran_main$i.f90 -c -o fortran-test.o -+flang-new -flang-experimental-exec c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+echo "----- nvfortran result : " -+clang c_func$i.c -c -o c-test.o -+nvfortran fortran_main$i.f90 -c -o fortran-test.o -+nvfortran c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+done -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/c_func001.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/c_func001.c -new file mode 100755 -index 0000000..042849e ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/c_func001.c -@@ -0,0 +1,8 @@ -+#include -+struct Ty { -+ int x, y; -+}; -+void c_func_(struct Ty *t) { -+ printf("%d\t", t->x); -+ printf("%d\n", t->y); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/c_func002.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/c_func002.c -new file mode 100755 -index 0000000..ad72ffd ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/c_func002.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ short x, y; -+}; -+void c_func_(struct Ty *t) { -+ printf("%hd\t", t->x); -+ printf("%hd\n", t->y); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/c_func003.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/c_func003.c -new file mode 100755 -index 0000000..78540c0 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/c_func003.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ long x, y; -+}; -+void c_func_(struct Ty *t) { -+ printf("%ld\t", t->x); -+ printf("%ld\n", t->y); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/c_func004.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/c_func004.c -new file mode 100755 -index 0000000..83bc034 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/c_func004.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ long long x, y; -+}; -+void c_func_(struct Ty *t) { -+ printf("%lld\t", t->x); -+ printf("%lld\n", t->y); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/c_func005.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/c_func005.c -new file mode 100755 -index 0000000..f0ec8b1 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/c_func005.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ signed char x, y; -+}; -+void c_func_(struct Ty *t) { -+ printf("%c\t", t->x); -+ printf("%c\n", t->y); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/c_func006.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/c_func006.c -new file mode 100755 -index 0000000..a37766e ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/c_func006.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ size_t x, y; -+}; -+void c_func_(struct Ty *t) { -+ printf("%ld\t", t->x); -+ printf("%ld\n", t->y); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/c_func007.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/c_func007.c -new file mode 100755 -index 0000000..71c4460 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/c_func007.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ int8_t x, y; -+}; -+void c_func_(struct Ty *t) { -+ printf("%hhd\t", t->x); -+ printf("%hhd\n", t->y); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/c_func008.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/c_func008.c -new file mode 100755 -index 0000000..cc4c156 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/c_func008.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ int16_t x, y; -+}; -+void c_func_(struct Ty *t) { -+ printf("%hd\t", t->x); -+ printf("%hd\n", t->y); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/c_func009.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/c_func009.c -new file mode 100755 -index 0000000..81c3db1 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/c_func009.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ int32_t x, y; -+}; -+void c_func_(struct Ty *t) { -+ printf("%d\t", t->x); -+ printf("%d\n", t->y); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/c_func010.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/c_func010.c -new file mode 100755 -index 0000000..0d8b990 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/c_func010.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ int64_t x,y; -+}; -+void c_func_(struct Ty *t) { -+ printf("%ld\t", t->x); -+ printf("%ld\n", t->y); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/c_func011.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/c_func011.c -new file mode 100755 -index 0000000..9d65b2a ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/c_func011.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ int_least8_t x, y; -+}; -+void c_func_(struct Ty *t) { -+ printf("%hhd\t", t->x); -+ printf("%hhd\n", t->y); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/c_func012.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/c_func012.c -new file mode 100755 -index 0000000..e77ab58 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/c_func012.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ int_least16_t x, y; -+}; -+void c_func_(struct Ty *t) { -+ printf("%hd\t", t->x); -+ printf("%hd\n", t->y); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/c_func013.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/c_func013.c -new file mode 100755 -index 0000000..c37c94e ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/c_func013.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ int_least32_t x, y; -+}; -+void c_func_(struct Ty *t) { -+ printf("%d\t", t->x); -+ printf("%d\n", t->y); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/c_func014.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/c_func014.c -new file mode 100755 -index 0000000..6f8a5b4 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/c_func014.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ int_least64_t x, y; -+}; -+void c_func_(struct Ty *t) { -+ printf("%ld\t", t->x); -+ printf("%ld\n", t->y); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/c_func015.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/c_func015.c -new file mode 100755 -index 0000000..9308c5b ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/c_func015.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ int_fast8_t x, y; -+}; -+void c_func_(struct Ty *t) { -+ printf("%hhd\t", t->x); -+ printf("%hhd\n", t->y); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/c_func016.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/c_func016.c -new file mode 100755 -index 0000000..1bdc74a ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/c_func016.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ int_fast16_t x, y; -+}; -+void c_func_(struct Ty *t) { -+ printf("%ld\t", t->x); -+ printf("%ld\n", t->y); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/c_func017.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/c_func017.c -new file mode 100755 -index 0000000..017daeb ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/c_func017.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ int_fast32_t x, y; -+}; -+void c_func_(struct Ty *t) { -+ printf("%ld\t", t->x); -+ printf("%ld\n", t->y); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/c_func018.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/c_func018.c -new file mode 100755 -index 0000000..3ab58e9 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/c_func018.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ int_fast64_t x, y; -+}; -+void c_func_(struct Ty *t) { -+ printf("%ld\t", t->x); -+ printf("%ld\n", t->y); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/c_func019.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/c_func019.c -new file mode 100755 -index 0000000..9c68e8d ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/c_func019.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ intmax_t x, y; -+}; -+void c_func_(struct Ty *t) { -+ printf("%ld\t", t->x); -+ printf("%ld\n", t->y); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/c_func020.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/c_func020.c -new file mode 100755 -index 0000000..9c41124 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/c_func020.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ intptr_t x, y; -+}; -+void c_func_(struct Ty *t) { -+ printf("%ld\t", t->x); -+ printf("%ld\n", t->y); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/c_func021.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/c_func021.c -new file mode 100755 -index 0000000..33704de ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/c_func021.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ float x, y; -+}; -+void c_func_(struct Ty *t) { -+ printf("%f\t", t->x); -+ printf("%f\n", t->y); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/c_func022.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/c_func022.c -new file mode 100755 -index 0000000..e8beea1 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/c_func022.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ double x, y; -+}; -+void c_func_(struct Ty *t) { -+ printf("%0.20lf\t", t->x); -+ printf("%0.20lf\n", t->y); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/c_func023.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/c_func023.c -new file mode 100755 -index 0000000..a735b8d ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/c_func023.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ long double x, y; -+}; -+void c_func_(struct Ty *t) { -+ printf("%0.20Lf\t", t->x); -+ printf("%0.20Lf\n", t->y); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/c_func024.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/c_func024.c -new file mode 100755 -index 0000000..aff5eaf ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/c_func024.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ float _Complex x, y; -+}; -+void c_func_(struct Ty *t) { -+ printf("%f + %fi\n", creal(t->x), cimag(t->x)); -+ printf("%f + %fi\n", creal(t->y), cimag(t->y)); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/c_func025.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/c_func025.c -new file mode 100755 -index 0000000..cac2da2 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/c_func025.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ double _Complex x, y; -+}; -+void c_func_(struct Ty *t) { -+ printf("%lf + %lfi\n", creal(t->x), cimag(t->x)); -+ printf("%lf + %lfi\n", creal(t->y), cimag(t->y)); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/c_func026.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/c_func026.c -new file mode 100755 -index 0000000..886667b ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/c_func026.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ long double _Complex x, y; -+}; -+void c_func_(struct Ty *t) { -+ printf("%f + %fi\n", creal(t->x), cimag(t->x)); -+ printf("%f + %fi\n", creal(t->y), cimag(t->y)); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/c_func027.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/c_func027.c -new file mode 100755 -index 0000000..ef8ac27 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/c_func027.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ _Bool x, y; -+}; -+void c_func_(struct Ty *t) { -+ printf("%d\t", t->x); -+ printf("%d\n", t->y); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/c_func028.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/c_func028.c -new file mode 100755 -index 0000000..1b00b60 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/c_func028.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ char x, y; -+}; -+void c_func_(struct Ty *t) { -+ printf("%c\t", t->x); -+ printf("%c\n", t->y); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/fortran_main001.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/fortran_main001.f90 -new file mode 100755 -index 0000000..f8a10fd ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/fortran_main001.f90 -@@ -0,0 +1,17 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type int with bindc -+! -+program main -+ type, bind(c) :: t -+ integer :: x = -2147483647 -+ integer :: y = 2147483647 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) bind(c, name = "c_func_") -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/fortran_main002.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/fortran_main002.f90 -new file mode 100755 -index 0000000..b53b9e7 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/fortran_main002.f90 -@@ -0,0 +1,17 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type short with bindc -+! -+program main -+ type, bind(c) :: t -+ integer(2) :: x = -32768 -+ integer(2) :: y = 32767 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) bind(c, name = "c_func_") -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/fortran_main003.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/fortran_main003.f90 -new file mode 100755 -index 0000000..a3d7c1a ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/fortran_main003.f90 -@@ -0,0 +1,17 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type long with bindc -+! -+program main -+ type, bind(c) :: t -+ integer(8) :: x = -2147483647 -+ integer(8) :: y = 2147483647 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) bind(c, name = "c_func_") -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/fortran_main004.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/fortran_main004.f90 -new file mode 100755 -index 0000000..d10bb01 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/fortran_main004.f90 -@@ -0,0 +1,17 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type long long with bindc -+! -+program main -+ type, bind(c) :: t -+ integer(8) :: x = -9223372036854775807 -+ integer(8) :: y = 9223372036854775807 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) bind(c, name = "c_func_") -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/fortran_main005.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/fortran_main005.f90 -new file mode 100755 -index 0000000..6cabf1e ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/fortran_main005.f90 -@@ -0,0 +1,17 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type signed char with bindc -+! -+program main -+ type, bind(c) :: t -+ integer(1) :: x = 65 -+ integer(1) :: y = 66 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) bind(c, name = "c_func_") -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/fortran_main006.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/fortran_main006.f90 -new file mode 100755 -index 0000000..3887fa0 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/fortran_main006.f90 -@@ -0,0 +1,17 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type size_t with bindc -+! -+program main -+ type, bind(c) :: t -+ integer(8) :: x = 0 -+ integer(8) :: y = 9223372036854775807 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) bind(c, name = "c_func_") -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/fortran_main007.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/fortran_main007.f90 -new file mode 100755 -index 0000000..1d7951e ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/fortran_main007.f90 -@@ -0,0 +1,17 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type int8_t with bindc -+! -+program main -+ type, bind(c) :: t -+ integer(1) :: x = -128 -+ integer(1) :: y = 127 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) bind(c, name = "c_func_") -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/fortran_main008.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/fortran_main008.f90 -new file mode 100755 -index 0000000..6fc5715 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/fortran_main008.f90 -@@ -0,0 +1,17 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type int16_t with bindc -+! -+program main -+ type, bind(c) :: t -+ integer(2) :: x = -32768 -+ integer(2) :: y = 32767 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) bind(c, name = "c_func_") -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/fortran_main009.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/fortran_main009.f90 -new file mode 100755 -index 0000000..22b4634 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/fortran_main009.f90 -@@ -0,0 +1,17 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type int32_t with bindc -+! -+program main -+ type, bind(c) :: t -+ integer(4) :: x = -2147483647 -+ integer(4) :: y = 2147483647 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) bind(c, name = "c_func_") -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/fortran_main010.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/fortran_main010.f90 -new file mode 100755 -index 0000000..766fd46 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/fortran_main010.f90 -@@ -0,0 +1,17 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type int64_t with bindc -+! -+program main -+ type, bind(c) :: t -+ integer(8) :: x = -9223372036854775807 -+ integer(8) :: y = 9223372036854775807 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) bind(c, name = "c_func_") -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/fortran_main011.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/fortran_main011.f90 -new file mode 100755 -index 0000000..a7f9f0b ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/fortran_main011.f90 -@@ -0,0 +1,17 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type int_least8_t with bindc -+! -+program main -+ type, bind(c) :: t -+ integer(1) :: x = -128 -+ integer(1) :: y = 127 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) bind(c, name = "c_func_") -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/fortran_main012.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/fortran_main012.f90 -new file mode 100755 -index 0000000..b8499ac ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/fortran_main012.f90 -@@ -0,0 +1,17 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type int_least16_t with bindc -+! -+program main -+ type, bind(c) :: t -+ integer(2) :: x = -32768 -+ integer(2) :: y = 32767 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) bind(c, name = "c_func_") -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/fortran_main013.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/fortran_main013.f90 -new file mode 100755 -index 0000000..43e293e ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/fortran_main013.f90 -@@ -0,0 +1,17 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type int_least32_t with bindc -+! -+program main -+ type, bind(c) :: t -+ integer(4) :: x = -2147483647 -+ integer(4) :: y = 2147483647 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) bind(c, name = "c_func_") -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/fortran_main014.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/fortran_main014.f90 -new file mode 100755 -index 0000000..455ea93 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/fortran_main014.f90 -@@ -0,0 +1,17 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type int_least64_t with bindc -+! -+program main -+ type, bind(c) :: t -+ integer(8) :: x = -9223372036854775807 -+ integer(8) :: y = 9223372036854775807 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) bind(c, name = "c_func_") -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/fortran_main015.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/fortran_main015.f90 -new file mode 100755 -index 0000000..f66e589 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/fortran_main015.f90 -@@ -0,0 +1,17 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type int_fast8_t with bindc -+! -+program main -+ type, bind(c) :: t -+ integer(1) :: x = -128 -+ integer(1) :: y = 127 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) bind(c, name = "c_func_") -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/fortran_main016.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/fortran_main016.f90 -new file mode 100755 -index 0000000..3cb82eb ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/fortran_main016.f90 -@@ -0,0 +1,17 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type int_fast16_t with bindc -+! -+program main -+ type, bind(c) :: t -+ integer(8) :: x = -32768 -+ integer(8) :: y = 32767 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) bind(c, name = "c_func_") -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/fortran_main017.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/fortran_main017.f90 -new file mode 100755 -index 0000000..2a30b03 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/fortran_main017.f90 -@@ -0,0 +1,17 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type int_fast32_t with bindc -+! -+program main -+ type, bind(c) :: t -+ integer(8) :: x = -2147483647 -+ integer(8) :: y = 2147483647 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) bind(c, name = "c_func_") -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/fortran_main018.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/fortran_main018.f90 -new file mode 100755 -index 0000000..498f973 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/fortran_main018.f90 -@@ -0,0 +1,17 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type int_fast64_t with bindc -+! -+program main -+ type, bind(c) :: t -+ integer(8) :: x = -9223372036854775807 -+ integer(8) :: y = 9223372036854775807 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) bind(c, name = "c_func_") -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/fortran_main019.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/fortran_main019.f90 -new file mode 100755 -index 0000000..8bb8438 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/fortran_main019.f90 -@@ -0,0 +1,17 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type intmax_t with bindc -+! -+program main -+ type, bind(c) :: t -+ integer(8) :: x = -9223372036854775807 -+ integer(8) :: y = 9223372036854775807 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) bind(c, name = "c_func_") -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/fortran_main020.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/fortran_main020.f90 -new file mode 100755 -index 0000000..390252e ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/fortran_main020.f90 -@@ -0,0 +1,17 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type intptr_t with bindc -+! -+program main -+ type, bind(c) :: t -+ integer(8) :: x = -9223372036854775807 -+ integer(8) :: y = 9223372036854775807 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) bind(c, name = "c_func_") -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/fortran_main021.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/fortran_main021.f90 -new file mode 100755 -index 0000000..76280d0 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/fortran_main021.f90 -@@ -0,0 +1,17 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type float with bindc -+! -+program main -+ type, bind(c) :: t -+ real(4) :: x = 3.14 -+ real(4) :: y = 12345678.7654321 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) bind(c, name = "c_func_") -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/fortran_main022.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/fortran_main022.f90 -new file mode 100755 -index 0000000..7e9c07b ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/fortran_main022.f90 -@@ -0,0 +1,17 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type double with bindc -+! -+program main -+ type, bind(c) :: t -+ real(8) :: x = 3.14159265358979626 -+ real(8) :: y = 12345678.7654321 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) bind(c, name = "c_func_") -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/fortran_main023.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/fortran_main023.f90 -new file mode 100755 -index 0000000..9b11204 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/fortran_main023.f90 -@@ -0,0 +1,18 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type long double with bindc -+! -+program main -+ integer, parameter :: K = selected_real_kind(16) -+ type, bind(c) :: t -+ real(K) :: x = 3.14159265358979626 -+ real(K) :: y = 12345678.7654321 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) bind(c, name = "c_func_") -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/fortran_main024.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/fortran_main024.f90 -new file mode 100755 -index 0000000..07ba6e3 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/fortran_main024.f90 -@@ -0,0 +1,17 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type float _Complex with bindc -+! -+program main -+ type, bind(c) :: t -+ complex(4) :: x = (-3, 1) -+ complex(4) :: y = (3, 1) -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) bind(c, name = "c_func_") -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/fortran_main025.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/fortran_main025.f90 -new file mode 100755 -index 0000000..345db90 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/fortran_main025.f90 -@@ -0,0 +1,17 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type double _Complex with bindc -+! -+program main -+ type, bind(c) :: t -+ complex(8) :: x = (-3, 1) -+ complex(8) :: y = (3, 1) -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) bind(c, name = "c_func_") -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/fortran_main026.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/fortran_main026.f90 -new file mode 100755 -index 0000000..ddff0aa ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/fortran_main026.f90 -@@ -0,0 +1,18 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type long double _Complex with bindc -+! -+program main -+ integer, parameter :: K = selected_real_kind(16) -+ type, bind(c) :: t -+ complex(K) :: x = (-3.1415926, 1.654) -+ complex(K) :: y = (3, 1) -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) bind(c, name = "c_func_") -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/fortran_main027.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/fortran_main027.f90 -new file mode 100755 -index 0000000..d88a33b ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/fortran_main027.f90 -@@ -0,0 +1,17 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type bool with bindc -+! -+program main -+ type, bind(c) :: t -+ logical(1) :: x = .TRUE. -+ logical(1) :: y = .FALSE. -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) bind(c, name = "c_func_") -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/fortran_main028.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/fortran_main028.f90 -new file mode 100755 -index 0000000..a95ae9d ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/fortran_main028.f90 -@@ -0,0 +1,17 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type char with bindc -+! -+program main -+ type, bind(c) :: t -+ character(1) :: x = 'b' -+ character(1) :: y = 'c' -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) bind(c, name = "c_func_") -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/result.md b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/result.md -new file mode 100644 -index 0000000..5d05d3e ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/result.md -@@ -0,0 +1,29 @@ -+ | test | gfortran | flang | nvfortran| -+ | 001 | PASS | PASS | PASS | -+ | 002 | PASS | PASS | PASS | -+ | 003 | PASS | PASS | PASS | -+ | 004 | PASS | PASS | ERROR | -+ | 005 | PASS | PASS | PASS | -+ | 006 | PASS | PASS | ERROR | -+ | 007 | PASS | PASS | PASS | -+ | 008 | PASS | PASS | PASS | -+ | 009 | PASS | PASS | PASS | -+ | 010 | PASS | PASS | ERROR | -+ | 011 | PASS | PASS | PASS | -+ | 012 | PASS | PASS | PASS | -+ | 013 | PASS | PASS | PASS | -+ | 014 | PASS | PASS | ERROR | -+ | 015 | PASS | PASS | PASS | -+ | 016 | PASS | PASS | PASS | -+ | 017 | PASS | PASS | PASS | -+ | 018 | PASS | PASS | ERROR | -+ | 019 | PASS | PASS | ERROR | -+ | 020 | PASS | PASS | ERROR | -+ | 021 | PASS | PASS | PASS | -+ | 022 | PASS | PASS | PASS | -+ | 023 | PASS | PASS | ERROR | -+ | 024 | PASS | PASS | PASS | -+ | 025 | PASS | PASS | PASS | -+ | 026 | PASS | ERROR | ERROR | -+ | 027 | PASS | PASS | PASS | -+ | 028 | PASS | PASS | PASS | -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/run.sh b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/run.sh -new file mode 100644 -index 0000000..dbbd62f ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/004_fortran_call_c_struct_bindc/run.sh -@@ -0,0 +1,22 @@ -+for i in {001..028} -+do -+echo "------- test $i ------." -+echo "----- gfortran result:" -+gcc c_func$i.c -c -o c-test.o -+gfortran fortran_main$i.f90 -fno-range-check -c -o fortran-test.o -+gfortran c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+echo "----- flang-new result : " -+clang c_func$i.c -c -o c-test.o -+flang-new fortran_main$i.f90 -c -o fortran-test.o -+flang-new -flang-experimental-exec c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+echo "----- nvfortran result : " -+clang c_func$i.c -c -o c-test.o -+nvfortran fortran_main$i.f90 -c -o fortran-test.o -+nvfortran c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+done -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/c_func001.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/c_func001.c -new file mode 100755 -index 0000000..7a8788f ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/c_func001.c -@@ -0,0 +1,8 @@ -+#include -+struct Ty { -+ int x, y; -+}; -+void c_func_(struct Ty t) { -+ printf("%d\t", t.x); -+ printf("%d\n", t.y); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/c_func002.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/c_func002.c -new file mode 100755 -index 0000000..7cba7f9 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/c_func002.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ short x, y; -+}; -+void c_func_(struct Ty t) { -+ printf("%hd\t", t.x); -+ printf("%hd\n", t.y); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/c_func003.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/c_func003.c -new file mode 100755 -index 0000000..41cb86c ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/c_func003.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ long x, y; -+}; -+void c_func_(struct Ty t) { -+ printf("%ld\t", t.x); -+ printf("%ld\n", t.y); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/c_func004.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/c_func004.c -new file mode 100755 -index 0000000..6640290 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/c_func004.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ long long x, y; -+}; -+void c_func_(struct Ty t) { -+ printf("%lld\t", t.x); -+ printf("%lld\n", t.y); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/c_func005.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/c_func005.c -new file mode 100755 -index 0000000..d9a1ec5 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/c_func005.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ signed char x, y; -+}; -+void c_func_(struct Ty t) { -+ printf("%c\t", t.x); -+ printf("%c\n", t.y); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/c_func006.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/c_func006.c -new file mode 100755 -index 0000000..e0b93d1 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/c_func006.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ size_t x, y; -+}; -+void c_func_(struct Ty t) { -+ printf("%ld\t", t.x); -+ printf("%ld\n", t.y); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/c_func007.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/c_func007.c -new file mode 100755 -index 0000000..3b17b2a ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/c_func007.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ int8_t x, y; -+}; -+void c_func_(struct Ty t) { -+ printf("%hhd\t", t.x); -+ printf("%hhd\n", t.y); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/c_func008.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/c_func008.c -new file mode 100755 -index 0000000..08c7afe ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/c_func008.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ int16_t x, y; -+}; -+void c_func_(struct Ty t) { -+ printf("%hd\t", t.x); -+ printf("%hd\n", t.y); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/c_func009.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/c_func009.c -new file mode 100755 -index 0000000..5f3993b ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/c_func009.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ int32_t x, y; -+}; -+void c_func_(struct Ty t) { -+ printf("%d\t", t.x); -+ printf("%d\n", t.y); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/c_func010.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/c_func010.c -new file mode 100755 -index 0000000..3541573 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/c_func010.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ int64_t x,y; -+}; -+void c_func_(struct Ty t) { -+ printf("%ld\t", t.x); -+ printf("%ld\n", t.y); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/c_func011.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/c_func011.c -new file mode 100755 -index 0000000..6901a13 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/c_func011.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ int_least8_t x, y; -+}; -+void c_func_(struct Ty t) { -+ printf("%hhd\t", t.x); -+ printf("%hhd\n", t.y); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/c_func012.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/c_func012.c -new file mode 100755 -index 0000000..5dfb29d ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/c_func012.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ int_least16_t x, y; -+}; -+void c_func_(struct Ty t) { -+ printf("%hd\t", t.x); -+ printf("%hd\n", t.y); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/c_func013.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/c_func013.c -new file mode 100755 -index 0000000..cb167d2 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/c_func013.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ int_least32_t x, y; -+}; -+void c_func_(struct Ty t) { -+ printf("%d\t", t.x); -+ printf("%d\n", t.y); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/c_func014.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/c_func014.c -new file mode 100755 -index 0000000..ed52fea ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/c_func014.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ int_least64_t x, y; -+}; -+void c_func_(struct Ty t) { -+ printf("%ld\t", t.x); -+ printf("%ld\n", t.y); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/c_func015.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/c_func015.c -new file mode 100755 -index 0000000..160b6e2 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/c_func015.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ int_fast8_t x, y; -+}; -+void c_func_(struct Ty t) { -+ printf("%hhd\t", t.x); -+ printf("%hhd\n", t.y); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/c_func016.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/c_func016.c -new file mode 100755 -index 0000000..55557b7 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/c_func016.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ int_fast16_t x, y; -+}; -+void c_func_(struct Ty t) { -+ printf("%ld\t", t.x); -+ printf("%ld\n", t.y); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/c_func017.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/c_func017.c -new file mode 100755 -index 0000000..a684869 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/c_func017.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ int_fast32_t x, y; -+}; -+void c_func_(struct Ty t) { -+ printf("%ld\t", t.x); -+ printf("%ld\n", t.y); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/c_func018.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/c_func018.c -new file mode 100755 -index 0000000..c0a9a57 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/c_func018.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ int_fast64_t x, y; -+}; -+void c_func_(struct Ty t) { -+ printf("%ld\t", t.x); -+ printf("%ld\n", t.y); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/c_func019.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/c_func019.c -new file mode 100755 -index 0000000..e85eacc ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/c_func019.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ intmax_t x, y; -+}; -+void c_func_(struct Ty t) { -+ printf("%ld\t", t.x); -+ printf("%ld\n", t.y); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/c_func020.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/c_func020.c -new file mode 100755 -index 0000000..e4db45f ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/c_func020.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ intptr_t x, y; -+}; -+void c_func_(struct Ty t) { -+ printf("%ld\t", t.x); -+ printf("%ld\n", t.y); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/c_func021.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/c_func021.c -new file mode 100755 -index 0000000..8b9411f ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/c_func021.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ float x, y; -+}; -+void c_func_(struct Ty t) { -+ printf("%f\t", t.x); -+ printf("%f\n", t.y); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/c_func022.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/c_func022.c -new file mode 100755 -index 0000000..b9a6b7d ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/c_func022.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ double x, y; -+}; -+void c_func_(struct Ty t) { -+ printf("%0.20lf\t", t.x); -+ printf("%0.20lf\n", t.y); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/c_func023.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/c_func023.c -new file mode 100755 -index 0000000..f7e21ce ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/c_func023.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ long double x, y; -+}; -+void c_func_(struct Ty t) { -+ printf("%0.20Lf\t", t.x); -+ printf("%0.20Lf\n", t.y); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/c_func024.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/c_func024.c -new file mode 100755 -index 0000000..ea4e139 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/c_func024.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ float _Complex x, y; -+}; -+void c_func_(struct Ty t) { -+ printf("%f + %fi\n", creal(t.x), cimag(t.x)); -+ printf("%f + %fi\n", creal(t.y), cimag(t.y)); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/c_func025.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/c_func025.c -new file mode 100755 -index 0000000..763db48 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/c_func025.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ double _Complex x, y; -+}; -+void c_func_(struct Ty t) { -+ printf("%lf + %lfi\n", creal(t.x), cimag(t.x)); -+ printf("%lf + %lfi\n", creal(t.y), cimag(t.y)); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/c_func026.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/c_func026.c -new file mode 100755 -index 0000000..04022b0 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/c_func026.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ long double _Complex x, y; -+}; -+void c_func_(struct Ty t) { -+ printf("%f + %fi\n", creal(t.x), cimag(t.x)); -+ printf("%f + %fi\n", creal(t.y), cimag(t.y)); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/c_func027.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/c_func027.c -new file mode 100755 -index 0000000..fada375 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/c_func027.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ _Bool x, y; -+}; -+void c_func_(struct Ty t) { -+ printf("%d\t", t.x); -+ printf("%d\n", t.y); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/c_func028.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/c_func028.c -new file mode 100755 -index 0000000..eb28312 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/c_func028.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ char x, y; -+}; -+void c_func_(struct Ty t) { -+ printf("%c\t", t.x); -+ printf("%c\n", t.y); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/fortran_main001.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/fortran_main001.f90 -new file mode 100755 -index 0000000..b7c763c ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/fortran_main001.f90 -@@ -0,0 +1,17 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type int with value attribute -+! -+program main -+ type :: t -+ integer :: x = -2147483647 -+ integer :: y = 2147483647 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ import :: t -+ type(t), value :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/fortran_main002.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/fortran_main002.f90 -new file mode 100755 -index 0000000..0131d2a ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/fortran_main002.f90 -@@ -0,0 +1,17 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type short with value attribute -+! -+program main -+ type :: t -+ integer(2) :: x = -32768 -+ integer(2) :: y = 32767 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ import :: t -+ type(t), value :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/fortran_main003.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/fortran_main003.f90 -new file mode 100755 -index 0000000..1307540 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/fortran_main003.f90 -@@ -0,0 +1,17 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type long with value attribute -+! -+program main -+ type :: t -+ integer(8) :: x = -2147483647 -+ integer(8) :: y = 2147483647 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ import :: t -+ type(t), value :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/fortran_main004.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/fortran_main004.f90 -new file mode 100755 -index 0000000..42cd2b2 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/fortran_main004.f90 -@@ -0,0 +1,17 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type long long with value attribute -+! -+program main -+ type :: t -+ integer(8) :: x = -9223372036854775807 -+ integer(8) :: y = 9223372036854775807 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ import :: t -+ type(t), value :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/fortran_main005.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/fortran_main005.f90 -new file mode 100755 -index 0000000..1127bd7 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/fortran_main005.f90 -@@ -0,0 +1,17 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type signed char with value attribute -+! -+program main -+ type :: t -+ integer(1) :: x = 65 -+ integer(1) :: y = 66 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ import :: t -+ type(t), value :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/fortran_main006.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/fortran_main006.f90 -new file mode 100755 -index 0000000..8480c92 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/fortran_main006.f90 -@@ -0,0 +1,17 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type size_t with value attribute -+! -+program main -+ type :: t -+ integer(8) :: x = 0 -+ integer(8) :: y = 9223372036854775807 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ import :: t -+ type(t), value :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/fortran_main007.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/fortran_main007.f90 -new file mode 100755 -index 0000000..b0c1278 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/fortran_main007.f90 -@@ -0,0 +1,17 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type int8_t with value attribute -+! -+program main -+ type :: t -+ integer(1) :: x = -128 -+ integer(1) :: y = 127 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ import :: t -+ type(t), value :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/fortran_main008.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/fortran_main008.f90 -new file mode 100755 -index 0000000..081b48c ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/fortran_main008.f90 -@@ -0,0 +1,17 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type int16_t with value attribute -+! -+program main -+ type :: t -+ integer(2) :: x = -32768 -+ integer(2) :: y = 32767 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ import :: t -+ type(t), value :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/fortran_main009.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/fortran_main009.f90 -new file mode 100755 -index 0000000..7943885 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/fortran_main009.f90 -@@ -0,0 +1,17 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type int32_t with value attribute -+! -+program main -+ type :: t -+ integer(4) :: x = -2147483647 -+ integer(4) :: y = 2147483647 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ import :: t -+ type(t), value :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/fortran_main010.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/fortran_main010.f90 -new file mode 100755 -index 0000000..0941f1c ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/fortran_main010.f90 -@@ -0,0 +1,17 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type int64_t with value attribute -+! -+program main -+ type :: t -+ integer(8) :: x = -9223372036854775807 -+ integer(8) :: y = 9223372036854775807 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ import :: t -+ type(t), value :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/fortran_main011.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/fortran_main011.f90 -new file mode 100755 -index 0000000..40d02f1 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/fortran_main011.f90 -@@ -0,0 +1,17 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type int_least8_t with value attribute -+! -+program main -+ type :: t -+ integer(1) :: x = -128 -+ integer(1) :: y = 127 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ import :: t -+ type(t), value :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/fortran_main012.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/fortran_main012.f90 -new file mode 100755 -index 0000000..7c3ea58 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/fortran_main012.f90 -@@ -0,0 +1,17 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type int_least16_t with value attribute -+! -+program main -+ type :: t -+ integer(2) :: x = -32768 -+ integer(2) :: y = 32767 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ import :: t -+ type(t), value :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/fortran_main013.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/fortran_main013.f90 -new file mode 100755 -index 0000000..ae7a853 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/fortran_main013.f90 -@@ -0,0 +1,17 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type int_least32_t with value attribute -+! -+program main -+ type :: t -+ integer(4) :: x = -2147483647 -+ integer(4) :: y = 2147483647 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ import :: t -+ type(t), value :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/fortran_main014.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/fortran_main014.f90 -new file mode 100755 -index 0000000..8a6068a ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/fortran_main014.f90 -@@ -0,0 +1,17 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type int_least64_t with value attribute -+! -+program main -+ type :: t -+ integer(8) :: x = -9223372036854775807 -+ integer(8) :: y = 9223372036854775807 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ import :: t -+ type(t), value :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/fortran_main015.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/fortran_main015.f90 -new file mode 100755 -index 0000000..b34abd9 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/fortran_main015.f90 -@@ -0,0 +1,17 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type int_fast8_t with value attribute -+! -+program main -+ type :: t -+ integer(1) :: x = -128 -+ integer(1) :: y = 127 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ import :: t -+ type(t), value :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/fortran_main016.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/fortran_main016.f90 -new file mode 100755 -index 0000000..eabd0a7 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/fortran_main016.f90 -@@ -0,0 +1,17 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type int_fast16_t with value attribute -+! -+program main -+ type :: t -+ integer(8) :: x = -32768 -+ integer(8) :: y = 32767 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ import :: t -+ type(t), value :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/fortran_main017.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/fortran_main017.f90 -new file mode 100755 -index 0000000..6575a1d ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/fortran_main017.f90 -@@ -0,0 +1,17 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type int_fast32_t with value attribute -+! -+program main -+ type :: t -+ integer(8) :: x = -2147483647 -+ integer(8) :: y = 2147483647 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ import :: t -+ type(t), value :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/fortran_main018.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/fortran_main018.f90 -new file mode 100755 -index 0000000..df9c321 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/fortran_main018.f90 -@@ -0,0 +1,17 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type int_fast64_t with value attribute -+! -+program main -+ type :: t -+ integer(8) :: x = -9223372036854775807 -+ integer(8) :: y = 9223372036854775807 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ import :: t -+ type(t), value :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/fortran_main019.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/fortran_main019.f90 -new file mode 100755 -index 0000000..3f766e2 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/fortran_main019.f90 -@@ -0,0 +1,17 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type intmax_t with value attribute -+! -+program main -+ type :: t -+ integer(8) :: x = -9223372036854775807 -+ integer(8) :: y = 9223372036854775807 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ import :: t -+ type(t), value :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/fortran_main020.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/fortran_main020.f90 -new file mode 100755 -index 0000000..37bd9f2 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/fortran_main020.f90 -@@ -0,0 +1,17 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type intptr_t with value attribute -+! -+program main -+ type :: t -+ integer(8) :: x = -9223372036854775807 -+ integer(8) :: y = 9223372036854775807 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ import :: t -+ type(t), value :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/fortran_main021.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/fortran_main021.f90 -new file mode 100755 -index 0000000..b71e819 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/fortran_main021.f90 -@@ -0,0 +1,17 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type float with value attribute -+! -+program main -+ type :: t -+ real(4) :: x = 3.14 -+ real(4) :: y = 12345678.7654321 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ import :: t -+ type(t), value :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/fortran_main022.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/fortran_main022.f90 -new file mode 100755 -index 0000000..94d0458 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/fortran_main022.f90 -@@ -0,0 +1,17 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type double with value attribute -+! -+program main -+ type :: t -+ real(8) :: x = 3.14159265358979626 -+ real(8) :: y = 12345678.7654321 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ import :: t -+ type(t), value :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/fortran_main023.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/fortran_main023.f90 -new file mode 100755 -index 0000000..ef25d3a ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/fortran_main023.f90 -@@ -0,0 +1,18 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type long double with value attribute -+! -+program main -+ integer, parameter :: K = selected_real_kind(16) -+ type :: t -+ real(K) :: x = 3.14159265358979626 -+ real(K) :: y = 12345678.7654321 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ import :: t -+ type(t), value :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/fortran_main024.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/fortran_main024.f90 -new file mode 100755 -index 0000000..047c181 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/fortran_main024.f90 -@@ -0,0 +1,17 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type float _Complex with value attribute -+! -+program main -+ type :: t -+ complex(4) :: x = (-3, 1) -+ complex(4) :: y = (3, 1) -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ import :: t -+ type(t), value :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/fortran_main025.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/fortran_main025.f90 -new file mode 100755 -index 0000000..af39334 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/fortran_main025.f90 -@@ -0,0 +1,17 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type double _Complex with value attribute -+! -+program main -+ type :: t -+ complex(8) :: x = (-3, 1) -+ complex(8) :: y = (3, 1) -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ import :: t -+ type(t), value :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/fortran_main026.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/fortran_main026.f90 -new file mode 100755 -index 0000000..95e1d73 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/fortran_main026.f90 -@@ -0,0 +1,19 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type long double _Complex with value -+! attribute -+! -+program main -+ integer, parameter :: K = selected_real_kind(16) -+ type :: t -+ complex(K) :: x = (-3.1415926, 1.654) -+ complex(K) :: y = (3, 1) -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ import :: t -+ type(t), value :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/fortran_main027.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/fortran_main027.f90 -new file mode 100755 -index 0000000..a68f152 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/fortran_main027.f90 -@@ -0,0 +1,17 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type bool with value attribute -+! -+program main -+ type :: t -+ logical(1) :: x = .TRUE. -+ logical(1) :: y = .FALSE. -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ import :: t -+ type(t), value :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/fortran_main028.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/fortran_main028.f90 -new file mode 100755 -index 0000000..0492231 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/fortran_main028.f90 -@@ -0,0 +1,17 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type char with value attribute -+! -+program main -+ type :: t -+ character(1) :: x = 'b' -+ character(1) :: y = 'c' -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ import :: t -+ type(t), value :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/result.md b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/result.md -new file mode 100644 -index 0000000..c92d729 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/result.md -@@ -0,0 +1,30 @@ -+ | test | gfortran | flang | nvfortran| -+ | 001 | PASS | ERROR | PASS | -+ | 002 | PASS | ERROR | PASS | -+ | 003 | PASS | ERROR | PASS | -+ | 004 | PASS | ERROR | ERROR | -+ | 005 | PASS | ERROR | PASS | -+ | 006 | PASS | ERROR | ERROR | -+ | 007 | PASS | ERROR | PASS | -+ | 008 | PASS | ERROR | PASS | -+ | 009 | PASS | ERROR | PASS | -+ | 010 | PASS | ERROR | ERROR | -+ | 011 | PASS | ERROR | PASS | -+ | 012 | PASS | ERROR | PASS | -+ | 013 | PASS | ERROR | PASS | -+ | 014 | PASS | ERROR | ERROR | -+ | 015 | PASS | ERROR | PASS | -+ | 016 | PASS | ERROR | PASS | -+ | 017 | PASS | ERROR | PASS | -+ | 018 | PASS | ERROR | ERROR | -+ | 019 | PASS | ERROR | ERROR | -+ | 020 | PASS | ERROR | ERROR | -+ | 021 | PASS | ERROR | PASS | -+ | 022 | PASS | ERROR | PASS | -+ | 023 | PASS | PASS | ERROR | -+ | 024 | PASS | ERROR | PASS | -+ | 025 | PASS | PASS | PASS | -+ | 026 | PASS | ERROR | ERROR | -+ | 027 | PASS | ERROR | PASS | -+ | 028 | PASS | ERROR | ERROR | -+ ! except 028, the others because kind K or 9223372036854775807 -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/run.sh b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/run.sh -new file mode 100644 -index 0000000..dbbd62f ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/005_fortran_call_c_struct_value/run.sh -@@ -0,0 +1,22 @@ -+for i in {001..028} -+do -+echo "------- test $i ------." -+echo "----- gfortran result:" -+gcc c_func$i.c -c -o c-test.o -+gfortran fortran_main$i.f90 -fno-range-check -c -o fortran-test.o -+gfortran c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+echo "----- flang-new result : " -+clang c_func$i.c -c -o c-test.o -+flang-new fortran_main$i.f90 -c -o fortran-test.o -+flang-new -flang-experimental-exec c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+echo "----- nvfortran result : " -+clang c_func$i.c -c -o c-test.o -+nvfortran fortran_main$i.f90 -c -o fortran-test.o -+nvfortran c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+done -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/c_func001.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/c_func001.c -new file mode 100755 -index 0000000..7a8788f ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/c_func001.c -@@ -0,0 +1,8 @@ -+#include -+struct Ty { -+ int x, y; -+}; -+void c_func_(struct Ty t) { -+ printf("%d\t", t.x); -+ printf("%d\n", t.y); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/c_func002.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/c_func002.c -new file mode 100755 -index 0000000..7cba7f9 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/c_func002.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ short x, y; -+}; -+void c_func_(struct Ty t) { -+ printf("%hd\t", t.x); -+ printf("%hd\n", t.y); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/c_func003.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/c_func003.c -new file mode 100755 -index 0000000..41cb86c ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/c_func003.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ long x, y; -+}; -+void c_func_(struct Ty t) { -+ printf("%ld\t", t.x); -+ printf("%ld\n", t.y); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/c_func004.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/c_func004.c -new file mode 100755 -index 0000000..6640290 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/c_func004.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ long long x, y; -+}; -+void c_func_(struct Ty t) { -+ printf("%lld\t", t.x); -+ printf("%lld\n", t.y); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/c_func005.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/c_func005.c -new file mode 100755 -index 0000000..d9a1ec5 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/c_func005.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ signed char x, y; -+}; -+void c_func_(struct Ty t) { -+ printf("%c\t", t.x); -+ printf("%c\n", t.y); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/c_func006.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/c_func006.c -new file mode 100755 -index 0000000..e0b93d1 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/c_func006.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ size_t x, y; -+}; -+void c_func_(struct Ty t) { -+ printf("%ld\t", t.x); -+ printf("%ld\n", t.y); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/c_func007.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/c_func007.c -new file mode 100755 -index 0000000..3b17b2a ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/c_func007.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ int8_t x, y; -+}; -+void c_func_(struct Ty t) { -+ printf("%hhd\t", t.x); -+ printf("%hhd\n", t.y); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/c_func008.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/c_func008.c -new file mode 100755 -index 0000000..08c7afe ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/c_func008.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ int16_t x, y; -+}; -+void c_func_(struct Ty t) { -+ printf("%hd\t", t.x); -+ printf("%hd\n", t.y); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/c_func009.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/c_func009.c -new file mode 100755 -index 0000000..5f3993b ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/c_func009.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ int32_t x, y; -+}; -+void c_func_(struct Ty t) { -+ printf("%d\t", t.x); -+ printf("%d\n", t.y); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/c_func010.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/c_func010.c -new file mode 100755 -index 0000000..3541573 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/c_func010.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ int64_t x,y; -+}; -+void c_func_(struct Ty t) { -+ printf("%ld\t", t.x); -+ printf("%ld\n", t.y); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/c_func011.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/c_func011.c -new file mode 100755 -index 0000000..6901a13 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/c_func011.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ int_least8_t x, y; -+}; -+void c_func_(struct Ty t) { -+ printf("%hhd\t", t.x); -+ printf("%hhd\n", t.y); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/c_func012.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/c_func012.c -new file mode 100755 -index 0000000..5dfb29d ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/c_func012.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ int_least16_t x, y; -+}; -+void c_func_(struct Ty t) { -+ printf("%hd\t", t.x); -+ printf("%hd\n", t.y); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/c_func013.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/c_func013.c -new file mode 100755 -index 0000000..cb167d2 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/c_func013.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ int_least32_t x, y; -+}; -+void c_func_(struct Ty t) { -+ printf("%d\t", t.x); -+ printf("%d\n", t.y); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/c_func014.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/c_func014.c -new file mode 100755 -index 0000000..ed52fea ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/c_func014.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ int_least64_t x, y; -+}; -+void c_func_(struct Ty t) { -+ printf("%ld\t", t.x); -+ printf("%ld\n", t.y); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/c_func015.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/c_func015.c -new file mode 100755 -index 0000000..160b6e2 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/c_func015.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ int_fast8_t x, y; -+}; -+void c_func_(struct Ty t) { -+ printf("%hhd\t", t.x); -+ printf("%hhd\n", t.y); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/c_func016.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/c_func016.c -new file mode 100755 -index 0000000..55557b7 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/c_func016.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ int_fast16_t x, y; -+}; -+void c_func_(struct Ty t) { -+ printf("%ld\t", t.x); -+ printf("%ld\n", t.y); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/c_func017.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/c_func017.c -new file mode 100755 -index 0000000..a684869 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/c_func017.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ int_fast32_t x, y; -+}; -+void c_func_(struct Ty t) { -+ printf("%ld\t", t.x); -+ printf("%ld\n", t.y); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/c_func018.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/c_func018.c -new file mode 100755 -index 0000000..c0a9a57 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/c_func018.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ int_fast64_t x, y; -+}; -+void c_func_(struct Ty t) { -+ printf("%ld\t", t.x); -+ printf("%ld\n", t.y); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/c_func019.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/c_func019.c -new file mode 100755 -index 0000000..e85eacc ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/c_func019.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ intmax_t x, y; -+}; -+void c_func_(struct Ty t) { -+ printf("%ld\t", t.x); -+ printf("%ld\n", t.y); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/c_func020.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/c_func020.c -new file mode 100755 -index 0000000..e4db45f ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/c_func020.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ intptr_t x, y; -+}; -+void c_func_(struct Ty t) { -+ printf("%ld\t", t.x); -+ printf("%ld\n", t.y); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/c_func021.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/c_func021.c -new file mode 100755 -index 0000000..8b9411f ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/c_func021.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ float x, y; -+}; -+void c_func_(struct Ty t) { -+ printf("%f\t", t.x); -+ printf("%f\n", t.y); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/c_func022.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/c_func022.c -new file mode 100755 -index 0000000..b9a6b7d ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/c_func022.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ double x, y; -+}; -+void c_func_(struct Ty t) { -+ printf("%0.20lf\t", t.x); -+ printf("%0.20lf\n", t.y); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/c_func023.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/c_func023.c -new file mode 100755 -index 0000000..f7e21ce ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/c_func023.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ long double x, y; -+}; -+void c_func_(struct Ty t) { -+ printf("%0.20Lf\t", t.x); -+ printf("%0.20Lf\n", t.y); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/c_func024.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/c_func024.c -new file mode 100755 -index 0000000..ea4e139 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/c_func024.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ float _Complex x, y; -+}; -+void c_func_(struct Ty t) { -+ printf("%f + %fi\n", creal(t.x), cimag(t.x)); -+ printf("%f + %fi\n", creal(t.y), cimag(t.y)); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/c_func025.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/c_func025.c -new file mode 100755 -index 0000000..763db48 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/c_func025.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ double _Complex x, y; -+}; -+void c_func_(struct Ty t) { -+ printf("%lf + %lfi\n", creal(t.x), cimag(t.x)); -+ printf("%lf + %lfi\n", creal(t.y), cimag(t.y)); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/c_func026.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/c_func026.c -new file mode 100755 -index 0000000..04022b0 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/c_func026.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ long double _Complex x, y; -+}; -+void c_func_(struct Ty t) { -+ printf("%f + %fi\n", creal(t.x), cimag(t.x)); -+ printf("%f + %fi\n", creal(t.y), cimag(t.y)); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/c_func027.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/c_func027.c -new file mode 100755 -index 0000000..fada375 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/c_func027.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ _Bool x, y; -+}; -+void c_func_(struct Ty t) { -+ printf("%d\t", t.x); -+ printf("%d\n", t.y); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/c_func028.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/c_func028.c -new file mode 100755 -index 0000000..eb28312 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/c_func028.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ char x, y; -+}; -+void c_func_(struct Ty t) { -+ printf("%c\t", t.x); -+ printf("%c\n", t.y); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/fortran_main001.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/fortran_main001.f90 -new file mode 100755 -index 0000000..59e2790 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/fortran_main001.f90 -@@ -0,0 +1,17 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type int with value attribute and bindc -+! -+program main -+ type, bind(c) :: t -+ integer :: x = -2147483647 -+ integer :: y = 2147483647 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) bind(c, name = "c_func_") -+ import :: t -+ type(t), value :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/fortran_main002.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/fortran_main002.f90 -new file mode 100755 -index 0000000..5be6f1a ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/fortran_main002.f90 -@@ -0,0 +1,17 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type short with value attribute and bindc -+! -+program main -+ type, bind(c) :: t -+ integer(2) :: x = -32768 -+ integer(2) :: y = 32767 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) bind(c, name = "c_func_") -+ import :: t -+ type(t), value :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/fortran_main003.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/fortran_main003.f90 -new file mode 100755 -index 0000000..8fbfe15 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/fortran_main003.f90 -@@ -0,0 +1,17 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type long with value attribute and bindc -+! -+program main -+ type, bind(c) :: t -+ integer(8) :: x = -2147483647 -+ integer(8) :: y = 2147483647 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) bind(c, name = "c_func_") -+ import :: t -+ type(t), value :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/fortran_main004.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/fortran_main004.f90 -new file mode 100755 -index 0000000..92fbb6c ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/fortran_main004.f90 -@@ -0,0 +1,18 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type long long with value attribute and -+! bindc -+! -+program main -+ type, bind(c) :: t -+ integer(8) :: x = -9223372036854775807 -+ integer(8) :: y = 9223372036854775807 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) bind(c, name = "c_func_") -+ import :: t -+ type(t), value :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/fortran_main005.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/fortran_main005.f90 -new file mode 100755 -index 0000000..1f4a323 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/fortran_main005.f90 -@@ -0,0 +1,18 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type signed char with value attribute and -+! bindc -+! -+program main -+ type, bind(c) :: t -+ integer(1) :: x = 65 -+ integer(1) :: y = 66 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) bind(c, name = "c_func_") -+ import :: t -+ type(t), value :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/fortran_main006.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/fortran_main006.f90 -new file mode 100755 -index 0000000..ffbf545 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/fortran_main006.f90 -@@ -0,0 +1,17 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type size_t with value attribute and bindc -+! -+program main -+ type, bind(c) :: t -+ integer(8) :: x = 0 -+ integer(8) :: y = 9223372036854775807 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) bind(c, name = "c_func_") -+ import :: t -+ type(t), value :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/fortran_main007.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/fortran_main007.f90 -new file mode 100755 -index 0000000..ecfa7d4 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/fortran_main007.f90 -@@ -0,0 +1,17 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type int8_t with value attribute and bindc -+! -+program main -+ type, bind(c) :: t -+ integer(1) :: x = -128 -+ integer(1) :: y = 127 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) bind(c, name = "c_func_") -+ import :: t -+ type(t), value :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/fortran_main008.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/fortran_main008.f90 -new file mode 100755 -index 0000000..7d6ba7a ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/fortran_main008.f90 -@@ -0,0 +1,17 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type int16_t with value attribute and bindc -+! -+program main -+ type, bind(c) :: t -+ integer(2) :: x = -32768 -+ integer(2) :: y = 32767 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) bind(c, name = "c_func_") -+ import :: t -+ type(t), value :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/fortran_main009.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/fortran_main009.f90 -new file mode 100755 -index 0000000..02373ac ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/fortran_main009.f90 -@@ -0,0 +1,17 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type int32_t with value attribute and bindc -+! -+program main -+ type, bind(c) :: t -+ integer(4) :: x = -2147483647 -+ integer(4) :: y = 2147483647 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) bind(c, name = "c_func_") -+ import :: t -+ type(t), value :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/fortran_main010.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/fortran_main010.f90 -new file mode 100755 -index 0000000..45b0048 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/fortran_main010.f90 -@@ -0,0 +1,17 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type int64_t with value attribute and bindc -+! -+program main -+ type, bind(c) :: t -+ integer(8) :: x = -9223372036854775807 -+ integer(8) :: y = 9223372036854775807 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) bind(c, name = "c_func_") -+ import :: t -+ type(t), value :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/fortran_main011.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/fortran_main011.f90 -new file mode 100755 -index 0000000..2d66252 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/fortran_main011.f90 -@@ -0,0 +1,18 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type int_least8_t with value attribute and -+! bindc -+! -+program main -+ type, bind(c) :: t -+ integer(1) :: x = -128 -+ integer(1) :: y = 127 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) bind(c, name = "c_func_") -+ import :: t -+ type(t), value :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/fortran_main012.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/fortran_main012.f90 -new file mode 100755 -index 0000000..43813de ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/fortran_main012.f90 -@@ -0,0 +1,18 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type int_least16_t with value attribute and -+! bindc -+! -+program main -+ type, bind(c) :: t -+ integer(2) :: x = -32768 -+ integer(2) :: y = 32767 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) bind(c, name = "c_func_") -+ import :: t -+ type(t), value :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/fortran_main013.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/fortran_main013.f90 -new file mode 100755 -index 0000000..7be34fc ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/fortran_main013.f90 -@@ -0,0 +1,18 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type int_least32_t with value attribute and -+! bindc -+! -+program main -+ type, bind(c) :: t -+ integer(4) :: x = -2147483647 -+ integer(4) :: y = 2147483647 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) bind(c, name = "c_func_") -+ import :: t -+ type(t), value :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/fortran_main014.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/fortran_main014.f90 -new file mode 100755 -index 0000000..a131900 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/fortran_main014.f90 -@@ -0,0 +1,18 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type int_least64_t with value attribute and -+! bindc -+! -+program main -+ type, bind(c) :: t -+ integer(8) :: x = -9223372036854775807 -+ integer(8) :: y = 9223372036854775807 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) bind(c, name = "c_func_") -+ import :: t -+ type(t), value :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/fortran_main015.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/fortran_main015.f90 -new file mode 100755 -index 0000000..f818e3f ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/fortran_main015.f90 -@@ -0,0 +1,18 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type int_fast8_t with value attribute and -+! bindc -+! -+program main -+ type, bind(c) :: t -+ integer(1) :: x = -128 -+ integer(1) :: y = 127 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) bind(c, name = "c_func_") -+ import :: t -+ type(t), value :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/fortran_main016.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/fortran_main016.f90 -new file mode 100755 -index 0000000..dc10b7a ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/fortran_main016.f90 -@@ -0,0 +1,18 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type int_fast16_t with value attribute and -+! bindc -+! -+program main -+ type, bind(c) :: t -+ integer(8) :: x = -32768 -+ integer(8) :: y = 32767 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) bind(c, name = "c_func_") -+ import :: t -+ type(t), value :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/fortran_main017.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/fortran_main017.f90 -new file mode 100755 -index 0000000..b179389 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/fortran_main017.f90 -@@ -0,0 +1,18 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type int_fast32_t with value attribute and -+! bindc -+! -+program main -+ type, bind(c) :: t -+ integer(8) :: x = -2147483647 -+ integer(8) :: y = 2147483647 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) bind(c, name = "c_func_") -+ import :: t -+ type(t), value :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/fortran_main018.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/fortran_main018.f90 -new file mode 100755 -index 0000000..dce7a9b ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/fortran_main018.f90 -@@ -0,0 +1,18 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type int_fast64_t with value attribute and -+! bindc -+! -+program main -+ type, bind(c) :: t -+ integer(8) :: x = -9223372036854775807 -+ integer(8) :: y = 9223372036854775807 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) bind(c, name = "c_func_") -+ import :: t -+ type(t), value :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/fortran_main019.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/fortran_main019.f90 -new file mode 100755 -index 0000000..5112bc5 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/fortran_main019.f90 -@@ -0,0 +1,18 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type intmax_t with value attribute and -+! bindc -+! -+program main -+ type, bind(c) :: t -+ integer(8) :: x = -9223372036854775807 -+ integer(8) :: y = 9223372036854775807 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) bind(c, name = "c_func_") -+ import :: t -+ type(t), value :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/fortran_main020.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/fortran_main020.f90 -new file mode 100755 -index 0000000..f2fdf25 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/fortran_main020.f90 -@@ -0,0 +1,18 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type intptr_t with value attribute and -+! bindc -+! -+program main -+ type, bind(c) :: t -+ integer(8) :: x = -9223372036854775807 -+ integer(8) :: y = 9223372036854775807 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) bind(c, name = "c_func_") -+ import :: t -+ type(t), value :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/fortran_main021.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/fortran_main021.f90 -new file mode 100755 -index 0000000..e0032c4 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/fortran_main021.f90 -@@ -0,0 +1,17 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type float with value attribute and bindc -+! -+program main -+ type, bind(c) :: t -+ real(4) :: x = 3.14 -+ real(4) :: y = 12345678.7654321 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) bind(c, name = "c_func_") -+ import :: t -+ type(t), value :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/fortran_main022.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/fortran_main022.f90 -new file mode 100755 -index 0000000..3d4e7d6 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/fortran_main022.f90 -@@ -0,0 +1,17 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type double with value attribute and bindc -+! -+program main -+ type, bind(c) :: t -+ real(8) :: x = 3.14159265358979626 -+ real(8) :: y = 12345678.7654321 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) bind(c, name = "c_func_") -+ import :: t -+ type(t), value :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/fortran_main023.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/fortran_main023.f90 -new file mode 100755 -index 0000000..bb2e0ac ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/fortran_main023.f90 -@@ -0,0 +1,19 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type long double with value attribute and -+! bindc -+! -+program main -+ integer, parameter :: K = selected_real_kind(16) -+ type, bind(c) :: t -+ real(K) :: x = 3.14159265358979626 -+ real(K) :: y = 12345678.7654321 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) bind(c, name = "c_func_") -+ import :: t -+ type(t), value :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/fortran_main024.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/fortran_main024.f90 -new file mode 100755 -index 0000000..9060ca6 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/fortran_main024.f90 -@@ -0,0 +1,18 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type float _Complex with value attribute -+! and bindc -+! -+program main -+ type, bind(c) :: t -+ complex(4) :: x = (-3, 1) -+ complex(4) :: y = (3, 1) -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) bind(c, name = "c_func_") -+ import :: t -+ type(t), value :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/fortran_main025.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/fortran_main025.f90 -new file mode 100755 -index 0000000..7601a57 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/fortran_main025.f90 -@@ -0,0 +1,18 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type double _Complex with value attribute -+! and bindc -+! -+program main -+ type, bind(c) :: t -+ complex(8) :: x = (-3, 1) -+ complex(8) :: y = (3, 1) -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) bind(c, name = "c_func_") -+ import :: t -+ type(t), value :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/fortran_main026.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/fortran_main026.f90 -new file mode 100755 -index 0000000..11a7d6c ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/fortran_main026.f90 -@@ -0,0 +1,19 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type long double _Complex with value -+! attribute and bindc -+! -+program main -+ integer, parameter :: K = selected_real_kind(16) -+ type, bind(c) :: t -+ complex(K) :: x = (-3.1415926, 1.654) -+ complex(K) :: y = (3, 1) -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) bind(c, name = "c_func_") -+ import :: t -+ type(t), value :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/fortran_main027.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/fortran_main027.f90 -new file mode 100755 -index 0000000..886ec57 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/fortran_main027.f90 -@@ -0,0 +1,17 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type bool with value attribute and bindc -+! -+program main -+ type, bind(c) :: t -+ logical(1) :: x = .TRUE. -+ logical(1) :: y = .FALSE. -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) bind(c, name = "c_func_") -+ import :: t -+ type(t), value :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/fortran_main028.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/fortran_main028.f90 -new file mode 100755 -index 0000000..6462bbf ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/fortran_main028.f90 -@@ -0,0 +1,17 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is scalar of type char with value attribute and bindc -+! -+program main -+ type, bind(c) :: t -+ character(1) :: x = 'b' -+ character(1) :: y = 'c' -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) bind(c, name = "c_func_") -+ import :: t -+ type(t), value :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/result.md b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/result.md -new file mode 100644 -index 0000000..a35d72b ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/result.md -@@ -0,0 +1,30 @@ -+ | test | gfortran | flang | nvfortran| -+ | 001 | PASS | ERROR | PASS | -+ | 002 | PASS | ERROR | PASS | -+ | 003 | PASS | ERROR | PASS | -+ | 004 | PASS | ERROR | ERROR | -+ | 005 | PASS | ERROR | PASS | -+ | 006 | PASS | ERROR | ERROR | -+ | 007 | PASS | ERROR | PASS | -+ | 008 | PASS | ERROR | PASS | -+ | 009 | PASS | ERROR | PASS | -+ | 010 | PASS | ERROR | ERROR | -+ | 011 | PASS | ERROR | PASS | -+ | 012 | PASS | ERROR | PASS | -+ | 013 | PASS | ERROR | PASS | -+ | 014 | PASS | ERROR | ERROR | -+ | 015 | PASS | ERROR | PASS | -+ | 016 | PASS | ERROR | PASS | -+ | 017 | PASS | ERROR | PASS | -+ | 018 | PASS | ERROR | ERROR | -+ | 019 | PASS | ERROR | ERROR | -+ | 020 | PASS | ERROR | ERROR | -+ | 021 | PASS | ERROR | PASS | -+ | 022 | PASS | ERROR | PASS | -+ | 023 | PASS | PASS | ERROR | -+ | 024 | PASS | ERROR | PASS | -+ | 025 | PASS | PASS | PASS | -+ | 026 | PASS | ERROR | ERROR | -+ | 027 | PASS | ERROR | PASS | -+ | 028 | PASS | ERROR | ERROR | -+! except 028, the others because kind K or 9223372036854775807 -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/run.sh b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/run.sh -new file mode 100644 -index 0000000..dbbd62f ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/006_fortran_call_c_struct_value_bindc/run.sh -@@ -0,0 +1,22 @@ -+for i in {001..028} -+do -+echo "------- test $i ------." -+echo "----- gfortran result:" -+gcc c_func$i.c -c -o c-test.o -+gfortran fortran_main$i.f90 -fno-range-check -c -o fortran-test.o -+gfortran c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+echo "----- flang-new result : " -+clang c_func$i.c -c -o c-test.o -+flang-new fortran_main$i.f90 -c -o fortran-test.o -+flang-new -flang-experimental-exec c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+echo "----- nvfortran result : " -+clang c_func$i.c -c -o c-test.o -+nvfortran fortran_main$i.f90 -c -o fortran-test.o -+nvfortran c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+done -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/c_func001.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/c_func001.c -new file mode 100644 -index 0000000..6535dd7 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/c_func001.c -@@ -0,0 +1,10 @@ -+#include -+struct BaseTy { -+ int j; -+}; -+struct Ty { -+ struct BaseTy bt; -+}; -+void c_func_(struct Ty *t) { -+ printf("%d\n", t->bt.j); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/c_func002.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/c_func002.c -new file mode 100644 -index 0000000..e9bb160 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/c_func002.c -@@ -0,0 +1,10 @@ -+#include -+struct BaseTy { -+ short j; -+}; -+struct Ty { -+ struct BaseTy bt; -+}; -+void c_func_(struct Ty *t) { -+ printf("%hd\n", t->bt.j); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/c_func003.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/c_func003.c -new file mode 100644 -index 0000000..99c95b0 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/c_func003.c -@@ -0,0 +1,10 @@ -+#include -+struct BaseTy { -+ long j; -+}; -+struct Ty { -+ struct BaseTy bt; -+}; -+void c_func_(struct Ty *t) { -+ printf("%ld\n", t->bt.j); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/c_func004.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/c_func004.c -new file mode 100644 -index 0000000..69a1176 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/c_func004.c -@@ -0,0 +1,10 @@ -+#include -+struct BaseTy { -+ long long j; -+}; -+struct Ty { -+ struct BaseTy bt; -+}; -+void c_func_(struct Ty *t) { -+ printf("%lld\n", t->bt.j); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/c_func005.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/c_func005.c -new file mode 100644 -index 0000000..d5e28b1 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/c_func005.c -@@ -0,0 +1,10 @@ -+#include -+struct BaseTy { -+ signed char j; -+}; -+struct Ty { -+ struct BaseTy bt; -+}; -+void c_func_(struct Ty *t) { -+ printf("%c\n", t->bt.j); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/c_func006.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/c_func006.c -new file mode 100644 -index 0000000..542ddbc ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/c_func006.c -@@ -0,0 +1,10 @@ -+#include -+struct BaseTy { -+ size_t j; -+}; -+struct Ty { -+ struct BaseTy bt; -+}; -+void c_func_(struct Ty *t) { -+ printf("%ld\n", t->bt.j); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/c_func007.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/c_func007.c -new file mode 100644 -index 0000000..71ceb1c ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/c_func007.c -@@ -0,0 +1,11 @@ -+#include -+#include -+struct BaseTy { -+ int8_t j; -+}; -+struct Ty { -+ struct BaseTy bt; -+}; -+void c_func_(struct Ty *t) { -+ printf("%hhd\n", t->bt.j); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/c_func008.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/c_func008.c -new file mode 100644 -index 0000000..b6489b2 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/c_func008.c -@@ -0,0 +1,11 @@ -+#include -+#include -+struct BaseTy { -+ int16_t j; -+}; -+struct Ty { -+ struct BaseTy bt; -+}; -+void c_func_(struct Ty *t) { -+ printf("%hd\n", t->bt.j); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/c_func009.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/c_func009.c -new file mode 100644 -index 0000000..7ba6646 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/c_func009.c -@@ -0,0 +1,11 @@ -+#include -+#include -+struct BaseTy { -+ int32_t j; -+}; -+struct Ty { -+ struct BaseTy bt; -+}; -+void c_func_(struct Ty *t) { -+ printf("%d\n", t->bt.j); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/c_func010.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/c_func010.c -new file mode 100644 -index 0000000..672e95b ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/c_func010.c -@@ -0,0 +1,11 @@ -+#include -+#include -+struct BaseTy { -+ int64_t j; -+}; -+struct Ty { -+ struct BaseTy bt; -+}; -+void c_func_(struct Ty *t) { -+ printf("%ld\n", t->bt.j); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/c_func011.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/c_func011.c -new file mode 100644 -index 0000000..802995a ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/c_func011.c -@@ -0,0 +1,11 @@ -+#include -+#include -+struct BaseTy { -+ int_least8_t j; -+}; -+struct Ty { -+ struct BaseTy bt; -+}; -+void c_func_(struct Ty *t) { -+ printf("%hhd\n", t->bt.j); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/c_func012.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/c_func012.c -new file mode 100644 -index 0000000..bcc8dbd ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/c_func012.c -@@ -0,0 +1,11 @@ -+#include -+#include -+struct BaseTy { -+ int_least16_t j; -+}; -+struct Ty { -+ struct BaseTy bt; -+}; -+void c_func_(struct Ty *t) { -+ printf("%hd\n", t->bt.j); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/c_func013.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/c_func013.c -new file mode 100644 -index 0000000..4688138 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/c_func013.c -@@ -0,0 +1,11 @@ -+#include -+#include -+struct BaseTy { -+ int_least32_t j; -+}; -+struct Ty { -+ struct BaseTy bt; -+}; -+void c_func_(struct Ty *t) { -+ printf("%d\n", t->bt.j); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/c_func014.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/c_func014.c -new file mode 100644 -index 0000000..1c30ccc ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/c_func014.c -@@ -0,0 +1,11 @@ -+#include -+#include -+struct BaseTy { -+ int_least64_t j; -+}; -+struct Ty { -+ struct BaseTy bt; -+}; -+void c_func_(struct Ty *t) { -+ printf("%ld\n", t->bt.j); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/c_func015.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/c_func015.c -new file mode 100644 -index 0000000..0d3e522 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/c_func015.c -@@ -0,0 +1,11 @@ -+#include -+#include -+struct BaseTy { -+ int_fast8_t j; -+}; -+struct Ty { -+ struct BaseTy bt; -+}; -+void c_func_(struct Ty *t) { -+ printf("%hhd\n", t->bt.j); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/c_func016.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/c_func016.c -new file mode 100644 -index 0000000..e98a73b ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/c_func016.c -@@ -0,0 +1,11 @@ -+#include -+#include -+struct BaseTy { -+ int_fast16_t j; -+}; -+struct Ty { -+ struct BaseTy bt; -+}; -+void c_func_(struct Ty *t) { -+ printf("%ld\n", t->bt.j); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/c_func017.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/c_func017.c -new file mode 100644 -index 0000000..ef890d5 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/c_func017.c -@@ -0,0 +1,11 @@ -+#include -+#include -+struct BaseTy { -+ int_fast32_t j; -+}; -+struct Ty { -+ struct BaseTy bt; -+}; -+void c_func_(struct Ty *t) { -+ printf("%ld\n", t->bt.j); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/c_func018.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/c_func018.c -new file mode 100644 -index 0000000..4eb17aa ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/c_func018.c -@@ -0,0 +1,11 @@ -+#include -+#include -+struct BaseTy { -+ int_fast64_t j; -+}; -+struct Ty { -+ struct BaseTy bt; -+}; -+void c_func_(struct Ty *t) { -+ printf("%ld\n", t->bt.j); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/c_func019.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/c_func019.c -new file mode 100644 -index 0000000..e88ed31 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/c_func019.c -@@ -0,0 +1,11 @@ -+#include -+#include -+struct BaseTy { -+ intmax_t j; -+}; -+struct Ty { -+ struct BaseTy bt; -+}; -+void c_func_(struct Ty *t) { -+ printf("%ld\n", t->bt.j); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/c_func020.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/c_func020.c -new file mode 100644 -index 0000000..8a50887 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/c_func020.c -@@ -0,0 +1,11 @@ -+#include -+#include -+struct BaseTy { -+ intptr_t j; -+}; -+struct Ty { -+ struct BaseTy bt; -+}; -+void c_func_(struct Ty *t) { -+ printf("%ld\n", t->bt.j); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/c_func021.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/c_func021.c -new file mode 100644 -index 0000000..c8f6dac ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/c_func021.c -@@ -0,0 +1,10 @@ -+#include -+struct BaseTy { -+ float j; -+}; -+struct Ty { -+ struct BaseTy bt; -+}; -+void c_func_(struct Ty *t) { -+ printf("%.2f\n", t->bt.j); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/c_func022.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/c_func022.c -new file mode 100644 -index 0000000..72ce135 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/c_func022.c -@@ -0,0 +1,10 @@ -+#include -+struct BaseTy { -+ double j; -+}; -+struct Ty { -+ struct BaseTy bt; -+}; -+void c_func_(struct Ty *t) { -+ printf("%.2f\n", t->bt.j); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/c_func023.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/c_func023.c -new file mode 100644 -index 0000000..b3f0db5 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/c_func023.c -@@ -0,0 +1,10 @@ -+#include -+struct BaseTy { -+ long double j; -+}; -+struct Ty { -+ struct BaseTy bt; -+}; -+void c_func_(struct Ty *t) { -+ printf("%.2Lf\n", t->bt.j); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/c_func024.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/c_func024.c -new file mode 100644 -index 0000000..315c5c4 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/c_func024.c -@@ -0,0 +1,11 @@ -+#include -+#include -+struct BaseTy { -+ float _Complex j; -+}; -+struct Ty { -+ struct BaseTy bt; -+}; -+void c_func_(struct Ty *t) { -+ printf("%f + %fi\n", creal(t->bt.j), cimag(t->bt.j)); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/c_func025.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/c_func025.c -new file mode 100644 -index 0000000..4bfcf58 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/c_func025.c -@@ -0,0 +1,11 @@ -+#include -+#include -+struct BaseTy { -+ double _Complex j; -+}; -+struct Ty { -+ struct BaseTy bt; -+}; -+void c_func_(struct Ty *t) { -+ printf("%.20lf + %.20lfi\n", creal(t->bt.j), cimag(t->bt.j)); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/c_func026.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/c_func026.c -new file mode 100644 -index 0000000..40b4a7b ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/c_func026.c -@@ -0,0 +1,11 @@ -+#include -+#include -+struct BaseTy { -+ long double _Complex j; -+}; -+struct Ty { -+ struct BaseTy bt; -+}; -+void c_func_(struct Ty *t) { -+ printf("%f + %fi\n", creal(t->bt.j), cimag(t->bt.j)); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/c_func027.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/c_func027.c -new file mode 100644 -index 0000000..5614736 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/c_func027.c -@@ -0,0 +1,10 @@ -+#include -+struct BaseTy { -+ _Bool j; -+}; -+struct Ty { -+ struct BaseTy bt; -+}; -+void c_func_(struct Ty *t, _Bool *a) { -+ printf("%d\n", t->bt.j); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/c_func028.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/c_func028.c -new file mode 100644 -index 0000000..82233e7 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/c_func028.c -@@ -0,0 +1,11 @@ -+#include -+#include -+struct BaseTy { -+ char j; -+}; -+struct Ty { -+ struct BaseTy bt; -+}; -+void c_func_(struct Ty *t) { -+ printf("%c\n", t->bt.j); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/fortran_main001.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/fortran_main001.f90 -new file mode 100644 -index 0000000..a87b80c ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/fortran_main001.f90 -@@ -0,0 +1,20 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is derived type the other component of derived type is -+! scalar type of int -+! -+program main -+ type, bind(c) :: base -+ integer :: j = -2 -+ end type base -+ type, bind(c) :: t -+ type(base) :: bt -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/fortran_main002.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/fortran_main002.f90 -new file mode 100644 -index 0000000..eba5ed5 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/fortran_main002.f90 -@@ -0,0 +1,20 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is derived type the other component of derived type is -+! scalar type of short -+! -+program main -+ type, bind(c) :: base -+ integer(2) :: j = -2 -+ end type base -+ type, bind(c) :: t -+ type(base) :: bt -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/fortran_main003.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/fortran_main003.f90 -new file mode 100644 -index 0000000..73a5bcf ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/fortran_main003.f90 -@@ -0,0 +1,20 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is derived type the other component of derived type is -+! scalar type of long -+! -+program main -+ type, bind(c) :: base -+ integer(8) :: j = -2 -+ end type base -+ type, bind(c) :: t -+ type(base) :: bt -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/fortran_main004.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/fortran_main004.f90 -new file mode 100644 -index 0000000..55a915f ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/fortran_main004.f90 -@@ -0,0 +1,20 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is derived type the other component of derived type is -+! scalar type of long long -+! -+program main -+ type, bind(c) :: base -+ integer(8) :: j = -2 -+ end type base -+ type, bind(c) :: t -+ type(base) :: bt -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/fortran_main005.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/fortran_main005.f90 -new file mode 100644 -index 0000000..2531e8c ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/fortran_main005.f90 -@@ -0,0 +1,20 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is derived type the other component of derived type is -+! scalar type of signed char -+! -+program main -+ type, bind(c) :: base -+ integer(1) :: j = 65 -+ end type base -+ type, bind(c) :: t -+ type(base) :: bt -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/fortran_main006.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/fortran_main006.f90 -new file mode 100644 -index 0000000..c9ae956 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/fortran_main006.f90 -@@ -0,0 +1,20 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is derived type the other component of derived type is -+! scalar type of size_t -+! -+program main -+ type, bind(c) :: base -+ integer(8) :: j = 0 -+ end type base -+ type, bind(c) :: t -+ type(base) :: bt -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/fortran_main007.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/fortran_main007.f90 -new file mode 100644 -index 0000000..c864163 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/fortran_main007.f90 -@@ -0,0 +1,20 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is derived type the other component of derived type is -+! scalar type of int8_t -+! -+program main -+ type, bind(c) :: base -+ integer(1) :: j = -2 -+ end type base -+ type, bind(c) :: t -+ type(base) :: bt -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/fortran_main008.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/fortran_main008.f90 -new file mode 100644 -index 0000000..4adf5fe ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/fortran_main008.f90 -@@ -0,0 +1,20 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is derived type the other component of derived type is -+! scalar type of int16_t -+! -+program main -+ type, bind(c) :: base -+ integer(2) :: j = -2 -+ end type base -+ type, bind(c) :: t -+ type(base) :: bt -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/fortran_main009.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/fortran_main009.f90 -new file mode 100644 -index 0000000..57b4035 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/fortran_main009.f90 -@@ -0,0 +1,20 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is derived type the other component of derived type is -+! scalar type of int32_t -+! -+program main -+ type, bind(c) :: base -+ integer(4) :: j = -2 -+ end type base -+ type, bind(c) :: t -+ type(base) :: bt -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/fortran_main010.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/fortran_main010.f90 -new file mode 100644 -index 0000000..0183cad ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/fortran_main010.f90 -@@ -0,0 +1,20 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is derived type the other component of derived type is -+! scalar type of int64_t -+! -+program main -+ type, bind(c) :: base -+ integer(8) :: j = -2 -+ end type base -+ type, bind(c) :: t -+ type(base) :: bt -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/fortran_main011.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/fortran_main011.f90 -new file mode 100644 -index 0000000..7b5942f ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/fortran_main011.f90 -@@ -0,0 +1,20 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is derived type the other component of derived type is -+! scalar type of int_least_8 -+! -+program main -+ type, bind(c) :: base -+ integer(1) :: j = -2 -+ end type base -+ type, bind(c) :: t -+ type(base) :: bt -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/fortran_main012.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/fortran_main012.f90 -new file mode 100644 -index 0000000..44c8378 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/fortran_main012.f90 -@@ -0,0 +1,20 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is derived type the other component of derived type is -+! scalar type of int_least16_t -+! -+program main -+ type, bind(c) :: base -+ integer(2) :: j = -2 -+ end type base -+ type, bind(c) :: t -+ type(base) :: bt -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/fortran_main013.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/fortran_main013.f90 -new file mode 100644 -index 0000000..f3e8018 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/fortran_main013.f90 -@@ -0,0 +1,20 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is derived type the other component of derived type is -+! scalar type of int_least32_t -+! -+program main -+ type, bind(c) :: base -+ integer(4) :: j = -2 -+ end type base -+ type, bind(c) :: t -+ type(base) :: bt -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/fortran_main014.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/fortran_main014.f90 -new file mode 100644 -index 0000000..143d75e ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/fortran_main014.f90 -@@ -0,0 +1,20 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is derived type the other component of derived type is -+! scalar type of int_least64_t -+! -+program main -+ type, bind(c) :: base -+ integer(8) :: j = -2 -+ end type base -+ type, bind(c) :: t -+ type(base) :: bt -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/fortran_main015.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/fortran_main015.f90 -new file mode 100644 -index 0000000..ded38dd ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/fortran_main015.f90 -@@ -0,0 +1,20 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is derived type the other component of derived type is -+! scalar type of int_fast8_t -+! -+program main -+ type, bind(c) :: base -+ integer(1) :: j = -2 -+ end type base -+ type, bind(c) :: t -+ type(base) :: bt -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/fortran_main016.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/fortran_main016.f90 -new file mode 100644 -index 0000000..79d6f7f ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/fortran_main016.f90 -@@ -0,0 +1,20 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is derived type the other component of derived type is -+! scalar type of int_fast16_t -+! -+program main -+ type, bind(c) :: base -+ integer(8) :: j = -2 -+ end type base -+ type, bind(c) :: t -+ type(base) :: bt -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/fortran_main017.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/fortran_main017.f90 -new file mode 100644 -index 0000000..b48cc58 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/fortran_main017.f90 -@@ -0,0 +1,20 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is derived type the other component of derived type is -+! scalar type of int_fast32_t -+! -+program main -+ type, bind(c) :: base -+ integer(8) :: j = -2 -+ end type base -+ type, bind(c) :: t -+ type(base) :: bt -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/fortran_main018.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/fortran_main018.f90 -new file mode 100644 -index 0000000..82878b7 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/fortran_main018.f90 -@@ -0,0 +1,20 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is derived type the other component of derived type is -+! scalar type of int_fast64_t -+! -+program main -+ type, bind(c) :: base -+ integer(8) :: j = -2 -+ end type base -+ type, bind(c) :: t -+ type(base) :: bt -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/fortran_main019.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/fortran_main019.f90 -new file mode 100644 -index 0000000..b60089f ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/fortran_main019.f90 -@@ -0,0 +1,20 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is derived type the other component of derived type is -+! scalar type of intmax_t -+! -+program main -+ type, bind(c) :: base -+ integer(8) :: j = -2 -+ end type base -+ type, bind(c) :: t -+ type(base) :: bt -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/fortran_main020.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/fortran_main020.f90 -new file mode 100644 -index 0000000..277b313 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/fortran_main020.f90 -@@ -0,0 +1,20 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is derived type the other component of derived type is -+! scalar type of intptr_t -+! -+program main -+ type, bind(c) :: base -+ integer(8) :: j = -2 -+ end type base -+ type, bind(c) :: t -+ type(base) :: bt -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/fortran_main021.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/fortran_main021.f90 -new file mode 100644 -index 0000000..a191c0d ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/fortran_main021.f90 -@@ -0,0 +1,20 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is derived type the other component of derived type is -+! scalar type of float -+! -+program main -+ type, bind(c) :: base -+ real(4) :: j = -2.36 -+ end type base -+ type, bind(c) :: t -+ type(base) :: bt -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/fortran_main022.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/fortran_main022.f90 -new file mode 100644 -index 0000000..e8df525 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/fortran_main022.f90 -@@ -0,0 +1,20 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is derived type the other component of derived type is -+! scalar type of float -+! -+program main -+ type, bind(c) :: base -+ real(8) :: j = -2.36 -+ end type base -+ type, bind(c) :: t -+ type(base) :: bt -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/fortran_main023.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/fortran_main023.f90 -new file mode 100644 -index 0000000..90e2060 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/fortran_main023.f90 -@@ -0,0 +1,21 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is derived type the other component of derived type is -+! scalar type of long double -+! -+program main -+ integer, parameter :: K = selected_real_kind(16) -+ type, bind(c) :: base -+ real(K) :: j = -2.36 -+ end type base -+ type, bind(c) :: t -+ type(base) :: bt -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/fortran_main024.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/fortran_main024.f90 -new file mode 100644 -index 0000000..a5a051a ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/fortran_main024.f90 -@@ -0,0 +1,21 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is derived type the other component of derived type is -+! scalar type of float _Complex -+! -+program main -+ type, bind(c) :: base -+ complex(4) :: j = (1, 2); -+ end type base -+ type, bind(c) :: t -+ type(base) :: bt -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ use iso_c_binding -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/fortran_main025.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/fortran_main025.f90 -new file mode 100644 -index 0000000..be78fcc ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/fortran_main025.f90 -@@ -0,0 +1,21 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is derived type the other component of derived type is -+! scalar type of double _Complex -+! -+program main -+ type, bind(c) :: base -+ complex(8) :: j = (1, 2); -+ end type base -+ type, bind(c) :: t -+ type(base) :: bt -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ use iso_c_binding -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/fortran_main026.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/fortran_main026.f90 -new file mode 100644 -index 0000000..6d7c710 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/fortran_main026.f90 -@@ -0,0 +1,22 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is derived type the other component of derived type is -+! scalar type of long double _Complex -+! -+program main -+ integer, parameter :: K = selected_real_kind(16) -+ type, bind(c) :: base -+ complex(K) :: j = (1, 2); -+ end type base -+ type, bind(c) :: t -+ type(base) :: bt -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ use iso_c_binding -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/fortran_main027.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/fortran_main027.f90 -new file mode 100644 -index 0000000..ed52db7 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/fortran_main027.f90 -@@ -0,0 +1,20 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is derived type the other component of derived type is -+! scalar type of _Bool -+! -+program main -+ type, bind(c) :: base -+ logical(1) :: j = .TRUE. -+ end type base -+ type, bind(c) :: t -+ type(base) :: bt -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/fortran_main028.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/fortran_main028.f90 -new file mode 100644 -index 0000000..7bd346a ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/fortran_main028.f90 -@@ -0,0 +1,20 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is derived type the other component of derived type is -+! scalar type of char -+! -+program main -+ type, bind(c) :: base -+ character(1) :: j = 'a' -+ end type base -+ type, bind(c) :: t -+ type(base) :: bt -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/result.md b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/result.md -new file mode 100644 -index 0000000..810e8d4 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/result.md -@@ -0,0 +1,29 @@ -+ | test | gfortran | flang | nvfortran| -+ | 001 | PASS | PASS | PASS | -+ | 002 | PASS | PASS | PASS | -+ | 003 | PASS | PASS | PASS | -+ | 004 | PASS | PASS | PASS | -+ | 005 | PASS | PASS | PASS | -+ | 006 | PASS | PASS | PASS | -+ | 007 | PASS | PASS | PASS | -+ | 008 | PASS | PASS | PASS | -+ | 009 | PASS | PASS | PASS | -+ | 010 | PASS | PASS | PASS | -+ | 011 | PASS | PASS | PASS | -+ | 012 | PASS | PASS | PASS | -+ | 013 | PASS | PASS | PASS | -+ | 014 | PASS | PASS | PASS | -+ | 015 | PASS | PASS | PASS | -+ | 016 | PASS | PASS | PASS | -+ | 017 | PASS | PASS | PASS | -+ | 018 | PASS | PASS | PASS | -+ | 019 | PASS | PASS | PASS | -+ | 020 | PASS | PASS | PASS | -+ | 021 | PASS | PASS | PASS | -+ | 022 | PASS | PASS | PASS | -+ | 023 | PASS | PASS | ERROR | -+ | 024 | PASS | PASS | PASS | -+ | 025 | PASS | PASS | PASS | -+ | 026 | PASS | ERROR | ERROR | -+ | 027 | PASS | PASS | PASS | -+ | 028 | PASS | PASS | PASS | -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/run.sh b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/run.sh -new file mode 100644 -index 0000000..dbbd62f ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/007_fortran_call_c_nested_struct_simple/run.sh -@@ -0,0 +1,22 @@ -+for i in {001..028} -+do -+echo "------- test $i ------." -+echo "----- gfortran result:" -+gcc c_func$i.c -c -o c-test.o -+gfortran fortran_main$i.f90 -fno-range-check -c -o fortran-test.o -+gfortran c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+echo "----- flang-new result : " -+clang c_func$i.c -c -o c-test.o -+flang-new fortran_main$i.f90 -c -o fortran-test.o -+flang-new -flang-experimental-exec c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+echo "----- nvfortran result : " -+clang c_func$i.c -c -o c-test.o -+nvfortran fortran_main$i.f90 -c -o fortran-test.o -+nvfortran c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+done -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/008_fortran_call_c_nested_struct_complicated/c_func001.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/008_fortran_call_c_nested_struct_complicated/c_func001.c -new file mode 100644 -index 0000000..111e43b ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/008_fortran_call_c_nested_struct_complicated/c_func001.c -@@ -0,0 +1,16 @@ -+#include -+struct BaseTy { -+ int j; -+}; -+struct Ty { -+ struct BaseTy bt; -+ int n[4]; -+}; -+void c_func_(struct Ty *t) { -+ printf("%d\n", t->bt.j); -+ printf("%d\n", t->n[0]); -+ printf("%d\n", t->n[0]+t->bt.j); -+ printf("%d\n", t->n[1]); -+ printf("%d\n", t->n[2]); -+ printf("%d\n", t->n[3]); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/008_fortran_call_c_nested_struct_complicated/c_func002.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/008_fortran_call_c_nested_struct_complicated/c_func002.c -new file mode 100644 -index 0000000..c1df231 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/008_fortran_call_c_nested_struct_complicated/c_func002.c -@@ -0,0 +1,22 @@ -+#include -+struct BaseTy { -+ int j; -+}; -+struct Ty { -+ struct BaseTy bt; -+ int n[4]; -+}; -+void c_func_(struct Ty *t) { -+ printf("%d\n", t[0].bt.j); -+ printf("%d\n", t[0].n[0]); -+ printf("%d\n", t[0].n[0]+t->bt.j); -+ printf("%d\n", t[0].n[1]); -+ printf("%d\n", t[0].n[2]); -+ printf("%d\n", t[0].n[3]); -+ printf("%d\n", t[1].bt.j); -+ printf("%d\n", t[1].n[0]); -+ printf("%d\n", t[1].n[0]+t->bt.j); -+ printf("%d\n", t[1].n[1]); -+ printf("%d\n", t[1].n[2]); -+ printf("%d\n", t[1].n[3]); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/008_fortran_call_c_nested_struct_complicated/c_func003.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/008_fortran_call_c_nested_struct_complicated/c_func003.c -new file mode 100644 -index 0000000..8d0298b ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/008_fortran_call_c_nested_struct_complicated/c_func003.c -@@ -0,0 +1,23 @@ -+#include -+struct BaseTy { -+ int j; -+}; -+struct Ty1 { -+ struct BaseTy bt; -+ int k; -+}; -+struct Ty { -+ struct BaseTy bt; -+ struct Ty1 yt; -+ int n[4]; -+}; -+void c_func_(struct Ty *t) { -+ printf("%d\n", t->bt.j); -+ printf("%d\n", t->n[0]); -+ printf("%d\n", t->n[0]+t->bt.j); -+ printf("%d\n", t->n[1]); -+ printf("%d\n", t->n[2]); -+ printf("%d\n", t->n[3]); -+ printf("%d\n", t->yt.k); -+ printf("%d\n", t->yt.bt.j); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/008_fortran_call_c_nested_struct_complicated/c_func004.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/008_fortran_call_c_nested_struct_complicated/c_func004.c -new file mode 100644 -index 0000000..ff232d9 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/008_fortran_call_c_nested_struct_complicated/c_func004.c -@@ -0,0 +1,30 @@ -+#include -+struct BaseTy { -+ int j; -+}; -+struct Ty1 { -+ struct BaseTy bt; -+ int k1; -+}; -+struct Ty2 { -+ struct Ty1 bty1; -+ int k2; -+}; -+struct Ty3 { -+ struct Ty2 bty2; -+ int k3; -+}; -+struct Ty { -+ struct Ty3 yt; -+ int n[4]; -+}; -+void c_func_(struct Ty *t) { -+ printf("%d\n", t->n[0]); -+ printf("%d\n", t->n[1]); -+ printf("%d\n", t->n[2]); -+ printf("%d\n", t->n[3]); -+ printf("%d\n", t->yt.k3); -+ printf("%d\n", t->yt.bty2.k2); -+ printf("%d\n", t->yt.bty2.bty1.k1); -+ printf("%d\n", t->yt.bty2.bty1.bt.j); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/008_fortran_call_c_nested_struct_complicated/c_func005.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/008_fortran_call_c_nested_struct_complicated/c_func005.c -new file mode 100644 -index 0000000..9cff8b8 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/008_fortran_call_c_nested_struct_complicated/c_func005.c -@@ -0,0 +1,18 @@ -+#include -+struct BaseTy { -+ int j; -+}; -+struct Ty { -+ struct BaseTy bt[3]; -+ int n[4]; -+}; -+void c_func_(struct Ty *t) { -+ printf("%d\n", t->bt[0].j); -+ printf("%d\n", t->bt[1].j); -+ printf("%d\n", t->bt[2].j); -+ printf("%d\n", t->n[0]); -+ printf("%d\n", t->n[0]+t->bt[0].j); -+ printf("%d\n", t->n[1]); -+ printf("%d\n", t->n[2]); -+ printf("%d\n", t->n[3]); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/008_fortran_call_c_nested_struct_complicated/c_func006.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/008_fortran_call_c_nested_struct_complicated/c_func006.c -new file mode 100644 -index 0000000..6bd160d ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/008_fortran_call_c_nested_struct_complicated/c_func006.c -@@ -0,0 +1,19 @@ -+#include -+struct BaseTy { -+ int j; -+}; -+struct Ty { -+ struct BaseTy bt[3]; -+ int n[4]; -+}; -+struct Ty* c_func_(struct Ty *t) { -+ printf("%d\n", t->bt[0].j); -+ printf("%d\n", t->bt[1].j); -+ printf("%d\n", t->bt[2].j); -+ printf("%d\n", t->n[0]); -+ printf("%d\n", t->n[0]+t->bt[0].j); -+ printf("%d\n", t->n[1]); -+ printf("%d\n", t->n[2]); -+ printf("%d\n", t->n[3]); -+ return t; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/008_fortran_call_c_nested_struct_complicated/fortran_main001.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/008_fortran_call_c_nested_struct_complicated/fortran_main001.f90 -new file mode 100644 -index 0000000..2647a97 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/008_fortran_call_c_nested_struct_complicated/fortran_main001.f90 -@@ -0,0 +1,20 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is derived type -+! -+program main -+ type, bind(c) :: base -+ integer(4) :: j = -1 -+ end type base -+ type, bind(c) :: t -+ type(base) :: bt -+ integer(4) :: i(4) = 1 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/008_fortran_call_c_nested_struct_complicated/fortran_main002.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/008_fortran_call_c_nested_struct_complicated/fortran_main002.f90 -new file mode 100644 -index 0000000..edf7112 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/008_fortran_call_c_nested_struct_complicated/fortran_main002.f90 -@@ -0,0 +1,20 @@ -+! Test fortran call c for the array of derived type and the component -+! of the derived type is derived type -+! -+program main -+ type, bind(c) :: base -+ integer(4) :: j = -1 -+ end type base -+ type, bind(c) :: t -+ type(base) :: bt -+ integer(4) :: i(4) = 1 -+ end type t -+ type(t) :: my_t(2) -+ interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a(2) -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/008_fortran_call_c_nested_struct_complicated/fortran_main003.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/008_fortran_call_c_nested_struct_complicated/fortran_main003.f90 -new file mode 100644 -index 0000000..e0d5848 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/008_fortran_call_c_nested_struct_complicated/fortran_main003.f90 -@@ -0,0 +1,25 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type are derived types -+! -+program main -+ type, bind(c) :: base -+ integer(4) :: j = -1 -+ end type base -+ type, bind(c) :: base2 -+ type(base) :: bt -+ integer(4) :: k = 256 -+ end type base2 -+ type, bind(c) :: t -+ type(base) :: bt -+ type(base2) :: yt -+ integer(4) :: i(4) = 1 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/008_fortran_call_c_nested_struct_complicated/fortran_main004.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/008_fortran_call_c_nested_struct_complicated/fortran_main004.f90 -new file mode 100644 -index 0000000..66e62eb ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/008_fortran_call_c_nested_struct_complicated/fortran_main004.f90 -@@ -0,0 +1,31 @@ -+! Test fortran call c for the nesting of derived types -+! -+program main -+ type, bind(c) :: base -+ integer(4) :: j = -1 -+ end type base -+ type, bind(c) :: base1 -+ type(base) :: bt1 -+ integer(4) :: k1 = 256 -+ end type base1 -+ type, bind(c) :: base2 -+ type(base1) :: bt2 -+ integer(4) :: k2 = 257 -+ end type base2 -+ type, bind(c) :: base3 -+ type(base2) :: bt3 -+ integer(4) :: k3 = 258 -+ end type base3 -+ type, bind(c) :: t -+ type(base3) :: yt -+ integer(4) :: i(4) = 1 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/008_fortran_call_c_nested_struct_complicated/fortran_main005.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/008_fortran_call_c_nested_struct_complicated/fortran_main005.f90 -new file mode 100644 -index 0000000..60cd8ac ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/008_fortran_call_c_nested_struct_complicated/fortran_main005.f90 -@@ -0,0 +1,20 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is array of derived type -+! -+program main -+ type, bind(c) :: base -+ integer(4) :: j = -1 -+ end type base -+ type, bind(c) :: t -+ type(base) :: bt(3) -+ integer(4) :: i(4) = 1 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/008_fortran_call_c_nested_struct_complicated/fortran_main006.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/008_fortran_call_c_nested_struct_complicated/fortran_main006.f90 -new file mode 100644 -index 0000000..36ef4a9 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/008_fortran_call_c_nested_struct_complicated/fortran_main006.f90 -@@ -0,0 +1,20 @@ -+! Test fortran call c for the return type is derived type -+! -+program main -+ type, bind(c) :: base -+ integer(4) :: j = -1 -+ end type base -+ type, bind(c) :: t -+ type(base) :: bt(3) -+ integer(4) :: i(4) = 1 -+ end type t -+ type(t) :: my_t -+ interface -+ function c_func(a) result(res) bind(c, name = "c_func_") -+ import :: t -+ type(t) :: a -+ type(t), pointer :: res -+ end -+ end interface -+ print *, c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/008_fortran_call_c_nested_struct_complicated/result.md b/test/interoperability_with_c_fortran_call_c_global_and_struct/008_fortran_call_c_nested_struct_complicated/result.md -new file mode 100644 -index 0000000..f1fed1f ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/008_fortran_call_c_nested_struct_complicated/result.md -@@ -0,0 +1,7 @@ -+ | test | gfortran | flang | nvfortran| -+ | 001 | PASS | PASS | PASS | -+ | 002 | PASS | PASS | PASS | -+ | 003 | PASS | PASS | PASS | -+ | 004 | PASS | PASS | PASS | -+ | 005 | PASS | PASS | PASS | -+ | 006 | PASS | ERROR | ERROR | -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/008_fortran_call_c_nested_struct_complicated/run.sh b/test/interoperability_with_c_fortran_call_c_global_and_struct/008_fortran_call_c_nested_struct_complicated/run.sh -new file mode 100644 -index 0000000..2392045 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/008_fortran_call_c_nested_struct_complicated/run.sh -@@ -0,0 +1,22 @@ -+for i in {001..006} -+do -+echo "------- test $i ------." -+echo "----- gfortran result:" -+gcc c_func$i.c -c -o c-test.o -+gfortran fortran_main$i.f90 -fno-range-check -c -o fortran-test.o -+gfortran c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+echo "----- flang-new result : " -+clang c_func$i.c -c -o c-test.o -+flang-new fortran_main$i.f90 -c -o fortran-test.o -+flang-new -flang-experimental-exec c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+echo "----- nvfortran result : " -+clang c_func$i.c -c -o c-test.o -+nvfortran fortran_main$i.f90 -c -o fortran-test.o -+nvfortran c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+done -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/c_func001.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/c_func001.c -new file mode 100644 -index 0000000..af6f0af ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/c_func001.c -@@ -0,0 +1,8 @@ -+#include -+struct Ty { -+ int x[2]; -+}; -+void c_func_(struct Ty *t) { -+ printf("%d\t", t->x[0]); -+ printf("%d\n", t->x[1]); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/c_func002.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/c_func002.c -new file mode 100644 -index 0000000..8a69b38 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/c_func002.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ short x[2]; -+}; -+void c_func_(struct Ty *t) { -+ printf("%hd\t", t->x[0]); -+ printf("%hd\n", t->x[1]); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/c_func003.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/c_func003.c -new file mode 100644 -index 0000000..2daf4d0 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/c_func003.c -@@ -0,0 +1,8 @@ -+#include -+struct Ty { -+ long x[2]; -+}; -+void c_func_(struct Ty *t) { -+ printf("%ld\t", t->x[0]); -+ printf("%ld\n", t->x[1]); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/c_func004.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/c_func004.c -new file mode 100644 -index 0000000..2dba23e ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/c_func004.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ long long x[2]; -+}; -+void c_func_(struct Ty *t) { -+ printf("%lld\t", t->x[0]); -+ printf("%lld\n", t->x[1]); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/c_func005.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/c_func005.c -new file mode 100644 -index 0000000..3ff03dc ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/c_func005.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ signed char x[2]; -+}; -+void c_func_(struct Ty *t) { -+ printf("%c\t", t->x[0]); -+ printf("%c\n", t->x[1]); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/c_func006.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/c_func006.c -new file mode 100644 -index 0000000..15c7b76 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/c_func006.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ size_t x[2]; -+}; -+void c_func_(struct Ty *t) { -+ printf("%ld\t", t->x[0]); -+ printf("%ld\n", t->x[1]); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/c_func007.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/c_func007.c -new file mode 100644 -index 0000000..ab5a40e ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/c_func007.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ int8_t x[2]; -+}; -+void c_func_(struct Ty *t) { -+ printf("%hhd\t", t->x[0]); -+ printf("%hhd\n", t->x[1]); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/c_func008.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/c_func008.c -new file mode 100644 -index 0000000..48e1926 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/c_func008.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ int16_t x[2]; -+}; -+void c_func_(struct Ty *t) { -+ printf("%hd\t", t->x[0]); -+ printf("%hd\n", t->x[1]); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/c_func009.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/c_func009.c -new file mode 100644 -index 0000000..0cb1972 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/c_func009.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ int32_t x[2]; -+}; -+void c_func_(struct Ty *t) { -+ printf("%d\t", t->x[0]); -+ printf("%d\n", t->x[1]); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/c_func010.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/c_func010.c -new file mode 100644 -index 0000000..c158eee ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/c_func010.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ int64_t x[2]; -+}; -+void c_func_(struct Ty *t) { -+ printf("%ld\t", t->x[0]); -+ printf("%ld\n", t->x[1]); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/c_func011.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/c_func011.c -new file mode 100644 -index 0000000..7fb9f41 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/c_func011.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ int_least8_t x[2]; -+}; -+void c_func_(struct Ty *t) { -+ printf("%hhd\t", t->x[0]); -+ printf("%hhd\n", t->x[1]); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/c_func012.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/c_func012.c -new file mode 100644 -index 0000000..1ab424d ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/c_func012.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ int_least16_t x[2]; -+}; -+void c_func_(struct Ty *t) { -+ printf("%hd\t", t->x[0]); -+ printf("%hd\n", t->x[1]); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/c_func013.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/c_func013.c -new file mode 100644 -index 0000000..98a7568 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/c_func013.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ int_least32_t x[2]; -+}; -+void c_func_(struct Ty *t) { -+ printf("%d\t", t->x[0]); -+ printf("%d\n", t->x[1]); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/c_func014.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/c_func014.c -new file mode 100644 -index 0000000..56cd691 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/c_func014.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ int_least64_t x[2]; -+}; -+void c_func_(struct Ty *t) { -+ printf("%ld\t", t->x[0]); -+ printf("%ld\n", t->x[1]); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/c_func015.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/c_func015.c -new file mode 100644 -index 0000000..91823ae ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/c_func015.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ int_fast8_t x[2]; -+}; -+void c_func_(struct Ty *t) { -+ printf("%hhd\t", t->x[0]); -+ printf("%hhd\n", t->x[1]); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/c_func016.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/c_func016.c -new file mode 100644 -index 0000000..99bd5f1 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/c_func016.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ int_fast16_t x[2]; -+}; -+void c_func_(struct Ty *t) { -+ printf("%ld\t", t->x[0]); -+ printf("%ld\n", t->x[1]); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/c_func017.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/c_func017.c -new file mode 100644 -index 0000000..51c3977 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/c_func017.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ int_fast32_t x[2]; -+}; -+void c_func_(struct Ty *t) { -+ printf("%ld\t", t->x[0]); -+ printf("%ld\n", t->x[1]); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/c_func018.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/c_func018.c -new file mode 100644 -index 0000000..575e915 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/c_func018.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ int_fast64_t x[2]; -+}; -+void c_func_(struct Ty *t) { -+ printf("%ld\t", t->x[0]); -+ printf("%ld\n", t->x[1]); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/c_func019.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/c_func019.c -new file mode 100644 -index 0000000..45f0beb ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/c_func019.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ intmax_t x[2]; -+}; -+void c_func_(struct Ty *t) { -+ printf("%ld\t", t->x[0]); -+ printf("%ld\n", t->x[1]); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/c_func020.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/c_func020.c -new file mode 100644 -index 0000000..553b51b ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/c_func020.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ intptr_t x[2]; -+}; -+void c_func_(struct Ty *t) { -+ printf("%ld\t", t->x[0]); -+ printf("%ld\n", t->x[1]); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/c_func021.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/c_func021.c -new file mode 100644 -index 0000000..13cce4d ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/c_func021.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ float x[2]; -+}; -+void c_func_(struct Ty *t) { -+ printf("%f\t", t->x[0]); -+ printf("%f\n", t->x[1]); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/c_func022.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/c_func022.c -new file mode 100644 -index 0000000..d1f7b9d ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/c_func022.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ double x[2]; -+}; -+void c_func_(struct Ty *t) { -+ printf("%lf\t", t->x[0]); -+ printf("%lf\n", t->x[1]); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/c_func023.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/c_func023.c -new file mode 100644 -index 0000000..5f383b1 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/c_func023.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ long double x[2]; -+}; -+void c_func_(struct Ty *t) { -+ printf("%Lf\t", t->x[0]); -+ printf("%Lf\n", t->x[1]); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/c_func024.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/c_func024.c -new file mode 100644 -index 0000000..65309d7 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/c_func024.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ float _Complex x[2]; -+}; -+void c_func_(struct Ty *t) { -+ printf("%f + %fi\n", creal(t->x[0]), cimag(t->x[0])); -+ printf("%f + %fi\n", creal(t->x[1]), cimag(t->x[1])); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/c_func025.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/c_func025.c -new file mode 100644 -index 0000000..b36c40e ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/c_func025.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ double _Complex x[2]; -+}; -+void c_func_(struct Ty *t) { -+ printf("%lf + %lfi\n", creal(t->x[0]), cimag(t->x[0])); -+ printf("%lf + %lfi\n", creal(t->x[1]), cimag(t->x[1])); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/c_func026.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/c_func026.c -new file mode 100644 -index 0000000..a7bcf01 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/c_func026.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ long double _Complex x[2]; -+}; -+void c_func_(struct Ty *t) { -+ printf("%f + %fi\n", creal(t->x[0]), cimag(t->x[0])); -+ printf("%f + %fi\n", creal(t->x[1]), cimag(t->x[1])); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/c_func027.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/c_func027.c -new file mode 100644 -index 0000000..5723427 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/c_func027.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ _Bool x[2]; -+}; -+void c_func_(struct Ty *t) { -+ printf("%d\t", t->x[0]); -+ printf("%d\n", t->x[1]); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/c_func028.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/c_func028.c -new file mode 100644 -index 0000000..47138e9 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/c_func028.c -@@ -0,0 +1,9 @@ -+#include -+#include -+struct Ty { -+ char x[2]; -+}; -+void c_func_(struct Ty *t) { -+ printf("%c\t", t->x[0]); -+ printf("%c\n", t->x[1]); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main001.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main001.f90 -new file mode 100644 -index 0000000..6c8c711 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main001.f90 -@@ -0,0 +1,16 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is array of type int without iso_c_binding -+! -+program main -+ type, bind(c) :: t -+ integer :: x(2) = 1 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main002.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main002.f90 -new file mode 100644 -index 0000000..4c9f0b9 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main002.f90 -@@ -0,0 +1,16 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is array of type short without iso_c_binding -+! -+program main -+ type, bind(c) :: t -+ integer(2) :: x(2) = -32768 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main003.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main003.f90 -new file mode 100644 -index 0000000..f8962b2 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main003.f90 -@@ -0,0 +1,16 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is array of type long without iso_c_binding -+! -+program main -+ type, bind(c) :: t -+ integer(8) :: x(2) = -2147483647 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main004.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main004.f90 -new file mode 100644 -index 0000000..1bdf578 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main004.f90 -@@ -0,0 +1,16 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is array of type long long without iso_c_binding -+! -+program main -+ type, bind(c) :: t -+ integer(8) :: x(2) = -9223372036854775807 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main005.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main005.f90 -new file mode 100644 -index 0000000..b8d6d20 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main005.f90 -@@ -0,0 +1,16 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is array of type signed char without iso_c_binding -+! -+program main -+ type, bind(c) :: t -+ integer(1) :: x(2) = 65 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main006.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main006.f90 -new file mode 100644 -index 0000000..24f4d74 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main006.f90 -@@ -0,0 +1,16 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is array of type size_t without iso_c_binding -+! -+program main -+ type, bind(c) :: t -+ integer(8) :: x(2) = 0 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main007.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main007.f90 -new file mode 100644 -index 0000000..4c868b3 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main007.f90 -@@ -0,0 +1,16 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is array of type int8_t without iso_c_binding -+! -+program main -+ type, bind(c) :: t -+ integer(1) :: x(2) = -128 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main008.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main008.f90 -new file mode 100644 -index 0000000..0fd89db ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main008.f90 -@@ -0,0 +1,16 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is array of type int16_t without iso_c_binding -+! -+program main -+ type, bind(c) :: t -+ integer(2) :: x(2) = -32768 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main009.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main009.f90 -new file mode 100644 -index 0000000..2dee9f6 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main009.f90 -@@ -0,0 +1,16 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is array of type int32_t without iso_c_binding -+! -+program main -+ type, bind(c) :: t -+ integer(4) :: x(2) = -2147483647 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main010.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main010.f90 -new file mode 100644 -index 0000000..60b3af9 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main010.f90 -@@ -0,0 +1,16 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is array of type int64_t without iso_c_binding -+! -+program main -+ type, bind(c) :: t -+ integer(8) :: x(2) = -9223372036854775807 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main011.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main011.f90 -new file mode 100644 -index 0000000..2ac8242 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main011.f90 -@@ -0,0 +1,16 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is array of type int_least8_t without iso_c_binding -+! -+program main -+ type, bind(c) :: t -+ integer(1) :: x(2) = -128 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main012.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main012.f90 -new file mode 100644 -index 0000000..50c6ca8 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main012.f90 -@@ -0,0 +1,16 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is array of type int_least16_t without iso_c_binding -+! -+program main -+ type, bind(c) :: t -+ integer(2) :: x(2) = -32768 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main013.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main013.f90 -new file mode 100644 -index 0000000..ff3b140 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main013.f90 -@@ -0,0 +1,16 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is array of type int_least32_t without iso_c_binding -+! -+program main -+ type, bind(c) :: t -+ integer(4) :: x(2) = -2147483647 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main014.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main014.f90 -new file mode 100644 -index 0000000..366a7a3 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main014.f90 -@@ -0,0 +1,16 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is array of type int_least64_t without iso_c_binding -+! -+program main -+ type, bind(c) :: t -+ integer(8) :: x(2) = -9223372036854775807 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main015.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main015.f90 -new file mode 100644 -index 0000000..654302d ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main015.f90 -@@ -0,0 +1,16 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is array of type int_fast8_t without iso_c_binding -+! -+program main -+ type, bind(c) :: t -+ integer(1) :: x(2) = -128 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main016.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main016.f90 -new file mode 100644 -index 0000000..78727d9 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main016.f90 -@@ -0,0 +1,16 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is array of type int_fast16_t without iso_c_binding -+! -+program main -+ type, bind(c) :: t -+ integer(8) :: x(2) = -32768 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main017.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main017.f90 -new file mode 100644 -index 0000000..122b60d ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main017.f90 -@@ -0,0 +1,16 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is array of type int_fast32_t without iso_c_binding -+! -+program main -+ type, bind(c) :: t -+ integer(8) :: x(2) = -2147483647 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main018.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main018.f90 -new file mode 100644 -index 0000000..245cca8 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main018.f90 -@@ -0,0 +1,16 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is array of type int_fast64_t without iso_c_binding -+! -+program main -+ type, bind(c) :: t -+ integer(8) :: x(2) = -9223372036854775807 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main019.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main019.f90 -new file mode 100644 -index 0000000..f46b68f ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main019.f90 -@@ -0,0 +1,16 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is array of type intmax_t without iso_c_binding -+! -+program main -+ type, bind(c) :: t -+ integer(8) :: x(2) = -9223372036854775807 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main020.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main020.f90 -new file mode 100644 -index 0000000..21ec77a ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main020.f90 -@@ -0,0 +1,16 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is array of type intptr_t without iso_c_binding -+! -+program main -+ type, bind(c) :: t -+ integer(8) :: x(2) = -9223372036854775807 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main021.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main021.f90 -new file mode 100644 -index 0000000..fe827d4 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main021.f90 -@@ -0,0 +1,16 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is array of type float without iso_c_binding -+! -+program main -+ type, bind(c) :: t -+ real(4) :: x(2) = 3.14 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main022.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main022.f90 -new file mode 100644 -index 0000000..55bd7d1 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main022.f90 -@@ -0,0 +1,16 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is array of type double without iso_c_binding -+! -+program main -+ type, bind(c) :: t -+ real(8) :: x(2) = 450359962737049.621345 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main023.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main023.f90 -new file mode 100644 -index 0000000..8f17598 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main023.f90 -@@ -0,0 +1,17 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is array of type long double without iso_c_binding -+! -+program main -+ integer, parameter :: K = selected_real_kind(16) -+ type, bind(c) :: t -+ real(K) :: x(2) = 450359962737049.621345 -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main024.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main024.f90 -new file mode 100644 -index 0000000..635ac18 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main024.f90 -@@ -0,0 +1,16 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is array of type float _Complex without iso_c_binding -+! -+program main -+ type, bind(c) :: t -+ complex(4) :: x(2) = (-3, 1) -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main025.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main025.f90 -new file mode 100644 -index 0000000..66ec48b ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main025.f90 -@@ -0,0 +1,16 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is array of type double _Complex without iso_c_binding -+! -+program main -+ type, bind(c) :: t -+ complex(8) :: x(2) = (-3, 1) -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main026.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main026.f90 -new file mode 100644 -index 0000000..304647b ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main026.f90 -@@ -0,0 +1,18 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is array of type long double _Complex without -+! iso_c_binding -+! -+program main -+ integer, parameter :: K = selected_real_kind(16) -+ type, bind(c) :: t -+ complex(K) :: x(2) = (-3.1415926, 1.654) -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main027.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main027.f90 -new file mode 100644 -index 0000000..e454591 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main027.f90 -@@ -0,0 +1,15 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is array of type _Bool without iso_c_binding -+! -+ type, bind(c) :: t -+ logical(1) :: x(2) = .TRUE. -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main028.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main028.f90 -new file mode 100644 -index 0000000..e2ee053 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/fortran_main028.f90 -@@ -0,0 +1,16 @@ -+! Test fortran call c for the derived type and the component of the -+! derived type is array of type char without iso_c_binding -+! -+program main -+ type, bind(c) :: t -+ character :: x(2) = 'b' -+ end type t -+ type(t) :: my_t -+ interface -+ subroutine c_func(a) -+ import :: t -+ type(t) :: a -+ end -+ end interface -+ call c_func(my_t) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/result.md b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/result.md -new file mode 100644 -index 0000000..b0681e1 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/result.md -@@ -0,0 +1,29 @@ -+ | test | gfortran | flang | nvfortran| -+ | 001 | PASS | PASS | PASS | -+ | 002 | PASS | PASS | PASS | -+ | 003 | PASS | PASS | PASS | -+ | 004 | PASS | PASS | ERROR | -+ | 005 | PASS | PASS | PASS | -+ | 006 | PASS | PASS | PASS | -+ | 007 | PASS | PASS | PASS | -+ | 008 | PASS | PASS | PASS | -+ | 009 | PASS | PASS | PASS | -+ | 010 | PASS | PASS | ERROR | -+ | 011 | PASS | PASS | PASS | -+ | 012 | PASS | PASS | PASS | -+ | 013 | PASS | PASS | PASS | -+ | 014 | PASS | PASS | ERROR | -+ | 015 | PASS | PASS | PASS | -+ | 016 | PASS | PASS | PASS | -+ | 017 | PASS | PASS | PASS | -+ | 018 | PASS | PASS | ERROR | -+ | 019 | PASS | PASS | ERROR | -+ | 020 | PASS | PASS | ERROR | -+ | 021 | PASS | PASS | PASS | -+ | 022 | PASS | PASS | PASS | -+ | 023 | PASS | ERROR | ERROR | -+ | 024 | PASS | PASS | PASS | -+ | 025 | PASS | PASS | PASS | -+ | 026 | PASS | ERROR | ERROR | -+ | 027 | PASS | PASS | PASS | -+ | 028 | PASS | PASS | PASS | -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/run.sh b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/run.sh -new file mode 100644 -index 0000000..dbbd62f ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/009_fortran_call_c_array_in_struct/run.sh -@@ -0,0 +1,22 @@ -+for i in {001..028} -+do -+echo "------- test $i ------." -+echo "----- gfortran result:" -+gcc c_func$i.c -c -o c-test.o -+gfortran fortran_main$i.f90 -fno-range-check -c -o fortran-test.o -+gfortran c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+echo "----- flang-new result : " -+clang c_func$i.c -c -o c-test.o -+flang-new fortran_main$i.f90 -c -o fortran-test.o -+flang-new -flang-experimental-exec c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+echo "----- nvfortran result : " -+clang c_func$i.c -c -o c-test.o -+nvfortran fortran_main$i.f90 -c -o fortran-test.o -+nvfortran c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+done -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/c_func001.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/c_func001.c -new file mode 100644 -index 0000000..de0139f ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/c_func001.c -@@ -0,0 +1,9 @@ -+extern struct block { -+ int num; -+}b; -+extern struct block block_; -+void c_func_() -+{ -+ block_.num = 11; -+} -+ -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/c_func002.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/c_func002.c -new file mode 100644 -index 0000000..fa320f9 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/c_func002.c -@@ -0,0 +1,11 @@ -+extern struct block { -+ int num[4]; -+}b; -+extern struct block block_; -+void c_func_() -+{ -+ for(int i = 0; i < 4; i++) { -+ block_.num[i] = 11; -+ } -+} -+ -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/c_func003.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/c_func003.c -new file mode 100644 -index 0000000..629a9ab ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/c_func003.c -@@ -0,0 +1,12 @@ -+#include -+extern struct block { -+ int16_t num; -+ int8_t num2; -+}b; -+extern struct block block_; -+void c_func_() -+{ -+ block_.num = 12; -+ block_.num2 = 12; -+} -+ -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/c_func004.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/c_func004.c -new file mode 100644 -index 0000000..a681532 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/c_func004.c -@@ -0,0 +1,13 @@ -+#include -+extern struct block { -+ int32_t num; -+ int16_t num2; -+ int8_t num3; -+}b; -+extern struct block block_; -+void c_func_() -+{ -+ block_.num = 12; -+ block_.num2 = 13; -+ block_.num3 = 14; -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/c_func005.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/c_func005.c -new file mode 100644 -index 0000000..c85e66c ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/c_func005.c -@@ -0,0 +1,15 @@ -+#include -+extern struct block { -+ int64_t num; -+ int32_t num2; -+ int16_t num3; -+ int8_t num4; -+}b; -+extern struct block block_; -+void c_func_() -+{ -+ block_.num = 12; -+ block_.num2 = 13; -+ block_.num3 = 14; -+ block_.num4 = 15; -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/c_func006.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/c_func006.c -new file mode 100644 -index 0000000..acf1f0c ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/c_func006.c -@@ -0,0 +1,17 @@ -+#include -+extern struct block { -+ int64_t num[2]; -+ int64_t num2; -+ int32_t num3; -+ int16_t num4; -+ int8_t num5; -+}b; -+extern struct block block_; -+void c_func_() -+{ -+ block_.num[0] = 12; -+ block_.num2 = 13; -+ block_.num3 = 14; -+ block_.num4 = 15; -+ block_.num5 = 16; -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/c_func007.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/c_func007.c -new file mode 100644 -index 0000000..5cacb79 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/c_func007.c -@@ -0,0 +1,21 @@ -+#include -+extern struct block { -+ int64_t num[4]; -+ int64_t num2[2]; -+ int32_t num3[2]; -+ int16_t num4[3]; -+ int8_t num5[3]; -+}b; -+extern struct block block_; -+void c_func_() -+{ -+ for(int i = 0; i < 2; i++) { -+ block_.num[2 * i] = 12; -+ block_.num2[i] = 13; -+ block_.num3[i] = 14; -+ block_.num4[i] = 15; -+ block_.num5[i] = 16; -+ } -+ block_.num4[2] = 15; -+ block_.num5[2] = 16; -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/c_func008.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/c_func008.c -new file mode 100644 -index 0000000..43c2eb1 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/c_func008.c -@@ -0,0 +1,11 @@ -+struct test { -+ int x; -+}; -+extern struct block { -+ struct test a; -+}b; -+extern struct block block_; -+void c_func_() -+{ -+ block_.a.x = 1; -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/c_func009.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/c_func009.c -new file mode 100644 -index 0000000..c0908d3 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/c_func009.c -@@ -0,0 +1,14 @@ -+#include -+struct test { -+ int16_t x2; -+ int8_t x1; -+}; -+extern struct block { -+ struct test a; -+}b; -+extern struct block block_; -+void c_func_() -+{ -+ block_.a.x1 = 10; -+ block_.a.x2 = 11; -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/c_func010.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/c_func010.c -new file mode 100644 -index 0000000..d0c4d2c ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/c_func010.c -@@ -0,0 +1,16 @@ -+#include -+struct test { -+ int32_t x3; -+ int16_t x2; -+ int8_t x1; -+}; -+extern struct block { -+ struct test a; -+}b; -+extern struct block block_; -+void c_func_() -+{ -+ block_.a.x1 = 10; -+ block_.a.x2 = 11; -+ block_.a.x3 = 12; -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/c_func011.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/c_func011.c -new file mode 100644 -index 0000000..756e90e ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/c_func011.c -@@ -0,0 +1,18 @@ -+#include -+struct test { -+ int64_t x4; -+ int32_t x3; -+ int16_t x2; -+ int8_t x1; -+}; -+extern struct block { -+ struct test a; -+}b; -+extern struct block block_; -+void c_func_() -+{ -+ block_.a.x1 = 10; -+ block_.a.x2 = 11; -+ block_.a.x3 = 12; -+ block_.a.x4 = 13; -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/c_func012.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/c_func012.c -new file mode 100644 -index 0000000..850ca97 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/c_func012.c -@@ -0,0 +1,20 @@ -+#include -+struct test { -+ int64_t x5[2]; -+ int64_t x4; -+ int32_t x3; -+ int16_t x2; -+ int8_t x1; -+}; -+extern struct block { -+ struct test a; -+}b; -+extern struct block block_; -+void c_func_() -+{ -+ block_.a.x1 = 10; -+ block_.a.x2 = 11; -+ block_.a.x3 = 12; -+ block_.a.x4 = 13; -+ block_.a.x5[0] = 14; -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/c_func013.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/c_func013.c -new file mode 100644 -index 0000000..15954da ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/c_func013.c -@@ -0,0 +1,23 @@ -+#include -+struct test { -+ int64_t x5[4]; -+ int64_t x4[2]; -+ int32_t x3[2]; -+ int16_t x2[2]; -+ int8_t x1[3]; -+}; -+extern struct block { -+ struct test a; -+}b; -+extern struct block block_; -+void c_func_() -+{ -+ for(int i = 0; i < 2; i++) { -+ block_.a.x1[i] = 10; -+ block_.a.x2[i] = 11; -+ block_.a.x3[i] = 12; -+ block_.a.x4[i] = 13; -+ block_.a.x5[2 * i] = 14; -+ } -+ block_.a.x1[2] = 10; -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/c_func014.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/c_func014.c -new file mode 100644 -index 0000000..24bfd50 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/c_func014.c -@@ -0,0 +1,22 @@ -+#include -+struct test { -+ int64_t x5[2]; -+ int64_t x4; -+ int32_t x3; -+ int16_t x2; -+ int8_t x1; -+}; -+extern struct block { -+ struct test a[5]; -+}b; -+extern struct block block_; -+void c_func_() -+{ -+ for(int i = 0; i < 5; i++) { -+ block_.a[i].x1 = 10; -+ block_.a[i].x2 = 11; -+ block_.a[i].x3 = 12; -+ block_.a[i].x4 = 13; -+ block_.a[i].x5[0] = 14; -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/c_func015.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/c_func015.c -new file mode 100644 -index 0000000..fab06bc ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/c_func015.c -@@ -0,0 +1,27 @@ -+#include -+struct test1 { -+ double x; -+ float y; -+}; -+struct test { -+ int64_t x5[2]; -+ struct test1 t; -+ int64_t x4; -+ int32_t x3; -+ int16_t x2; -+ int8_t x1; -+}; -+extern struct block { -+ struct test a; -+}b; -+extern struct block block_; -+void c_func_() -+{ -+ block_.a.x1 = 10; -+ block_.a.x2 = 11; -+ block_.a.x3 = 12; -+ block_.a.x4 = 13; -+ block_.a.x5[0] = 14; -+ block_.a.t.x = 3.1415; -+ block_.a.t.y = 3.14; -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/c_func016.c b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/c_func016.c -new file mode 100644 -index 0000000..f84b1d6 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/c_func016.c -@@ -0,0 +1,27 @@ -+#include -+struct test1 { -+ double x; -+ float y; -+}; -+struct test { -+ int64_t x5[2]; -+ int64_t x4; -+ int32_t x3; -+ int16_t x2; -+ int8_t x1; -+}; -+extern struct block { -+ struct test1 t1; -+ struct test a; -+}b; -+extern struct block block_; -+void c_func_() -+{ -+ block_.a.x1 = 10; -+ block_.a.x2 = 11; -+ block_.a.x3 = 12; -+ block_.a.x4 = 13; -+ block_.a.x5[0] = 14; -+ block_.t1.x = 3.1415; -+ block_.t1.y = 3.14; -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/fortran_main001.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/fortran_main001.f90 -new file mode 100644 -index 0000000..679cf43 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/fortran_main001.f90 -@@ -0,0 +1,8 @@ -+! test fortran call c for global about scalar -+! -+program main -+ common /block/ num -+ integer :: num -+ call c_func() -+ print *, num -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/fortran_main002.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/fortran_main002.f90 -new file mode 100644 -index 0000000..f265c32 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/fortran_main002.f90 -@@ -0,0 +1,8 @@ -+! test fortran call c for global about array -+! -+program main -+ common /block/ num -+ integer :: num(4) -+ call c_func() -+ print *, num -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/fortran_main003.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/fortran_main003.f90 -new file mode 100644 -index 0000000..8660ac0 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/fortran_main003.f90 -@@ -0,0 +1,10 @@ -+! test fortran call c for global about data alignment -+! -+program main -+ integer(2) :: num -+ integer(1) :: num2 -+ common /block/ num, num2 -+ call c_func() -+ print *, num -+ print *, num2 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/fortran_main004.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/fortran_main004.f90 -new file mode 100644 -index 0000000..7a64816 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/fortran_main004.f90 -@@ -0,0 +1,12 @@ -+! test fortran call c for global about data alignment -+! -+program main -+ integer(4) :: num -+ integer(2) :: num2 -+ integer(1) :: num3 -+ common /block/ num, num2, num3 -+ call c_func() -+ print *, num -+ print *, num2 -+ print *, num3 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/fortran_main005.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/fortran_main005.f90 -new file mode 100644 -index 0000000..645daa5 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/fortran_main005.f90 -@@ -0,0 +1,14 @@ -+! test fortran call c for global about data alignment -+! -+program main -+ integer(8) :: num -+ integer(4) :: num2 -+ integer(2) :: num3 -+ integer(1) :: num4 -+ common /block/ num, num2, num3, num4 -+ call c_func() -+ print *, num -+ print *, num2 -+ print *, num3 -+ print *, num4 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/fortran_main006.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/fortran_main006.f90 -new file mode 100644 -index 0000000..f81891c ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/fortran_main006.f90 -@@ -0,0 +1,16 @@ -+! test fortran call c for global about data alignment -+! -+program main -+ integer(16) :: num -+ integer(8) :: num2 -+ integer(4) :: num3 -+ integer(2) :: num4 -+ integer(1) :: num5 -+ common /block/ num, num2, num3, num4, num5 -+ call c_func() -+ print *, num -+ print *, num2 -+ print *, num3 -+ print *, num4 -+ print *, num5 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/fortran_main007.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/fortran_main007.f90 -new file mode 100644 -index 0000000..623a2ee ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/fortran_main007.f90 -@@ -0,0 +1,16 @@ -+! test fortran call c for global about data alignment -+! -+program main -+ integer(16) :: num(2) -+ integer(8) :: num2(2) -+ integer(4) :: num3(2) -+ integer(2) :: num4(3) -+ integer(1) :: num5(3) -+ common /block/ num, num2, num3, num4, num5 -+ call c_func() -+ print *, num -+ print *, num2 -+ print *, num3 -+ print *, num4 -+ print *, num5 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/fortran_main008.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/fortran_main008.f90 -new file mode 100644 -index 0000000..e1e655a ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/fortran_main008.f90 -@@ -0,0 +1,11 @@ -+! test fortran call c for global about sturct -+! -+program main -+ common /block/ a -+ type, bind(c) :: test -+ integer :: x -+ end type -+ type(test) :: a -+ call c_func() -+ print *, a%x -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/fortran_main009.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/fortran_main009.f90 -new file mode 100644 -index 0000000..b78d78b ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/fortran_main009.f90 -@@ -0,0 +1,13 @@ -+! test fortran call c for global about data alignment in struct -+! -+program main -+ common /block/ a -+ type, bind(c) :: test -+ integer(2) :: x2 -+ integer(1) :: x1 -+ end type -+ type(test) :: a -+ call c_func() -+ print *, a%x1 -+ print *, a%x2 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/fortran_main010.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/fortran_main010.f90 -new file mode 100644 -index 0000000..8555ad2 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/fortran_main010.f90 -@@ -0,0 +1,15 @@ -+! test fortran call c for global about data alignment in struct -+! -+program main -+ common /block/ a -+ type, bind(c) :: test -+ integer(4) :: x3 -+ integer(2) :: x2 -+ integer(1) :: x1 -+ end type -+ type(test) :: a -+ call c_func() -+ print *, a%x1 -+ print *, a%x2 -+ print *, a%x3 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/fortran_main011.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/fortran_main011.f90 -new file mode 100644 -index 0000000..0c32d6a ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/fortran_main011.f90 -@@ -0,0 +1,17 @@ -+! test fortran call c for global about data alignment in struct -+! -+program main -+ common /block/ a -+ type, bind(c) :: test -+ integer(8) :: x4 -+ integer(4) :: x3 -+ integer(2) :: x2 -+ integer(1) :: x1 -+ end type -+ type(test) :: a -+ call c_func() -+ print *, a%x1 -+ print *, a%x2 -+ print *, a%x3 -+ print *, a%x4 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/fortran_main012.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/fortran_main012.f90 -new file mode 100644 -index 0000000..ad2f256 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/fortran_main012.f90 -@@ -0,0 +1,19 @@ -+! test fortran call c for global about data alignment in struct -+! -+program main -+ common /block/ a -+ type, bind(c) :: test -+ integer(16) :: x5 -+ integer(8) :: x4 -+ integer(4) :: x3 -+ integer(2) :: x2 -+ integer(1) :: x1 -+ end type -+ type(test) :: a -+ call c_func() -+ print *, a%x1 -+ print *, a%x2 -+ print *, a%x3 -+ print *, a%x4 -+ print *, a%x5 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/fortran_main013.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/fortran_main013.f90 -new file mode 100644 -index 0000000..731f3e9 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/fortran_main013.f90 -@@ -0,0 +1,19 @@ -+! test fortran call c for global about data alignment in struct -+! -+program main -+ common /block/ a -+ type, bind(c) :: test -+ integer(16) :: x5(2) -+ integer(8) :: x4(2) -+ integer(4) :: x3(2) -+ integer(2) :: x2(2) -+ integer(1) :: x1(3) -+ end type -+ type(test) :: a -+ call c_func() -+ print *, a%x1 -+ print *, a%x2 -+ print *, a%x3 -+ print *, a%x4 -+ print *, a%x5 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/fortran_main014.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/fortran_main014.f90 -new file mode 100644 -index 0000000..8445326 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/fortran_main014.f90 -@@ -0,0 +1,21 @@ -+! test fortran call c for global about data alignment in struct -+! -+program main -+ common /block/ a -+ type, bind(c) :: test -+ integer(16) :: x5 -+ integer(8) :: x4 -+ integer(4) :: x3 -+ integer(2) :: x2 -+ integer(1) :: x1 -+ end type -+ type(test) :: a(5) -+ call c_func() -+ do i = 1, 5 -+ print *, a(i)%x1 -+ print *, a(i)%x2 -+ print *, a(i)%x3 -+ print *, a(i)%x4 -+ print *, a(i)%x5 -+ end do -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/fortran_main015.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/fortran_main015.f90 -new file mode 100644 -index 0000000..78df937 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/fortran_main015.f90 -@@ -0,0 +1,26 @@ -+! test fortran call c for global about data alignment in struct -+! -+program main -+ common /block/ a -+ type, bind(c) :: t1 -+ real(8) :: d -+ real(4) :: f -+ end type -+ type, bind(c) :: test -+ integer(16) :: x5 -+ type(t1) :: t -+ integer(8) :: x4 -+ integer(4) :: x3 -+ integer(2) :: x2 -+ integer(1) :: x1 -+ end type -+ type(test) :: a -+ call c_func() -+ print *, a%x1 -+ print *, a%x2 -+ print *, a%x3 -+ print *, a%x4 -+ print *, a%x5 -+ print *, a%t%d -+ print *, a%t%f -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/fortran_main016.f90 b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/fortran_main016.f90 -new file mode 100644 -index 0000000..3fe1782 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/fortran_main016.f90 -@@ -0,0 +1,26 @@ -+! test fortran call c for global about data alignment in struct -+! -+program main -+ common /block/ b, a -+ type, bind(c) :: t1 -+ real(8) :: d -+ real(4) :: f -+ end type -+ type, bind(c) :: test -+ integer(16) :: x5 -+ integer(8) :: x4 -+ integer(4) :: x3 -+ integer(2) :: x2 -+ integer(1) :: x1 -+ end type -+ type(test) :: a -+ type(t1) :: b -+ call c_func() -+ print *, a%x1 -+ print *, a%x2 -+ print *, a%x3 -+ print *, a%x4 -+ print *, a%x5 -+ print *, b%d -+ print *, b%f -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/result.md b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/result.md -new file mode 100644 -index 0000000..177b9ad ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/result.md -@@ -0,0 +1,17 @@ -+ | test | gfortran | flang | nvfortran| -+ | 001 | PASS | PASS | PASS | -+ | 002 | PASS | PASS | PASS | -+ | 003 | PASS | PASS | PASS | -+ | 004 | PASS | PASS | PASS | -+ | 005 | PASS | PASS | PASS | -+ | 006 | PASS | PASS | ERROR | -+ | 007 | PASS | PASS | ERROR | -+ | 008 | PASS | PASS | PASS | -+ | 009 | PASS | PASS | PASS | -+ | 010 | PASS | PASS | PASS | -+ | 011 | PASS | PASS | PASS | -+ | 012 | PASS | PASS | ERROR | -+ | 013 | PASS | PASS | ERROR | -+ | 014 | PASS | PASS | ERROR | -+ | 015 | PASS | PASS | ERROR | -+ | 016 | PASS | PASS | ERROR | -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/run.sh b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/run.sh -new file mode 100644 -index 0000000..8912310 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_global_and_struct/010_fortran_call_c_global/run.sh -@@ -0,0 +1,22 @@ -+for i in {001..016} -+do -+echo "------- test $i ------." -+echo "----- gfortran result:" -+gcc c_func$i.c -c -o c-test.o -+gfortran fortran_main$i.f90 -fno-range-check -c -o fortran-test.o -+gfortran c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+echo "----- flang-new result : " -+clang c_func$i.c -c -o c-test.o -+flang-new fortran_main$i.f90 -c -o fortran-test.o -+flang-new -flang-experimental-exec c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+echo "----- nvfortran result : " -+clang c_func$i.c -c -o c-test.o -+nvfortran fortran_main$i.f90 -c -o fortran-test.o -+nvfortran c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+done -\ No newline at end of file --- -2.25.1 - diff --git a/11-test-interoperability-with-c-c-call-fortran-array.patch b/11-test-interoperability-with-c-c-call-fortran-array.patch deleted file mode 100644 index ca03a0cff2d3b83f3368f8a8fa399591493ca896..0000000000000000000000000000000000000000 --- a/11-test-interoperability-with-c-c-call-fortran-array.patch +++ /dev/null @@ -1,1906 +0,0 @@ -From 328a19605b0fb7da6c5ee0e56a58a0ffdb1e7a3b Mon Sep 17 00:00:00 2001 -From: xieyihui -Date: Fri, 18 Nov 2022 13:01:06 +0800 -Subject: [PATCH] Add new test cases about array for interoperability with C - about C call fortran - -diff --git a/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main001.c b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main001.c -new file mode 100644 -index 0000000..621bebb ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main001.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the array type and the array type is int -+// -+#include -+extern void f_func_(int *i); -+int main() { -+ int i[5]; -+ f_func_(i); -+ for(int n = 0; n < 5; n++) { -+ printf("%d\n", i[n]); -+ } -+} -diff --git a/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main002.c b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main002.c -new file mode 100644 -index 0000000..c09f25d ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main002.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the array type and the array type is short -+// -+#include -+extern void f_func_(short *i); -+int main() { -+ short i[5]; -+ f_func_(i); -+ for(int n = 0; n < 5; n++) { -+ printf("%d\n", i[n]); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main003.c b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main003.c -new file mode 100644 -index 0000000..661840e ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main003.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the array type and the array type is long -+// -+#include -+extern void f_func_(long *i); -+int main() { -+ long i[5]; -+ f_func_(i); -+ for(int n = 0; n < 5; n++) { -+ printf("%ld\n", i[n]); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main004.c b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main004.c -new file mode 100644 -index 0000000..ad4d69c ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main004.c -@@ -0,0 +1,12 @@ -+// Test c call fortran for the array type and the array type is long -+// long -+// -+#include -+extern void f_func_(long long *i); -+int main() { -+ long long i[5]; -+ f_func_(i); -+ for(int n = 0; n < 5; n++) { -+ printf("%Ld\n", i[n]); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main005.c b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main005.c -new file mode 100644 -index 0000000..23ad3c8 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main005.c -@@ -0,0 +1,12 @@ -+// Test c call fortran for the array type and the array type is signed -+// char -+// -+#include -+extern void f_func_(signed char *i); -+int main() { -+ signed char i[5]; -+ f_func_(i); -+ for(int n = 0; n < 5; n++) { -+ printf("%hhd\n", i[n]); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main006.c b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main006.c -new file mode 100644 -index 0000000..f474697 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main006.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the array type and the array type is size_t -+// -+#include -+extern void f_func_(size_t *i); -+int main() { -+ size_t i[5]; -+ f_func_(i); -+ for(int n = 0; n < 5; n++) { -+ printf("%ld\n", i[n]); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main007.c b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main007.c -new file mode 100644 -index 0000000..9d94602 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main007.c -@@ -0,0 +1,12 @@ -+// Test c call fortran for the array type and the array type is int8_t -+// -+#include -+#include -+extern void f_func_(int8_t *i); -+int main() { -+ int8_t i[5]; -+ f_func_(i); -+ for(int n = 0; n < 5; n++) { -+ printf("%hhd\n", i[n]); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main008.c b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main008.c -new file mode 100644 -index 0000000..6854e0f ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main008.c -@@ -0,0 +1,12 @@ -+// Test c call fortran for the array type and the array type is int16_t -+// -+#include -+#include -+extern void f_func_(int16_t *i); -+int main() { -+ int16_t i[5]; -+ f_func_(i); -+ for(int n = 0; n < 5; n++) { -+ printf("%hd\n", i[n]); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main009.c b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main009.c -new file mode 100644 -index 0000000..a9be21e ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main009.c -@@ -0,0 +1,12 @@ -+// Test c call fortran for the array type and the array type is int32_t -+// -+#include -+#include -+extern void f_func_(int32_t *i); -+int main() { -+ int32_t i[5]; -+ f_func_(i); -+ for(int n = 0; n < 5; n++) { -+ printf("%d\n", i[n]); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main010.c b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main010.c -new file mode 100644 -index 0000000..cbdf3bb ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main010.c -@@ -0,0 +1,12 @@ -+// Test c call fortran for the array type and the array type is int64_t -+// -+#include -+#include -+extern void f_func_(int64_t *i); -+int main() { -+ int64_t i[5]; -+ f_func_(i); -+ for(int n = 0; n < 5; n++) { -+ printf("%ld\n", i[n]); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main011.c b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main011.c -new file mode 100644 -index 0000000..690ea3a ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main011.c -@@ -0,0 +1,13 @@ -+// Test c call fortran for the array type and the array type is -+// int_least8_t -+// -+#include -+#include -+extern void f_func_(int_least8_t *i); -+int main() { -+ int_least8_t i[5]; -+ f_func_(i); -+ for(int n = 0; n < 5; n++) { -+ printf("%hhd\n", i[n]); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main012.c b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main012.c -new file mode 100644 -index 0000000..89424aa ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main012.c -@@ -0,0 +1,13 @@ -+// Test c call fortran for the array type and the array type is -+// int_least16_t -+// -+#include -+#include -+extern void f_func_(int_least16_t *i); -+int main() { -+ int_least16_t i[5]; -+ f_func_(i); -+ for(int n = 0; n < 5; n++) { -+ printf("%hd\n", i[n]); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main013.c b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main013.c -new file mode 100644 -index 0000000..491e593 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main013.c -@@ -0,0 +1,13 @@ -+// Test c call fortran for the array type and the array type is -+// int_least32_t -+// -+#include -+#include -+extern void f_func_(int_least32_t *i); -+int main() { -+ int_least32_t i[5]; -+ f_func_(i); -+ for(int n = 0; n < 5; n++) { -+ printf("%d\n", i[n]); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main014.c b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main014.c -new file mode 100644 -index 0000000..8cbd80c ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main014.c -@@ -0,0 +1,13 @@ -+// Test c call fortran for the array type and the array type is -+// int_least64_t -+// -+#include -+#include -+extern void f_func_(int_least64_t *i); -+int main() { -+ int_least64_t i[5]; -+ f_func_(i); -+ for(int n = 0; n < 5; n++) { -+ printf("%ld\n", i[n]); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main015.c b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main015.c -new file mode 100644 -index 0000000..1e63863 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main015.c -@@ -0,0 +1,13 @@ -+// Test c call fortran for the array type and the array type is -+// int_fast8_t -+// -+#include -+#include -+extern void f_func_(int_fast8_t *i); -+int main() { -+ int_fast8_t i[5]; -+ f_func_(i); -+ for(int n = 0; n < 5; n++) { -+ printf("%hhd\n", i[n]); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main016.c b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main016.c -new file mode 100644 -index 0000000..e4fea02 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main016.c -@@ -0,0 +1,13 @@ -+// Test c call fortran for the array type and the array type is -+// int_fast16_t -+// -+#include -+#include -+extern void f_func_(int_fast16_t *i); -+int main() { -+ int_fast16_t i[5]; -+ f_func_(i); -+ for(int n = 0; n < 5; n++) { -+ printf("%ld\n", i[n]); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main017.c b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main017.c -new file mode 100644 -index 0000000..f8cbf67 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main017.c -@@ -0,0 +1,13 @@ -+// Test c call fortran for the array type and the array type is -+// int_fast32_t -+// -+#include -+#include -+extern void f_func_(int_fast32_t *i); -+int main() { -+ int_fast32_t i[5]; -+ f_func_(i); -+ for(int n = 0; n < 5; n++) { -+ printf("%ld\n", i[n]); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main018.c b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main018.c -new file mode 100644 -index 0000000..e9ebf24 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main018.c -@@ -0,0 +1,13 @@ -+// Test c call fortran for the array type and the array type is -+// int_fast64_t -+// -+#include -+#include -+extern void f_func_(int_fast64_t *i); -+int main() { -+ int_fast64_t i[5]; -+ f_func_(i); -+ for(int n = 0; n < 5; n++) { -+ printf("%ld\n", i[n]); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main019.c b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main019.c -new file mode 100644 -index 0000000..d35e1eb ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main019.c -@@ -0,0 +1,13 @@ -+// Test c call fortran for the array type and the array type is -+// intmax_t -+// -+#include -+#include -+extern void f_func_(intmax_t *i); -+int main() { -+ intmax_t i[5]; -+ f_func_(i); -+ for(int n = 0; n < 5; n++) { -+ printf("%ld\n", i[n]); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main020.c b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main020.c -new file mode 100644 -index 0000000..5bb25eb ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main020.c -@@ -0,0 +1,13 @@ -+// Test c call fortran for the array type and the array type is -+// intptr_t -+// -+#include -+#include -+extern void f_func_(intptr_t *i); -+int main() { -+ intptr_t i[5]; -+ f_func_(i); -+ for(int n = 0; n < 5; n++) { -+ printf("%ld\n", i[n]); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main021.c b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main021.c -new file mode 100644 -index 0000000..e8d8891 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main021.c -@@ -0,0 +1,12 @@ -+// Test c call fortran for the array type and the array type is float -+// -+#include -+#include -+extern void f_func_(float *i); -+int main() { -+ float i[5]; -+ f_func_(i); -+ for(int n = 0; n < 5; n++) { -+ printf("%0.20f\n", i[n]); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main022.c b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main022.c -new file mode 100644 -index 0000000..b284e25 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main022.c -@@ -0,0 +1,12 @@ -+// Test c call fortran for the array type and the array type is double -+// -+#include -+#include -+extern void f_func_(double *i); -+int main() { -+ double i[5]; -+ f_func_(i); -+ for(int n = 0; n < 5; n++) { -+ printf("%0.20lf\n", i[n]); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main023.c b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main023.c -new file mode 100644 -index 0000000..be8cf39 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main023.c -@@ -0,0 +1,13 @@ -+// Test c call fortran for the array type and the array type is long -+// double -+// -+#include -+#include -+extern void f_func_(long double *i); -+int main() { -+ long double i[5]; -+ f_func_(i); -+ for(int n = 0; n < 5; n++) { -+ printf("%0.20Lf\n", i[n]); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main024.c b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main024.c -new file mode 100644 -index 0000000..78ae53c ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main024.c -@@ -0,0 +1,13 @@ -+// Test c call fortran for the array type and the array type is float -+// _Complex -+// -+#include -+#include -+extern void f_func_(float _Complex *i); -+int main() { -+ float _Complex i[5]; -+ f_func_(i); -+ for(int n = 0; n < 5; n++) { -+ printf("%0.20f + %0.20fi\n", creal(i[n]), cimag(i[n])); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main025.c b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main025.c -new file mode 100644 -index 0000000..8676855 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main025.c -@@ -0,0 +1,13 @@ -+// Test c call fortran for the array type and the array type is double -+// _Complex -+// -+#include -+#include -+extern void f_func_(double _Complex *i); -+int main() { -+ double _Complex i[5]; -+ f_func_(i); -+ for(int n = 0; n < 5; n++) { -+ printf("%0.20lf + %0.20lfi\n", creal(i[n]), cimag(i[n])); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main026.c b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main026.c -new file mode 100644 -index 0000000..50221e7 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main026.c -@@ -0,0 +1,13 @@ -+// Test c call fortran for the array type and the array type is long -+// double _Complex -+// -+#include -+#include -+extern void f_func_(long double _Complex *i); -+int main() { -+ long double _Complex i[5]; -+ f_func_(i); -+ for(int n = 0; n < 5; n++) { -+ printf("%0.20lf + %0.20lfi\n", creal(i[n]), cimag(i[n])); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main027.c b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main027.c -new file mode 100644 -index 0000000..49ef333 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main027.c -@@ -0,0 +1,12 @@ -+// Test c call fortran for the array type and the array type is _Bool -+// -+#include -+#include -+extern void f_func_(_Bool *i); -+int main() { -+ _Bool i[5]; -+ f_func_(i); -+ for(int n = 0; n < 5; n++) { -+ printf("%d\n", i[n]); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main028.c b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main028.c -new file mode 100644 -index 0000000..6130858 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/c_main028.c -@@ -0,0 +1,12 @@ -+// Test c call fortran for the array type and the array type is char -+// -+#include -+#include -+extern void f_func_(char *i); -+int main() { -+ char i[5]; -+ f_func_(i); -+ for(int n = 0; n < 5; n++) { -+ printf("%c\n", i[n]); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func001.f90 b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func001.f90 -new file mode 100644 -index 0000000..f6f9163 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func001.f90 -@@ -0,0 +1,6 @@ -+subroutine f_func(i) -+ integer, dimension(*) :: i -+ do n = 1, 5 -+ i(n) = n -+ end do -+end -diff --git a/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func002.f90 b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func002.f90 -new file mode 100644 -index 0000000..67a7fac ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func002.f90 -@@ -0,0 +1,6 @@ -+subroutine f_func(i) -+ integer(2), dimension(*) :: i -+ do n = 1, 5 -+ i(n) = n -+ end do -+end -diff --git a/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func003.f90 b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func003.f90 -new file mode 100644 -index 0000000..d2b5a12 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func003.f90 -@@ -0,0 +1,6 @@ -+subroutine f_func(i) -+ integer(8), dimension(*) :: i -+ do n = 1, 5 -+ i(n) = n -+ end do -+end -diff --git a/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func004.f90 b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func004.f90 -new file mode 100644 -index 0000000..d2b5a12 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func004.f90 -@@ -0,0 +1,6 @@ -+subroutine f_func(i) -+ integer(8), dimension(*) :: i -+ do n = 1, 5 -+ i(n) = n -+ end do -+end -diff --git a/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func005.f90 b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func005.f90 -new file mode 100644 -index 0000000..a993613 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func005.f90 -@@ -0,0 +1,6 @@ -+subroutine f_func(i) -+ integer(1), dimension(*) :: i -+ do n = 1, 5 -+ i(n) = n -+ end do -+end -diff --git a/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func006.f90 b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func006.f90 -new file mode 100644 -index 0000000..d2b5a12 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func006.f90 -@@ -0,0 +1,6 @@ -+subroutine f_func(i) -+ integer(8), dimension(*) :: i -+ do n = 1, 5 -+ i(n) = n -+ end do -+end -diff --git a/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func007.f90 b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func007.f90 -new file mode 100644 -index 0000000..a993613 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func007.f90 -@@ -0,0 +1,6 @@ -+subroutine f_func(i) -+ integer(1), dimension(*) :: i -+ do n = 1, 5 -+ i(n) = n -+ end do -+end -diff --git a/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func008.f90 b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func008.f90 -new file mode 100644 -index 0000000..67a7fac ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func008.f90 -@@ -0,0 +1,6 @@ -+subroutine f_func(i) -+ integer(2), dimension(*) :: i -+ do n = 1, 5 -+ i(n) = n -+ end do -+end -diff --git a/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func009.f90 b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func009.f90 -new file mode 100644 -index 0000000..c5f780d ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func009.f90 -@@ -0,0 +1,6 @@ -+subroutine f_func(i) -+ integer(4), dimension(*) :: i -+ do n = 1, 5 -+ i(n) = n -+ end do -+end -diff --git a/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func010.f90 b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func010.f90 -new file mode 100644 -index 0000000..d2b5a12 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func010.f90 -@@ -0,0 +1,6 @@ -+subroutine f_func(i) -+ integer(8), dimension(*) :: i -+ do n = 1, 5 -+ i(n) = n -+ end do -+end -diff --git a/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func011.f90 b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func011.f90 -new file mode 100644 -index 0000000..a993613 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func011.f90 -@@ -0,0 +1,6 @@ -+subroutine f_func(i) -+ integer(1), dimension(*) :: i -+ do n = 1, 5 -+ i(n) = n -+ end do -+end -diff --git a/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func012.f90 b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func012.f90 -new file mode 100644 -index 0000000..67a7fac ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func012.f90 -@@ -0,0 +1,6 @@ -+subroutine f_func(i) -+ integer(2), dimension(*) :: i -+ do n = 1, 5 -+ i(n) = n -+ end do -+end -diff --git a/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func013.f90 b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func013.f90 -new file mode 100644 -index 0000000..c5f780d ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func013.f90 -@@ -0,0 +1,6 @@ -+subroutine f_func(i) -+ integer(4), dimension(*) :: i -+ do n = 1, 5 -+ i(n) = n -+ end do -+end -diff --git a/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func014.f90 b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func014.f90 -new file mode 100644 -index 0000000..d2b5a12 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func014.f90 -@@ -0,0 +1,6 @@ -+subroutine f_func(i) -+ integer(8), dimension(*) :: i -+ do n = 1, 5 -+ i(n) = n -+ end do -+end -diff --git a/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func015.f90 b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func015.f90 -new file mode 100644 -index 0000000..a993613 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func015.f90 -@@ -0,0 +1,6 @@ -+subroutine f_func(i) -+ integer(1), dimension(*) :: i -+ do n = 1, 5 -+ i(n) = n -+ end do -+end -diff --git a/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func016.f90 b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func016.f90 -new file mode 100644 -index 0000000..d2b5a12 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func016.f90 -@@ -0,0 +1,6 @@ -+subroutine f_func(i) -+ integer(8), dimension(*) :: i -+ do n = 1, 5 -+ i(n) = n -+ end do -+end -diff --git a/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func017.f90 b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func017.f90 -new file mode 100644 -index 0000000..d2b5a12 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func017.f90 -@@ -0,0 +1,6 @@ -+subroutine f_func(i) -+ integer(8), dimension(*) :: i -+ do n = 1, 5 -+ i(n) = n -+ end do -+end -diff --git a/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func018.f90 b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func018.f90 -new file mode 100644 -index 0000000..d2b5a12 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func018.f90 -@@ -0,0 +1,6 @@ -+subroutine f_func(i) -+ integer(8), dimension(*) :: i -+ do n = 1, 5 -+ i(n) = n -+ end do -+end -diff --git a/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func019.f90 b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func019.f90 -new file mode 100644 -index 0000000..d2b5a12 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func019.f90 -@@ -0,0 +1,6 @@ -+subroutine f_func(i) -+ integer(8), dimension(*) :: i -+ do n = 1, 5 -+ i(n) = n -+ end do -+end -diff --git a/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func020.f90 b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func020.f90 -new file mode 100644 -index 0000000..d2b5a12 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func020.f90 -@@ -0,0 +1,6 @@ -+subroutine f_func(i) -+ integer(8), dimension(*) :: i -+ do n = 1, 5 -+ i(n) = n -+ end do -+end -diff --git a/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func021.f90 b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func021.f90 -new file mode 100644 -index 0000000..3f9350c ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func021.f90 -@@ -0,0 +1,6 @@ -+subroutine f_func(i) -+ real(4), dimension(*) :: i -+ do n = 1, 5 -+ i(n) = n + 3.14159265358979 -+ end do -+end -diff --git a/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func022.f90 b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func022.f90 -new file mode 100644 -index 0000000..7f8ec30 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func022.f90 -@@ -0,0 +1,6 @@ -+subroutine f_func(i) -+ real(8), dimension(*) :: i -+ do n = 1, 5 -+ i(n) = n + 3.14159265358979 -+ end do -+end -diff --git a/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func023.f90 b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func023.f90 -new file mode 100644 -index 0000000..1ac77a3 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func023.f90 -@@ -0,0 +1,7 @@ -+subroutine f_func(i) -+ integer, parameter :: K = selected_real_kind(16) -+ real(K), dimension(*) :: i -+ do n = 1, 5 -+ i(n) = n + 3.14159265358979 -+ end do -+end -diff --git a/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func024.f90 b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func024.f90 -new file mode 100644 -index 0000000..fb4fe82 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func024.f90 -@@ -0,0 +1,6 @@ -+subroutine f_func(i) -+ complex(4), dimension(*) :: i -+ do n = 1, 5 -+ i(n) = (-12345678.7654321, 1) -+ end do -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func025.f90 b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func025.f90 -new file mode 100644 -index 0000000..a8953b9 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func025.f90 -@@ -0,0 +1,6 @@ -+subroutine f_func(i) -+ complex(8), dimension(*) :: i -+ do n = 1, 5 -+ i(n) = (-12345678.7654321, 1) -+ end do -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func026.f90 b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func026.f90 -new file mode 100644 -index 0000000..28c3971 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func026.f90 -@@ -0,0 +1,7 @@ -+subroutine f_func(i) -+ integer, parameter :: K = selected_real_kind(16) -+ complex(K), dimension(*) :: i -+ do n = 1, 5 -+ i(n) = (-12345678.7654321, 1) -+ end do -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func027.f90 b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func027.f90 -new file mode 100644 -index 0000000..3f45a9a ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func027.f90 -@@ -0,0 +1,6 @@ -+subroutine f_func(i) -+ logical(1), dimension(*) :: i -+ do n = 1, 5 -+ i(n) = .TRUE. -+ end do -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func028.f90 b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func028.f90 -new file mode 100644 -index 0000000..2153d9b ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/fortran_func028.f90 -@@ -0,0 +1,6 @@ -+subroutine f_func(i) -+ character(1), dimension(*) :: i -+ do n = 1, 5 -+ i(n) = 'a' -+ end do -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/result.md b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/result.md -new file mode 100644 -index 0000000..347da21 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/result.md -@@ -0,0 +1,29 @@ -+ | test | gfortran | flang | -+ | 001 | PASS | PASS | -+ | 002 | PASS | PASS | -+ | 003 | PASS | PASS | -+ | 004 | PASS | PASS | -+ | 005 | PASS | PASS | -+ | 006 | PASS | PASS | -+ | 007 | PASS | PASS | -+ | 008 | PASS | PASS | -+ | 009 | PASS | PASS | -+ | 010 | PASS | PASS | -+ | 011 | PASS | PASS | -+ | 012 | PASS | PASS | -+ | 013 | PASS | PASS | -+ | 014 | PASS | PASS | -+ | 015 | PASS | PASS | -+ | 016 | PASS | PASS | -+ | 017 | PASS | PASS | -+ | 018 | PASS | PASS | -+ | 019 | PASS | PASS | -+ | 020 | PASS | PASS | -+ | 021 | PASS | PASS | -+ | 022 | PASS | PASS | -+ | 023 | PASS | PASS | -+ | 024 | PASS | PASS | -+ | 025 | PASS | PASS | -+ | 026 | PASS | PASS | -+ | 027 | PASS | PASS | -+ | 028 | PASS | PASS | -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/run.sh b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/run.sh -new file mode 100644 -index 0000000..5b2202e ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_array/001_c_call_fortran_array/run.sh -@@ -0,0 +1,16 @@ -+for i in {001..028} -+do -+echo "------- test $i ------." -+echo "----- gfortran result:" -+gcc c_main$i.c -c -o c-test.o -+gfortran fortran_func$i.f90 -fno-range-check -c -o fortran-test.o -+gfortran fortran-test.o c-test.o -+./a.out -+rm *.o a.out -+echo "----- flang-new result : " -+clang c_main$i.c -c -o c-test.o -+flang-new fortran_func$i.f90 -c -o fortran-test.o -+flang-new -flang-experimental-exec c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+done -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main001.c b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main001.c -new file mode 100644 -index 0000000..104f21c ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main001.c -@@ -0,0 +1,12 @@ -+// Test c call fortran for the array type and the array type is int -+// with bindc -+// -+#include -+extern void f_func_(int *i); -+int main() { -+ int i[5]; -+ f_func_(i); -+ for(int n = 0; n < 5; n++) { -+ printf("%d\n", i[n]); -+ } -+} -diff --git a/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main002.c b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main002.c -new file mode 100644 -index 0000000..1c74e75 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main002.c -@@ -0,0 +1,12 @@ -+// Test c call fortran for the array type and the array type is short -+// with bindc -+// -+#include -+extern void f_func_(short *i); -+int main() { -+ short i[5]; -+ f_func_(i); -+ for(int n = 0; n < 5; n++) { -+ printf("%d\n", i[n]); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main003.c b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main003.c -new file mode 100644 -index 0000000..661840e ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main003.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the array type and the array type is long -+// -+#include -+extern void f_func_(long *i); -+int main() { -+ long i[5]; -+ f_func_(i); -+ for(int n = 0; n < 5; n++) { -+ printf("%ld\n", i[n]); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main004.c b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main004.c -new file mode 100644 -index 0000000..18788ca ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main004.c -@@ -0,0 +1,12 @@ -+// Test c call fortran for the array type and the array type is long -+// long with bindc -+// -+#include -+extern void f_func_(long long *i); -+int main() { -+ long long i[5]; -+ f_func_(i); -+ for(int n = 0; n < 5; n++) { -+ printf("%Ld\n", i[n]); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main005.c b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main005.c -new file mode 100644 -index 0000000..af4be4b ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main005.c -@@ -0,0 +1,12 @@ -+// Test c call fortran for the array type and the array type is signed -+// char with bindc -+// -+#include -+extern void f_func_(signed char *i); -+int main() { -+ signed char i[5]; -+ f_func_(i); -+ for(int n = 0; n < 5; n++) { -+ printf("%hhd\n", i[n]); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main006.c b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main006.c -new file mode 100644 -index 0000000..b0e7f4d ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main006.c -@@ -0,0 +1,12 @@ -+// Test c call fortran for the array type and the array type is size_t -+// with bindc -+// -+#include -+extern void f_func_(size_t *i); -+int main() { -+ size_t i[5]; -+ f_func_(i); -+ for(int n = 0; n < 5; n++) { -+ printf("%ld\n", i[n]); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main007.c b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main007.c -new file mode 100644 -index 0000000..e1d7d12 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main007.c -@@ -0,0 +1,13 @@ -+// Test c call fortran for the array type and the array type is int8_t -+// with bindc -+// -+#include -+#include -+extern void f_func_(int8_t *i); -+int main() { -+ int8_t i[5]; -+ f_func_(i); -+ for(int n = 0; n < 5; n++) { -+ printf("%hhd\n", i[n]); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main008.c b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main008.c -new file mode 100644 -index 0000000..99df9f9 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main008.c -@@ -0,0 +1,13 @@ -+// Test c call fortran for the array type and the array type is int16_t -+// with bindc -+// -+#include -+#include -+extern void f_func_(int16_t *i); -+int main() { -+ int16_t i[5]; -+ f_func_(i); -+ for(int n = 0; n < 5; n++) { -+ printf("%hd\n", i[n]); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main009.c b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main009.c -new file mode 100644 -index 0000000..f5f3d76 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main009.c -@@ -0,0 +1,13 @@ -+// Test c call fortran for the array type and the array type is int32_t -+// with bindc -+// -+#include -+#include -+extern void f_func_(int32_t *i); -+int main() { -+ int32_t i[5]; -+ f_func_(i); -+ for(int n = 0; n < 5; n++) { -+ printf("%d\n", i[n]); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main010.c b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main010.c -new file mode 100644 -index 0000000..db9c8e0 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main010.c -@@ -0,0 +1,13 @@ -+// Test c call fortran for the array type and the array type is int64_t -+// with bindc -+// -+#include -+#include -+extern void f_func_(int64_t *i); -+int main() { -+ int64_t i[5]; -+ f_func_(i); -+ for(int n = 0; n < 5; n++) { -+ printf("%ld\n", i[n]); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main011.c b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main011.c -new file mode 100644 -index 0000000..d7a4379 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main011.c -@@ -0,0 +1,13 @@ -+// Test c call fortran for the array type and the array type is -+// int_least8_t with bindc -+// -+#include -+#include -+extern void f_func_(int_least8_t *i); -+int main() { -+ int_least8_t i[5]; -+ f_func_(i); -+ for(int n = 0; n < 5; n++) { -+ printf("%hhd\n", i[n]); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main012.c b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main012.c -new file mode 100644 -index 0000000..5e8a295 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main012.c -@@ -0,0 +1,13 @@ -+// Test c call fortran for the array type and the array type is -+// int_least16_t with bindc -+// -+#include -+#include -+extern void f_func_(int_least16_t *i); -+int main() { -+ int_least16_t i[5]; -+ f_func_(i); -+ for(int n = 0; n < 5; n++) { -+ printf("%hd\n", i[n]); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main013.c b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main013.c -new file mode 100644 -index 0000000..37c0e17 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main013.c -@@ -0,0 +1,13 @@ -+// Test c call fortran for the array type and the array type is -+// int_least32_t with bindc -+// -+#include -+#include -+extern void f_func_(int_least32_t *i); -+int main() { -+ int_least32_t i[5]; -+ f_func_(i); -+ for(int n = 0; n < 5; n++) { -+ printf("%d\n", i[n]); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main014.c b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main014.c -new file mode 100644 -index 0000000..5ba4762 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main014.c -@@ -0,0 +1,13 @@ -+// Test c call fortran for the array type and the array type is -+// int_least64_t with bindc -+// -+#include -+#include -+extern void f_func_(int_least64_t *i); -+int main() { -+ int_least64_t i[5]; -+ f_func_(i); -+ for(int n = 0; n < 5; n++) { -+ printf("%ld\n", i[n]); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main015.c b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main015.c -new file mode 100644 -index 0000000..905c80a ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main015.c -@@ -0,0 +1,13 @@ -+// Test c call fortran for the array type and the array type is -+// int_fast8_t with bindc -+// -+#include -+#include -+extern void f_func_(int_fast8_t *i); -+int main() { -+ int_fast8_t i[5]; -+ f_func_(i); -+ for(int n = 0; n < 5; n++) { -+ printf("%hhd\n", i[n]); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main016.c b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main016.c -new file mode 100644 -index 0000000..51fe904 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main016.c -@@ -0,0 +1,13 @@ -+// Test c call fortran for the array type and the array type is -+// int_fast16_t with bindc -+// -+#include -+#include -+extern void f_func_(int_fast16_t *i); -+int main() { -+ int_fast16_t i[5]; -+ f_func_(i); -+ for(int n = 0; n < 5; n++) { -+ printf("%ld\n", i[n]); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main017.c b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main017.c -new file mode 100644 -index 0000000..6e2b2ce ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main017.c -@@ -0,0 +1,13 @@ -+// Test c call fortran for the array type and the array type is -+// int_fast32_t with bindc -+// -+#include -+#include -+extern void f_func_(int_fast32_t *i); -+int main() { -+ int_fast32_t i[5]; -+ f_func_(i); -+ for(int n = 0; n < 5; n++) { -+ printf("%ld\n", i[n]); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main018.c b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main018.c -new file mode 100644 -index 0000000..fbddce9 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main018.c -@@ -0,0 +1,13 @@ -+// Test c call fortran for the array type and the array type is -+// int_fast64_t with bindc -+// -+#include -+#include -+extern void f_func_(int_fast64_t *i); -+int main() { -+ int_fast64_t i[5]; -+ f_func_(i); -+ for(int n = 0; n < 5; n++) { -+ printf("%ld\n", i[n]); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main019.c b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main019.c -new file mode 100644 -index 0000000..effe5a0 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main019.c -@@ -0,0 +1,13 @@ -+// Test c call fortran for the array type and the array type is -+// intmax_t with bindc -+// -+#include -+#include -+extern void f_func_(intmax_t *i); -+int main() { -+ intmax_t i[5]; -+ f_func_(i); -+ for(int n = 0; n < 5; n++) { -+ printf("%ld\n", i[n]); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main020.c b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main020.c -new file mode 100644 -index 0000000..f85b7b6 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main020.c -@@ -0,0 +1,13 @@ -+// Test c call fortran for the array type and the array type is -+// intptr_t with bindc -+// -+#include -+#include -+extern void f_func_(intptr_t *i); -+int main() { -+ intptr_t i[5]; -+ f_func_(i); -+ for(int n = 0; n < 5; n++) { -+ printf("%ld\n", i[n]); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main021.c b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main021.c -new file mode 100644 -index 0000000..57e502b ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main021.c -@@ -0,0 +1,13 @@ -+// Test c call fortran for the array type and the array type is float -+// with bindc -+// -+#include -+#include -+extern void f_func_(float *i); -+int main() { -+ float i[5]; -+ f_func_(i); -+ for(int n = 0; n < 5; n++) { -+ printf("%0.20f\n", i[n]); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main022.c b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main022.c -new file mode 100644 -index 0000000..ef29ded ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main022.c -@@ -0,0 +1,13 @@ -+// Test c call fortran for the array type and the array type is double -+// with bindc -+// -+#include -+#include -+extern void f_func_(double *i); -+int main() { -+ double i[5]; -+ f_func_(i); -+ for(int n = 0; n < 5; n++) { -+ printf("%0.20lf\n", i[n]); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main023.c b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main023.c -new file mode 100644 -index 0000000..54098bd ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main023.c -@@ -0,0 +1,13 @@ -+// Test c call fortran for the array type and the array type is long -+// double with bindc -+// -+#include -+#include -+extern void f_func_(long double *i); -+int main() { -+ long double i[5]; -+ f_func_(i); -+ for(int n = 0; n < 5; n++) { -+ printf("%0.20Lf\n", i[n]); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main024.c b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main024.c -new file mode 100644 -index 0000000..1f09f05 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main024.c -@@ -0,0 +1,13 @@ -+// Test c call fortran for the array type and the array type is float -+// _Complex with bindc -+// -+#include -+#include -+extern void f_func_(float _Complex *i); -+int main() { -+ float _Complex i[5]; -+ f_func_(i); -+ for(int n = 0; n < 5; n++) { -+ printf("%0.20f + %0.20fi\n", creal(i[n]), cimag(i[n])); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main025.c b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main025.c -new file mode 100644 -index 0000000..196e624 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main025.c -@@ -0,0 +1,13 @@ -+// Test c call fortran for the array type and the array type is double -+// _Complex with bindc -+// -+#include -+#include -+extern void f_func_(double _Complex *i); -+int main() { -+ double _Complex i[5]; -+ f_func_(i); -+ for(int n = 0; n < 5; n++) { -+ printf("%0.20lf + %0.20lfi\n", creal(i[n]), cimag(i[n])); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main026.c b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main026.c -new file mode 100644 -index 0000000..8855d53 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main026.c -@@ -0,0 +1,13 @@ -+// Test c call fortran for the array type and the array type is long -+// double _Complex with bindc -+// -+#include -+#include -+extern void f_func_(long double _Complex *i); -+int main() { -+ long double _Complex i[5]; -+ f_func_(i); -+ for(int n = 0; n < 5; n++) { -+ printf("%0.20lf + %0.20lfi\n", creal(i[n]), cimag(i[n])); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main027.c b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main027.c -new file mode 100644 -index 0000000..e43e643 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main027.c -@@ -0,0 +1,13 @@ -+// Test c call fortran for the array type and the array type is _Bool -+// with bindc -+// -+#include -+#include -+extern void f_func_(_Bool *i); -+int main() { -+ _Bool i[5]; -+ f_func_(i); -+ for(int n = 0; n < 5; n++) { -+ printf("%d\n", i[n]); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main028.c b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main028.c -new file mode 100644 -index 0000000..8b449d5 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/c_main028.c -@@ -0,0 +1,13 @@ -+// Test c call fortran for the array type and the array type is char -+// with bindc -+// -+#include -+#include -+extern void f_func_(char *i); -+int main() { -+ char i[5]; -+ f_func_(i); -+ for(int n = 0; n < 5; n++) { -+ printf("%c\n", i[n]); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func001.f90 b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func001.f90 -new file mode 100644 -index 0000000..2b618c6 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func001.f90 -@@ -0,0 +1,6 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ integer, dimension(*) :: i -+ do n = 1, 5 -+ i(n) = n -+ end do -+end -diff --git a/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func002.f90 b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func002.f90 -new file mode 100644 -index 0000000..88bf55a ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func002.f90 -@@ -0,0 +1,6 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ integer(2), dimension(*) :: i -+ do n = 1, 5 -+ i(n) = n -+ end do -+end -diff --git a/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func003.f90 b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func003.f90 -new file mode 100644 -index 0000000..f7e9ec7 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func003.f90 -@@ -0,0 +1,6 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ integer(8), dimension(*) :: i -+ do n = 1, 5 -+ i(n) = n -+ end do -+end -diff --git a/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func004.f90 b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func004.f90 -new file mode 100644 -index 0000000..f7e9ec7 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func004.f90 -@@ -0,0 +1,6 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ integer(8), dimension(*) :: i -+ do n = 1, 5 -+ i(n) = n -+ end do -+end -diff --git a/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func005.f90 b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func005.f90 -new file mode 100644 -index 0000000..7f76df3 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func005.f90 -@@ -0,0 +1,6 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ integer(1), dimension(*) :: i -+ do n = 1, 5 -+ i(n) = n -+ end do -+end -diff --git a/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func006.f90 b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func006.f90 -new file mode 100644 -index 0000000..f7e9ec7 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func006.f90 -@@ -0,0 +1,6 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ integer(8), dimension(*) :: i -+ do n = 1, 5 -+ i(n) = n -+ end do -+end -diff --git a/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func007.f90 b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func007.f90 -new file mode 100644 -index 0000000..7f76df3 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func007.f90 -@@ -0,0 +1,6 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ integer(1), dimension(*) :: i -+ do n = 1, 5 -+ i(n) = n -+ end do -+end -diff --git a/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func008.f90 b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func008.f90 -new file mode 100644 -index 0000000..88bf55a ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func008.f90 -@@ -0,0 +1,6 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ integer(2), dimension(*) :: i -+ do n = 1, 5 -+ i(n) = n -+ end do -+end -diff --git a/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func009.f90 b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func009.f90 -new file mode 100644 -index 0000000..f1607ec ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func009.f90 -@@ -0,0 +1,6 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ integer(4), dimension(*) :: i -+ do n = 1, 5 -+ i(n) = n -+ end do -+end -diff --git a/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func010.f90 b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func010.f90 -new file mode 100644 -index 0000000..f7e9ec7 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func010.f90 -@@ -0,0 +1,6 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ integer(8), dimension(*) :: i -+ do n = 1, 5 -+ i(n) = n -+ end do -+end -diff --git a/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func011.f90 b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func011.f90 -new file mode 100644 -index 0000000..7f76df3 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func011.f90 -@@ -0,0 +1,6 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ integer(1), dimension(*) :: i -+ do n = 1, 5 -+ i(n) = n -+ end do -+end -diff --git a/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func012.f90 b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func012.f90 -new file mode 100644 -index 0000000..88bf55a ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func012.f90 -@@ -0,0 +1,6 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ integer(2), dimension(*) :: i -+ do n = 1, 5 -+ i(n) = n -+ end do -+end -diff --git a/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func013.f90 b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func013.f90 -new file mode 100644 -index 0000000..f1607ec ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func013.f90 -@@ -0,0 +1,6 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ integer(4), dimension(*) :: i -+ do n = 1, 5 -+ i(n) = n -+ end do -+end -diff --git a/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func014.f90 b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func014.f90 -new file mode 100644 -index 0000000..f7e9ec7 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func014.f90 -@@ -0,0 +1,6 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ integer(8), dimension(*) :: i -+ do n = 1, 5 -+ i(n) = n -+ end do -+end -diff --git a/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func015.f90 b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func015.f90 -new file mode 100644 -index 0000000..7f76df3 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func015.f90 -@@ -0,0 +1,6 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ integer(1), dimension(*) :: i -+ do n = 1, 5 -+ i(n) = n -+ end do -+end -diff --git a/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func016.f90 b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func016.f90 -new file mode 100644 -index 0000000..f7e9ec7 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func016.f90 -@@ -0,0 +1,6 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ integer(8), dimension(*) :: i -+ do n = 1, 5 -+ i(n) = n -+ end do -+end -diff --git a/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func017.f90 b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func017.f90 -new file mode 100644 -index 0000000..f7e9ec7 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func017.f90 -@@ -0,0 +1,6 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ integer(8), dimension(*) :: i -+ do n = 1, 5 -+ i(n) = n -+ end do -+end -diff --git a/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func018.f90 b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func018.f90 -new file mode 100644 -index 0000000..f7e9ec7 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func018.f90 -@@ -0,0 +1,6 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ integer(8), dimension(*) :: i -+ do n = 1, 5 -+ i(n) = n -+ end do -+end -diff --git a/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func019.f90 b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func019.f90 -new file mode 100644 -index 0000000..f7e9ec7 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func019.f90 -@@ -0,0 +1,6 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ integer(8), dimension(*) :: i -+ do n = 1, 5 -+ i(n) = n -+ end do -+end -diff --git a/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func020.f90 b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func020.f90 -new file mode 100644 -index 0000000..f7e9ec7 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func020.f90 -@@ -0,0 +1,6 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ integer(8), dimension(*) :: i -+ do n = 1, 5 -+ i(n) = n -+ end do -+end -diff --git a/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func021.f90 b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func021.f90 -new file mode 100644 -index 0000000..968582c ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func021.f90 -@@ -0,0 +1,6 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ real(4), dimension(*) :: i -+ do n = 1, 5 -+ i(n) = n + 3.14159265358979 -+ end do -+end -diff --git a/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func022.f90 b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func022.f90 -new file mode 100644 -index 0000000..6dedde8 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func022.f90 -@@ -0,0 +1,6 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ real(8), dimension(*) :: i -+ do n = 1, 5 -+ i(n) = n + 3.14159265358979 -+ end do -+end -diff --git a/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func023.f90 b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func023.f90 -new file mode 100644 -index 0000000..441062e ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func023.f90 -@@ -0,0 +1,7 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ integer, parameter :: K = selected_real_kind(16) -+ real(K), dimension(*) :: i -+ do n = 1, 5 -+ i(n) = n + 3.14159265358979 -+ end do -+end -diff --git a/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func024.f90 b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func024.f90 -new file mode 100644 -index 0000000..1de9dc0 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func024.f90 -@@ -0,0 +1,6 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ complex(4), dimension(*) :: i -+ do n = 1, 5 -+ i(n) = (-12345678.7654321, 1) -+ end do -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func025.f90 b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func025.f90 -new file mode 100644 -index 0000000..e7a7b5a ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func025.f90 -@@ -0,0 +1,6 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ complex(8), dimension(*) :: i -+ do n = 1, 5 -+ i(n) = (-12345678.7654321, 1) -+ end do -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func026.f90 b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func026.f90 -new file mode 100644 -index 0000000..af23ec9 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func026.f90 -@@ -0,0 +1,7 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ integer, parameter :: K = selected_real_kind(16) -+ complex(K), dimension(*) :: i -+ do n = 1, 5 -+ i(n) = (-12345678.7654321, 1) -+ end do -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func027.f90 b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func027.f90 -new file mode 100644 -index 0000000..1a4fc9d ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func027.f90 -@@ -0,0 +1,6 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ logical(1), dimension(*) :: i -+ do n = 1, 5 -+ i(n) = .TRUE. -+ end do -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func028.f90 b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func028.f90 -new file mode 100644 -index 0000000..e039766 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/fortran_func028.f90 -@@ -0,0 +1,6 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ character(1), dimension(*) :: i -+ do n = 1, 5 -+ i(n) = 'a' -+ end do -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/result.md b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/result.md -new file mode 100644 -index 0000000..347da21 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/result.md -@@ -0,0 +1,29 @@ -+ | test | gfortran | flang | -+ | 001 | PASS | PASS | -+ | 002 | PASS | PASS | -+ | 003 | PASS | PASS | -+ | 004 | PASS | PASS | -+ | 005 | PASS | PASS | -+ | 006 | PASS | PASS | -+ | 007 | PASS | PASS | -+ | 008 | PASS | PASS | -+ | 009 | PASS | PASS | -+ | 010 | PASS | PASS | -+ | 011 | PASS | PASS | -+ | 012 | PASS | PASS | -+ | 013 | PASS | PASS | -+ | 014 | PASS | PASS | -+ | 015 | PASS | PASS | -+ | 016 | PASS | PASS | -+ | 017 | PASS | PASS | -+ | 018 | PASS | PASS | -+ | 019 | PASS | PASS | -+ | 020 | PASS | PASS | -+ | 021 | PASS | PASS | -+ | 022 | PASS | PASS | -+ | 023 | PASS | PASS | -+ | 024 | PASS | PASS | -+ | 025 | PASS | PASS | -+ | 026 | PASS | PASS | -+ | 027 | PASS | PASS | -+ | 028 | PASS | PASS | -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/run.sh b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/run.sh -new file mode 100644 -index 0000000..5b2202e ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_array/002_c_call_fortan_array_bindc/run.sh -@@ -0,0 +1,16 @@ -+for i in {001..028} -+do -+echo "------- test $i ------." -+echo "----- gfortran result:" -+gcc c_main$i.c -c -o c-test.o -+gfortran fortran_func$i.f90 -fno-range-check -c -o fortran-test.o -+gfortran fortran-test.o c-test.o -+./a.out -+rm *.o a.out -+echo "----- flang-new result : " -+clang c_main$i.c -c -o c-test.o -+flang-new fortran_func$i.f90 -c -o fortran-test.o -+flang-new -flang-experimental-exec c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+done -\ No newline at end of file --- -2.25.1 - diff --git a/12-test-interoperability-with-c-c-call-fortran-function.patch b/12-test-interoperability-with-c-c-call-fortran-function.patch deleted file mode 100644 index a56b470cf538aee5df6f63d4926a63ecb07c341a..0000000000000000000000000000000000000000 --- a/12-test-interoperability-with-c-c-call-fortran-function.patch +++ /dev/null @@ -1,4345 +0,0 @@ -From 8fa00ecae018be771be6031c7468be3e8bed234b Mon Sep 17 00:00:00 2001 -From: xieyihui -Date: Fri, 18 Nov 2022 13:02:22 +0800 -Subject: [PATCH] Add new test cases about function for interoperability with C - about C call fortran - -diff --git a/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main001.c b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main001.c -new file mode 100644 -index 0000000..8889aba ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main001.c -@@ -0,0 +1,9 @@ -+// Test c call fortran for the return type is int -+// -+#include -+extern int f_func_(int *i); -+int main() { -+ int s1 = 5; -+ int res = f_func_(&s1); -+ printf("%d\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main002.c b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main002.c -new file mode 100644 -index 0000000..31b044f ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main002.c -@@ -0,0 +1,9 @@ -+// Test c call fortran for the return type is short -+// -+#include -+extern short f_func_(short *i); -+int main() { -+ short s1 = 5; -+ short res = f_func_(&s1); -+ printf("%hd\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main003.c b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main003.c -new file mode 100644 -index 0000000..d01bca9 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main003.c -@@ -0,0 +1,9 @@ -+// Test c call fortran for the return type is long -+// -+#include -+extern long f_func_(long *i); -+int main() { -+ long s1 = 5; -+ long res = f_func_(&s1); -+ printf("%ld\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main004.c b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main004.c -new file mode 100644 -index 0000000..7680380 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main004.c -@@ -0,0 +1,9 @@ -+// Test c call fortran for the return type is long long -+// -+#include -+extern long long f_func_(long long *i); -+int main() { -+ long long s1 = 5; -+ long long res = f_func_(&s1); -+ printf("%Ld\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main005.c b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main005.c -new file mode 100644 -index 0000000..4cf34d1 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main005.c -@@ -0,0 +1,9 @@ -+// Test c call fortran for the return type is signed char -+// -+#include -+extern signed char f_func_(signed char *i); -+int main() { -+ signed char s1 = 85; -+ signed char res = f_func_(&s1); -+ printf("%c\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main006.c b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main006.c -new file mode 100644 -index 0000000..1066139 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main006.c -@@ -0,0 +1,9 @@ -+// Test c call fortran for the return type is size_t -+// -+#include -+extern size_t f_func_(size_t *i); -+int main() { -+ size_t s1 = 5; -+ size_t res = f_func_(&s1); -+ printf("%ld\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main007.c b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main007.c -new file mode 100644 -index 0000000..547b2a1 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main007.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is int8_t -+// -+#include -+#include -+extern int8_t f_func_(int8_t *i); -+int main() { -+ int8_t s1 = 5; -+ int8_t res = f_func_(&s1); -+ printf("%hhd\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main008.c b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main008.c -new file mode 100644 -index 0000000..0a91427 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main008.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is int16_t -+// -+#include -+#include -+extern int16_t f_func_(int16_t *i); -+int main() { -+ int16_t s1 = 5; -+ int16_t res = f_func_(&s1); -+ printf("%hd\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main009.c b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main009.c -new file mode 100644 -index 0000000..ec7c9dd ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main009.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is int32_t -+// -+#include -+#include -+extern int32_t f_func_(int32_t *i); -+int main() { -+ int32_t s1 = 5; -+ int32_t res = f_func_(&s1); -+ printf("%d\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main010.c b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main010.c -new file mode 100644 -index 0000000..40aa8e9 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main010.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is int64_t -+// -+#include -+#include -+extern int64_t f_func_(int64_t *i); -+int main() { -+ int64_t s1 = 5; -+ int64_t res = f_func_(&s1); -+ printf("%ld\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main011.c b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main011.c -new file mode 100644 -index 0000000..2ff6688 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main011.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is int_least8_t -+// -+#include -+#include -+extern int_least8_t f_func_(int_least8_t *i); -+int main() { -+ int_least8_t s1 = 5; -+ int_least8_t res = f_func_(&s1); -+ printf("%hhd\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main012.c b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main012.c -new file mode 100644 -index 0000000..c332da0 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main012.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is int_least16_t -+// -+#include -+#include -+extern int_least16_t f_func_(int_least16_t *i); -+int main() { -+ int_least16_t s1 = 5; -+ int_least16_t res = f_func_(&s1); -+ printf("%hd\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main013.c b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main013.c -new file mode 100644 -index 0000000..f72441e ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main013.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is int_least32_t -+// -+#include -+#include -+extern int_least32_t f_func_(int_least32_t *i); -+int main() { -+ int_least32_t s1 = 5; -+ int_least32_t res = f_func_(&s1); -+ printf("%d\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main014.c b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main014.c -new file mode 100644 -index 0000000..4d98217 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main014.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is int_least64_t -+// -+#include -+#include -+extern int_least64_t f_func_(int_least64_t *i); -+int main() { -+ int_least64_t s1 = 5; -+ int_least64_t res = f_func_(&s1); -+ printf("%ld\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main015.c b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main015.c -new file mode 100644 -index 0000000..dd99955 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main015.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is int_fast8_t -+// -+#include -+#include -+extern int_fast8_t f_func_(int_fast8_t *i); -+int main() { -+ int_fast8_t s1 = 5; -+ int_fast8_t res = f_func_(&s1); -+ printf("%hhd\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main016.c b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main016.c -new file mode 100644 -index 0000000..c8ca6e2 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main016.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is int_fast16_t -+// -+#include -+#include -+extern int_fast16_t f_func_(int_fast16_t *i); -+int main() { -+ int_fast16_t s1 = 5; -+ int_fast16_t res = f_func_(&s1); -+ printf("%ld\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main017.c b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main017.c -new file mode 100644 -index 0000000..d5dbfa1 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main017.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is int_fast32_t -+// -+#include -+#include -+extern int_fast32_t f_func_(int_fast32_t *i); -+int main() { -+ int_fast32_t s1 = 5; -+ int_fast32_t res = f_func_(&s1); -+ printf("%ld\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main018.c b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main018.c -new file mode 100644 -index 0000000..11536d8 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main018.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is int_fast64_t -+// -+#include -+#include -+extern int_fast64_t f_func_(int_fast64_t *i); -+int main() { -+ int_fast64_t s1 = 5; -+ int_fast64_t res = f_func_(&s1); -+ printf("%ld\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main019.c b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main019.c -new file mode 100644 -index 0000000..c5c0ac0 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main019.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is intmax_t -+// -+#include -+#include -+extern intmax_t f_func_(intmax_t *i); -+int main() { -+ intmax_t s1 = 5; -+ intmax_t res = f_func_(&s1); -+ printf("%ld\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main020.c b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main020.c -new file mode 100644 -index 0000000..3985c08 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main020.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is intptr_t -+// -+#include -+#include -+extern intptr_t f_func_(intptr_t *i); -+int main() { -+ intptr_t s1 = 5; -+ intptr_t res = f_func_(&s1); -+ printf("%ld\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main021.c b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main021.c -new file mode 100644 -index 0000000..e260dd4 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main021.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is float -+// -+#include -+#include -+extern float f_func_(float *i); -+int main() { -+ float i = 0.5; -+ float res = f_func_(&i); -+ printf("%0.20f\n", res); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main022.c b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main022.c -new file mode 100644 -index 0000000..1e9fdd4 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main022.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is double -+// -+#include -+#include -+extern double f_func_(double *i); -+int main() { -+ double i = 0.5; -+ double res = f_func_(&i); -+ printf("%0.20lf\n", res); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main023.c b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main023.c -new file mode 100644 -index 0000000..8b1d692 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main023.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is long double -+// -+#include -+#include -+extern long double f_func_(long double *i); -+int main() { -+ long double i = 0.5; -+ long double res = f_func_(&i); -+ printf("%0.20Lf\n", res); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main024.c b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main024.c -new file mode 100644 -index 0000000..350055a ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main024.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is float _Complex -+// -+#include -+#include -+extern float _Complex f_func_(float _Complex *i); -+int main() { -+ float _Complex i; -+ float _Complex res = f_func_(&i); -+ printf("%0.20f + %0.20fi\n", creal(res), cimag(res)); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main025.c b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main025.c -new file mode 100644 -index 0000000..b81188d ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main025.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is double _Complex -+// -+#include -+#include -+extern double _Complex f_func_(double _Complex *i); -+int main() { -+ double _Complex i; -+ double _Complex res = f_func_(&i); -+ printf("%0.20lf + %0.20lfi\n", creal(res), cimag(res)); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main026.c b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main026.c -new file mode 100644 -index 0000000..630ab26 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main026.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is long double _Complex -+// -+#include -+#include -+extern long double _Complex f_func_(long double _Complex *i); -+int main() { -+ long double _Complex i; -+ long double _Complex res = f_func_(&i); -+ printf("%0.20lf + %0.20lfi\n", creal(res), cimag(res)); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main027.c b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main027.c -new file mode 100644 -index 0000000..dd95917 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main027.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is _Bool -+// -+#include -+#include -+extern _Bool f_func_(_Bool *i); -+int main() { -+ _Bool i = 0; -+ _Bool res = f_func_(&i); -+ printf("%d\n", res); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main028.c b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main028.c -new file mode 100644 -index 0000000..1bbb2a6 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/c_main028.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is char -+// -+#include -+#include -+extern char f_func_(char *i); -+int main() { -+ char i; -+ char res = f_func_(&i); -+ printf("%c\n", res); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func001.f90 b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func001.f90 -new file mode 100644 -index 0000000..8809b59 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func001.f90 -@@ -0,0 +1,4 @@ -+integer function f_func(i) -+ integer :: i -+ f_func = 10 + i -+end -diff --git a/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func002.f90 b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func002.f90 -new file mode 100644 -index 0000000..91a5d95 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func002.f90 -@@ -0,0 +1,4 @@ -+integer function f_func(i) -+ integer(2) :: i -+ f_func = 10 + i -+end -diff --git a/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func003.f90 b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func003.f90 -new file mode 100644 -index 0000000..d91ed67 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func003.f90 -@@ -0,0 +1,4 @@ -+integer function f_func(i) -+ integer(8) :: i -+ f_func = 10 + i -+end -diff --git a/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func004.f90 b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func004.f90 -new file mode 100644 -index 0000000..d91ed67 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func004.f90 -@@ -0,0 +1,4 @@ -+integer function f_func(i) -+ integer(8) :: i -+ f_func = 10 + i -+end -diff --git a/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func005.f90 b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func005.f90 -new file mode 100644 -index 0000000..bd7b3fc ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func005.f90 -@@ -0,0 +1,4 @@ -+integer function f_func(i) -+ integer(1) :: i -+ f_func = 10 + i -+end -diff --git a/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func006.f90 b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func006.f90 -new file mode 100644 -index 0000000..d91ed67 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func006.f90 -@@ -0,0 +1,4 @@ -+integer function f_func(i) -+ integer(8) :: i -+ f_func = 10 + i -+end -diff --git a/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func007.f90 b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func007.f90 -new file mode 100644 -index 0000000..bd7b3fc ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func007.f90 -@@ -0,0 +1,4 @@ -+integer function f_func(i) -+ integer(1) :: i -+ f_func = 10 + i -+end -diff --git a/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func008.f90 b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func008.f90 -new file mode 100644 -index 0000000..91a5d95 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func008.f90 -@@ -0,0 +1,4 @@ -+integer function f_func(i) -+ integer(2) :: i -+ f_func = 10 + i -+end -diff --git a/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func009.f90 b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func009.f90 -new file mode 100644 -index 0000000..c386948 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func009.f90 -@@ -0,0 +1,4 @@ -+integer function f_func(i) -+ integer(4) :: i -+ f_func = 10 + i -+end -diff --git a/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func010.f90 b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func010.f90 -new file mode 100644 -index 0000000..d91ed67 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func010.f90 -@@ -0,0 +1,4 @@ -+integer function f_func(i) -+ integer(8) :: i -+ f_func = 10 + i -+end -diff --git a/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func011.f90 b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func011.f90 -new file mode 100644 -index 0000000..bd7b3fc ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func011.f90 -@@ -0,0 +1,4 @@ -+integer function f_func(i) -+ integer(1) :: i -+ f_func = 10 + i -+end -diff --git a/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func012.f90 b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func012.f90 -new file mode 100644 -index 0000000..91a5d95 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func012.f90 -@@ -0,0 +1,4 @@ -+integer function f_func(i) -+ integer(2) :: i -+ f_func = 10 + i -+end -diff --git a/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func013.f90 b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func013.f90 -new file mode 100644 -index 0000000..c386948 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func013.f90 -@@ -0,0 +1,4 @@ -+integer function f_func(i) -+ integer(4) :: i -+ f_func = 10 + i -+end -diff --git a/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func014.f90 b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func014.f90 -new file mode 100644 -index 0000000..d91ed67 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func014.f90 -@@ -0,0 +1,4 @@ -+integer function f_func(i) -+ integer(8) :: i -+ f_func = 10 + i -+end -diff --git a/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func015.f90 b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func015.f90 -new file mode 100644 -index 0000000..bd7b3fc ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func015.f90 -@@ -0,0 +1,4 @@ -+integer function f_func(i) -+ integer(1) :: i -+ f_func = 10 + i -+end -diff --git a/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func016.f90 b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func016.f90 -new file mode 100644 -index 0000000..d91ed67 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func016.f90 -@@ -0,0 +1,4 @@ -+integer function f_func(i) -+ integer(8) :: i -+ f_func = 10 + i -+end -diff --git a/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func017.f90 b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func017.f90 -new file mode 100644 -index 0000000..d91ed67 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func017.f90 -@@ -0,0 +1,4 @@ -+integer function f_func(i) -+ integer(8) :: i -+ f_func = 10 + i -+end -diff --git a/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func018.f90 b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func018.f90 -new file mode 100644 -index 0000000..d91ed67 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func018.f90 -@@ -0,0 +1,4 @@ -+integer function f_func(i) -+ integer(8) :: i -+ f_func = 10 + i -+end -diff --git a/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func019.f90 b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func019.f90 -new file mode 100644 -index 0000000..d91ed67 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func019.f90 -@@ -0,0 +1,4 @@ -+integer function f_func(i) -+ integer(8) :: i -+ f_func = 10 + i -+end -diff --git a/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func020.f90 b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func020.f90 -new file mode 100644 -index 0000000..d91ed67 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func020.f90 -@@ -0,0 +1,4 @@ -+integer function f_func(i) -+ integer(8) :: i -+ f_func = 10 + i -+end -diff --git a/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func021.f90 b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func021.f90 -new file mode 100644 -index 0000000..27c8008 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func021.f90 -@@ -0,0 +1,4 @@ -+real function f_func(i) -+ real(4) :: i -+ f_func = i + 0.1 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func022.f90 b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func022.f90 -new file mode 100644 -index 0000000..b862910 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func022.f90 -@@ -0,0 +1,4 @@ -+real(8) function f_func(i) -+ real(8) :: i -+ f_func = i + 0.1 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func023.f90 b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func023.f90 -new file mode 100644 -index 0000000..5a24ed7 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func023.f90 -@@ -0,0 +1,6 @@ -+function f_func(i) -+ integer, parameter :: K = selected_real_kind(16) -+ real(K) :: i -+ real(K) :: f_func -+ f_func = i + 0.1 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func024.f90 b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func024.f90 -new file mode 100644 -index 0000000..e158cce ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func024.f90 -@@ -0,0 +1,4 @@ -+complex(4) function f_func(i) -+ complex(4) :: i -+ f_func = (-12345678.7654321, 1) -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func025.f90 b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func025.f90 -new file mode 100644 -index 0000000..3cd9e4e ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func025.f90 -@@ -0,0 +1,4 @@ -+complex(8) function f_func(i) -+ complex(8) :: i -+ f_func = (-12345678.7654321, 1) -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func026.f90 b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func026.f90 -new file mode 100644 -index 0000000..fb3c477 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func026.f90 -@@ -0,0 +1,6 @@ -+function f_func(i) -+ integer, parameter :: K = selected_real_kind(16) -+ complex(K) :: i -+ complex(K) :: f_func -+ f_func = (-12345678.7654321, 1) -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func027.f90 b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func027.f90 -new file mode 100644 -index 0000000..f331e96 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func027.f90 -@@ -0,0 +1,4 @@ -+logical function f_func(i) -+ logical(1) :: i -+ f_func = .TRUE. -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func028.f90 b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func028.f90 -new file mode 100644 -index 0000000..228b066 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/fortran_func028.f90 -@@ -0,0 +1,4 @@ -+character function f_func(i) -+ character(1) :: i -+ f_func = 'b' -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/result.md b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/result.md -new file mode 100644 -index 0000000..3d13906 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/result.md -@@ -0,0 +1,29 @@ -+ | test | gfortran | flang | -+ | 001 | PASS | PASS | -+ | 002 | PASS | PASS | -+ | 003 | PASS | PASS | -+ | 004 | PASS | PASS | -+ | 005 | PASS | PASS | -+ | 006 | PASS | PASS | -+ | 007 | PASS | PASS | -+ | 008 | PASS | PASS | -+ | 009 | PASS | PASS | -+ | 010 | PASS | PASS | -+ | 011 | PASS | PASS | -+ | 012 | PASS | PASS | -+ | 013 | PASS | PASS | -+ | 014 | PASS | PASS | -+ | 015 | PASS | PASS | -+ | 016 | PASS | PASS | -+ | 017 | PASS | PASS | -+ | 018 | PASS | PASS | -+ | 019 | PASS | PASS | -+ | 020 | PASS | PASS | -+ | 021 | PASS | PASS | -+ | 022 | PASS | PASS | -+ | 023 | PASS | PASS | -+ | 024 | PASS | PASS | -+ | 025 | PASS | PASS | -+ | 026 | PASS | ERROR | -+ | 027 | PASS | PASS | -+ | 028 | PASS | ERROR | -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/run.sh b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/run.sh -new file mode 100644 -index 0000000..5b2202e ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/001_c_call_fortran_function_value/run.sh -@@ -0,0 +1,16 @@ -+for i in {001..028} -+do -+echo "------- test $i ------." -+echo "----- gfortran result:" -+gcc c_main$i.c -c -o c-test.o -+gfortran fortran_func$i.f90 -fno-range-check -c -o fortran-test.o -+gfortran fortran-test.o c-test.o -+./a.out -+rm *.o a.out -+echo "----- flang-new result : " -+clang c_main$i.c -c -o c-test.o -+flang-new fortran_func$i.f90 -c -o fortran-test.o -+flang-new -flang-experimental-exec c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+done -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main001.c b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main001.c -new file mode 100644 -index 0000000..750e07c ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main001.c -@@ -0,0 +1,9 @@ -+// Test c call fortran for the return type is int with bindc -+// -+#include -+extern int f_func_(int *i); -+int main() { -+ int s1 = 5; -+ int res = f_func_(&s1); -+ printf("%d\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main002.c b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main002.c -new file mode 100644 -index 0000000..801bbd9 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main002.c -@@ -0,0 +1,9 @@ -+// Test c call fortran for the return type is short with bindc -+// -+#include -+extern short f_func_(short *i); -+int main() { -+ short s1 = 5; -+ short res = f_func_(&s1); -+ printf("%hd\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main003.c b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main003.c -new file mode 100644 -index 0000000..d141bc0 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main003.c -@@ -0,0 +1,9 @@ -+// Test c call fortran for the return type is long with bindc -+// -+#include -+extern long f_func_(long *i); -+int main() { -+ long s1 = 5; -+ long res = f_func_(&s1); -+ printf("%ld\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main004.c b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main004.c -new file mode 100644 -index 0000000..447e373 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main004.c -@@ -0,0 +1,9 @@ -+// Test c call fortran for the return type is long long with bindc -+// -+#include -+extern long long f_func_(long long *i); -+int main() { -+ long long s1 = 5; -+ long long res = f_func_(&s1); -+ printf("%Ld\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main005.c b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main005.c -new file mode 100644 -index 0000000..2f680d5 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main005.c -@@ -0,0 +1,9 @@ -+// Test c call fortran for the return type is signed char with bindc -+// -+#include -+extern signed char f_func_(signed char *i); -+int main() { -+ signed char s1 = 85; -+ signed char res = f_func_(&s1); -+ printf("%c\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main006.c b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main006.c -new file mode 100644 -index 0000000..47eec77 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main006.c -@@ -0,0 +1,9 @@ -+// Test c call fortran for the return type is size_t with bindc -+// -+#include -+extern size_t f_func_(size_t *i); -+int main() { -+ size_t s1 = 5; -+ size_t res = f_func_(&s1); -+ printf("%ld\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main007.c b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main007.c -new file mode 100644 -index 0000000..7e39eb4 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main007.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is int8_t with bindc -+// -+#include -+#include -+extern int8_t f_func_(int8_t *i); -+int main() { -+ int8_t s1 = 5; -+ int8_t res = f_func_(&s1); -+ printf("%hhd\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main008.c b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main008.c -new file mode 100644 -index 0000000..5a96518 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main008.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is int16_t with bindc -+// -+#include -+#include -+extern int16_t f_func_(int16_t *i); -+int main() { -+ int16_t s1 = 5; -+ int16_t res = f_func_(&s1); -+ printf("%hd\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main009.c b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main009.c -new file mode 100644 -index 0000000..61b0a1c ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main009.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is int32_t with bindc -+// -+#include -+#include -+extern int32_t f_func_(int32_t *i); -+int main() { -+ int32_t s1 = 5; -+ int32_t res = f_func_(&s1); -+ printf("%d\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main010.c b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main010.c -new file mode 100644 -index 0000000..f74292e ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main010.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is int64_t with bindc -+// -+#include -+#include -+extern int64_t f_func_(int64_t *i); -+int main() { -+ int64_t s1 = 5; -+ int64_t res = f_func_(&s1); -+ printf("%ld\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main011.c b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main011.c -new file mode 100644 -index 0000000..034044f ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main011.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is int_least8_t with bindc -+// -+#include -+#include -+extern int_least8_t f_func_(int_least8_t *i); -+int main() { -+ int_least8_t s1 = 5; -+ int_least8_t res = f_func_(&s1); -+ printf("%hhd\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main012.c b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main012.c -new file mode 100644 -index 0000000..1597575 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main012.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is int_least16_t with bindc -+// -+#include -+#include -+extern int_least16_t f_func_(int_least16_t *i); -+int main() { -+ int_least16_t s1 = 5; -+ int_least16_t res = f_func_(&s1); -+ printf("%hd\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main013.c b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main013.c -new file mode 100644 -index 0000000..dc2226d ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main013.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is int_least32_t with bindc -+// -+#include -+#include -+extern int_least32_t f_func_(int_least32_t *i); -+int main() { -+ int_least32_t s1 = 5; -+ int_least32_t res = f_func_(&s1); -+ printf("%d\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main014.c b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main014.c -new file mode 100644 -index 0000000..b935d4a ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main014.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is int_least64_t with bindc -+// -+#include -+#include -+extern int_least64_t f_func_(int_least64_t *i); -+int main() { -+ int_least64_t s1 = 5; -+ int_least64_t res = f_func_(&s1); -+ printf("%ld\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main015.c b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main015.c -new file mode 100644 -index 0000000..ce49dad ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main015.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is int_fast8_t with bindc -+// -+#include -+#include -+extern int_fast8_t f_func_(int_fast8_t *i); -+int main() { -+ int_fast8_t s1 = 5; -+ int_fast8_t res = f_func_(&s1); -+ printf("%hhd\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main016.c b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main016.c -new file mode 100644 -index 0000000..9f0bef4 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main016.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is int_fast16_t with bindc -+// -+#include -+#include -+extern int_fast16_t f_func_(int_fast16_t *i); -+int main() { -+ int_fast16_t s1 = 5; -+ int_fast16_t res = f_func_(&s1); -+ printf("%ld\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main017.c b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main017.c -new file mode 100644 -index 0000000..8ab1c0a ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main017.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is int_fast32_t with bindc -+// -+#include -+#include -+extern int_fast32_t f_func_(int_fast32_t *i); -+int main() { -+ int_fast32_t s1 = 5; -+ int_fast32_t res = f_func_(&s1); -+ printf("%ld\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main018.c b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main018.c -new file mode 100644 -index 0000000..9310bfa ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main018.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is int_fast64_t with bindc -+// -+#include -+#include -+extern int_fast64_t f_func_(int_fast64_t *i); -+int main() { -+ int_fast64_t s1 = 5; -+ int_fast64_t res = f_func_(&s1); -+ printf("%ld\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main019.c b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main019.c -new file mode 100644 -index 0000000..af4c9c7 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main019.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is intmax_t with bindc -+// -+#include -+#include -+extern intmax_t f_func_(intmax_t *i); -+int main() { -+ intmax_t s1 = 5; -+ intmax_t res = f_func_(&s1); -+ printf("%ld\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main020.c b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main020.c -new file mode 100644 -index 0000000..f3fbe2f ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main020.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is intptr_t with bindc -+// -+#include -+#include -+extern intptr_t f_func_(intptr_t *i); -+int main() { -+ intptr_t s1 = 5; -+ intptr_t res = f_func_(&s1); -+ printf("%ld\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main021.c b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main021.c -new file mode 100644 -index 0000000..850d4ad ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main021.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is float with bindc -+// -+#include -+#include -+extern float f_func_(float *i); -+int main() { -+ float i = 0.5; -+ float res = f_func_(&i); -+ printf("%0.20f\n", res); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main022.c b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main022.c -new file mode 100644 -index 0000000..6340c04 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main022.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is double with bindc -+// -+#include -+#include -+extern double f_func_(double *i); -+int main() { -+ double i = 0.5; -+ double res = f_func_(&i); -+ printf("%0.20lf\n", res); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main023.c b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main023.c -new file mode 100644 -index 0000000..66a84a1 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main023.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is long double with bindc -+// -+#include -+#include -+extern long double f_func_(long double *i); -+int main() { -+ long double i = 0.5; -+ long double res = f_func_(&i); -+ printf("%0.20Lf\n", res); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main024.c b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main024.c -new file mode 100644 -index 0000000..c508d13 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main024.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is float _Complex with bindc -+// -+#include -+#include -+extern float _Complex f_func_(float _Complex *i); -+int main() { -+ float _Complex i; -+ float _Complex res = f_func_(&i); -+ printf("%0.20f + %0.20fi\n", creal(res), cimag(res)); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main025.c b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main025.c -new file mode 100644 -index 0000000..cae3878 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main025.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the return type is double _Complex with -+// bindc -+// -+#include -+#include -+extern double _Complex f_func_(double _Complex *i); -+int main() { -+ double _Complex i; -+ double _Complex res = f_func_(&i); -+ printf("%0.20lf + %0.20lfi\n", creal(res), cimag(res)); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main026.c b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main026.c -new file mode 100644 -index 0000000..b1aabf8 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main026.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the return type is long double _Complex with -+// bindc -+// -+#include -+#include -+extern long double _Complex f_func_(long double _Complex *i); -+int main() { -+ long double _Complex i; -+ long double _Complex res = f_func_(&i); -+ printf("%0.20lf + %0.20lfi\n", creal(res), cimag(res)); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main027.c b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main027.c -new file mode 100644 -index 0000000..e90c830 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main027.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is _Bool with bindc -+// -+#include -+#include -+extern _Bool f_func_(_Bool *i); -+int main() { -+ _Bool i = 0; -+ _Bool res = f_func_(&i); -+ printf("%d\n", res); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main028.c b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main028.c -new file mode 100644 -index 0000000..7885475 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/c_main028.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is char with bindc -+// -+#include -+#include -+extern char f_func_(char *i); -+int main() { -+ char i; -+ char res = f_func_(&i); -+ printf("%c\n", res); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func001.f90 b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func001.f90 -new file mode 100644 -index 0000000..97fc0ff ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func001.f90 -@@ -0,0 +1,4 @@ -+integer function f_func(i) bind(c, name = "f_func_") -+ integer :: i -+ f_func = 10 + i -+end -diff --git a/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func002.f90 b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func002.f90 -new file mode 100644 -index 0000000..a92967c ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func002.f90 -@@ -0,0 +1,4 @@ -+integer function f_func(i) bind(c, name = "f_func_") -+ integer(2) :: i -+ f_func = 10 + i -+end -diff --git a/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func003.f90 b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func003.f90 -new file mode 100644 -index 0000000..0003034 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func003.f90 -@@ -0,0 +1,4 @@ -+integer function f_func(i) bind(c, name = "f_func_") -+ integer(8) :: i -+ f_func = 10 + i -+end -diff --git a/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func004.f90 b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func004.f90 -new file mode 100644 -index 0000000..0003034 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func004.f90 -@@ -0,0 +1,4 @@ -+integer function f_func(i) bind(c, name = "f_func_") -+ integer(8) :: i -+ f_func = 10 + i -+end -diff --git a/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func005.f90 b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func005.f90 -new file mode 100644 -index 0000000..4a50645 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func005.f90 -@@ -0,0 +1,4 @@ -+integer function f_func(i) bind(c, name = "f_func_") -+ integer(1) :: i -+ f_func = 10 + i -+end -diff --git a/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func006.f90 b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func006.f90 -new file mode 100644 -index 0000000..0003034 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func006.f90 -@@ -0,0 +1,4 @@ -+integer function f_func(i) bind(c, name = "f_func_") -+ integer(8) :: i -+ f_func = 10 + i -+end -diff --git a/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func007.f90 b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func007.f90 -new file mode 100644 -index 0000000..4a50645 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func007.f90 -@@ -0,0 +1,4 @@ -+integer function f_func(i) bind(c, name = "f_func_") -+ integer(1) :: i -+ f_func = 10 + i -+end -diff --git a/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func008.f90 b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func008.f90 -new file mode 100644 -index 0000000..a92967c ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func008.f90 -@@ -0,0 +1,4 @@ -+integer function f_func(i) bind(c, name = "f_func_") -+ integer(2) :: i -+ f_func = 10 + i -+end -diff --git a/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func009.f90 b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func009.f90 -new file mode 100644 -index 0000000..fbe023b ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func009.f90 -@@ -0,0 +1,4 @@ -+integer function f_func(i) bind(c, name = "f_func_") -+ integer(4) :: i -+ f_func = 10 + i -+end -diff --git a/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func010.f90 b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func010.f90 -new file mode 100644 -index 0000000..0003034 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func010.f90 -@@ -0,0 +1,4 @@ -+integer function f_func(i) bind(c, name = "f_func_") -+ integer(8) :: i -+ f_func = 10 + i -+end -diff --git a/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func011.f90 b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func011.f90 -new file mode 100644 -index 0000000..4a50645 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func011.f90 -@@ -0,0 +1,4 @@ -+integer function f_func(i) bind(c, name = "f_func_") -+ integer(1) :: i -+ f_func = 10 + i -+end -diff --git a/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func012.f90 b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func012.f90 -new file mode 100644 -index 0000000..a92967c ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func012.f90 -@@ -0,0 +1,4 @@ -+integer function f_func(i) bind(c, name = "f_func_") -+ integer(2) :: i -+ f_func = 10 + i -+end -diff --git a/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func013.f90 b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func013.f90 -new file mode 100644 -index 0000000..fbe023b ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func013.f90 -@@ -0,0 +1,4 @@ -+integer function f_func(i) bind(c, name = "f_func_") -+ integer(4) :: i -+ f_func = 10 + i -+end -diff --git a/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func014.f90 b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func014.f90 -new file mode 100644 -index 0000000..0003034 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func014.f90 -@@ -0,0 +1,4 @@ -+integer function f_func(i) bind(c, name = "f_func_") -+ integer(8) :: i -+ f_func = 10 + i -+end -diff --git a/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func015.f90 b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func015.f90 -new file mode 100644 -index 0000000..4a50645 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func015.f90 -@@ -0,0 +1,4 @@ -+integer function f_func(i) bind(c, name = "f_func_") -+ integer(1) :: i -+ f_func = 10 + i -+end -diff --git a/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func016.f90 b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func016.f90 -new file mode 100644 -index 0000000..0003034 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func016.f90 -@@ -0,0 +1,4 @@ -+integer function f_func(i) bind(c, name = "f_func_") -+ integer(8) :: i -+ f_func = 10 + i -+end -diff --git a/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func017.f90 b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func017.f90 -new file mode 100644 -index 0000000..0003034 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func017.f90 -@@ -0,0 +1,4 @@ -+integer function f_func(i) bind(c, name = "f_func_") -+ integer(8) :: i -+ f_func = 10 + i -+end -diff --git a/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func018.f90 b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func018.f90 -new file mode 100644 -index 0000000..0003034 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func018.f90 -@@ -0,0 +1,4 @@ -+integer function f_func(i) bind(c, name = "f_func_") -+ integer(8) :: i -+ f_func = 10 + i -+end -diff --git a/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func019.f90 b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func019.f90 -new file mode 100644 -index 0000000..0003034 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func019.f90 -@@ -0,0 +1,4 @@ -+integer function f_func(i) bind(c, name = "f_func_") -+ integer(8) :: i -+ f_func = 10 + i -+end -diff --git a/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func020.f90 b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func020.f90 -new file mode 100644 -index 0000000..0003034 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func020.f90 -@@ -0,0 +1,4 @@ -+integer function f_func(i) bind(c, name = "f_func_") -+ integer(8) :: i -+ f_func = 10 + i -+end -diff --git a/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func021.f90 b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func021.f90 -new file mode 100644 -index 0000000..830bae6 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func021.f90 -@@ -0,0 +1,4 @@ -+real function f_func(i) bind(c, name = "f_func_") -+ real(4) :: i -+ f_func = i + 0.1 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func022.f90 b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func022.f90 -new file mode 100644 -index 0000000..5e78483 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func022.f90 -@@ -0,0 +1,4 @@ -+real(8) function f_func(i) bind(c, name = "f_func_") -+ real(8) :: i -+ f_func = i + 0.1 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func023.f90 b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func023.f90 -new file mode 100644 -index 0000000..af3887a ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func023.f90 -@@ -0,0 +1,6 @@ -+function f_func(i) bind(c, name = "f_func_") -+ integer, parameter :: K = selected_real_kind(16) -+ real(K) :: i -+ real(K) :: f_func -+ f_func = i + 0.1 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func024.f90 b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func024.f90 -new file mode 100644 -index 0000000..62de96e ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func024.f90 -@@ -0,0 +1,4 @@ -+complex(4) function f_func(i) bind(c, name = "f_func_") -+ complex(4) :: i -+ f_func = (-12345678.7654321, 1) -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func025.f90 b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func025.f90 -new file mode 100644 -index 0000000..9474d00 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func025.f90 -@@ -0,0 +1,4 @@ -+complex(8) function f_func(i) bind(c, name = "f_func_") -+ complex(8) :: i -+ f_func = (-12345678.7654321, 1) -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func026.f90 b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func026.f90 -new file mode 100644 -index 0000000..4221aff ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func026.f90 -@@ -0,0 +1,6 @@ -+function f_func(i) bind(c, name = "f_func_") -+ integer, parameter :: K = selected_real_kind(16) -+ complex(K) :: i -+ complex(K) :: f_func -+ f_func = (-12345678.7654321, 1) -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func027.f90 b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func027.f90 -new file mode 100644 -index 0000000..d6a9631 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func027.f90 -@@ -0,0 +1,4 @@ -+logical function f_func(i) bind(c, name = "f_func_") -+ logical(1) :: i -+ f_func = .TRUE. -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func028.f90 b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func028.f90 -new file mode 100644 -index 0000000..ae4df1e ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/fortran_func028.f90 -@@ -0,0 +1,4 @@ -+character function f_func(i) bind(c, name = "f_func_") -+ character :: i -+ f_func = 'a' -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/result.md b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/result.md -new file mode 100644 -index 0000000..3d13906 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/result.md -@@ -0,0 +1,29 @@ -+ | test | gfortran | flang | -+ | 001 | PASS | PASS | -+ | 002 | PASS | PASS | -+ | 003 | PASS | PASS | -+ | 004 | PASS | PASS | -+ | 005 | PASS | PASS | -+ | 006 | PASS | PASS | -+ | 007 | PASS | PASS | -+ | 008 | PASS | PASS | -+ | 009 | PASS | PASS | -+ | 010 | PASS | PASS | -+ | 011 | PASS | PASS | -+ | 012 | PASS | PASS | -+ | 013 | PASS | PASS | -+ | 014 | PASS | PASS | -+ | 015 | PASS | PASS | -+ | 016 | PASS | PASS | -+ | 017 | PASS | PASS | -+ | 018 | PASS | PASS | -+ | 019 | PASS | PASS | -+ | 020 | PASS | PASS | -+ | 021 | PASS | PASS | -+ | 022 | PASS | PASS | -+ | 023 | PASS | PASS | -+ | 024 | PASS | PASS | -+ | 025 | PASS | PASS | -+ | 026 | PASS | ERROR | -+ | 027 | PASS | PASS | -+ | 028 | PASS | ERROR | -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/run.sh b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/run.sh -new file mode 100644 -index 0000000..5b2202e ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/002_c_call_fortran_function_value_bindc/run.sh -@@ -0,0 +1,16 @@ -+for i in {001..028} -+do -+echo "------- test $i ------." -+echo "----- gfortran result:" -+gcc c_main$i.c -c -o c-test.o -+gfortran fortran_func$i.f90 -fno-range-check -c -o fortran-test.o -+gfortran fortran-test.o c-test.o -+./a.out -+rm *.o a.out -+echo "----- flang-new result : " -+clang c_main$i.c -c -o c-test.o -+flang-new fortran_func$i.f90 -c -o fortran-test.o -+flang-new -flang-experimental-exec c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+done -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main001.c b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main001.c -new file mode 100644 -index 0000000..8eb1204 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main001.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is ptr of type int -+// -+#include -+extern int* f_func_(int *i); -+int main() { -+ int s1 = 5; -+ int *res = f_func_(&s1); -+ printf("%d\n", *res); -+} -+ -diff --git a/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main002.c b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main002.c -new file mode 100644 -index 0000000..325438b ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main002.c -@@ -0,0 +1,9 @@ -+// Test c call fortran for the return type is ptr of type short -+// -+#include -+extern short* f_func_(short *i); -+int main() { -+ short s1 = 5; -+ short *res = f_func_(&s1); -+ printf("%hd\n", *res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main003.c b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main003.c -new file mode 100644 -index 0000000..3afb3b2 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main003.c -@@ -0,0 +1,9 @@ -+// Test c call fortran for the return type is ptr of type long -+// -+#include -+extern long* f_func_(long *i); -+int main() { -+ long s1 = 5; -+ long *res = f_func_(&s1); -+ printf("%ld\n", *res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main004.c b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main004.c -new file mode 100644 -index 0000000..d1031ab ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main004.c -@@ -0,0 +1,9 @@ -+// Test c call fortran for the return type is ptr of type long long -+// -+#include -+extern long long* f_func_(long long *i); -+int main() { -+ long long s1 = 5; -+ long long *res = f_func_(&s1); -+ printf("%Ld\n", *res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main005.c b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main005.c -new file mode 100644 -index 0000000..51b51d4 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main005.c -@@ -0,0 +1,9 @@ -+// Test c call fortran for the return type is ptr of type signed char -+// -+#include -+extern signed char* f_func_(signed char *i); -+int main() { -+ signed char s1 = 85; -+ signed char *res = f_func_(&s1); -+ printf("%c\n", *res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main006.c b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main006.c -new file mode 100644 -index 0000000..cd3e8bb ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main006.c -@@ -0,0 +1,9 @@ -+// Test c call fortran for the return type is ptr of type size_t -+// -+#include -+extern size_t* f_func_(size_t *i); -+int main() { -+ size_t s1 = 5; -+ size_t *res = f_func_(&s1); -+ printf("%ld\n", *res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main007.c b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main007.c -new file mode 100644 -index 0000000..aff24d6 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main007.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is ptr of type int8_t -+// -+#include -+#include -+extern int8_t* f_func_(int8_t *i); -+int main() { -+ int8_t s1 = 5; -+ int8_t *res = f_func_(&s1); -+ printf("%hhd\n", *res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main008.c b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main008.c -new file mode 100644 -index 0000000..fa388de ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main008.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is ptr of type int16_t -+// -+#include -+#include -+extern int16_t* f_func_(int16_t *i); -+int main() { -+ int16_t s1 = 5; -+ int16_t *res = f_func_(&s1); -+ printf("%hd\n", *res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main009.c b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main009.c -new file mode 100644 -index 0000000..12fc747 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main009.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is ptr of type int32_t -+// -+#include -+#include -+extern int32_t* f_func_(int32_t *i); -+int main() { -+ int32_t s1 = 5; -+ int32_t *res = f_func_(&s1); -+ printf("%d\n", *res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main010.c b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main010.c -new file mode 100644 -index 0000000..0154808 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main010.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is ptr of type int64_t -+// -+#include -+#include -+extern int64_t* f_func_(int64_t *i); -+int main() { -+ int64_t s1 = 5; -+ int64_t *res = f_func_(&s1); -+ printf("%ld\n", *res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main011.c b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main011.c -new file mode 100644 -index 0000000..8ea7c30 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main011.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is ptr of type int_least8_t -+// -+#include -+#include -+extern int_least8_t* f_func_(int_least8_t *i); -+int main() { -+ int_least8_t s1 = 5; -+ int_least8_t *res = f_func_(&s1); -+ printf("%hhd\n", *res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main012.c b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main012.c -new file mode 100644 -index 0000000..aac8267 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main012.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is ptr of type int_least16_t -+// -+#include -+#include -+extern int_least16_t* f_func_(int_least16_t *i); -+int main() { -+ int_least16_t s1 = 5; -+ int_least16_t *res = f_func_(&s1); -+ printf("%hd\n", *res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main013.c b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main013.c -new file mode 100644 -index 0000000..679a0b0 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main013.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is ptr of type int_least32_t -+// -+#include -+#include -+extern int_least32_t* f_func_(int_least32_t *i); -+int main() { -+ int_least32_t s1 = 5; -+ int_least32_t *res = f_func_(&s1); -+ printf("%d\n", *res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main014.c b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main014.c -new file mode 100644 -index 0000000..451e0af ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main014.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is ptr of type int_least64_t -+// -+#include -+#include -+extern int_least64_t* f_func_(int_least64_t *i); -+int main() { -+ int_least64_t s1 = 5; -+ int_least64_t *res = f_func_(&s1); -+ printf("%ld\n", *res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main015.c b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main015.c -new file mode 100644 -index 0000000..c71eb46 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main015.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is ptr of type int_fast8_t -+// -+#include -+#include -+extern int_fast8_t* f_func_(int_fast8_t *i); -+int main() { -+ int_fast8_t s1 = 5; -+ int_fast8_t *res = f_func_(&s1); -+ printf("%hhd\n", *res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main016.c b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main016.c -new file mode 100644 -index 0000000..14ef2eb ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main016.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is ptr of type int_fast16_t -+// -+#include -+#include -+extern int_fast16_t* f_func_(int_fast16_t *i); -+int main() { -+ int_fast16_t s1 = 5; -+ int_fast16_t *res = f_func_(&s1); -+ printf("%ld\n", *res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main017.c b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main017.c -new file mode 100644 -index 0000000..7539524 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main017.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is ptr of type int_fast32_t -+// -+#include -+#include -+extern int_fast32_t* f_func_(int_fast32_t *i); -+int main() { -+ int_fast32_t s1 = 5; -+ int_fast32_t *res = f_func_(&s1); -+ printf("%ld\n", *res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main018.c b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main018.c -new file mode 100644 -index 0000000..fa74746 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main018.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is ptr of type int_fast64_t -+// -+#include -+#include -+extern int_fast64_t* f_func_(int_fast64_t *i); -+int main() { -+ int_fast64_t s1 = 5; -+ int_fast64_t *res = f_func_(&s1); -+ printf("%ld\n", *res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main019.c b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main019.c -new file mode 100644 -index 0000000..88b466c ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main019.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is ptr of type intmax_t -+// -+#include -+#include -+extern intmax_t* f_func_(intmax_t *i); -+int main() { -+ intmax_t s1 = 5; -+ intmax_t *res = f_func_(&s1); -+ printf("%ld\n", *res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main020.c b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main020.c -new file mode 100644 -index 0000000..198ff81 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main020.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is ptr of type intptr_t -+// -+#include -+#include -+extern intptr_t* f_func_(intptr_t *i); -+int main() { -+ intptr_t s1 = 5; -+ intptr_t *res = f_func_(&s1); -+ printf("%ld\n", *res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main021.c b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main021.c -new file mode 100644 -index 0000000..381859e ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main021.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is ptr of type float -+// -+#include -+#include -+extern float* f_func_(float *i); -+int main() { -+ float i = 0.5; -+ float *res = f_func_(&i); -+ printf("%0.20f\n", *res); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main022.c b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main022.c -new file mode 100644 -index 0000000..082273e ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main022.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is ptr of type double -+// -+#include -+#include -+extern double* f_func_(double *i); -+int main() { -+ double i = 0.5; -+ double *res = f_func_(&i); -+ printf("%0.20lf\n", *res); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main023.c b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main023.c -new file mode 100644 -index 0000000..1e4934d ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main023.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is ptr of type long double -+// -+#include -+#include -+extern long double* f_func_(long double *i); -+int main() { -+ long double i = 0.5; -+ long double *res = f_func_(&i); -+ printf("%0.20Lf\n", *res); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main024.c b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main024.c -new file mode 100644 -index 0000000..e34d02b ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main024.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the return type is ptr of type float -+// _Complex -+// -+#include -+#include -+extern float _Complex* f_func_(float _Complex *i); -+int main() { -+ float _Complex i; -+ float _Complex *res = f_func_(&i); -+ printf("%0.20f + %0.20fi\n", creal(*res), cimag(*res)); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main025.c b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main025.c -new file mode 100644 -index 0000000..fc3dd26 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main025.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the return type is ptr of type double -+// _Complex -+// -+#include -+#include -+extern double _Complex* f_func_(double _Complex *i); -+int main() { -+ double _Complex i; -+ double _Complex *res = f_func_(&i); -+ printf("%0.20lf + %0.20lfi\n", creal(*res), cimag(*res)); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main026.c b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main026.c -new file mode 100644 -index 0000000..b2f0dc3 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main026.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the return type is ptr of type long double -+// _Complex -+// -+#include -+#include -+extern long double _Complex* f_func_(long double _Complex *i); -+int main() { -+ long double _Complex i; -+ long double _Complex *res = f_func_(&i); -+ printf("%0.20lf + %0.20lfi\n", creal(*res), cimag(*res)); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main027.c b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main027.c -new file mode 100644 -index 0000000..081b376 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main027.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is ptr of type _Bool -+// -+#include -+#include -+extern _Bool* f_func_(_Bool *i); -+int main() { -+ _Bool i = 0; -+ _Bool *res = f_func_(&i); -+ printf("%d\n", *res); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main028.c b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main028.c -new file mode 100644 -index 0000000..a12499d ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/c_main028.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is ptr of type char -+// -+#include -+#include -+extern char* f_func_(char *i); -+int main() { -+ char i; -+ char *res = f_func_(&i); -+ printf("%c\n", *res); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func001.f90 b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func001.f90 -new file mode 100644 -index 0000000..d8cce54 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func001.f90 -@@ -0,0 +1,6 @@ -+function f_func(b) result(res) -+ integer, target :: b -+ integer, pointer :: res -+ b = b + 1 -+ res => b -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func002.f90 b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func002.f90 -new file mode 100644 -index 0000000..393d5dc ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func002.f90 -@@ -0,0 +1,6 @@ -+function f_func(b) result(res) -+ integer(2), target :: b -+ integer(2), pointer :: res -+ b = b + 1 -+ res => b -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func003.f90 b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func003.f90 -new file mode 100644 -index 0000000..3080e86 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func003.f90 -@@ -0,0 +1,6 @@ -+function f_func(b) result(res) -+ integer(8), target :: b -+ integer(8), pointer :: res -+ b = b + 1 -+ res => b -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func004.f90 b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func004.f90 -new file mode 100644 -index 0000000..3080e86 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func004.f90 -@@ -0,0 +1,6 @@ -+function f_func(b) result(res) -+ integer(8), target :: b -+ integer(8), pointer :: res -+ b = b + 1 -+ res => b -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func005.f90 b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func005.f90 -new file mode 100644 -index 0000000..6b52903 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func005.f90 -@@ -0,0 +1,6 @@ -+function f_func(b) result(res) -+ integer(1), target :: b -+ integer(1), pointer :: res -+ b = b + 1 -+ res => b -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func006.f90 b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func006.f90 -new file mode 100644 -index 0000000..3080e86 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func006.f90 -@@ -0,0 +1,6 @@ -+function f_func(b) result(res) -+ integer(8), target :: b -+ integer(8), pointer :: res -+ b = b + 1 -+ res => b -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func007.f90 b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func007.f90 -new file mode 100644 -index 0000000..6b52903 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func007.f90 -@@ -0,0 +1,6 @@ -+function f_func(b) result(res) -+ integer(1), target :: b -+ integer(1), pointer :: res -+ b = b + 1 -+ res => b -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func008.f90 b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func008.f90 -new file mode 100644 -index 0000000..393d5dc ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func008.f90 -@@ -0,0 +1,6 @@ -+function f_func(b) result(res) -+ integer(2), target :: b -+ integer(2), pointer :: res -+ b = b + 1 -+ res => b -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func009.f90 b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func009.f90 -new file mode 100644 -index 0000000..50d1fb2 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func009.f90 -@@ -0,0 +1,6 @@ -+function f_func(b) result(res) -+ integer(4), target :: b -+ integer(4), pointer :: res -+ b = b + 1 -+ res => b -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func010.f90 b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func010.f90 -new file mode 100644 -index 0000000..3080e86 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func010.f90 -@@ -0,0 +1,6 @@ -+function f_func(b) result(res) -+ integer(8), target :: b -+ integer(8), pointer :: res -+ b = b + 1 -+ res => b -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func011.f90 b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func011.f90 -new file mode 100644 -index 0000000..6b52903 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func011.f90 -@@ -0,0 +1,6 @@ -+function f_func(b) result(res) -+ integer(1), target :: b -+ integer(1), pointer :: res -+ b = b + 1 -+ res => b -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func012.f90 b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func012.f90 -new file mode 100644 -index 0000000..393d5dc ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func012.f90 -@@ -0,0 +1,6 @@ -+function f_func(b) result(res) -+ integer(2), target :: b -+ integer(2), pointer :: res -+ b = b + 1 -+ res => b -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func013.f90 b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func013.f90 -new file mode 100644 -index 0000000..50d1fb2 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func013.f90 -@@ -0,0 +1,6 @@ -+function f_func(b) result(res) -+ integer(4), target :: b -+ integer(4), pointer :: res -+ b = b + 1 -+ res => b -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func014.f90 b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func014.f90 -new file mode 100644 -index 0000000..3080e86 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func014.f90 -@@ -0,0 +1,6 @@ -+function f_func(b) result(res) -+ integer(8), target :: b -+ integer(8), pointer :: res -+ b = b + 1 -+ res => b -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func015.f90 b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func015.f90 -new file mode 100644 -index 0000000..6b52903 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func015.f90 -@@ -0,0 +1,6 @@ -+function f_func(b) result(res) -+ integer(1), target :: b -+ integer(1), pointer :: res -+ b = b + 1 -+ res => b -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func016.f90 b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func016.f90 -new file mode 100644 -index 0000000..3080e86 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func016.f90 -@@ -0,0 +1,6 @@ -+function f_func(b) result(res) -+ integer(8), target :: b -+ integer(8), pointer :: res -+ b = b + 1 -+ res => b -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func017.f90 b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func017.f90 -new file mode 100644 -index 0000000..3080e86 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func017.f90 -@@ -0,0 +1,6 @@ -+function f_func(b) result(res) -+ integer(8), target :: b -+ integer(8), pointer :: res -+ b = b + 1 -+ res => b -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func018.f90 b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func018.f90 -new file mode 100644 -index 0000000..3080e86 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func018.f90 -@@ -0,0 +1,6 @@ -+function f_func(b) result(res) -+ integer(8), target :: b -+ integer(8), pointer :: res -+ b = b + 1 -+ res => b -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func019.f90 b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func019.f90 -new file mode 100644 -index 0000000..3080e86 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func019.f90 -@@ -0,0 +1,6 @@ -+function f_func(b) result(res) -+ integer(8), target :: b -+ integer(8), pointer :: res -+ b = b + 1 -+ res => b -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func020.f90 b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func020.f90 -new file mode 100644 -index 0000000..3080e86 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func020.f90 -@@ -0,0 +1,6 @@ -+function f_func(b) result(res) -+ integer(8), target :: b -+ integer(8), pointer :: res -+ b = b + 1 -+ res => b -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func021.f90 b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func021.f90 -new file mode 100644 -index 0000000..72c883d ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func021.f90 -@@ -0,0 +1,6 @@ -+function f_func(i) result(res) -+ real(4), target :: i -+ real(4), pointer :: res -+ i = i + 0.1 -+ res => i -+end -diff --git a/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func022.f90 b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func022.f90 -new file mode 100644 -index 0000000..9c29036 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func022.f90 -@@ -0,0 +1,6 @@ -+function f_func(i) result(res) -+ real(8), target :: i -+ real(8), pointer :: res -+ i = i + 0.1 -+ res => i -+end -diff --git a/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func023.f90 b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func023.f90 -new file mode 100644 -index 0000000..2304e96 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func023.f90 -@@ -0,0 +1,7 @@ -+function f_func(i) result(res) -+ integer, parameter :: K = selected_real_kind(16) -+ real(K), target :: i -+ real(K), pointer :: res -+ i = i + 0.1 -+ res => i -+end -diff --git a/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func024.f90 b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func024.f90 -new file mode 100644 -index 0000000..bd11ffd ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func024.f90 -@@ -0,0 +1,6 @@ -+function f_func(i) result(res) -+ complex(4), target :: i -+ complex(4), pointer :: res -+ i = (-12345678.7654321, 1) -+ res => i -+end -diff --git a/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func025.f90 b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func025.f90 -new file mode 100644 -index 0000000..b67ac5d ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func025.f90 -@@ -0,0 +1,6 @@ -+function f_func(i) result(res) -+ complex(8), target :: i -+ complex(8), pointer :: res -+ i = (-12345678.7654321, 1) -+ res => i -+end -diff --git a/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func026.f90 b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func026.f90 -new file mode 100644 -index 0000000..aaad4f2 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func026.f90 -@@ -0,0 +1,7 @@ -+function f_func(i) result(res) -+ integer, parameter :: K = selected_real_kind(16) -+ complex(K), target :: i -+ complex(K), pointer :: res -+ i = (-12345678.7654321, 1) -+ res => i -+end -diff --git a/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func027.f90 b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func027.f90 -new file mode 100644 -index 0000000..51a5ae5 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func027.f90 -@@ -0,0 +1,6 @@ -+function f_func(b) result(res) -+ logical(1), target :: b -+ logical(1), pointer :: res -+ b = .TRUE. -+ res => b -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func028.f90 b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func028.f90 -new file mode 100644 -index 0000000..6487ee2 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/fortran_func028.f90 -@@ -0,0 +1,6 @@ -+function f_func(b) result(res) -+ character(1), target :: b -+ character(1), pointer :: res -+ b = 'a' -+ res => b -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/result.md b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/result.md -new file mode 100644 -index 0000000..1f6658e ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/result.md -@@ -0,0 +1,29 @@ -+ | test | gfortran | flang | -+ | 001 | PASS | ERROR | -+ | 002 | PASS | ERROR | -+ | 003 | PASS | ERROR | -+ | 004 | PASS | ERROR | -+ | 005 | PASS | ERROR | -+ | 006 | PASS | ERROR | -+ | 007 | PASS | ERROR | -+ | 008 | PASS | ERROR | -+ | 009 | PASS | ERROR | -+ | 010 | PASS | ERROR | -+ | 011 | PASS | ERROR | -+ | 012 | PASS | ERROR | -+ | 013 | PASS | ERROR | -+ | 014 | PASS | ERROR | -+ | 015 | PASS | ERROR | -+ | 016 | PASS | ERROR | -+ | 017 | PASS | ERROR | -+ | 018 | PASS | ERROR | -+ | 019 | PASS | ERROR | -+ | 020 | PASS | ERROR | -+ | 021 | PASS | ERROR | -+ | 022 | PASS | ERROR | -+ | 023 | PASS | ERROR | -+ | 024 | PASS | ERROR | -+ | 025 | PASS | PASS | -+ | 026 | PASS | PASS | -+ | 027 | PASS | ERROR | -+ | 028 | ERROR | ERROR | -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/run.sh b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/run.sh -new file mode 100644 -index 0000000..5b2202e ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/003_c_call_fortran_function_ptr/run.sh -@@ -0,0 +1,16 @@ -+for i in {001..028} -+do -+echo "------- test $i ------." -+echo "----- gfortran result:" -+gcc c_main$i.c -c -o c-test.o -+gfortran fortran_func$i.f90 -fno-range-check -c -o fortran-test.o -+gfortran fortran-test.o c-test.o -+./a.out -+rm *.o a.out -+echo "----- flang-new result : " -+clang c_main$i.c -c -o c-test.o -+flang-new fortran_func$i.f90 -c -o fortran-test.o -+flang-new -flang-experimental-exec c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+done -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main001.c b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main001.c -new file mode 100644 -index 0000000..b615d87 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main001.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the return type is ptr of type int with -+// bindc -+// -+#include -+extern int* f_func_(int *i); -+int main() { -+ int s1 = 5; -+ int *res = f_func_(&s1); -+ printf("%d\n", *res); -+} -+ -diff --git a/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main002.c b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main002.c -new file mode 100644 -index 0000000..6012316 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main002.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is ptr of type short with -+// bindc -+// -+#include -+extern short* f_func_(short *i); -+int main() { -+ short s1 = 5; -+ short *res = f_func_(&s1); -+ printf("%hd\n", *res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main003.c b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main003.c -new file mode 100644 -index 0000000..a6aef18 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main003.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is ptr of type long with -+// bindc -+// -+#include -+extern long* f_func_(long *i); -+int main() { -+ long s1 = 5; -+ long *res = f_func_(&s1); -+ printf("%ld\n", *res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main004.c b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main004.c -new file mode 100644 -index 0000000..342c438 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main004.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is ptr of type long long -+// with bindc -+// -+#include -+extern long long* f_func_(long long *i); -+int main() { -+ long long s1 = 5; -+ long long *res = f_func_(&s1); -+ printf("%Ld\n", *res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main005.c b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main005.c -new file mode 100644 -index 0000000..d4e4f55 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main005.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is ptr of type signed char -+// with bindc -+// -+#include -+extern signed char* f_func_(signed char *i); -+int main() { -+ signed char s1 = 85; -+ signed char *res = f_func_(&s1); -+ printf("%c\n", *res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main006.c b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main006.c -new file mode 100644 -index 0000000..5f0663e ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main006.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the return type is ptr of type size_t with -+// bindc -+// -+#include -+extern size_t* f_func_(size_t *i); -+int main() { -+ size_t s1 = 5; -+ size_t *res = f_func_(&s1); -+ printf("%ld\n", *res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main007.c b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main007.c -new file mode 100644 -index 0000000..dd19a2c ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main007.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the return type is ptr of type int8_t with -+// bindc -+// -+#include -+#include -+extern int8_t* f_func_(int8_t *i); -+int main() { -+ int8_t s1 = 5; -+ int8_t *res = f_func_(&s1); -+ printf("%hhd\n", *res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main008.c b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main008.c -new file mode 100644 -index 0000000..c8a62df ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main008.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the return type is ptr of type int16_t with -+// bindc -+// -+#include -+#include -+extern int16_t* f_func_(int16_t *i); -+int main() { -+ int16_t s1 = 5; -+ int16_t *res = f_func_(&s1); -+ printf("%hd\n", *res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main009.c b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main009.c -new file mode 100644 -index 0000000..992c05d ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main009.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the return type is ptr of type int32_t with -+// bindc -+// -+#include -+#include -+extern int32_t* f_func_(int32_t *i); -+int main() { -+ int32_t s1 = 5; -+ int32_t *res = f_func_(&s1); -+ printf("%d\n", *res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main010.c b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main010.c -new file mode 100644 -index 0000000..44843b1 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main010.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the return type is ptr of type int64_t with -+// bindc -+// -+#include -+#include -+extern int64_t* f_func_(int64_t *i); -+int main() { -+ int64_t s1 = 5; -+ int64_t *res = f_func_(&s1); -+ printf("%ld\n", *res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main011.c b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main011.c -new file mode 100644 -index 0000000..5fc5115 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main011.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the return type is ptr of type int_least8_t -+// with bindc -+// -+#include -+#include -+extern int_least8_t* f_func_(int_least8_t *i); -+int main() { -+ int_least8_t s1 = 5; -+ int_least8_t *res = f_func_(&s1); -+ printf("%hhd\n", *res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main012.c b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main012.c -new file mode 100644 -index 0000000..2a51a21 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main012.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the return type is ptr of type int_least16_t -+// with bindc -+// -+#include -+#include -+extern int_least16_t* f_func_(int_least16_t *i); -+int main() { -+ int_least16_t s1 = 5; -+ int_least16_t *res = f_func_(&s1); -+ printf("%hd\n", *res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main013.c b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main013.c -new file mode 100644 -index 0000000..ab81bab ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main013.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the return type is ptr of type int_least32_t -+// with bindc -+// -+#include -+#include -+extern int_least32_t* f_func_(int_least32_t *i); -+int main() { -+ int_least32_t s1 = 5; -+ int_least32_t *res = f_func_(&s1); -+ printf("%d\n", *res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main014.c b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main014.c -new file mode 100644 -index 0000000..9576f05 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main014.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the return type is ptr of type int_least64_t -+// with bindc -+// -+#include -+#include -+extern int_least64_t* f_func_(int_least64_t *i); -+int main() { -+ int_least64_t s1 = 5; -+ int_least64_t *res = f_func_(&s1); -+ printf("%ld\n", *res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main015.c b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main015.c -new file mode 100644 -index 0000000..c23aeca ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main015.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the return type is ptr of type int_fast8_t -+// with bindc -+// -+#include -+#include -+extern int_fast8_t* f_func_(int_fast8_t *i); -+int main() { -+ int_fast8_t s1 = 5; -+ int_fast8_t *res = f_func_(&s1); -+ printf("%hhd\n", *res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main016.c b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main016.c -new file mode 100644 -index 0000000..dfa53bf ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main016.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the return type is ptr of type int_fast16_t -+// with bindc -+// -+#include -+#include -+extern int_fast16_t* f_func_(int_fast16_t *i); -+int main() { -+ int_fast16_t s1 = 5; -+ int_fast16_t *res = f_func_(&s1); -+ printf("%ld\n", *res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main017.c b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main017.c -new file mode 100644 -index 0000000..e9414da ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main017.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the return type is ptr of type int_fast32_t -+// with bindc -+// -+#include -+#include -+extern int_fast32_t* f_func_(int_fast32_t *i); -+int main() { -+ int_fast32_t s1 = 5; -+ int_fast32_t *res = f_func_(&s1); -+ printf("%ld\n", *res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main018.c b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main018.c -new file mode 100644 -index 0000000..7b84fdf ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main018.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the return type is ptr of type int_fast64_t -+// with bindc -+// -+#include -+#include -+extern int_fast64_t* f_func_(int_fast64_t *i); -+int main() { -+ int_fast64_t s1 = 5; -+ int_fast64_t *res = f_func_(&s1); -+ printf("%ld\n", *res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main019.c b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main019.c -new file mode 100644 -index 0000000..9a74d6c ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main019.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the return type is ptr of type intmax_t with -+// bindc -+// -+#include -+#include -+extern intmax_t* f_func_(intmax_t *i); -+int main() { -+ intmax_t s1 = 5; -+ intmax_t *res = f_func_(&s1); -+ printf("%ld\n", *res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main020.c b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main020.c -new file mode 100644 -index 0000000..7f073be ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main020.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the return type is ptr of type intptr_t with -+// bindc -+// -+#include -+#include -+extern intptr_t* f_func_(intptr_t *i); -+int main() { -+ intptr_t s1 = 5; -+ intptr_t *res = f_func_(&s1); -+ printf("%ld\n", *res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main021.c b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main021.c -new file mode 100644 -index 0000000..ab108c2 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main021.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the return type is ptr of type float with -+// bindc -+// -+#include -+#include -+extern float* f_func_(float *i); -+int main() { -+ float i = 0.5; -+ float *res = f_func_(&i); -+ printf("%0.20f\n", *res); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main022.c b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main022.c -new file mode 100644 -index 0000000..c814ef4 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main022.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the return type is ptr of type double with -+// bindc -+// -+#include -+#include -+extern double* f_func_(double *i); -+int main() { -+ double i = 0.5; -+ double *res = f_func_(&i); -+ printf("%0.20lf\n", *res); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main023.c b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main023.c -new file mode 100644 -index 0000000..707b692 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main023.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the return type is ptr of type long double -+// with bindc -+// -+#include -+#include -+extern long double* f_func_(long double *i); -+int main() { -+ long double i = 0.5; -+ long double *res = f_func_(&i); -+ printf("%0.20Lf\n", *res); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main024.c b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main024.c -new file mode 100644 -index 0000000..ff6af62 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main024.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the return type is ptr of type float -+// _Complex with bindc -+// -+#include -+#include -+extern float _Complex* f_func_(float _Complex *i); -+int main() { -+ float _Complex i; -+ float _Complex *res = f_func_(&i); -+ printf("%0.20f + %0.20fi\n", creal(*res), cimag(*res)); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main025.c b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main025.c -new file mode 100644 -index 0000000..9d0e8b3 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main025.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the return type is ptr of type double -+// _Complex with bindc -+// -+#include -+#include -+extern double _Complex* f_func_(double _Complex *i); -+int main() { -+ double _Complex i; -+ double _Complex *res = f_func_(&i); -+ printf("%0.20lf + %0.20lfi\n", creal(*res), cimag(*res)); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main026.c b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main026.c -new file mode 100644 -index 0000000..7751d18 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main026.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the return type is ptr of type long double -+// _Complex with bindc -+// -+#include -+#include -+extern long double _Complex* f_func_(long double _Complex *i); -+int main() { -+ long double _Complex i; -+ long double _Complex *res = f_func_(&i); -+ printf("%0.20lf + %0.20lfi\n", creal(*res), cimag(*res)); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main027.c b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main027.c -new file mode 100644 -index 0000000..3a8a3de ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main027.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the return type is ptr of type _Bool with -+// bindc -+// -+#include -+#include -+extern _Bool* f_func_(_Bool *i); -+int main() { -+ _Bool i = 0; -+ _Bool *res = f_func_(&i); -+ printf("%d\n", *res); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main028.c b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main028.c -new file mode 100644 -index 0000000..1184003 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/c_main028.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the return type is ptr of type char with -+// bindc -+// -+#include -+#include -+extern char* f_func_(char *i); -+int main() { -+ char i; -+ char *res = f_func_(&i); -+ printf("%c\n", *res); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func001.f90 b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func001.f90 -new file mode 100644 -index 0000000..c36beda ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func001.f90 -@@ -0,0 +1,6 @@ -+function f_func(b) result(res) bind(c, name = "f_func_") -+ integer, target :: b -+ integer, pointer :: res -+ b = b + 1 -+ res => b -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func002.f90 b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func002.f90 -new file mode 100644 -index 0000000..e3e115d ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func002.f90 -@@ -0,0 +1,6 @@ -+function f_func(b) result(res) bind(c, name = "f_func_") -+ integer(2), target :: b -+ integer(2), pointer :: res -+ b = b + 1 -+ res => b -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func003.f90 b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func003.f90 -new file mode 100644 -index 0000000..98b5ce1 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func003.f90 -@@ -0,0 +1,6 @@ -+function f_func(b) result(res) bind(c, name = "f_func_") -+ integer(8), target :: b -+ integer(8), pointer :: res -+ b = b + 1 -+ res => b -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func004.f90 b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func004.f90 -new file mode 100644 -index 0000000..98b5ce1 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func004.f90 -@@ -0,0 +1,6 @@ -+function f_func(b) result(res) bind(c, name = "f_func_") -+ integer(8), target :: b -+ integer(8), pointer :: res -+ b = b + 1 -+ res => b -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func005.f90 b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func005.f90 -new file mode 100644 -index 0000000..a86b428 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func005.f90 -@@ -0,0 +1,6 @@ -+function f_func(b) result(res) bind(c, name = "f_func_") -+ integer(1), target :: b -+ integer(1), pointer :: res -+ b = b + 1 -+ res => b -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func006.f90 b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func006.f90 -new file mode 100644 -index 0000000..98b5ce1 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func006.f90 -@@ -0,0 +1,6 @@ -+function f_func(b) result(res) bind(c, name = "f_func_") -+ integer(8), target :: b -+ integer(8), pointer :: res -+ b = b + 1 -+ res => b -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func007.f90 b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func007.f90 -new file mode 100644 -index 0000000..a86b428 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func007.f90 -@@ -0,0 +1,6 @@ -+function f_func(b) result(res) bind(c, name = "f_func_") -+ integer(1), target :: b -+ integer(1), pointer :: res -+ b = b + 1 -+ res => b -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func008.f90 b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func008.f90 -new file mode 100644 -index 0000000..e3e115d ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func008.f90 -@@ -0,0 +1,6 @@ -+function f_func(b) result(res) bind(c, name = "f_func_") -+ integer(2), target :: b -+ integer(2), pointer :: res -+ b = b + 1 -+ res => b -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func009.f90 b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func009.f90 -new file mode 100644 -index 0000000..c5e3ff3 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func009.f90 -@@ -0,0 +1,6 @@ -+function f_func(b) result(res) bind(c, name = "f_func_") -+ integer(4), target :: b -+ integer(4), pointer :: res -+ b = b + 1 -+ res => b -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func010.f90 b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func010.f90 -new file mode 100644 -index 0000000..98b5ce1 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func010.f90 -@@ -0,0 +1,6 @@ -+function f_func(b) result(res) bind(c, name = "f_func_") -+ integer(8), target :: b -+ integer(8), pointer :: res -+ b = b + 1 -+ res => b -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func011.f90 b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func011.f90 -new file mode 100644 -index 0000000..a86b428 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func011.f90 -@@ -0,0 +1,6 @@ -+function f_func(b) result(res) bind(c, name = "f_func_") -+ integer(1), target :: b -+ integer(1), pointer :: res -+ b = b + 1 -+ res => b -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func012.f90 b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func012.f90 -new file mode 100644 -index 0000000..e3e115d ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func012.f90 -@@ -0,0 +1,6 @@ -+function f_func(b) result(res) bind(c, name = "f_func_") -+ integer(2), target :: b -+ integer(2), pointer :: res -+ b = b + 1 -+ res => b -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func013.f90 b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func013.f90 -new file mode 100644 -index 0000000..c5e3ff3 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func013.f90 -@@ -0,0 +1,6 @@ -+function f_func(b) result(res) bind(c, name = "f_func_") -+ integer(4), target :: b -+ integer(4), pointer :: res -+ b = b + 1 -+ res => b -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func014.f90 b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func014.f90 -new file mode 100644 -index 0000000..98b5ce1 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func014.f90 -@@ -0,0 +1,6 @@ -+function f_func(b) result(res) bind(c, name = "f_func_") -+ integer(8), target :: b -+ integer(8), pointer :: res -+ b = b + 1 -+ res => b -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func015.f90 b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func015.f90 -new file mode 100644 -index 0000000..a86b428 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func015.f90 -@@ -0,0 +1,6 @@ -+function f_func(b) result(res) bind(c, name = "f_func_") -+ integer(1), target :: b -+ integer(1), pointer :: res -+ b = b + 1 -+ res => b -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func016.f90 b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func016.f90 -new file mode 100644 -index 0000000..98b5ce1 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func016.f90 -@@ -0,0 +1,6 @@ -+function f_func(b) result(res) bind(c, name = "f_func_") -+ integer(8), target :: b -+ integer(8), pointer :: res -+ b = b + 1 -+ res => b -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func017.f90 b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func017.f90 -new file mode 100644 -index 0000000..98b5ce1 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func017.f90 -@@ -0,0 +1,6 @@ -+function f_func(b) result(res) bind(c, name = "f_func_") -+ integer(8), target :: b -+ integer(8), pointer :: res -+ b = b + 1 -+ res => b -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func018.f90 b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func018.f90 -new file mode 100644 -index 0000000..98b5ce1 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func018.f90 -@@ -0,0 +1,6 @@ -+function f_func(b) result(res) bind(c, name = "f_func_") -+ integer(8), target :: b -+ integer(8), pointer :: res -+ b = b + 1 -+ res => b -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func019.f90 b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func019.f90 -new file mode 100644 -index 0000000..98b5ce1 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func019.f90 -@@ -0,0 +1,6 @@ -+function f_func(b) result(res) bind(c, name = "f_func_") -+ integer(8), target :: b -+ integer(8), pointer :: res -+ b = b + 1 -+ res => b -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func020.f90 b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func020.f90 -new file mode 100644 -index 0000000..98b5ce1 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func020.f90 -@@ -0,0 +1,6 @@ -+function f_func(b) result(res) bind(c, name = "f_func_") -+ integer(8), target :: b -+ integer(8), pointer :: res -+ b = b + 1 -+ res => b -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func021.f90 b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func021.f90 -new file mode 100644 -index 0000000..e58e139 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func021.f90 -@@ -0,0 +1,6 @@ -+function f_func(i) result(res) bind(c, name = "f_func_") -+ real(4), target :: i -+ real(4), pointer :: res -+ i = i + 0.1 -+ res => i -+end -diff --git a/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func022.f90 b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func022.f90 -new file mode 100644 -index 0000000..340d2f2 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func022.f90 -@@ -0,0 +1,6 @@ -+function f_func(i) result(res) bind(c, name = "f_func_") -+ real(8), target :: i -+ real(8), pointer :: res -+ i = i + 0.1 -+ res => i -+end -diff --git a/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func023.f90 b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func023.f90 -new file mode 100644 -index 0000000..7863881 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func023.f90 -@@ -0,0 +1,7 @@ -+function f_func(i) result(res) bind(c, name = "f_func_") -+ integer, parameter :: K = selected_real_kind(16) -+ real(K), target :: i -+ real(K), pointer :: res -+ i = i + 0.1 -+ res => i -+end -diff --git a/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func024.f90 b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func024.f90 -new file mode 100644 -index 0000000..cb093eb ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func024.f90 -@@ -0,0 +1,6 @@ -+function f_func(i) result(res) bind(c, name = "f_func_") -+ complex(4), target :: i -+ complex(4), pointer :: res -+ i = (-12345678.7654321, 1) -+ res => i -+end -diff --git a/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func025.f90 b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func025.f90 -new file mode 100644 -index 0000000..0ec6812 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func025.f90 -@@ -0,0 +1,6 @@ -+function f_func(i) result(res) bind(c, name = "f_func_") -+ complex(8), target :: i -+ complex(8), pointer :: res -+ i = (-12345678.7654321, 1) -+ res => i -+end -diff --git a/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func026.f90 b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func026.f90 -new file mode 100644 -index 0000000..97df80a ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func026.f90 -@@ -0,0 +1,7 @@ -+function f_func(i) result(res) bind(c, name = "f_func_") -+ integer, parameter :: K = selected_real_kind(16) -+ complex(K), target :: i -+ complex(K), pointer :: res -+ i = (-12345678.7654321, 1) -+ res => i -+end -diff --git a/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func027.f90 b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func027.f90 -new file mode 100644 -index 0000000..f8f22bd ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func027.f90 -@@ -0,0 +1,6 @@ -+function f_func(b) result(res) bind(c, name = "f_func_") -+ logical(1), target :: b -+ logical(1), pointer :: res -+ b = .TRUE. -+ res => b -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func028.f90 b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func028.f90 -new file mode 100644 -index 0000000..69cff1e ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/fortran_func028.f90 -@@ -0,0 +1,6 @@ -+function f_func(b) result(res) bind(c, name = "f_func_") -+ character(1), target :: b -+ character(1), pointer :: res -+ b = 'a' -+ res => b -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/result.md b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/result.md -new file mode 100644 -index 0000000..1f6658e ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/result.md -@@ -0,0 +1,29 @@ -+ | test | gfortran | flang | -+ | 001 | PASS | ERROR | -+ | 002 | PASS | ERROR | -+ | 003 | PASS | ERROR | -+ | 004 | PASS | ERROR | -+ | 005 | PASS | ERROR | -+ | 006 | PASS | ERROR | -+ | 007 | PASS | ERROR | -+ | 008 | PASS | ERROR | -+ | 009 | PASS | ERROR | -+ | 010 | PASS | ERROR | -+ | 011 | PASS | ERROR | -+ | 012 | PASS | ERROR | -+ | 013 | PASS | ERROR | -+ | 014 | PASS | ERROR | -+ | 015 | PASS | ERROR | -+ | 016 | PASS | ERROR | -+ | 017 | PASS | ERROR | -+ | 018 | PASS | ERROR | -+ | 019 | PASS | ERROR | -+ | 020 | PASS | ERROR | -+ | 021 | PASS | ERROR | -+ | 022 | PASS | ERROR | -+ | 023 | PASS | ERROR | -+ | 024 | PASS | ERROR | -+ | 025 | PASS | PASS | -+ | 026 | PASS | PASS | -+ | 027 | PASS | ERROR | -+ | 028 | ERROR | ERROR | -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/run.sh b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/run.sh -new file mode 100644 -index 0000000..5b2202e ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/004_c_call_fortran_function_ptr_bindc/run.sh -@@ -0,0 +1,16 @@ -+for i in {001..028} -+do -+echo "------- test $i ------." -+echo "----- gfortran result:" -+gcc c_main$i.c -c -o c-test.o -+gfortran fortran_func$i.f90 -fno-range-check -c -o fortran-test.o -+gfortran fortran-test.o c-test.o -+./a.out -+rm *.o a.out -+echo "----- flang-new result : " -+clang c_main$i.c -c -o c-test.o -+flang-new fortran_func$i.f90 -c -o fortran-test.o -+flang-new -flang-experimental-exec c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+done -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/005_c_call_fortran_function_array/c_main001.c b/test/interoperability_with_c_c_call_fortran_function/005_c_call_fortran_function_array/c_main001.c -new file mode 100644 -index 0000000..1f5133c ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/005_c_call_fortran_function_array/c_main001.c -@@ -0,0 +1,15 @@ -+// Test c call fortran for return array of integer about different -+// length -+// -+#include -+#include -+#include -+extern int* f_func_(int *); -+int main() { -+ int x[4]; -+ int *p; -+ p = f_func_(x); -+ for(int i = 0; i < 4; i++) { -+ printf("%d\n", p[i]); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/005_c_call_fortran_function_array/c_main002.c b/test/interoperability_with_c_c_call_fortran_function/005_c_call_fortran_function_array/c_main002.c -new file mode 100644 -index 0000000..d247ebe ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/005_c_call_fortran_function_array/c_main002.c -@@ -0,0 +1,15 @@ -+// Test c call fortran for return array of integer about different -+// length -+// -+#include -+#include -+#include -+extern int* f_func_(int *); -+int main() { -+ int *p, x[5]; -+ p = (int*) malloc(5 * sizeof(int)); -+ p = f_func_(x); -+ for(int i = 0; i < 5; i++) { -+ printf("%d\n", p[i]); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/005_c_call_fortran_function_array/c_main003.c b/test/interoperability_with_c_c_call_fortran_function/005_c_call_fortran_function_array/c_main003.c -new file mode 100644 -index 0000000..e2a44a6 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/005_c_call_fortran_function_array/c_main003.c -@@ -0,0 +1,15 @@ -+// Test c call fortran for return array of integer about different -+// length -+// -+#include -+#include -+#include -+extern int* f_func_(int *); -+int main() { -+ int *p, x[8]; -+ p = (int*) malloc(8 * sizeof(int)); -+ p = f_func_(x); -+ for(int i = 0; i < 8; i++) { -+ printf("%d\n", p[i]); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/005_c_call_fortran_function_array/c_main004.c b/test/interoperability_with_c_c_call_fortran_function/005_c_call_fortran_function_array/c_main004.c -new file mode 100644 -index 0000000..5113295 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/005_c_call_fortran_function_array/c_main004.c -@@ -0,0 +1,15 @@ -+// Test c call fortran for return array of integer about different -+// length -+// -+#include -+#include -+#include -+extern int* f_func_(int *); -+int main() { -+ int *p, x[9]; -+ p = (int*) malloc(9 * sizeof(int)); -+ p = f_func_(x); -+ for(int i = 0; i < 9; i++) { -+ printf("%d\n", p[i]); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/005_c_call_fortran_function_array/c_main005.c b/test/interoperability_with_c_c_call_fortran_function/005_c_call_fortran_function_array/c_main005.c -new file mode 100644 -index 0000000..6ae6a5c ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/005_c_call_fortran_function_array/c_main005.c -@@ -0,0 +1,15 @@ -+// Test c call fortran for return array of integer about different -+// length -+// -+#include -+#include -+#include -+extern int* f_func_(int *); -+int main() { -+ int *p, x[26]; -+ p = (int*) malloc(26 * sizeof(int)); -+ p = f_func_(x); -+ for(int i = 0; i < 26; i++) { -+ printf("%d\n", p[i]); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/005_c_call_fortran_function_array/c_main006.c b/test/interoperability_with_c_c_call_fortran_function/005_c_call_fortran_function_array/c_main006.c -new file mode 100644 -index 0000000..c201c2d ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/005_c_call_fortran_function_array/c_main006.c -@@ -0,0 +1,15 @@ -+// Test c call fortran for return array of integer about different -+// length -+// -+#include -+#include -+#include -+extern int* f_func_(int *); -+int main() { -+ int *p, x[100]; -+ p = (int*) malloc(100 * sizeof(int)); -+ p = f_func_(x); -+ for(int i = 0; i < 100; i++) { -+ printf("%d\n", p[i]); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/005_c_call_fortran_function_array/c_main007.c b/test/interoperability_with_c_c_call_fortran_function/005_c_call_fortran_function_array/c_main007.c -new file mode 100644 -index 0000000..1f5133c ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/005_c_call_fortran_function_array/c_main007.c -@@ -0,0 +1,15 @@ -+// Test c call fortran for return array of integer about different -+// length -+// -+#include -+#include -+#include -+extern int* f_func_(int *); -+int main() { -+ int x[4]; -+ int *p; -+ p = f_func_(x); -+ for(int i = 0; i < 4; i++) { -+ printf("%d\n", p[i]); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/005_c_call_fortran_function_array/c_main008.c b/test/interoperability_with_c_c_call_fortran_function/005_c_call_fortran_function_array/c_main008.c -new file mode 100644 -index 0000000..1f5133c ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/005_c_call_fortran_function_array/c_main008.c -@@ -0,0 +1,15 @@ -+// Test c call fortran for return array of integer about different -+// length -+// -+#include -+#include -+#include -+extern int* f_func_(int *); -+int main() { -+ int x[4]; -+ int *p; -+ p = f_func_(x); -+ for(int i = 0; i < 4; i++) { -+ printf("%d\n", p[i]); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/005_c_call_fortran_function_array/fortran_func001.f90 b/test/interoperability_with_c_c_call_fortran_function/005_c_call_fortran_function_array/fortran_func001.f90 -new file mode 100644 -index 0000000..de2c1dc ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/005_c_call_fortran_function_array/fortran_func001.f90 -@@ -0,0 +1,8 @@ -+function f_func(x) -+ integer, target :: x(4) -+ integer, pointer :: res(:) -+ do i = 1, 4 -+ x(i) = i -+ end do -+ res => x -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/005_c_call_fortran_function_array/fortran_func002.f90 b/test/interoperability_with_c_c_call_fortran_function/005_c_call_fortran_function_array/fortran_func002.f90 -new file mode 100644 -index 0000000..08c2f10 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/005_c_call_fortran_function_array/fortran_func002.f90 -@@ -0,0 +1,8 @@ -+function f_func(x) -+ integer, target :: x(5) -+ integer, pointer :: res(:) -+ do i = 1, 5 -+ x(i) = i -+ end do -+ res => x -+end -diff --git a/test/interoperability_with_c_c_call_fortran_function/005_c_call_fortran_function_array/fortran_func003.f90 b/test/interoperability_with_c_c_call_fortran_function/005_c_call_fortran_function_array/fortran_func003.f90 -new file mode 100644 -index 0000000..dcfb26d ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/005_c_call_fortran_function_array/fortran_func003.f90 -@@ -0,0 +1,8 @@ -+function f_func(x) -+ integer, target :: x(8) -+ integer, pointer :: res(:) -+ do i = 1, 8 -+ x(i) = i -+ end do -+ res => x -+end -diff --git a/test/interoperability_with_c_c_call_fortran_function/005_c_call_fortran_function_array/fortran_func004.f90 b/test/interoperability_with_c_c_call_fortran_function/005_c_call_fortran_function_array/fortran_func004.f90 -new file mode 100644 -index 0000000..46d82f9 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/005_c_call_fortran_function_array/fortran_func004.f90 -@@ -0,0 +1,8 @@ -+function f_func(x) -+ integer, target :: x(9) -+ integer, pointer :: res(:) -+ do i = 1, 9 -+ x(i) = i -+ end do -+ res => x -+end -diff --git a/test/interoperability_with_c_c_call_fortran_function/005_c_call_fortran_function_array/fortran_func005.f90 b/test/interoperability_with_c_c_call_fortran_function/005_c_call_fortran_function_array/fortran_func005.f90 -new file mode 100644 -index 0000000..32c24fc ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/005_c_call_fortran_function_array/fortran_func005.f90 -@@ -0,0 +1,8 @@ -+function f_func(x) -+ integer, target :: x(26) -+ integer, pointer :: res(:) -+ do i = 1, 26 -+ x(i) = i -+ end do -+ res => x -+end -diff --git a/test/interoperability_with_c_c_call_fortran_function/005_c_call_fortran_function_array/fortran_func006.f90 b/test/interoperability_with_c_c_call_fortran_function/005_c_call_fortran_function_array/fortran_func006.f90 -new file mode 100644 -index 0000000..b2fe720 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/005_c_call_fortran_function_array/fortran_func006.f90 -@@ -0,0 +1,8 @@ -+function f_func(x) -+ integer, target :: x(100) -+ integer, pointer :: res(:) -+ do i = 1, 100 -+ x(i) = i -+ end do -+ res => x -+end -diff --git a/test/interoperability_with_c_c_call_fortran_function/005_c_call_fortran_function_array/fortran_func007.f90 b/test/interoperability_with_c_c_call_fortran_function/005_c_call_fortran_function_array/fortran_func007.f90 -new file mode 100644 -index 0000000..fda07ba ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/005_c_call_fortran_function_array/fortran_func007.f90 -@@ -0,0 +1,8 @@ -+function f_func(x) -+ integer, target :: x(5) -+ integer, pointer :: f_func(:) -+ do i = 1, 5 -+ x(i) = i -+ end do -+ f_func => x -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/005_c_call_fortran_function_array/fortran_func008.f90 b/test/interoperability_with_c_c_call_fortran_function/005_c_call_fortran_function_array/fortran_func008.f90 -new file mode 100644 -index 0000000..d18a92e ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/005_c_call_fortran_function_array/fortran_func008.f90 -@@ -0,0 +1,8 @@ -+function f_func(x) -+ integer :: x(5) -+ integer :: f_func(5) -+ do i = 1, 5 -+ x(i) = i -+ end do -+ f_func = x -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/005_c_call_fortran_function_array/result.md b/test/interoperability_with_c_c_call_fortran_function/005_c_call_fortran_function_array/result.md -new file mode 100644 -index 0000000..29f6af4 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/005_c_call_fortran_function_array/result.md -@@ -0,0 +1,9 @@ -+ | test | gfortran | flang | -+ | 001 | PASS | PASS | -+ | 002 | PASS | PASS | -+ | 003 | PASS | PASS | -+ | 004 | PASS | PASS | -+ | 005 | PASS | PASS | -+ | 006 | PASS | PASS | -+ | 007 | ERROR | ERROR | -+ | 008 | ERROR | ERROR | -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/005_c_call_fortran_function_array/run.sh b/test/interoperability_with_c_c_call_fortran_function/005_c_call_fortran_function_array/run.sh -new file mode 100644 -index 0000000..e2a8cbf ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/005_c_call_fortran_function_array/run.sh -@@ -0,0 +1,16 @@ -+for i in {001..008} -+do -+echo "------- test $i ------." -+echo "----- gfortran result:" -+gcc c_main$i.c -c -o c-test.o -+gfortran fortran_func$i.f90 -fno-range-check -c -o fortran-test.o -+gfortran fortran-test.o c-test.o -+./a.out -+rm *.o a.out -+echo "----- flang-new result : " -+clang c_main$i.c -c -o c-test.o -+flang-new fortran_func$i.f90 -c -o fortran-test.o -+flang-new -flang-experimental-exec c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+done -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/006_c_call_fortran_function_array_bindc/c_main001.c b/test/interoperability_with_c_c_call_fortran_function/006_c_call_fortran_function_array_bindc/c_main001.c -new file mode 100644 -index 0000000..b3fd45f ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/006_c_call_fortran_function_array_bindc/c_main001.c -@@ -0,0 +1,15 @@ -+// Test c call fortran for return array of integer about different -+// length with bindc -+// -+#include -+#include -+#include -+extern int* f_func_(int *); -+int main() { -+ int x[4]; -+ int *p; -+ p = f_func_(x); -+ for(int i = 0; i < 4; i++) { -+ printf("%d\n", p[i]); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/006_c_call_fortran_function_array_bindc/c_main002.c b/test/interoperability_with_c_c_call_fortran_function/006_c_call_fortran_function_array_bindc/c_main002.c -new file mode 100644 -index 0000000..03a8d40 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/006_c_call_fortran_function_array_bindc/c_main002.c -@@ -0,0 +1,15 @@ -+// Test c call fortran for return array of integer about different -+// length with bindc -+// -+#include -+#include -+#include -+extern int* f_func_(int *); -+int main() { -+ int *p, x[5]; -+ p = (int*) malloc(5 * sizeof(int)); -+ p = f_func_(x); -+ for(int i = 0; i < 5; i++) { -+ printf("%d\n", p[i]); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/006_c_call_fortran_function_array_bindc/c_main003.c b/test/interoperability_with_c_c_call_fortran_function/006_c_call_fortran_function_array_bindc/c_main003.c -new file mode 100644 -index 0000000..dc3cdea ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/006_c_call_fortran_function_array_bindc/c_main003.c -@@ -0,0 +1,15 @@ -+// Test c call fortran for return array of integer about different -+// length with bindc -+// -+#include -+#include -+#include -+extern int* f_func_(int *); -+int main() { -+ int *p, x[8]; -+ p = (int*) malloc(8 * sizeof(int)); -+ p = f_func_(x); -+ for(int i = 0; i < 8; i++) { -+ printf("%d\n", p[i]); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/006_c_call_fortran_function_array_bindc/c_main004.c b/test/interoperability_with_c_c_call_fortran_function/006_c_call_fortran_function_array_bindc/c_main004.c -new file mode 100644 -index 0000000..fb5d02d ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/006_c_call_fortran_function_array_bindc/c_main004.c -@@ -0,0 +1,15 @@ -+// Test c call fortran for return array of integer about different -+// length with bindc -+// -+#include -+#include -+#include -+extern int* f_func_(int *); -+int main() { -+ int *p, x[9]; -+ p = (int*) malloc(9 * sizeof(int)); -+ p = f_func_(x); -+ for(int i = 0; i < 9; i++) { -+ printf("%d\n", p[i]); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/006_c_call_fortran_function_array_bindc/c_main005.c b/test/interoperability_with_c_c_call_fortran_function/006_c_call_fortran_function_array_bindc/c_main005.c -new file mode 100644 -index 0000000..0769299 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/006_c_call_fortran_function_array_bindc/c_main005.c -@@ -0,0 +1,15 @@ -+// Test c call fortran for return array of integer about different -+// length with bindc -+// -+#include -+#include -+#include -+extern int* f_func_(int *); -+int main() { -+ int *p, x[26]; -+ p = (int*) malloc(26 * sizeof(int)); -+ p = f_func_(x); -+ for(int i = 0; i < 26; i++) { -+ printf("%d\n", p[i]); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/006_c_call_fortran_function_array_bindc/c_main006.c b/test/interoperability_with_c_c_call_fortran_function/006_c_call_fortran_function_array_bindc/c_main006.c -new file mode 100644 -index 0000000..7d4f4bb ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/006_c_call_fortran_function_array_bindc/c_main006.c -@@ -0,0 +1,15 @@ -+// Test c call fortran for return array of integer about different -+// length with bindc -+// -+#include -+#include -+#include -+extern int* f_func_(int *); -+int main() { -+ int *p, x[100]; -+ p = (int*) malloc(100 * sizeof(int)); -+ p = f_func_(x); -+ for(int i = 0; i < 100; i++) { -+ printf("%d\n", p[i]); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/006_c_call_fortran_function_array_bindc/c_main007.c b/test/interoperability_with_c_c_call_fortran_function/006_c_call_fortran_function_array_bindc/c_main007.c -new file mode 100644 -index 0000000..b3fd45f ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/006_c_call_fortran_function_array_bindc/c_main007.c -@@ -0,0 +1,15 @@ -+// Test c call fortran for return array of integer about different -+// length with bindc -+// -+#include -+#include -+#include -+extern int* f_func_(int *); -+int main() { -+ int x[4]; -+ int *p; -+ p = f_func_(x); -+ for(int i = 0; i < 4; i++) { -+ printf("%d\n", p[i]); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/006_c_call_fortran_function_array_bindc/c_main008.c b/test/interoperability_with_c_c_call_fortran_function/006_c_call_fortran_function_array_bindc/c_main008.c -new file mode 100644 -index 0000000..b3fd45f ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/006_c_call_fortran_function_array_bindc/c_main008.c -@@ -0,0 +1,15 @@ -+// Test c call fortran for return array of integer about different -+// length with bindc -+// -+#include -+#include -+#include -+extern int* f_func_(int *); -+int main() { -+ int x[4]; -+ int *p; -+ p = f_func_(x); -+ for(int i = 0; i < 4; i++) { -+ printf("%d\n", p[i]); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/006_c_call_fortran_function_array_bindc/fortran_func001.f90 b/test/interoperability_with_c_c_call_fortran_function/006_c_call_fortran_function_array_bindc/fortran_func001.f90 -new file mode 100644 -index 0000000..a956589 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/006_c_call_fortran_function_array_bindc/fortran_func001.f90 -@@ -0,0 +1,8 @@ -+function f_func(x) bind(c, name = "f_func_") -+ integer, target :: x(4) -+ integer, pointer :: res(:) -+ do i = 1, 4 -+ x(i) = i -+ end do -+ res => x -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/006_c_call_fortran_function_array_bindc/fortran_func002.f90 b/test/interoperability_with_c_c_call_fortran_function/006_c_call_fortran_function_array_bindc/fortran_func002.f90 -new file mode 100644 -index 0000000..c7cb1ad ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/006_c_call_fortran_function_array_bindc/fortran_func002.f90 -@@ -0,0 +1,8 @@ -+function f_func(x) bind(c, name = "f_func_") -+ integer, target :: x(5) -+ integer, pointer :: res(:) -+ do i = 1, 5 -+ x(i) = i -+ end do -+ res => x -+end -diff --git a/test/interoperability_with_c_c_call_fortran_function/006_c_call_fortran_function_array_bindc/fortran_func003.f90 b/test/interoperability_with_c_c_call_fortran_function/006_c_call_fortran_function_array_bindc/fortran_func003.f90 -new file mode 100644 -index 0000000..149f6e9 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/006_c_call_fortran_function_array_bindc/fortran_func003.f90 -@@ -0,0 +1,8 @@ -+function f_func(x) bind(c, name = "f_func_") -+ integer, target :: x(8) -+ integer, pointer :: res(:) -+ do i = 1, 8 -+ x(i) = i -+ end do -+ res => x -+end -diff --git a/test/interoperability_with_c_c_call_fortran_function/006_c_call_fortran_function_array_bindc/fortran_func004.f90 b/test/interoperability_with_c_c_call_fortran_function/006_c_call_fortran_function_array_bindc/fortran_func004.f90 -new file mode 100644 -index 0000000..2e44601 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/006_c_call_fortran_function_array_bindc/fortran_func004.f90 -@@ -0,0 +1,8 @@ -+function f_func(x) bind(c, name = "f_func_") -+ integer, target :: x(9) -+ integer, pointer :: res(:) -+ do i = 1, 9 -+ x(i) = i -+ end do -+ res => x -+end -diff --git a/test/interoperability_with_c_c_call_fortran_function/006_c_call_fortran_function_array_bindc/fortran_func005.f90 b/test/interoperability_with_c_c_call_fortran_function/006_c_call_fortran_function_array_bindc/fortran_func005.f90 -new file mode 100644 -index 0000000..930903f ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/006_c_call_fortran_function_array_bindc/fortran_func005.f90 -@@ -0,0 +1,8 @@ -+function f_func(x) bind(c, name = "f_func_") -+ integer, target :: x(26) -+ integer, pointer :: res(:) -+ do i = 1, 26 -+ x(i) = i -+ end do -+ res => x -+end -diff --git a/test/interoperability_with_c_c_call_fortran_function/006_c_call_fortran_function_array_bindc/fortran_func006.f90 b/test/interoperability_with_c_c_call_fortran_function/006_c_call_fortran_function_array_bindc/fortran_func006.f90 -new file mode 100644 -index 0000000..e8c6b2f ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/006_c_call_fortran_function_array_bindc/fortran_func006.f90 -@@ -0,0 +1,8 @@ -+function f_func(x) bind(c, name = "f_func_") -+ integer, target :: x(100) -+ integer, pointer :: res(:) -+ do i = 1, 100 -+ x(i) = i -+ end do -+ res => x -+end -diff --git a/test/interoperability_with_c_c_call_fortran_function/006_c_call_fortran_function_array_bindc/fortran_func007.f90 b/test/interoperability_with_c_c_call_fortran_function/006_c_call_fortran_function_array_bindc/fortran_func007.f90 -new file mode 100644 -index 0000000..3d3f09a ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/006_c_call_fortran_function_array_bindc/fortran_func007.f90 -@@ -0,0 +1,8 @@ -+function f_func(x) bind(c, name = "f_func_") -+ integer, target :: x(5) -+ integer, pointer :: f_func(:) -+ do i = 1, 5 -+ x(i) = i -+ end do -+ f_func => x -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/006_c_call_fortran_function_array_bindc/fortran_func008.f90 b/test/interoperability_with_c_c_call_fortran_function/006_c_call_fortran_function_array_bindc/fortran_func008.f90 -new file mode 100644 -index 0000000..699d71c ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/006_c_call_fortran_function_array_bindc/fortran_func008.f90 -@@ -0,0 +1,8 @@ -+function f_func(x) bind(c, name = "f_func_") -+ integer :: x(5) -+ integer :: f_func(5) -+ do i = 1, 5 -+ x(i) = i -+ end do -+ f_func = x -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/006_c_call_fortran_function_array_bindc/result.md b/test/interoperability_with_c_c_call_fortran_function/006_c_call_fortran_function_array_bindc/result.md -new file mode 100644 -index 0000000..29f6af4 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/006_c_call_fortran_function_array_bindc/result.md -@@ -0,0 +1,9 @@ -+ | test | gfortran | flang | -+ | 001 | PASS | PASS | -+ | 002 | PASS | PASS | -+ | 003 | PASS | PASS | -+ | 004 | PASS | PASS | -+ | 005 | PASS | PASS | -+ | 006 | PASS | PASS | -+ | 007 | ERROR | ERROR | -+ | 008 | ERROR | ERROR | -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/006_c_call_fortran_function_array_bindc/run.sh b/test/interoperability_with_c_c_call_fortran_function/006_c_call_fortran_function_array_bindc/run.sh -new file mode 100644 -index 0000000..e2a8cbf ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/006_c_call_fortran_function_array_bindc/run.sh -@@ -0,0 +1,16 @@ -+for i in {001..008} -+do -+echo "------- test $i ------." -+echo "----- gfortran result:" -+gcc c_main$i.c -c -o c-test.o -+gfortran fortran_func$i.f90 -fno-range-check -c -o fortran-test.o -+gfortran fortran-test.o c-test.o -+./a.out -+rm *.o a.out -+echo "----- flang-new result : " -+clang c_main$i.c -c -o c-test.o -+flang-new fortran_func$i.f90 -c -o fortran-test.o -+flang-new -flang-experimental-exec c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+done -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/007_c_call_fortran_function_struct/c_main001.c b/test/interoperability_with_c_c_call_fortran_function/007_c_call_fortran_function_struct/c_main001.c -new file mode 100644 -index 0000000..9dbfe03 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/007_c_call_fortran_function_struct/c_main001.c -@@ -0,0 +1,14 @@ -+// Test c call fortran for return struct type -+// -+#include -+#include -+#include -+struct t1 { -+ int x; -+}; -+extern struct t1 f_func_(); -+int main() { -+ struct t1 res; -+ res = f_func_(); -+ printf("%d\n", res.x); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/007_c_call_fortran_function_struct/c_main002.c b/test/interoperability_with_c_c_call_fortran_function/007_c_call_fortran_function_struct/c_main002.c -new file mode 100644 -index 0000000..1467c39 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/007_c_call_fortran_function_struct/c_main002.c -@@ -0,0 +1,16 @@ -+// Test c call fortran for return struct type and data alignment -+// -+#include -+#include -+#include -+struct t1 { -+ int16_t x2; -+ int8_t x; -+}; -+extern struct t1 f_func_(); -+int main() { -+ struct t1 res; -+ res = f_func_(); -+ printf("%hhd\n", res.x); -+ printf("%hd\n", res.x2); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/007_c_call_fortran_function_struct/c_main003.c b/test/interoperability_with_c_c_call_fortran_function/007_c_call_fortran_function_struct/c_main003.c -new file mode 100644 -index 0000000..9d038ff ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/007_c_call_fortran_function_struct/c_main003.c -@@ -0,0 +1,18 @@ -+// Test c call fortran for return struct type and data alignment -+// -+#include -+#include -+#include -+struct t1 { -+ int32_t x3; -+ int16_t x2; -+ int8_t x; -+}; -+extern struct t1 f_func_(); -+int main() { -+ struct t1 res; -+ res = f_func_(); -+ printf("%hhd\n", res.x); -+ printf("%hd\n", res.x2); -+ printf("%d\n", res.x3); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/007_c_call_fortran_function_struct/c_main004.c b/test/interoperability_with_c_c_call_fortran_function/007_c_call_fortran_function_struct/c_main004.c -new file mode 100644 -index 0000000..cebab37 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/007_c_call_fortran_function_struct/c_main004.c -@@ -0,0 +1,20 @@ -+// Test c call fortran for return struct type and data alignment -+// -+#include -+#include -+#include -+struct t1 { -+ int64_t x4; -+ int32_t x3; -+ int16_t x2; -+ int8_t x; -+}; -+extern struct t1 f_func_(); -+int main() { -+ struct t1 res; -+ res = f_func_(); -+ printf("%hhd\n", res.x); -+ printf("%hd\n", res.x2); -+ printf("%d\n", res.x3); -+ printf("%ld\n", res.x4); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/007_c_call_fortran_function_struct/c_main005.c b/test/interoperability_with_c_c_call_fortran_function/007_c_call_fortran_function_struct/c_main005.c -new file mode 100644 -index 0000000..3004cab ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/007_c_call_fortran_function_struct/c_main005.c -@@ -0,0 +1,22 @@ -+// Test c call fortran for return struct type and data alignment -+// -+#include -+#include -+#include -+struct t1 { -+ int64_t x5[2]; -+ int64_t x4; -+ int32_t x3; -+ int16_t x2; -+ int8_t x; -+}; -+extern struct t1 f_func_(); -+int main() { -+ struct t1 res; -+ res = f_func_(); -+ printf("%hhd\n", res.x); -+ printf("%hd\n", res.x2); -+ printf("%d\n", res.x3); -+ printf("%ld\n", res.x4); -+ printf("%ld\n", res.x5[0]); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/007_c_call_fortran_function_struct/c_main006.c b/test/interoperability_with_c_c_call_fortran_function/007_c_call_fortran_function_struct/c_main006.c -new file mode 100644 -index 0000000..1258dd7 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/007_c_call_fortran_function_struct/c_main006.c -@@ -0,0 +1,24 @@ -+// Test c call fortran for return struct type and data alignment -+// -+#include -+#include -+#include -+struct t1 { -+ int64_t x5[4]; -+ int64_t x4[2]; -+ int32_t x3[2]; -+ int16_t x2[2]; -+ int8_t x[2]; -+}; -+extern struct t1 f_func_(); -+int main() { -+ struct t1 res; -+ res = f_func_(); -+ for(int i = 0; i < 2; i++) { -+ printf("%hhd\n", res.x[i]); -+ printf("%hd\n", res.x2[i]); -+ printf("%d\n", res.x3[i]); -+ printf("%ld\n", res.x4[i]); -+ printf("%ld\n", res.x5[i * 2]); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/007_c_call_fortran_function_struct/fortran_func001.f90 b/test/interoperability_with_c_c_call_fortran_function/007_c_call_fortran_function_struct/fortran_func001.f90 -new file mode 100644 -index 0000000..4fb08e3 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/007_c_call_fortran_function_struct/fortran_func001.f90 -@@ -0,0 +1,7 @@ -+function f_func() -+ type t1 -+ integer :: x -+ end type -+ type(t1) :: f_func -+ f_func%x = 2 -+end -diff --git a/test/interoperability_with_c_c_call_fortran_function/007_c_call_fortran_function_struct/fortran_func002.f90 b/test/interoperability_with_c_c_call_fortran_function/007_c_call_fortran_function_struct/fortran_func002.f90 -new file mode 100644 -index 0000000..14c8d83 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/007_c_call_fortran_function_struct/fortran_func002.f90 -@@ -0,0 +1,9 @@ -+function f_func() -+ type t1 -+ integer(2) :: x2 -+ integer(1) :: x -+ end type -+ type(t1) :: f_func -+ f_func%x = 2 -+ f_func%x2 = 3 -+end -diff --git a/test/interoperability_with_c_c_call_fortran_function/007_c_call_fortran_function_struct/fortran_func003.f90 b/test/interoperability_with_c_c_call_fortran_function/007_c_call_fortran_function_struct/fortran_func003.f90 -new file mode 100644 -index 0000000..1766d2d ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/007_c_call_fortran_function_struct/fortran_func003.f90 -@@ -0,0 +1,11 @@ -+function f_func() -+ type t1 -+ integer(4) :: x3 -+ integer(2) :: x2 -+ integer(1) :: x -+ end type -+ type(t1) :: f_func -+ f_func%x = 2 -+ f_func%x2 = 3 -+ f_func%x3 = 4 -+end -diff --git a/test/interoperability_with_c_c_call_fortran_function/007_c_call_fortran_function_struct/fortran_func004.f90 b/test/interoperability_with_c_c_call_fortran_function/007_c_call_fortran_function_struct/fortran_func004.f90 -new file mode 100644 -index 0000000..352aa76 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/007_c_call_fortran_function_struct/fortran_func004.f90 -@@ -0,0 +1,13 @@ -+function f_func() -+ type t1 -+ integer(8) :: x4 -+ integer(4) :: x3 -+ integer(2) :: x2 -+ integer(1) :: x -+ end type -+ type(t1) :: f_func -+ f_func%x = 2 -+ f_func%x2 = 3 -+ f_func%x3 = 4 -+ f_func%x4 = 5 -+end -diff --git a/test/interoperability_with_c_c_call_fortran_function/007_c_call_fortran_function_struct/fortran_func005.f90 b/test/interoperability_with_c_c_call_fortran_function/007_c_call_fortran_function_struct/fortran_func005.f90 -new file mode 100644 -index 0000000..c02a6ea ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/007_c_call_fortran_function_struct/fortran_func005.f90 -@@ -0,0 +1,15 @@ -+function f_func() -+ type t1 -+ integer(16) :: x5 -+ integer(8) :: x4 -+ integer(4) :: x3 -+ integer(2) :: x2 -+ integer(1) :: x -+ end type -+ type(t1) :: f_func -+ f_func%x = 2 -+ f_func%x2 = 3 -+ f_func%x3 = 4 -+ f_func%x4 = 5 -+ f_func%x5 = 6 -+end -diff --git a/test/interoperability_with_c_c_call_fortran_function/007_c_call_fortran_function_struct/fortran_func006.f90 b/test/interoperability_with_c_c_call_fortran_function/007_c_call_fortran_function_struct/fortran_func006.f90 -new file mode 100644 -index 0000000..654d751 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/007_c_call_fortran_function_struct/fortran_func006.f90 -@@ -0,0 +1,17 @@ -+function f_func() -+ type t1 -+ integer(16) :: x5(2) -+ integer(8) :: x4(2) -+ integer(4) :: x3(2) -+ integer(2) :: x2(2) -+ integer(1) :: x(2) -+ end type -+ type(t1) :: f_func -+ do i = 1, 2 -+ f_func%x(i) = 2 -+ f_func%x2(i) = 3 -+ f_func%x3(i) = 4 -+ f_func%x4(i) = 5 -+ f_func%x5(i) = 6 -+ end do -+end -diff --git a/test/interoperability_with_c_c_call_fortran_function/007_c_call_fortran_function_struct/result.md b/test/interoperability_with_c_c_call_fortran_function/007_c_call_fortran_function_struct/result.md -new file mode 100644 -index 0000000..4c1d072 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/007_c_call_fortran_function_struct/result.md -@@ -0,0 +1,7 @@ -+ | test | gfortran | flang | -+ | 001 | PASS | ERROR | -+ | 002 | PASS | ERROR | -+ | 003 | PASS | ERROR | -+ | 004 | PASS | ERROR | -+ | 005 | PASS | PASS | -+ | 006 | PASS | PASS | -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_function/007_c_call_fortran_function_struct/run.sh b/test/interoperability_with_c_c_call_fortran_function/007_c_call_fortran_function_struct/run.sh -new file mode 100644 -index 0000000..cd0e873 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_function/007_c_call_fortran_function_struct/run.sh -@@ -0,0 +1,16 @@ -+for i in {001..006} -+do -+echo "------- test $i ------." -+echo "----- gfortran result:" -+gcc c_main$i.c -c -o c-test.o -+gfortran fortran_func$i.f90 -fno-range-check -c -o fortran-test.o -+gfortran fortran-test.o c-test.o -+./a.out -+rm *.o a.out -+echo "----- flang-new result : " -+clang c_main$i.c -c -o c-test.o -+flang-new fortran_func$i.f90 -c -o fortran-test.o -+flang-new -flang-experimental-exec c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+done -\ No newline at end of file --- -2.25.1 - diff --git a/13-test-interoperability-with-c-c-call-fortran-global-and-struct.patch b/13-test-interoperability-with-c-c-call-fortran-global-and-struct.patch deleted file mode 100644 index 7ee200b527331611c3059e90564a3385ce993b9f..0000000000000000000000000000000000000000 --- a/13-test-interoperability-with-c-c-call-fortran-global-and-struct.patch +++ /dev/null @@ -1,3583 +0,0 @@ -From 3c229bccd4260a5af3be41c1be953c9c021e980b Mon Sep 17 00:00:00 2001 -From: xieyihui -Date: Fri, 18 Nov 2022 13:02:54 +0800 -Subject: [PATCH] Add new test cases about global and struct for - interoperability with C about C call fortran - -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main001.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main001.c -new file mode 100644 -index 0000000..11d0136 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main001.c -@@ -0,0 +1,13 @@ -+// Test c call fortran for the derived type and the component of the -+// derived type is scalar of type int -+// -+#include -+struct test { -+ int t; -+}; -+extern void f_func_(struct test *s); -+int main() { -+ struct test a; -+ f_func_(&a); -+ printf("%d\n", a.t); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main002.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main002.c -new file mode 100644 -index 0000000..c44d440 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main002.c -@@ -0,0 +1,13 @@ -+// Test c call fortran for the derived type and the component of the -+// derived type is scalar of type short -+// -+#include -+struct test { -+ short t; -+}; -+extern void f_func_(struct test *s); -+int main() { -+ struct test a; -+ f_func_(&a); -+ printf("%hd\n", a.t); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main003.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main003.c -new file mode 100644 -index 0000000..76739dc ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main003.c -@@ -0,0 +1,13 @@ -+// Test c call fortran for the derived type and the component of the -+// derived type is scalar of type long -+// -+#include -+struct test { -+ long t; -+}; -+extern void f_func_(struct test *s); -+int main() { -+ struct test a; -+ f_func_(&a); -+ printf("%ld\n", a.t); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main004.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main004.c -new file mode 100644 -index 0000000..d696b17 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main004.c -@@ -0,0 +1,13 @@ -+// Test c call fortran for the derived type and the component of the -+// derived type is scalar of type long long -+// -+#include -+struct test { -+ long long t; -+}; -+extern void f_func_(struct test *s); -+int main() { -+ struct test a; -+ f_func_(&a); -+ printf("%Ld\n", a.t); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main005.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main005.c -new file mode 100644 -index 0000000..ec2abe6 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main005.c -@@ -0,0 +1,13 @@ -+// Test c call fortran for the derived type and the component of the -+// derived type is scalar of signed char -+// -+#include -+struct test { -+ signed char t; -+}; -+extern void f_func_(struct test *s); -+int main() { -+ struct test a; -+ f_func_(&a); -+ printf("%hhd\n", a.t); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main006.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main006.c -new file mode 100644 -index 0000000..a063a8a ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main006.c -@@ -0,0 +1,13 @@ -+// Test c call fortran for the derived type and the component of the -+// derived type is scalar of type size_t -+// -+#include -+struct test { -+ size_t t; -+}; -+extern void f_func_(struct test *s); -+int main() { -+ struct test a; -+ f_func_(&a); -+ printf("%ld\n", a.t); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main007.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main007.c -new file mode 100644 -index 0000000..809e893 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main007.c -@@ -0,0 +1,14 @@ -+// Test c call fortran for the derived type and the component of the -+// derived type is scalar of type int8_t -+// -+#include -+#include -+struct test { -+ int8_t t; -+}; -+extern void f_func_(struct test *s); -+int main() { -+ struct test a; -+ f_func_(&a); -+ printf("%hhd\n", a.t); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main008.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main008.c -new file mode 100644 -index 0000000..3366e85 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main008.c -@@ -0,0 +1,14 @@ -+// Test c call fortran for the derived type and the component of the -+// derived type is scalar of type int16_t -+// -+#include -+#include -+struct test { -+ int16_t t; -+}; -+extern void f_func_(struct test *s); -+int main() { -+ struct test a; -+ f_func_(&a); -+ printf("%hd\n", a.t); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main009.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main009.c -new file mode 100644 -index 0000000..edd916a ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main009.c -@@ -0,0 +1,14 @@ -+// Test c call fortran for the derived type and the component of the -+// derived type is scalar of type int32_t -+// -+#include -+#include -+struct test { -+ int32_t t; -+}; -+extern void f_func_(struct test *s); -+int main() { -+ struct test a; -+ f_func_(&a); -+ printf("%d\n", a.t); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main010.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main010.c -new file mode 100644 -index 0000000..743e4b6 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main010.c -@@ -0,0 +1,14 @@ -+// Test c call fortran for the derived type and the component of the -+// derived type is scalar of type int64_t -+// -+#include -+#include -+struct test { -+ int64_t t; -+}; -+extern void f_func_(struct test *s); -+int main() { -+ struct test a; -+ f_func_(&a); -+ printf("%ld\n", a.t); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main011.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main011.c -new file mode 100644 -index 0000000..f77bc3f ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main011.c -@@ -0,0 +1,14 @@ -+// Test c call fortran for the derived type and the component of the -+// derived type is scalar of type int_least8_t -+// -+#include -+#include -+struct test { -+ int_least8_t t; -+}; -+extern void f_func_(struct test *s); -+int main() { -+ struct test a; -+ f_func_(&a); -+ printf("%hhd\n", a.t); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main012.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main012.c -new file mode 100644 -index 0000000..39e1a52 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main012.c -@@ -0,0 +1,14 @@ -+// Test c call fortran for the derived type and the component of the -+// derived type is scalar of type int_least16_t -+// -+#include -+#include -+struct test { -+ int_least16_t t; -+}; -+extern void f_func_(struct test *s); -+int main() { -+ struct test a; -+ f_func_(&a); -+ printf("%hd\n", a.t); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main013.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main013.c -new file mode 100644 -index 0000000..296873d ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main013.c -@@ -0,0 +1,14 @@ -+// Test c call fortran for the derived type and the component of the -+// derived type is scalar of type int_least32_t -+// -+#include -+#include -+struct test { -+ int_least32_t t; -+}; -+extern void f_func_(struct test *s); -+int main() { -+ struct test a; -+ f_func_(&a); -+ printf("%d\n", a.t); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main014.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main014.c -new file mode 100644 -index 0000000..e2a48ae ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main014.c -@@ -0,0 +1,14 @@ -+// Test c call fortran for the derived type and the component of the -+// derived type is scalar of type int_least64_t -+// -+#include -+#include -+struct test { -+ int_least64_t t; -+}; -+extern void f_func_(struct test *s); -+int main() { -+ struct test a; -+ f_func_(&a); -+ printf("%ld\n", a.t); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main015.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main015.c -new file mode 100644 -index 0000000..fda3683 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main015.c -@@ -0,0 +1,14 @@ -+// Test c call fortran for the derived type and the component of the -+// derived type is scalar of type int_fast8_t -+// -+#include -+#include -+struct test { -+ int_fast8_t t; -+}; -+extern void f_func_(struct test *s); -+int main() { -+ struct test a; -+ f_func_(&a); -+ printf("%hhd\n", a.t); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main016.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main016.c -new file mode 100644 -index 0000000..c88cf3e ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main016.c -@@ -0,0 +1,14 @@ -+// Test c call fortran for the derived type and the component of the -+// derived type is scalar of type int_fast16_t -+// -+#include -+#include -+struct test { -+ int_fast16_t t; -+}; -+extern void f_func_(struct test *s); -+int main() { -+ struct test a; -+ f_func_(&a); -+ printf("%ld\n", a.t); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main017.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main017.c -new file mode 100644 -index 0000000..e7c385d ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main017.c -@@ -0,0 +1,14 @@ -+// Test c call fortran for the derived type and the component of the -+// derived type is scalar of type int_fast32_t -+// -+#include -+#include -+struct test { -+ int_fast32_t t; -+}; -+extern void f_func_(struct test *s); -+int main() { -+ struct test a; -+ f_func_(&a); -+ printf("%ld\n", a.t); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main018.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main018.c -new file mode 100644 -index 0000000..959a511 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main018.c -@@ -0,0 +1,14 @@ -+// Test c call fortran for the derived type and the component of the -+// derived type is scalar of type int_fast64_t -+// -+#include -+#include -+struct test { -+ int_fast64_t t; -+}; -+extern void f_func_(struct test *s); -+int main() { -+ struct test a; -+ f_func_(&a); -+ printf("%ld\n", a.t); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main019.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main019.c -new file mode 100644 -index 0000000..0dbf9d8 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main019.c -@@ -0,0 +1,14 @@ -+// Test c call fortran for the derived type and the component of the -+// derived type is scalar of type intmax_t -+// -+#include -+#include -+struct test { -+ intmax_t t; -+}; -+extern void f_func_(struct test *s); -+int main() { -+ struct test a; -+ f_func_(&a); -+ printf("%ld\n", a.t); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main020.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main020.c -new file mode 100644 -index 0000000..7aca7aa ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main020.c -@@ -0,0 +1,14 @@ -+// Test c call fortran for the derived type and the component of the -+// derived type is scalar of type intptr_t -+// -+#include -+#include -+struct test { -+ intptr_t t; -+}; -+extern void f_func_(struct test *s); -+int main() { -+ struct test a; -+ f_func_(&a); -+ printf("%ld\n", a.t); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main021.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main021.c -new file mode 100644 -index 0000000..d6e95af ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main021.c -@@ -0,0 +1,14 @@ -+// Test c call fortran for the derived type and the component of the -+// derived type is scalar of type float -+// -+#include -+#include -+struct test { -+ float t; -+}; -+extern void f_func_(struct test *s); -+int main() { -+ struct test a; -+ f_func_(&a); -+ printf("%0.20f\n", a.t); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main022.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main022.c -new file mode 100644 -index 0000000..153aaa0 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main022.c -@@ -0,0 +1,14 @@ -+// Test c call fortran for the derived type and the component of the -+// derived type is scalar of type double -+// -+#include -+#include -+struct test { -+ double t; -+}; -+extern void f_func_(struct test *s); -+int main() { -+ struct test a; -+ f_func_(&a); -+ printf("%0.20lf\n", a.t); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main023.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main023.c -new file mode 100644 -index 0000000..6232a85 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main023.c -@@ -0,0 +1,14 @@ -+// Test c call fortran for the derived type and the component of the -+// derived type is scalar of type long double -+// -+#include -+#include -+struct test { -+ long double t; -+}; -+extern void f_func_(struct test *s); -+int main() { -+ struct test a; -+ f_func_(&a); -+ printf("%0.20Lf\n", a.t); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main024.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main024.c -new file mode 100644 -index 0000000..d57ddfc ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main024.c -@@ -0,0 +1,14 @@ -+// Test c call fortran for the derived type and the component of the -+// derived type is scalar of type float _Complex -+// -+#include -+#include -+struct test { -+ float _Complex t; -+}; -+extern void f_func_(struct test *s); -+int main() { -+ struct test a; -+ f_func_(&a); -+ printf("%0.20f + %0.20fi\n", creal(a.t), cimag(a.t)); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main025.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main025.c -new file mode 100644 -index 0000000..c5daac4 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main025.c -@@ -0,0 +1,14 @@ -+// Test c call fortran for the derived type and the component of the -+// derived type is scalar of type double _Complex -+// -+#include -+#include -+struct test { -+ double _Complex t; -+}; -+extern void f_func_(struct test *s); -+int main() { -+ struct test a; -+ f_func_(&a); -+ printf("%0.20lf + %0.20lfi\n", creal(a.t), cimag(a.t)); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main026.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main026.c -new file mode 100644 -index 0000000..1b26750 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main026.c -@@ -0,0 +1,14 @@ -+// Test c call fortran for the derived type and the component of the -+// derived type is scalar of type long double _Complex -+// -+#include -+#include -+struct test { -+ long double _Complex t; -+}; -+extern void f_func_(struct test *s); -+int main() { -+ struct test a; -+ f_func_(&a); -+ printf("%0.20lf + %0.20lfi\n", creal(a.t), cimag(a.t)); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main027.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main027.c -new file mode 100644 -index 0000000..2a4ce6c ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main027.c -@@ -0,0 +1,14 @@ -+// Test c call fortran for the derived type and the component of the -+// derived type is scalar of type _Bool -+// -+#include -+#include -+struct test { -+ _Bool t; -+}; -+extern void f_func_(struct test *s); -+int main() { -+ struct test a; -+ f_func_(&a); -+ printf("%d\n", a.t); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main028.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main028.c -new file mode 100644 -index 0000000..4bfabde ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/c_main028.c -@@ -0,0 +1,14 @@ -+// Test c call fortran for the derived type and the component of the -+// derived type is scalar of type char -+// -+#include -+#include -+struct test { -+ char t; -+}; -+extern void f_func_(struct test *s); -+int main() { -+ struct test a; -+ f_func_(&a); -+ printf("%c\n", a.t); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func001.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func001.f90 -new file mode 100644 -index 0000000..042bc57 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func001.f90 -@@ -0,0 +1,7 @@ -+subroutine f_func(t) -+ type test -+ integer n -+ end type -+ type(test) :: t -+ t%n = 100 -+end -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func002.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func002.f90 -new file mode 100644 -index 0000000..9ec2ac8 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func002.f90 -@@ -0,0 +1,7 @@ -+subroutine f_func(t) -+ type test -+ integer(2) n -+ end type -+ type(test) :: t -+ t%n = 100 -+end -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func003.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func003.f90 -new file mode 100644 -index 0000000..c2bffdc ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func003.f90 -@@ -0,0 +1,7 @@ -+subroutine f_func(t) -+ type test -+ integer(8) n -+ end type -+ type(test) :: t -+ t%n = 100 -+end -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func004.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func004.f90 -new file mode 100644 -index 0000000..c2bffdc ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func004.f90 -@@ -0,0 +1,7 @@ -+subroutine f_func(t) -+ type test -+ integer(8) n -+ end type -+ type(test) :: t -+ t%n = 100 -+end -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func005.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func005.f90 -new file mode 100644 -index 0000000..0f05a35 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func005.f90 -@@ -0,0 +1,7 @@ -+subroutine f_func(t) -+ type test -+ integer(1) n -+ end type -+ type(test) :: t -+ t%n = 100 -+end -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func006.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func006.f90 -new file mode 100644 -index 0000000..c2bffdc ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func006.f90 -@@ -0,0 +1,7 @@ -+subroutine f_func(t) -+ type test -+ integer(8) n -+ end type -+ type(test) :: t -+ t%n = 100 -+end -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func007.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func007.f90 -new file mode 100644 -index 0000000..0f05a35 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func007.f90 -@@ -0,0 +1,7 @@ -+subroutine f_func(t) -+ type test -+ integer(1) n -+ end type -+ type(test) :: t -+ t%n = 100 -+end -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func008.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func008.f90 -new file mode 100644 -index 0000000..9ec2ac8 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func008.f90 -@@ -0,0 +1,7 @@ -+subroutine f_func(t) -+ type test -+ integer(2) n -+ end type -+ type(test) :: t -+ t%n = 100 -+end -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func009.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func009.f90 -new file mode 100644 -index 0000000..64f54d3 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func009.f90 -@@ -0,0 +1,7 @@ -+subroutine f_func(t) -+ type test -+ integer(4) n -+ end type -+ type(test) :: t -+ t%n = 100 -+end -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func010.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func010.f90 -new file mode 100644 -index 0000000..c2bffdc ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func010.f90 -@@ -0,0 +1,7 @@ -+subroutine f_func(t) -+ type test -+ integer(8) n -+ end type -+ type(test) :: t -+ t%n = 100 -+end -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func011.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func011.f90 -new file mode 100644 -index 0000000..0f05a35 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func011.f90 -@@ -0,0 +1,7 @@ -+subroutine f_func(t) -+ type test -+ integer(1) n -+ end type -+ type(test) :: t -+ t%n = 100 -+end -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func012.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func012.f90 -new file mode 100644 -index 0000000..9ec2ac8 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func012.f90 -@@ -0,0 +1,7 @@ -+subroutine f_func(t) -+ type test -+ integer(2) n -+ end type -+ type(test) :: t -+ t%n = 100 -+end -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func013.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func013.f90 -new file mode 100644 -index 0000000..64f54d3 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func013.f90 -@@ -0,0 +1,7 @@ -+subroutine f_func(t) -+ type test -+ integer(4) n -+ end type -+ type(test) :: t -+ t%n = 100 -+end -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func014.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func014.f90 -new file mode 100644 -index 0000000..c2bffdc ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func014.f90 -@@ -0,0 +1,7 @@ -+subroutine f_func(t) -+ type test -+ integer(8) n -+ end type -+ type(test) :: t -+ t%n = 100 -+end -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func015.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func015.f90 -new file mode 100644 -index 0000000..0f05a35 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func015.f90 -@@ -0,0 +1,7 @@ -+subroutine f_func(t) -+ type test -+ integer(1) n -+ end type -+ type(test) :: t -+ t%n = 100 -+end -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func016.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func016.f90 -new file mode 100644 -index 0000000..c2bffdc ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func016.f90 -@@ -0,0 +1,7 @@ -+subroutine f_func(t) -+ type test -+ integer(8) n -+ end type -+ type(test) :: t -+ t%n = 100 -+end -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func017.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func017.f90 -new file mode 100644 -index 0000000..c2bffdc ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func017.f90 -@@ -0,0 +1,7 @@ -+subroutine f_func(t) -+ type test -+ integer(8) n -+ end type -+ type(test) :: t -+ t%n = 100 -+end -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func018.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func018.f90 -new file mode 100644 -index 0000000..c2bffdc ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func018.f90 -@@ -0,0 +1,7 @@ -+subroutine f_func(t) -+ type test -+ integer(8) n -+ end type -+ type(test) :: t -+ t%n = 100 -+end -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func019.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func019.f90 -new file mode 100644 -index 0000000..c2bffdc ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func019.f90 -@@ -0,0 +1,7 @@ -+subroutine f_func(t) -+ type test -+ integer(8) n -+ end type -+ type(test) :: t -+ t%n = 100 -+end -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func020.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func020.f90 -new file mode 100644 -index 0000000..c2bffdc ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func020.f90 -@@ -0,0 +1,7 @@ -+subroutine f_func(t) -+ type test -+ integer(8) n -+ end type -+ type(test) :: t -+ t%n = 100 -+end -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func021.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func021.f90 -new file mode 100644 -index 0000000..75d8e36 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func021.f90 -@@ -0,0 +1,7 @@ -+subroutine f_func(t) -+ type test -+ real(4) n -+ end type -+ type(test) :: t -+ t%n = 3.14 -+end -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func022.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func022.f90 -new file mode 100644 -index 0000000..b8dc58e ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func022.f90 -@@ -0,0 +1,7 @@ -+subroutine f_func(t) -+ type test -+ real(8) n -+ end type -+ type(test) :: t -+ t%n = 3.14 -+end -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func023.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func023.f90 -new file mode 100644 -index 0000000..7e7d3ab ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func023.f90 -@@ -0,0 +1,8 @@ -+subroutine f_func(t) -+ integer, parameter :: K = selected_real_kind(16) -+ type test -+ real(K) n -+ end type -+ type(test) :: t -+ t%n = 3.14 -+end -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func024.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func024.f90 -new file mode 100644 -index 0000000..2c5946d ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func024.f90 -@@ -0,0 +1,7 @@ -+subroutine f_func(t) -+ type test -+ complex(4) n -+ end type -+ type(test) :: t -+ t%n = (-12345678.7654321, 1) -+end -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func025.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func025.f90 -new file mode 100644 -index 0000000..37d5023 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func025.f90 -@@ -0,0 +1,7 @@ -+subroutine f_func(t) -+ type test -+ complex(8) n -+ end type -+ type(test) :: t -+ t%n = (-12345678.7654321, 1) -+end -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func026.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func026.f90 -new file mode 100644 -index 0000000..e5882c2 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func026.f90 -@@ -0,0 +1,8 @@ -+subroutine f_func(t) -+ integer, parameter :: K = selected_real_kind(16) -+ type test -+ complex(K) n -+ end type -+ type(test) :: t -+ t%n = (-12345678.7654321, 1) -+end -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func027.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func027.f90 -new file mode 100644 -index 0000000..3672b88 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func027.f90 -@@ -0,0 +1,7 @@ -+subroutine f_func(t) -+ type test -+ logical(1) n -+ end type -+ type(test) :: t -+ t%n = .TRUE. -+end -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func028.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func028.f90 -new file mode 100644 -index 0000000..af8daba ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/fortran_func028.f90 -@@ -0,0 +1,7 @@ -+subroutine f_func(t) -+ type test -+ character(1) n -+ end type -+ type(test) :: t -+ t%n = 'a' -+end -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/result.md b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/result.md -new file mode 100644 -index 0000000..347da21 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/result.md -@@ -0,0 +1,29 @@ -+ | test | gfortran | flang | -+ | 001 | PASS | PASS | -+ | 002 | PASS | PASS | -+ | 003 | PASS | PASS | -+ | 004 | PASS | PASS | -+ | 005 | PASS | PASS | -+ | 006 | PASS | PASS | -+ | 007 | PASS | PASS | -+ | 008 | PASS | PASS | -+ | 009 | PASS | PASS | -+ | 010 | PASS | PASS | -+ | 011 | PASS | PASS | -+ | 012 | PASS | PASS | -+ | 013 | PASS | PASS | -+ | 014 | PASS | PASS | -+ | 015 | PASS | PASS | -+ | 016 | PASS | PASS | -+ | 017 | PASS | PASS | -+ | 018 | PASS | PASS | -+ | 019 | PASS | PASS | -+ | 020 | PASS | PASS | -+ | 021 | PASS | PASS | -+ | 022 | PASS | PASS | -+ | 023 | PASS | PASS | -+ | 024 | PASS | PASS | -+ | 025 | PASS | PASS | -+ | 026 | PASS | PASS | -+ | 027 | PASS | PASS | -+ | 028 | PASS | PASS | -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/run.sh b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/run.sh -new file mode 100644 -index 0000000..5b2202e ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/001_c_call_fortran_struct/run.sh -@@ -0,0 +1,16 @@ -+for i in {001..028} -+do -+echo "------- test $i ------." -+echo "----- gfortran result:" -+gcc c_main$i.c -c -o c-test.o -+gfortran fortran_func$i.f90 -fno-range-check -c -o fortran-test.o -+gfortran fortran-test.o c-test.o -+./a.out -+rm *.o a.out -+echo "----- flang-new result : " -+clang c_main$i.c -c -o c-test.o -+flang-new fortran_func$i.f90 -c -o fortran-test.o -+flang-new -flang-experimental-exec c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+done -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main001.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main001.c -new file mode 100644 -index 0000000..82f07ce ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main001.c -@@ -0,0 +1,16 @@ -+// Test c call fortran for the derived type and the component of the -+// derived type is scalar of type int -+// -+#include -+struct t { -+ int x; -+}; -+struct test { -+ struct t w; -+}; -+extern void f_func_(struct test *s); -+int main() { -+ struct test a; -+ f_func_(&a); -+ printf("%d\n", a.w.x); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main002.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main002.c -new file mode 100644 -index 0000000..16adfde ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main002.c -@@ -0,0 +1,16 @@ -+// Test c call fortran for the derived type and the component of the -+// derived type is scalar of type short -+// -+#include -+struct t { -+ short x; -+}; -+struct test { -+ struct t w; -+}; -+extern void f_func_(struct test *s); -+int main() { -+ struct test a; -+ f_func_(&a); -+ printf("%hd\n", a.w.x); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main003.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main003.c -new file mode 100644 -index 0000000..f5e7c6f ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main003.c -@@ -0,0 +1,16 @@ -+// Test c call fortran for the derived type and the component of the -+// derived type is scalar of type long -+// -+#include -+struct t { -+ long x; -+}; -+struct test { -+ struct t w; -+}; -+extern void f_func_(struct test *s); -+int main() { -+ struct test a; -+ f_func_(&a); -+ printf("%ld\n", a.w.x); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main004.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main004.c -new file mode 100644 -index 0000000..6945b96 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main004.c -@@ -0,0 +1,16 @@ -+// Test c call fortran for the derived type and the component of the -+// derived type is scalar of type long long -+// -+#include -+struct t { -+ long long x; -+}; -+struct test { -+ struct t w; -+}; -+extern void f_func_(struct test *s); -+int main() { -+ struct test a; -+ f_func_(&a); -+ printf("%Ld\n", a.w.x); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main005.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main005.c -new file mode 100644 -index 0000000..5313969 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main005.c -@@ -0,0 +1,16 @@ -+// Test c call fortran for the derived type and the component of the -+// derived type is scalar of type signed char -+// -+#include -+struct t { -+ signed char x; -+}; -+struct test { -+ struct t w; -+}; -+extern void f_func_(struct test *s); -+int main() { -+ struct test a; -+ f_func_(&a); -+ printf("%hhd\n", a.w.x); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main006.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main006.c -new file mode 100644 -index 0000000..999d759 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main006.c -@@ -0,0 +1,16 @@ -+// Test c call fortran for the derived type and the component of the -+// derived type is scalar of type size_t -+// -+#include -+struct t { -+ size_t x; -+}; -+struct test { -+ struct t w; -+}; -+extern void f_func_(struct test *s); -+int main() { -+ struct test a; -+ f_func_(&a); -+ printf("%ld\n", a.w.x); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main007.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main007.c -new file mode 100644 -index 0000000..680992f ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main007.c -@@ -0,0 +1,17 @@ -+// Test c call fortran for the derived type and the component of the -+// derived type is scalar of type int8_t -+// -+#include -+#include -+struct t { -+ int8_t x; -+}; -+struct test { -+ struct t w; -+}; -+extern void f_func_(struct test *s); -+int main() { -+ struct test a; -+ f_func_(&a); -+ printf("%hhd\n", a.w.x); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main008.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main008.c -new file mode 100644 -index 0000000..f5b7510 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main008.c -@@ -0,0 +1,17 @@ -+// Test c call fortran for the derived type and the component of the -+// derived type is scalar of type int16_t -+// -+#include -+#include -+struct t { -+ int16_t x; -+}; -+struct test { -+ struct t w; -+}; -+extern void f_func_(struct test *s); -+int main() { -+ struct test a; -+ f_func_(&a); -+ printf("%hd\n", a.w.x); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main009.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main009.c -new file mode 100644 -index 0000000..2227047 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main009.c -@@ -0,0 +1,17 @@ -+// Test c call fortran for the derived type and the component of the -+// derived type is scalar of type int32_t -+// -+#include -+#include -+struct t { -+ int32_t x; -+}; -+struct test { -+ struct t w; -+}; -+extern void f_func_(struct test *s); -+int main() { -+ struct test a; -+ f_func_(&a); -+ printf("%d\n", a.w.x); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main010.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main010.c -new file mode 100644 -index 0000000..355b4c5 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main010.c -@@ -0,0 +1,17 @@ -+// Test c call fortran for the derived type and the component of the -+// derived type is scalar of type int64_t -+// -+#include -+#include -+struct t { -+ int64_t x; -+}; -+struct test { -+ struct t w; -+}; -+extern void f_func_(struct test *s); -+int main() { -+ struct test a; -+ f_func_(&a); -+ printf("%ld\n", a.w.x); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main011.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main011.c -new file mode 100644 -index 0000000..88754d2 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main011.c -@@ -0,0 +1,17 @@ -+// Test c call fortran for the derived type and the component of the -+// derived type is scalar of type int_least8_t -+// -+#include -+#include -+struct t { -+ int_least8_t x; -+}; -+struct test { -+ struct t w; -+}; -+extern void f_func_(struct test *s); -+int main() { -+ struct test a; -+ f_func_(&a); -+ printf("%hhd\n", a.w.x); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main012.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main012.c -new file mode 100644 -index 0000000..930d148 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main012.c -@@ -0,0 +1,17 @@ -+// Test c call fortran for the derived type and the component of the -+// derived type is scalar of type int_least16_t -+// -+#include -+#include -+struct t { -+ int_least16_t x; -+}; -+struct test { -+ struct t w; -+}; -+extern void f_func_(struct test *s); -+int main() { -+ struct test a; -+ f_func_(&a); -+ printf("%hd\n", a.w.x); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main013.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main013.c -new file mode 100644 -index 0000000..b26527a ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main013.c -@@ -0,0 +1,17 @@ -+// Test c call fortran for the derived type and the component of the -+// derived type is scalar of type int_least32_t -+// -+#include -+#include -+struct t { -+ int_least32_t x; -+}; -+struct test { -+ struct t w; -+}; -+extern void f_func_(struct test *s); -+int main() { -+ struct test a; -+ f_func_(&a); -+ printf("%d\n", a.w.x); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main014.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main014.c -new file mode 100644 -index 0000000..9effff1 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main014.c -@@ -0,0 +1,17 @@ -+// Test c call fortran for the derived type and the component of the -+// derived type is scalar of type int_least64_t -+// -+#include -+#include -+struct t { -+ int_least64_t x; -+}; -+struct test { -+ struct t w; -+}; -+extern void f_func_(struct test *s); -+int main() { -+ struct test a; -+ f_func_(&a); -+ printf("%ld\n", a.w.x); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main015.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main015.c -new file mode 100644 -index 0000000..7be24d8 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main015.c -@@ -0,0 +1,17 @@ -+// Test c call fortran for the derived type and the component of the -+// derived type is scalar of type int_fast8_t -+// -+#include -+#include -+struct t { -+ int_fast8_t x; -+}; -+struct test { -+ struct t w; -+}; -+extern void f_func_(struct test *s); -+int main() { -+ struct test a; -+ f_func_(&a); -+ printf("%hhd\n", a.w.x); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main016.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main016.c -new file mode 100644 -index 0000000..e394f92 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main016.c -@@ -0,0 +1,17 @@ -+// Test c call fortran for the derived type and the component of the -+// derived type is scalar of type int_fast16_t -+// -+#include -+#include -+struct t { -+ int_fast16_t x; -+}; -+struct test { -+ struct t w; -+}; -+extern void f_func_(struct test *s); -+int main() { -+ struct test a; -+ f_func_(&a); -+ printf("%ld\n", a.w.x); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main017.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main017.c -new file mode 100644 -index 0000000..cffa904 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main017.c -@@ -0,0 +1,17 @@ -+// Test c call fortran for the derived type and the component of the -+// derived type is scalar of type int_fast32_t -+// -+#include -+#include -+struct t { -+ int_fast32_t x; -+}; -+struct test { -+ struct t w; -+}; -+extern void f_func_(struct test *s); -+int main() { -+ struct test a; -+ f_func_(&a); -+ printf("%ld\n", a.w.x); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main018.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main018.c -new file mode 100644 -index 0000000..9a6ad4c ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main018.c -@@ -0,0 +1,17 @@ -+// Test c call fortran for the derived type and the component of the -+// derived type is scalar of type int_fast64_t -+// -+#include -+#include -+struct t { -+ int_fast64_t x; -+}; -+struct test { -+ struct t w; -+}; -+extern void f_func_(struct test *s); -+int main() { -+ struct test a; -+ f_func_(&a); -+ printf("%ld\n", a.w.x); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main019.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main019.c -new file mode 100644 -index 0000000..ed94ed7 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main019.c -@@ -0,0 +1,17 @@ -+// Test c call fortran for the derived type and the component of the -+// derived type is scalar of type intmax_t -+// -+#include -+#include -+struct t { -+ intmax_t x; -+}; -+struct test { -+ struct t w; -+}; -+extern void f_func_(struct test *s); -+int main() { -+ struct test a; -+ f_func_(&a); -+ printf("%ld\n", a.w.x); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main020.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main020.c -new file mode 100644 -index 0000000..7235d2f ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main020.c -@@ -0,0 +1,17 @@ -+// Test c call fortran for the derived type and the component of the -+// derived type is scalar of type intptr_t -+// -+#include -+#include -+struct t { -+ intptr_t x; -+}; -+struct test { -+ struct t w; -+}; -+extern void f_func_(struct test *s); -+int main() { -+ struct test a; -+ f_func_(&a); -+ printf("%ld\n", a.w.x); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main021.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main021.c -new file mode 100644 -index 0000000..7947fb4 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main021.c -@@ -0,0 +1,16 @@ -+// Test c call fortran for the derived type and the component of the -+// derived type is scalar of type float -+// -+#include -+struct t { -+ float x; -+}; -+struct test { -+ struct t w; -+}; -+extern void f_func_(struct test *s); -+int main() { -+ struct test a; -+ f_func_(&a); -+ printf("%0.20f\n", a.w.x); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main022.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main022.c -new file mode 100644 -index 0000000..39765cf ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main022.c -@@ -0,0 +1,16 @@ -+// Test c call fortran for the derived type and the component of the -+// derived type is scalar of type double -+// -+#include -+struct t { -+ double x; -+}; -+struct test { -+ struct t w; -+}; -+extern void f_func_(struct test *s); -+int main() { -+ struct test a; -+ f_func_(&a); -+ printf("%0.20lf\n", a.w.x); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main023.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main023.c -new file mode 100644 -index 0000000..b560246 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main023.c -@@ -0,0 +1,16 @@ -+// Test c call fortran for the derived type and the component of the -+// derived type is scalar of type long double -+// -+#include -+struct t { -+ long double x; -+}; -+struct test { -+ struct t w; -+}; -+extern void f_func_(struct test *s); -+int main() { -+ struct test a; -+ f_func_(&a); -+ printf("%0.20Lf\n", a.w.x); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main024.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main024.c -new file mode 100644 -index 0000000..882ac49 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main024.c -@@ -0,0 +1,18 @@ -+// Test c call fortran for the derived type and the component of the -+// derived type is scalar of type float _Complex -+// -+#include -+#include -+struct t { -+ float _Complex x; -+}; -+struct test { -+ struct t w; -+}; -+extern void f_func_(struct test *s); -+int main() { -+ struct test a; -+ f_func_(&a); -+ printf("%0.20f + %0.20fi\n", creal(a.w.x), cimag(a.w.x)); -+} -+ -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main025.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main025.c -new file mode 100644 -index 0000000..d85a610 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main025.c -@@ -0,0 +1,18 @@ -+// Test c call fortran for the derived type and the component of the -+// derived type is scalar of type double _Complex -+// -+#include -+#include -+struct t { -+ double _Complex x; -+}; -+struct test { -+ struct t w; -+}; -+extern void f_func_(struct test *s); -+int main() { -+ struct test a; -+ f_func_(&a); -+ printf("%0.20lf + %0.20lfi\n", creal(a.w.x), cimag(a.w.x)); -+} -+ -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main026.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main026.c -new file mode 100644 -index 0000000..bf45517 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main026.c -@@ -0,0 +1,18 @@ -+// Test c call fortran for the derived type and the component of the -+// derived type is scalar of type long double _Complex -+// -+#include -+#include -+struct t { -+ long double _Complex x; -+}; -+struct test { -+ struct t w; -+}; -+extern void f_func_(struct test *s); -+int main() { -+ struct test a; -+ f_func_(&a); -+ printf("%0.20lf + %0.20lfi\n", creal(a.w.x), cimag(a.w.x)); -+} -+ -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main027.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main027.c -new file mode 100644 -index 0000000..d2f28cb ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main027.c -@@ -0,0 +1,16 @@ -+// Test c call fortran for the derived type and the component of the -+// derived type is scalar of type _Bool -+// -+#include -+struct t { -+ _Bool x; -+}; -+struct test { -+ struct t w; -+}; -+extern void f_func_(struct test *s); -+int main() { -+ struct test a; -+ f_func_(&a); -+ printf("%d\n", a.w.x); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main028.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main028.c -new file mode 100644 -index 0000000..55c5de0 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/c_main028.c -@@ -0,0 +1,16 @@ -+// Test c call fortran for the derived type and the component of the -+// derived type is scalar of type char -+// -+#include -+struct t { -+ char x; -+}; -+struct test { -+ struct t w; -+}; -+extern void f_func_(struct test *s); -+int main() { -+ struct test a; -+ f_func_(&a); -+ printf("%c\n", a.w.x); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func001.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func001.f90 -new file mode 100644 -index 0000000..293ee2a ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func001.f90 -@@ -0,0 +1,10 @@ -+subroutine f_func(i) -+ type t -+ integer n -+ end type t -+ type test -+ type(t) x -+ end type test -+ type(test) :: i -+ i%x%n = 100 -+end -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func002.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func002.f90 -new file mode 100644 -index 0000000..71f216b ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func002.f90 -@@ -0,0 +1,10 @@ -+subroutine f_func(i) -+ type t -+ integer(2) n -+ end type t -+ type test -+ type(t) x -+ end type test -+ type(test) :: i -+ i%x%n = 100 -+end -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func003.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func003.f90 -new file mode 100644 -index 0000000..4f89b40 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func003.f90 -@@ -0,0 +1,10 @@ -+subroutine f_func(i) -+ type t -+ integer(8) n -+ end type t -+ type test -+ type(t) x -+ end type test -+ type(test) :: i -+ i%x%n = 100 -+end -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func004.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func004.f90 -new file mode 100644 -index 0000000..4f89b40 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func004.f90 -@@ -0,0 +1,10 @@ -+subroutine f_func(i) -+ type t -+ integer(8) n -+ end type t -+ type test -+ type(t) x -+ end type test -+ type(test) :: i -+ i%x%n = 100 -+end -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func005.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func005.f90 -new file mode 100644 -index 0000000..b16ce20 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func005.f90 -@@ -0,0 +1,10 @@ -+subroutine f_func(i) -+ type t -+ integer(1) n -+ end type t -+ type test -+ type(t) x -+ end type test -+ type(test) :: i -+ i%x%n = 100 -+end -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func006.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func006.f90 -new file mode 100644 -index 0000000..4f89b40 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func006.f90 -@@ -0,0 +1,10 @@ -+subroutine f_func(i) -+ type t -+ integer(8) n -+ end type t -+ type test -+ type(t) x -+ end type test -+ type(test) :: i -+ i%x%n = 100 -+end -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func007.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func007.f90 -new file mode 100644 -index 0000000..b16ce20 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func007.f90 -@@ -0,0 +1,10 @@ -+subroutine f_func(i) -+ type t -+ integer(1) n -+ end type t -+ type test -+ type(t) x -+ end type test -+ type(test) :: i -+ i%x%n = 100 -+end -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func008.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func008.f90 -new file mode 100644 -index 0000000..71f216b ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func008.f90 -@@ -0,0 +1,10 @@ -+subroutine f_func(i) -+ type t -+ integer(2) n -+ end type t -+ type test -+ type(t) x -+ end type test -+ type(test) :: i -+ i%x%n = 100 -+end -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func009.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func009.f90 -new file mode 100644 -index 0000000..c53073a ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func009.f90 -@@ -0,0 +1,10 @@ -+subroutine f_func(i) -+ type t -+ integer(4) n -+ end type t -+ type test -+ type(t) x -+ end type test -+ type(test) :: i -+ i%x%n = 100 -+end -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func010.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func010.f90 -new file mode 100644 -index 0000000..4f89b40 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func010.f90 -@@ -0,0 +1,10 @@ -+subroutine f_func(i) -+ type t -+ integer(8) n -+ end type t -+ type test -+ type(t) x -+ end type test -+ type(test) :: i -+ i%x%n = 100 -+end -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func011.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func011.f90 -new file mode 100644 -index 0000000..b16ce20 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func011.f90 -@@ -0,0 +1,10 @@ -+subroutine f_func(i) -+ type t -+ integer(1) n -+ end type t -+ type test -+ type(t) x -+ end type test -+ type(test) :: i -+ i%x%n = 100 -+end -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func012.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func012.f90 -new file mode 100644 -index 0000000..71f216b ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func012.f90 -@@ -0,0 +1,10 @@ -+subroutine f_func(i) -+ type t -+ integer(2) n -+ end type t -+ type test -+ type(t) x -+ end type test -+ type(test) :: i -+ i%x%n = 100 -+end -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func013.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func013.f90 -new file mode 100644 -index 0000000..c53073a ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func013.f90 -@@ -0,0 +1,10 @@ -+subroutine f_func(i) -+ type t -+ integer(4) n -+ end type t -+ type test -+ type(t) x -+ end type test -+ type(test) :: i -+ i%x%n = 100 -+end -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func014.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func014.f90 -new file mode 100644 -index 0000000..4f89b40 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func014.f90 -@@ -0,0 +1,10 @@ -+subroutine f_func(i) -+ type t -+ integer(8) n -+ end type t -+ type test -+ type(t) x -+ end type test -+ type(test) :: i -+ i%x%n = 100 -+end -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func015.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func015.f90 -new file mode 100644 -index 0000000..b16ce20 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func015.f90 -@@ -0,0 +1,10 @@ -+subroutine f_func(i) -+ type t -+ integer(1) n -+ end type t -+ type test -+ type(t) x -+ end type test -+ type(test) :: i -+ i%x%n = 100 -+end -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func016.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func016.f90 -new file mode 100644 -index 0000000..4f89b40 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func016.f90 -@@ -0,0 +1,10 @@ -+subroutine f_func(i) -+ type t -+ integer(8) n -+ end type t -+ type test -+ type(t) x -+ end type test -+ type(test) :: i -+ i%x%n = 100 -+end -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func017.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func017.f90 -new file mode 100644 -index 0000000..4f89b40 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func017.f90 -@@ -0,0 +1,10 @@ -+subroutine f_func(i) -+ type t -+ integer(8) n -+ end type t -+ type test -+ type(t) x -+ end type test -+ type(test) :: i -+ i%x%n = 100 -+end -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func018.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func018.f90 -new file mode 100644 -index 0000000..4f89b40 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func018.f90 -@@ -0,0 +1,10 @@ -+subroutine f_func(i) -+ type t -+ integer(8) n -+ end type t -+ type test -+ type(t) x -+ end type test -+ type(test) :: i -+ i%x%n = 100 -+end -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func019.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func019.f90 -new file mode 100644 -index 0000000..4f89b40 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func019.f90 -@@ -0,0 +1,10 @@ -+subroutine f_func(i) -+ type t -+ integer(8) n -+ end type t -+ type test -+ type(t) x -+ end type test -+ type(test) :: i -+ i%x%n = 100 -+end -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func020.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func020.f90 -new file mode 100644 -index 0000000..4f89b40 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func020.f90 -@@ -0,0 +1,10 @@ -+subroutine f_func(i) -+ type t -+ integer(8) n -+ end type t -+ type test -+ type(t) x -+ end type test -+ type(test) :: i -+ i%x%n = 100 -+end -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func021.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func021.f90 -new file mode 100644 -index 0000000..0542cd2 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func021.f90 -@@ -0,0 +1,10 @@ -+subroutine f_func(i) -+ type t -+ real(4) n -+ end type t -+ type test -+ type(t) x -+ end type test -+ type(test) :: i -+ i%x%n = 123.4567898765432123456789 -+end -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func022.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func022.f90 -new file mode 100644 -index 0000000..b3463b7 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func022.f90 -@@ -0,0 +1,10 @@ -+subroutine f_func(i) -+ type t -+ real(8) n -+ end type t -+ type test -+ type(t) x -+ end type test -+ type(test) :: i -+ i%x%n = 123.4567898765432123456789 -+end -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func023.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func023.f90 -new file mode 100644 -index 0000000..6e0641b ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func023.f90 -@@ -0,0 +1,12 @@ -+subroutine f_func(i) -+ integer, parameter :: K = selected_real_kind(16) -+ type t -+ real(K) n -+ end type t -+ type test -+ type(t) x -+ end type test -+ type(test) :: i -+ i%x%n = 123.4567898765432123456789 -+end -+ -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func024.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func024.f90 -new file mode 100644 -index 0000000..e05aa79 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func024.f90 -@@ -0,0 +1,12 @@ -+subroutine f_func(i) -+ type t -+ complex(4) n -+ end type t -+ type test -+ type(t) x -+ end type test -+ type(test) :: i -+ i%x%n = (123.4567898765432123456789, 1) -+end -+ -+ -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func025.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func025.f90 -new file mode 100644 -index 0000000..835cd59 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func025.f90 -@@ -0,0 +1,12 @@ -+subroutine f_func(i) -+ type t -+ complex(8) n -+ end type t -+ type test -+ type(t) x -+ end type test -+ type(test) :: i -+ i%x%n = (123.4567898765432123456789, 1) -+end -+ -+ -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func026.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func026.f90 -new file mode 100644 -index 0000000..bb690e7 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func026.f90 -@@ -0,0 +1,14 @@ -+subroutine f_func(i) -+ integer, parameter :: K = selected_real_kind(16) -+ type t -+ complex(K) n -+ end type t -+ type test -+ type(t) x -+ end type test -+ type(test) :: i -+ i%x%n = (123.4567898765432123456789, 1) -+end -+ -+ -+ -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func027.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func027.f90 -new file mode 100644 -index 0000000..8044a61 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func027.f90 -@@ -0,0 +1,10 @@ -+subroutine f_func(i) -+ type t -+ logical(1) n -+ end type t -+ type test -+ type(t) x -+ end type test -+ type(test) :: i -+ i%x%n = .TRUE. -+end -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func028.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func028.f90 -new file mode 100644 -index 0000000..0b4f672 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/fortran_func028.f90 -@@ -0,0 +1,10 @@ -+subroutine f_func(i) -+ type t -+ character(1) n -+ end type t -+ type test -+ type(t) x -+ end type test -+ type(test) :: i -+ i%x%n = 'a' -+end -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/result.md b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/result.md -new file mode 100644 -index 0000000..347da21 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/result.md -@@ -0,0 +1,29 @@ -+ | test | gfortran | flang | -+ | 001 | PASS | PASS | -+ | 002 | PASS | PASS | -+ | 003 | PASS | PASS | -+ | 004 | PASS | PASS | -+ | 005 | PASS | PASS | -+ | 006 | PASS | PASS | -+ | 007 | PASS | PASS | -+ | 008 | PASS | PASS | -+ | 009 | PASS | PASS | -+ | 010 | PASS | PASS | -+ | 011 | PASS | PASS | -+ | 012 | PASS | PASS | -+ | 013 | PASS | PASS | -+ | 014 | PASS | PASS | -+ | 015 | PASS | PASS | -+ | 016 | PASS | PASS | -+ | 017 | PASS | PASS | -+ | 018 | PASS | PASS | -+ | 019 | PASS | PASS | -+ | 020 | PASS | PASS | -+ | 021 | PASS | PASS | -+ | 022 | PASS | PASS | -+ | 023 | PASS | PASS | -+ | 024 | PASS | PASS | -+ | 025 | PASS | PASS | -+ | 026 | PASS | PASS | -+ | 027 | PASS | PASS | -+ | 028 | PASS | PASS | -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/run.sh b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/run.sh -new file mode 100644 -index 0000000..5b2202e ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/002_c_call_fortran_nested_struct_simple/run.sh -@@ -0,0 +1,16 @@ -+for i in {001..028} -+do -+echo "------- test $i ------." -+echo "----- gfortran result:" -+gcc c_main$i.c -c -o c-test.o -+gfortran fortran_func$i.f90 -fno-range-check -c -o fortran-test.o -+gfortran fortran-test.o c-test.o -+./a.out -+rm *.o a.out -+echo "----- flang-new result : " -+clang c_main$i.c -c -o c-test.o -+flang-new fortran_func$i.f90 -c -o fortran-test.o -+flang-new -flang-experimental-exec c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+done -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/003_c_call_fortran_nested_struct_complicated/c_main001.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/003_c_call_fortran_nested_struct_complicated/c_main001.c -new file mode 100644 -index 0000000..c76dd0a ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/003_c_call_fortran_nested_struct_complicated/c_main001.c -@@ -0,0 +1,21 @@ -+// Test c call fortran for the derived type and the component of the -+// derived type is derived type -+// -+#include -+struct t { -+ int x; -+}; -+struct test { -+ struct t w; -+ int ww[4]; -+}; -+extern void f_func_(struct test *s); -+int main() { -+ struct test a; -+ f_func_(&a); -+ printf("%d\n", a.w.x); -+ printf("%d\n", a.ww[0]); -+ printf("%d\n", a.ww[1]); -+ printf("%d\n", a.ww[2]); -+ printf("%d\n", a.ww[3]); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/003_c_call_fortran_nested_struct_complicated/c_main002.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/003_c_call_fortran_nested_struct_complicated/c_main002.c -new file mode 100644 -index 0000000..1f77697 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/003_c_call_fortran_nested_struct_complicated/c_main002.c -@@ -0,0 +1,26 @@ -+// Test c call fortran for the array of derived type and the component -+// of the derived type is derived type -+// -+#include -+struct t { -+ int x; -+}; -+struct test { -+ struct t w; -+ int ww[4]; -+}; -+extern void f_func_(struct test s[2]); -+int main() { -+ struct test a[2]; -+ f_func_(a); -+ printf("%d\n", a[0].w.x); -+ printf("%d\n", a[0].ww[0]); -+ printf("%d\n", a[0].ww[1]); -+ printf("%d\n", a[0].ww[2]); -+ printf("%d\n", a[0].ww[3]); -+ printf("%d\n", a[1].w.x); -+ printf("%d\n", a[1].ww[0]); -+ printf("%d\n", a[1].ww[1]); -+ printf("%d\n", a[1].ww[2]); -+ printf("%d\n", a[1].ww[3]); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/003_c_call_fortran_nested_struct_complicated/c_main003.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/003_c_call_fortran_nested_struct_complicated/c_main003.c -new file mode 100644 -index 0000000..75fc179 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/003_c_call_fortran_nested_struct_complicated/c_main003.c -@@ -0,0 +1,23 @@ -+// Test c call fortran for the derived type and the component of the -+// derived type are derived types -+// -+#include -+struct t { -+ int x; -+}; -+struct t2 { -+ struct t t2w; -+ int t2x; -+}; -+struct test { -+ struct t w; -+ struct t2 ww; -+}; -+extern void f_func_(struct test *s); -+int main() { -+ struct test a; -+ f_func_(&a); -+ printf("%d\n", a.w.x); -+ printf("%d\n", a.ww.t2x); -+ printf("%d\n", a.ww.t2w.x); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/003_c_call_fortran_nested_struct_complicated/c_main004.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/003_c_call_fortran_nested_struct_complicated/c_main004.c -new file mode 100644 -index 0000000..d861d2d ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/003_c_call_fortran_nested_struct_complicated/c_main004.c -@@ -0,0 +1,30 @@ -+// Test c call fortran for the nesting of derived types -+// -+#include -+struct t { -+ int x; -+}; -+struct t1 { -+ struct t t1t; -+ int x1; -+}; -+struct t2 { -+ struct t1 t2t1; -+ int x2; -+}; -+struct t3 { -+ struct t2 t3t2; -+ int x3; -+}; -+struct test { -+ struct t3 w; -+}; -+extern void f_func_(struct test *s); -+int main() { -+ struct test a; -+ f_func_(&a); -+ printf("%d\n", a.w.x3); -+ printf("%d\n", a.w.t3t2.x2); -+ printf("%d\n", a.w.t3t2.t2t1.x1); -+ printf("%d\n", a.w.t3t2.t2t1.t1t.x); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/003_c_call_fortran_nested_struct_complicated/c_main005.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/003_c_call_fortran_nested_struct_complicated/c_main005.c -new file mode 100644 -index 0000000..e270b60 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/003_c_call_fortran_nested_struct_complicated/c_main005.c -@@ -0,0 +1,19 @@ -+// Test c call fortran for the derived type and the component of the -+// derived type is array of derived type -+// -+#include -+struct t { -+ int x; -+}; -+struct test { -+ struct t w[4]; -+}; -+extern void f_func_(struct test *s); -+int main() { -+ struct test a; -+ f_func_(&a); -+ printf("%d\n", a.w[0].x); -+ printf("%d\n", a.w[1].x); -+ printf("%d\n", a.w[2].x); -+ printf("%d\n", a.w[3].x); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/003_c_call_fortran_nested_struct_complicated/c_main006.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/003_c_call_fortran_nested_struct_complicated/c_main006.c -new file mode 100644 -index 0000000..706d40a ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/003_c_call_fortran_nested_struct_complicated/c_main006.c -@@ -0,0 +1,15 @@ -+// Test c call fortran for the derived type and the component of the -+// derived type is scalar of type int -+// -+#include -+struct t { -+ int x; -+}; -+extern struct t f_func_(struct t *s); -+int main() { -+ struct t a; -+ struct t b; -+ b = f_func_(&a); -+ printf("%d\n", a.x); -+ printf("%d\n", b.x); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/003_c_call_fortran_nested_struct_complicated/fortran_func001.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/003_c_call_fortran_nested_struct_complicated/fortran_func001.f90 -new file mode 100644 -index 0000000..eddf162 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/003_c_call_fortran_nested_struct_complicated/fortran_func001.f90 -@@ -0,0 +1,14 @@ -+subroutine f_func(i) -+ type t -+ integer n -+ end type t -+ type test -+ type(t) x -+ integer :: ww(4) -+ end type test -+ type(test) :: i -+ i%x%n = 100 -+ do j = 1, 4 -+ i%ww(j) = j -+ end do -+end -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/003_c_call_fortran_nested_struct_complicated/fortran_func002.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/003_c_call_fortran_nested_struct_complicated/fortran_func002.f90 -new file mode 100644 -index 0000000..d05af6d ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/003_c_call_fortran_nested_struct_complicated/fortran_func002.f90 -@@ -0,0 +1,18 @@ -+subroutine f_func(i) -+ type t -+ integer n -+ end type t -+ type test -+ type(t) x -+ integer :: ww(4) -+ end type test -+ type(test) :: i(2) -+ i(1)%x%n = 100 -+ do j = 1, 4 -+ i(1)%ww(j) = j -+ end do -+ i(2)%x%n = 200 -+ do j = 1, 4 -+ i(2)%ww(j) = j + 1 -+ end do -+end -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/003_c_call_fortran_nested_struct_complicated/fortran_func003.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/003_c_call_fortran_nested_struct_complicated/fortran_func003.f90 -new file mode 100644 -index 0000000..4b00f99 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/003_c_call_fortran_nested_struct_complicated/fortran_func003.f90 -@@ -0,0 +1,17 @@ -+subroutine f_func(i) -+ type t -+ integer n -+ end type t -+ type t2 -+ type(t) t2x -+ integer t2n -+ end type t2 -+ type test -+ type(t) x -+ type(t2) x2 -+ end type test -+ type(test) :: i -+ i%x%n = 100 -+ i%x2%t2n = 100 -+ i%x2%t2x%n = 100 -+end -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/003_c_call_fortran_nested_struct_complicated/fortran_func004.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/003_c_call_fortran_nested_struct_complicated/fortran_func004.f90 -new file mode 100644 -index 0000000..652f176 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/003_c_call_fortran_nested_struct_complicated/fortran_func004.f90 -@@ -0,0 +1,25 @@ -+subroutine f_func(i) -+ type t -+ integer n -+ end type t -+ type t1 -+ type(t) x1 -+ integer n1 -+ end type t1 -+ type t2 -+ type(t1) x2 -+ integer n2 -+ end type t2 -+ type t3 -+ type(t2) x3 -+ integer n3 -+ end type t3 -+ type test -+ type(t3) x -+ end type test -+ type(test) :: i -+ i%x%n3 = 100 -+ i%x%x3%n2 = 100 -+ i%x%x3%x2%n1 = 100 -+ i%x%x3%x2%x1%n = 100 -+end -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/003_c_call_fortran_nested_struct_complicated/fortran_func005.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/003_c_call_fortran_nested_struct_complicated/fortran_func005.f90 -new file mode 100644 -index 0000000..d4dc973 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/003_c_call_fortran_nested_struct_complicated/fortran_func005.f90 -@@ -0,0 +1,12 @@ -+subroutine f_func(i) -+ type t -+ integer n -+ end type t -+ type test -+ type(t) x(4) -+ end type test -+ type(test) :: i -+ do j = 1, 4 -+ i%x(j)%n = j -+ end do -+end -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/003_c_call_fortran_nested_struct_complicated/fortran_func006.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/003_c_call_fortran_nested_struct_complicated/fortran_func006.f90 -new file mode 100644 -index 0000000..95c3653 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/003_c_call_fortran_nested_struct_complicated/fortran_func006.f90 -@@ -0,0 +1,9 @@ -+function f_func(a) -+ type t -+ integer n -+ end type t -+ type(t) :: a -+ type(t) :: f_func -+ a%n = 1 -+ f_func%n = 2 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/003_c_call_fortran_nested_struct_complicated/result.md b/test/interoperability_with_c_c_call_fortran_global_and_struct/003_c_call_fortran_nested_struct_complicated/result.md -new file mode 100644 -index 0000000..d0a737b ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/003_c_call_fortran_nested_struct_complicated/result.md -@@ -0,0 +1,7 @@ -+ | test | gfortran | flang | -+ | 001 | PASS | PASS | -+ | 002 | PASS | PASS | -+ | 003 | PASS | PASS | -+ | 004 | PASS | PASS | -+ | 005 | PASS | PASS | -+ | 006 | PASS | ERROR | -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/003_c_call_fortran_nested_struct_complicated/run.sh b/test/interoperability_with_c_c_call_fortran_global_and_struct/003_c_call_fortran_nested_struct_complicated/run.sh -new file mode 100644 -index 0000000..cd0e873 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/003_c_call_fortran_nested_struct_complicated/run.sh -@@ -0,0 +1,16 @@ -+for i in {001..006} -+do -+echo "------- test $i ------." -+echo "----- gfortran result:" -+gcc c_main$i.c -c -o c-test.o -+gfortran fortran_func$i.f90 -fno-range-check -c -o fortran-test.o -+gfortran fortran-test.o c-test.o -+./a.out -+rm *.o a.out -+echo "----- flang-new result : " -+clang c_main$i.c -c -o c-test.o -+flang-new fortran_func$i.f90 -c -o fortran-test.o -+flang-new -flang-experimental-exec c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+done -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/c_main001.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/c_main001.c -new file mode 100644 -index 0000000..0c74416 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/c_main001.c -@@ -0,0 +1,13 @@ -+// test c call fortran for global about scalar -+// -+#include -+extern struct block { -+ int num; -+}b; -+extern struct block block_; -+extern void f_func_(); -+int main() { -+ block_.num = 1; -+ f_func_(); -+ printf("%d\n", block_.num); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/c_main002.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/c_main002.c -new file mode 100644 -index 0000000..a54e182 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/c_main002.c -@@ -0,0 +1,15 @@ -+// test c call fortran for global about array -+// -+#include -+extern struct block { -+ int num[4]; -+}b; -+extern struct block block_; -+extern void f_func_(); -+int main() { -+ for(int i = 0; i < 4; i++) -+ block_.num[i] = 0; -+ f_func_(); -+ for(int i = 0; i < 4; i++) -+ printf("%d\n", block_.num[i]); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/c_main003.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/c_main003.c -new file mode 100644 -index 0000000..685b825 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/c_main003.c -@@ -0,0 +1,17 @@ -+// test c call fortran for global about data alignment -+// -+#include -+#include -+extern struct block { -+ int16_t num1; -+ int8_t num; -+}b; -+extern struct block block_; -+extern void f_func_(); -+int main() { -+ block_.num = 1; -+ block_.num1 = 1; -+ f_func_(); -+ printf("%d\n", block_.num); -+ printf("%d\n", block_.num1); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/c_main004.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/c_main004.c -new file mode 100644 -index 0000000..c139851 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/c_main004.c -@@ -0,0 +1,20 @@ -+// test c call fortran for global about data alignment -+// -+#include -+#include -+extern struct block { -+ int32_t num2; -+ int16_t num1; -+ int8_t num; -+}b; -+extern struct block block_; -+extern void f_func_(); -+int main() { -+ block_.num2 = 1; -+ block_.num = 1; -+ block_.num1 = 1; -+ f_func_(); -+ printf("%d\n", block_.num); -+ printf("%d\n", block_.num1); -+ printf("%d\n", block_.num2); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/c_main005.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/c_main005.c -new file mode 100644 -index 0000000..ed63583 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/c_main005.c -@@ -0,0 +1,23 @@ -+// test c call fortran for global about data alignment -+// -+#include -+#include -+extern struct block { -+ int64_t num3; -+ int32_t num2; -+ int16_t num1; -+ int8_t num; -+}b; -+extern struct block block_; -+extern void f_func_(); -+int main() { -+ block_.num3 = 1; -+ block_.num2 = 1; -+ block_.num = 1; -+ block_.num1 = 1; -+ f_func_(); -+ printf("%d\n", block_.num); -+ printf("%d\n", block_.num1); -+ printf("%d\n", block_.num2); -+ printf("%ld\n", block_.num3); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/c_main006.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/c_main006.c -new file mode 100644 -index 0000000..d26ef44 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/c_main006.c -@@ -0,0 +1,26 @@ -+// test c call fortran for global about data alignment -+// -+#include -+#include -+extern struct block { -+ int64_t num4[2]; -+ int64_t num3; -+ int32_t num2; -+ int16_t num1; -+ int8_t num; -+}b; -+extern struct block block_; -+extern void f_func_(); -+int main() { -+ block_.num4[0] = 1; -+ block_.num3 = 1; -+ block_.num2 = 1; -+ block_.num = 1; -+ block_.num1 = 1; -+ f_func_(); -+ printf("%d\n", block_.num); -+ printf("%d\n", block_.num1); -+ printf("%d\n", block_.num2); -+ printf("%ld\n", block_.num3); -+ printf("%ld\n", block_.num4[0]); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/c_main007.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/c_main007.c -new file mode 100644 -index 0000000..d508f07 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/c_main007.c -@@ -0,0 +1,24 @@ -+// test c call fortran for global about data alignment -+// -+#include -+#include -+extern struct block { -+ int64_t num4[4]; -+ int64_t num3[2]; -+ int32_t num2[2]; -+ int16_t num1[2]; -+ int8_t num[3]; -+}b; -+extern struct block block_; -+extern void f_func_(); -+int main() { -+ f_func_(); -+ for(int i = 0; i < 2; i++) { -+ printf("%d\n", block_.num[i]); -+ printf("%d\n", block_.num1[i]); -+ printf("%d\n", block_.num2[i]); -+ printf("%ld\n", block_.num3[i]); -+ printf("%ld\n", block_.num4[2 * i]); -+ } -+ printf("%d\n", block_.num[2]); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/c_main008.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/c_main008.c -new file mode 100644 -index 0000000..4848bf1 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/c_main008.c -@@ -0,0 +1,16 @@ -+// test c call fortran for global about struct -+// -+#include -+#include -+struct test { -+ int x; -+}; -+extern struct block { -+ struct test a; -+}b; -+extern struct block block_; -+extern void f_func_(); -+int main() { -+ f_func_(); -+ printf("%d\n", block_.a.x); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/c_main009.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/c_main009.c -new file mode 100644 -index 0000000..e9e432d ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/c_main009.c -@@ -0,0 +1,18 @@ -+// test c call fortran for global about struct -+// -+#include -+#include -+struct test { -+ int16_t x2; -+ int8_t x; -+}; -+extern struct block { -+ struct test a; -+}b; -+extern struct block block_; -+extern void f_func_(); -+int main() { -+ f_func_(); -+ printf("%hhd\n", block_.a.x); -+ printf("%hd\n", block_.a.x2); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/c_main010.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/c_main010.c -new file mode 100644 -index 0000000..f31b9ba ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/c_main010.c -@@ -0,0 +1,20 @@ -+// test c call fortran for global about struct -+// -+#include -+#include -+struct test { -+ int32_t x3; -+ int16_t x2; -+ int8_t x; -+}; -+extern struct block { -+ struct test a; -+}b; -+extern struct block block_; -+extern void f_func_(); -+int main() { -+ f_func_(); -+ printf("%hhd\n", block_.a.x); -+ printf("%hd\n", block_.a.x2); -+ printf("%d\n", block_.a.x3); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/c_main011.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/c_main011.c -new file mode 100644 -index 0000000..c62df4a ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/c_main011.c -@@ -0,0 +1,22 @@ -+// test c call fortran for global about struct -+// -+#include -+#include -+struct test { -+ int64_t x4; -+ int32_t x3; -+ int16_t x2; -+ int8_t x; -+}; -+extern struct block { -+ struct test a; -+}b; -+extern struct block block_; -+extern void f_func_(); -+int main() { -+ f_func_(); -+ printf("%hhd\n", block_.a.x); -+ printf("%hd\n", block_.a.x2); -+ printf("%d\n", block_.a.x3); -+ printf("%ld\n", block_.a.x4); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/c_main012.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/c_main012.c -new file mode 100644 -index 0000000..48e44ca ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/c_main012.c -@@ -0,0 +1,24 @@ -+// test c call fortran for global about struct -+// -+#include -+#include -+struct test { -+ int64_t x5[2]; -+ int64_t x4; -+ int32_t x3; -+ int16_t x2; -+ int8_t x; -+}; -+extern struct block { -+ struct test a; -+}b; -+extern struct block block_; -+extern void f_func_(); -+int main() { -+ f_func_(); -+ printf("%hhd\n", block_.a.x); -+ printf("%hd\n", block_.a.x2); -+ printf("%d\n", block_.a.x3); -+ printf("%ld\n", block_.a.x4); -+ printf("%ld\n", block_.a.x5[0]); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/c_main013.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/c_main013.c -new file mode 100644 -index 0000000..410e0ef ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/c_main013.c -@@ -0,0 +1,27 @@ -+// test c call fortran for global about struct -+// -+#include -+#include -+struct test { -+ int64_t x5[4]; -+ int64_t x4[2]; -+ int32_t x3[2]; -+ int16_t x2[2]; -+ int8_t x[3]; -+}; -+extern struct block { -+ struct test a; -+}b; -+extern struct block block_; -+extern void f_func_(); -+int main() { -+ f_func_(); -+ for (int i = 0; i < 2; i++) { -+ printf("%hhd\n", block_.a.x[i]); -+ printf("%hd\n", block_.a.x2[i]); -+ printf("%d\n", block_.a.x3[i]); -+ printf("%ld\n", block_.a.x4[i]); -+ printf("%ld\n", block_.a.x5[2 * i]); -+ } -+ printf("%hhd\n", block_.a.x[2]); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/c_main014.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/c_main014.c -new file mode 100644 -index 0000000..be41930 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/c_main014.c -@@ -0,0 +1,27 @@ -+// test c call fortran for global about struct -+// -+#include -+#include -+struct test { -+ int64_t x5[2]; -+ int64_t x4; -+ int32_t x3; -+ int16_t x2; -+ int8_t x; -+}; -+extern struct block { -+ struct test a[5]; -+}b; -+extern struct block block_; -+extern void f_func_(); -+int main() { -+ f_func_(); -+ for(int i = 0; i < 5; i++) { -+ printf("%hhd\n", block_.a[i].x); -+ printf("%hd\n", block_.a[i].x2); -+ printf("%d\n", block_.a[i].x3); -+ printf("%ld\n", block_.a[i].x4); -+ printf("%ld\n", block_.a[i].x5[0]); -+ } -+ -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/c_main015.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/c_main015.c -new file mode 100644 -index 0000000..8a84f8d ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/c_main015.c -@@ -0,0 +1,31 @@ -+// test c call fortran for global about struct -+// -+#include -+#include -+struct test1 { -+ double d; -+ float f; -+}; -+struct test { -+ int64_t x5[2]; -+ struct test1 t; -+ int64_t x4; -+ int32_t x3; -+ int16_t x2; -+ int8_t x; -+}; -+extern struct block { -+ struct test a; -+}b; -+extern struct block block_; -+extern void f_func_(); -+int main() { -+ f_func_(); -+ printf("%hhd\n", block_.a.x); -+ printf("%hd\n", block_.a.x2); -+ printf("%d\n", block_.a.x3); -+ printf("%ld\n", block_.a.x4); -+ printf("%ld\n", block_.a.x5[0]); -+ printf("%lf\n", block_.a.t.d); -+ printf("%f\n", block_.a.t.f); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/c_main016.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/c_main016.c -new file mode 100644 -index 0000000..8e083ca ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/c_main016.c -@@ -0,0 +1,31 @@ -+// test c call fortran for global about structs -+// -+#include -+#include -+struct test1 { -+ double d; -+ float f; -+}; -+struct test { -+ int64_t x5[2]; -+ int64_t x4; -+ int32_t x3; -+ int16_t x2; -+ int8_t x; -+}; -+extern struct block { -+ struct test a; -+ struct test1 t; -+}b; -+extern struct block block_; -+extern void f_func_(); -+int main() { -+ f_func_(); -+ printf("%hhd\n", block_.a.x); -+ printf("%hd\n", block_.a.x2); -+ printf("%d\n", block_.a.x3); -+ printf("%ld\n", block_.a.x4); -+ printf("%ld\n", block_.a.x5[0]); -+ printf("%lf\n", block_.t.d); -+ printf("%f\n", block_.t.f); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/fortran_func001.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/fortran_func001.f90 -new file mode 100644 -index 0000000..b897dd1 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/fortran_func001.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func() -+ common /block/ num -+ integer :: num -+ num = 10 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/fortran_func002.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/fortran_func002.f90 -new file mode 100644 -index 0000000..9abf96c ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/fortran_func002.f90 -@@ -0,0 +1,7 @@ -+subroutine f_func() -+ common /block/ num -+ integer :: num(4) -+ do i = 1, 4 -+ num(i) = 10 + i -+ end do -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/fortran_func003.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/fortran_func003.f90 -new file mode 100644 -index 0000000..9c00b6c ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/fortran_func003.f90 -@@ -0,0 +1,7 @@ -+subroutine f_func() -+ common /block/ num1, num -+ integer(2) :: num1 -+ integer(1) :: num -+ num = 10 -+ num1 = 11 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/fortran_func004.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/fortran_func004.f90 -new file mode 100644 -index 0000000..4f38cd8 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/fortran_func004.f90 -@@ -0,0 +1,9 @@ -+subroutine f_func() -+ common /block/ num2, num1, num -+ integer(4) :: num2 -+ integer(2) :: num1 -+ integer(1) :: num -+ num2 = 12 -+ num1 = 11 -+ num = 10 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/fortran_func005.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/fortran_func005.f90 -new file mode 100644 -index 0000000..8b4a639 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/fortran_func005.f90 -@@ -0,0 +1,11 @@ -+subroutine f_func() -+ common /block/ num3, num2, num1, num -+ integer(8) :: num3 -+ integer(4) :: num2 -+ integer(2) :: num1 -+ integer(1) :: num -+ num3 = 13 -+ num2 = 12 -+ num1 = 11 -+ num = 10 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/fortran_func006.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/fortran_func006.f90 -new file mode 100644 -index 0000000..c5267ae ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/fortran_func006.f90 -@@ -0,0 +1,13 @@ -+subroutine f_func() -+ common /block/ num4, num3, num2, num1, num -+ integer(16) :: num4 -+ integer(8) :: num3 -+ integer(4) :: num2 -+ integer(2) :: num1 -+ integer(1) :: num -+ num4 = 14 -+ num3 = 13 -+ num2 = 12 -+ num1 = 11 -+ num = 10 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/fortran_func007.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/fortran_func007.f90 -new file mode 100644 -index 0000000..b2e42cf ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/fortran_func007.f90 -@@ -0,0 +1,16 @@ -+subroutine f_func() -+ common /block/ num4, num3, num2, num1, num -+ integer(16) :: num4(2) -+ integer(8) :: num3(2) -+ integer(4) :: num2(2) -+ integer(2) :: num1(2) -+ integer(1) :: num(3) -+ do i = 1, 2 -+ num4(i) = 14 -+ num3(i) = 13 -+ num2(i) = 12 -+ num1(i) = 11 -+ num(i) = 10 -+ end do -+ num(3) = 1 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/fortran_func008.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/fortran_func008.f90 -new file mode 100644 -index 0000000..024764d ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/fortran_func008.f90 -@@ -0,0 +1,8 @@ -+subroutine f_func() -+ common /block/ a -+ type, bind(c) :: t -+ integer :: x -+ end type -+ type(t) :: a -+ a%x = 1 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/fortran_func009.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/fortran_func009.f90 -new file mode 100644 -index 0000000..bc98173 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/fortran_func009.f90 -@@ -0,0 +1,10 @@ -+subroutine f_func() -+ common /block/ a -+ type, bind(c) :: t -+ integer(2) :: x2 -+ integer(1) :: x -+ end type -+ type(t) :: a -+ a%x = 1 -+ a%x2 = 2 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/fortran_func010.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/fortran_func010.f90 -new file mode 100644 -index 0000000..f7cfd98 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/fortran_func010.f90 -@@ -0,0 +1,12 @@ -+subroutine f_func() -+ common /block/ a -+ type, bind(c) :: t -+ integer(4) :: x3 -+ integer(2) :: x2 -+ integer(1) :: x -+ end type -+ type(t) :: a -+ a%x = 1 -+ a%x2 = 2 -+ a%x3 = 3 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/fortran_func011.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/fortran_func011.f90 -new file mode 100644 -index 0000000..56ba0bb ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/fortran_func011.f90 -@@ -0,0 +1,14 @@ -+subroutine f_func() -+ common /block/ a -+ type, bind(c) :: t -+ integer(8) :: x4 -+ integer(4) :: x3 -+ integer(2) :: x2 -+ integer(1) :: x -+ end type -+ type(t) :: a -+ a%x = 1 -+ a%x2 = 2 -+ a%x3 = 3 -+ a%x4 = 4 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/fortran_func012.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/fortran_func012.f90 -new file mode 100644 -index 0000000..e62d62b ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/fortran_func012.f90 -@@ -0,0 +1,16 @@ -+subroutine f_func() -+ common /block/ a -+ type, bind(c) :: t -+ integer(16) :: x5 -+ integer(8) :: x4 -+ integer(4) :: x3 -+ integer(2) :: x2 -+ integer(1) :: x -+ end type -+ type(t) :: a -+ a%x = 1 -+ a%x2 = 2 -+ a%x3 = 3 -+ a%x4 = 4 -+ a%x5 = 5 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/fortran_func013.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/fortran_func013.f90 -new file mode 100644 -index 0000000..9ec7f34 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/fortran_func013.f90 -@@ -0,0 +1,19 @@ -+subroutine f_func() -+ common /block/ a -+ type, bind(c) :: t -+ integer(16) :: x5(2) -+ integer(8) :: x4(2) -+ integer(4) :: x3(2) -+ integer(2) :: x2(2) -+ integer(1) :: x(3) -+ end type -+ type(t) :: a -+ do i = 1, 2 -+ a%x(i) = 1 -+ a%x2(i) = 2 -+ a%x3(i) = 3 -+ a%x4(i) = 4 -+ a%x5(i) = 5 -+ end do -+ a%x(3) = 1 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/fortran_func014.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/fortran_func014.f90 -new file mode 100644 -index 0000000..45f6fb8 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/fortran_func014.f90 -@@ -0,0 +1,18 @@ -+subroutine f_func() -+ common /block/ a -+ type, bind(c) :: t -+ integer(16) :: x5 -+ integer(8) :: x4 -+ integer(4) :: x3 -+ integer(2) :: x2 -+ integer(1) :: x -+ end type -+ type(t) :: a(5) -+ do i = 1, 5 -+ a(i)%x = 1 -+ a(i)%x2 = 2 -+ a(i)%x3 = 3 -+ a(i)%x4 = 4 -+ a(i)%x5 = 5 -+ end do -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/fortran_func015.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/fortran_func015.f90 -new file mode 100644 -index 0000000..2ef10c3 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/fortran_func015.f90 -@@ -0,0 +1,23 @@ -+subroutine f_func() -+ common /block/ a -+ type, bind(c) :: test1 -+ real(8) :: d -+ real(4) :: f -+ end type -+ type, bind(c) :: t -+ integer(16) :: x5 -+ type(test1) :: w -+ integer(8) :: x4 -+ integer(4) :: x3 -+ integer(2) :: x2 -+ integer(1) :: x -+ end type -+ type(t) :: a -+ a%x = 1 -+ a%x2 = 2 -+ a%x3 = 3 -+ a%x4 = 4 -+ a%x5 = 5 -+ a%w%d = 3.1415 -+ a%w%f = 3.14 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/fortran_func016.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/fortran_func016.f90 -new file mode 100644 -index 0000000..14b2fef ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/fortran_func016.f90 -@@ -0,0 +1,23 @@ -+subroutine f_func() -+ common /block/ a, b -+ type, bind(c) :: test1 -+ real(8) :: d -+ real(4) :: f -+ end type -+ type, bind(c) :: t -+ integer(16) :: x5 -+ integer(8) :: x4 -+ integer(4) :: x3 -+ integer(2) :: x2 -+ integer(1) :: x -+ end type -+ type(t) :: a -+ type(test1) :: b -+ a%x = 1 -+ a%x2 = 2 -+ a%x3 = 3 -+ a%x4 = 4 -+ a%x5 = 5 -+ b%d = 3.1415 -+ b%f = 3.14 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/result.md b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/result.md -new file mode 100644 -index 0000000..84a7b69 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/result.md -@@ -0,0 +1,17 @@ -+ | test | gfortran | flang | -+ | 001 | PASS | PASS | -+ | 002 | PASS | PASS | -+ | 003 | PASS | PASS | -+ | 004 | PASS | PASS | -+ | 005 | PASS | PASS | -+ | 006 | PASS | PASS | -+ | 007 | PASS | PASS | -+ | 008 | PASS | PASS | -+ | 009 | PASS | PASS | -+ | 010 | PASS | PASS | -+ | 011 | PASS | PASS | -+ | 012 | PASS | PASS | -+ | 013 | PASS | PASS | -+ | 014 | PASS | PASS | -+ | 015 | PASS | PASS | -+ | 016 | PASS | PASS | -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/run.sh b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/run.sh -new file mode 100644 -index 0000000..513cf9b ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/004_c_call_fortran_global/run.sh -@@ -0,0 +1,16 @@ -+for i in {001..016} -+do -+echo "------- test $i ------." -+echo "----- gfortran result:" -+gcc c_main$i.c -c -o c-test.o -+gfortran fortran_func$i.f90 -fno-range-check -c -o fortran-test.o -+gfortran fortran-test.o c-test.o -+./a.out -+rm *.o a.out -+echo "----- flang-new result : " -+clang c_main$i.c -c -o c-test.o -+flang-new fortran_func$i.f90 -c -o fortran-test.o -+flang-new -flang-experimental-exec c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+done -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/005_c_call_fortran_struct_value/c_main001.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/005_c_call_fortran_struct_value/c_main001.c -new file mode 100644 -index 0000000..5c0b74c ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/005_c_call_fortran_struct_value/c_main001.c -@@ -0,0 +1,13 @@ -+// Test c call fortran for the struct type with value attribute -+// -+#include -+struct t1 { -+ int t; -+}; -+extern void f_func_(struct t1); -+int main() { -+ struct t1 res; -+ res.t = 10; -+ f_func_(res); -+ printf("%hhd\n", res.t); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/005_c_call_fortran_struct_value/c_main002.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/005_c_call_fortran_struct_value/c_main002.c -new file mode 100644 -index 0000000..694736a ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/005_c_call_fortran_struct_value/c_main002.c -@@ -0,0 +1,17 @@ -+// Test c call fortran for the struct type with value attribute -+// -+#include -+#include -+struct t1 { -+ int16_t n2; -+ int8_t n; -+}; -+extern void f_func_(struct t1); -+int main() { -+ struct t1 res; -+ res.n = 10; -+ res.n2 = 11; -+ f_func_(res); -+ printf("%hhd\n", res.n); -+ printf("%hd\n", res.n2); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/005_c_call_fortran_struct_value/c_main003.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/005_c_call_fortran_struct_value/c_main003.c -new file mode 100644 -index 0000000..eb780e9 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/005_c_call_fortran_struct_value/c_main003.c -@@ -0,0 +1,20 @@ -+// Test c call fortran for the struct type with value attribute -+// -+#include -+#include -+struct t1 { -+ int32_t n3; -+ int16_t n2; -+ int8_t n; -+}; -+extern void f_func_(struct t1); -+int main() { -+ struct t1 res; -+ res.n = 10; -+ res.n2 = 11; -+ res.n3 = 12; -+ f_func_(res); -+ printf("%hhd\n", res.n); -+ printf("%hd\n", res.n2); -+ printf("%d\n", res.n3); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/005_c_call_fortran_struct_value/c_main004.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/005_c_call_fortran_struct_value/c_main004.c -new file mode 100644 -index 0000000..073fc39 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/005_c_call_fortran_struct_value/c_main004.c -@@ -0,0 +1,23 @@ -+// Test c call fortran for the struct type with value attribute -+// -+#include -+#include -+struct t1 { -+ int64_t n4; -+ int32_t n3; -+ int16_t n2; -+ int8_t n; -+}; -+extern void f_func_(struct t1); -+int main() { -+ struct t1 res; -+ res.n = 10; -+ res.n2 = 11; -+ res.n3 = 12; -+ res.n4 = 13; -+ f_func_(res); -+ printf("%hhd\n", res.n); -+ printf("%hd\n", res.n2); -+ printf("%d\n", res.n3); -+ printf("%ld\n", res.n4); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/005_c_call_fortran_struct_value/c_main005.c b/test/interoperability_with_c_c_call_fortran_global_and_struct/005_c_call_fortran_struct_value/c_main005.c -new file mode 100644 -index 0000000..069feb3 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/005_c_call_fortran_struct_value/c_main005.c -@@ -0,0 +1,27 @@ -+// Test c call fortran for the struct type with value attribute -+// -+#include -+#include -+struct t1 { -+ int64_t n4[5]; -+ int32_t n3[5]; -+ int16_t n2[5]; -+ int8_t n[5]; -+}; -+extern void f_func_(struct t1); -+int main() { -+ struct t1 res; -+ for(int i = 0; i < 5; i++) { -+ res.n[i] = 10; -+ res.n2[i] = 11; -+ res.n3[i] = 12; -+ res.n4[i] = 13; -+ } -+ f_func_(res); -+ for(int i = 0; i < 5; i++) { -+ printf("%hhd\n", res.n[i]); -+ printf("%hd\n", res.n2[i]); -+ printf("%d\n", res.n3[i]); -+ printf("%ld\n", res.n4[i]); -+ } -+} -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/005_c_call_fortran_struct_value/fortran_func001.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/005_c_call_fortran_struct_value/fortran_func001.f90 -new file mode 100644 -index 0000000..cf4f75c ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/005_c_call_fortran_struct_value/fortran_func001.f90 -@@ -0,0 +1,8 @@ -+subroutine f_func(b) -+ type t -+ integer :: a -+ end type -+ type(t), value :: b -+ b%a = b%a + 1 -+ print *, b%a -+end -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/005_c_call_fortran_struct_value/fortran_func002.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/005_c_call_fortran_struct_value/fortran_func002.f90 -new file mode 100644 -index 0000000..a2bd744 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/005_c_call_fortran_struct_value/fortran_func002.f90 -@@ -0,0 +1,11 @@ -+subroutine f_func(b) -+ type t -+ integer(2) :: a2 -+ integer(1) :: a -+ end type -+ type(t), value :: b -+ b%a = b%a + 1 -+ b%a2 = b%a2 + 1 -+ print *, b%a -+ print *, b%a2 -+end -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/005_c_call_fortran_struct_value/fortran_func003.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/005_c_call_fortran_struct_value/fortran_func003.f90 -new file mode 100644 -index 0000000..89835ff ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/005_c_call_fortran_struct_value/fortran_func003.f90 -@@ -0,0 +1,14 @@ -+subroutine f_func(b) -+ type t -+ integer(4) :: a3 -+ integer(2) :: a2 -+ integer(1) :: a -+ end type -+ type(t), value :: b -+ b%a = b%a + 1 -+ b%a2 = b%a2 + 1 -+ b%a3 = b%a3 + 1 -+ print *, b%a -+ print *, b%a2 -+ print *, b%a3 -+end -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/005_c_call_fortran_struct_value/fortran_func004.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/005_c_call_fortran_struct_value/fortran_func004.f90 -new file mode 100644 -index 0000000..6e9c218 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/005_c_call_fortran_struct_value/fortran_func004.f90 -@@ -0,0 +1,17 @@ -+subroutine f_func(b) -+ type t -+ integer(8) :: a4 -+ integer(4) :: a3 -+ integer(2) :: a2 -+ integer(1) :: a -+ end type -+ type(t), value :: b -+ b%a = b%a + 1 -+ b%a2 = b%a2 + 1 -+ b%a3 = b%a3 + 1 -+ b%a4 = b%a4 + 1 -+ print *, b%a -+ print *, b%a2 -+ print *, b%a3 -+ print *, b%a4 -+end -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/005_c_call_fortran_struct_value/fortran_func005.f90 b/test/interoperability_with_c_c_call_fortran_global_and_struct/005_c_call_fortran_struct_value/fortran_func005.f90 -new file mode 100644 -index 0000000..92b84ca ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/005_c_call_fortran_struct_value/fortran_func005.f90 -@@ -0,0 +1,21 @@ -+subroutine f_func(b) -+ type t -+ integer(8) :: a4(5) -+ integer(4) :: a3(5) -+ integer(2) :: a2(5) -+ integer(1) :: a(5) -+ end type -+ type(t), value :: b -+ do i = 1, 5 -+ b%a(i) = b%a(i) + 1 -+ b%a2(i) = b%a2(i) + 1 -+ b%a3(i) = b%a3(i) + 1 -+ b%a4(i) = b%a4(i) + 1 -+ end do -+ do i = 1, 5 -+ print *, b%a(i) -+ print *, b%a2(i) -+ print *, b%a3(i) -+ print *, b%a4(i) -+ end do -+end -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/005_c_call_fortran_struct_value/result.md b/test/interoperability_with_c_c_call_fortran_global_and_struct/005_c_call_fortran_struct_value/result.md -new file mode 100644 -index 0000000..a6a4576 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/005_c_call_fortran_struct_value/result.md -@@ -0,0 +1,6 @@ -+ | test | gfortran | flang | -+ | 001 | PASS | PASS | -+ | 002 | PASS | PASS | -+ | 003 | PASS | PASS | -+ | 004 | PASS | PASS | -+ | 005 | PASS | PASS | -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_global_and_struct/005_c_call_fortran_struct_value/run.sh b/test/interoperability_with_c_c_call_fortran_global_and_struct/005_c_call_fortran_struct_value/run.sh -new file mode 100644 -index 0000000..d45b793 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_global_and_struct/005_c_call_fortran_struct_value/run.sh -@@ -0,0 +1,16 @@ -+for i in {001..005} -+do -+echo "------- test $i ------." -+echo "----- gfortran result:" -+gcc c_main$i.c -c -o c-test.o -+gfortran fortran_func$i.f90 -fno-range-check -c -o fortran-test.o -+gfortran fortran-test.o c-test.o -+./a.out -+rm *.o a.out -+echo "----- flang-new result : " -+clang c_main$i.c -c -o c-test.o -+flang-new fortran_func$i.f90 -c -o fortran-test.o -+flang-new -flang-experimental-exec c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+done -\ No newline at end of file --- -2.25.1 - diff --git a/14-add-test-cases-for-attribute-declarations-and-specifications-2.patch b/14-add-test-cases-for-attribute-declarations-and-specifications-2.patch deleted file mode 100644 index 4985db6f9fe9a3255dd1a67a9e4c32a84d840078..0000000000000000000000000000000000000000 --- a/14-add-test-cases-for-attribute-declarations-and-specifications-2.patch +++ /dev/null @@ -1,382 +0,0 @@ -commit 72aa4f5e0daf7ab03cae7a81b9da84537d6fc346 -Author: wzw -Date: Tue Nov 29 16:23:41 2022 +0800 - - [flang] Add test cases for attribute declarations and specifications 2 - Add test cases for attribute declarations and specifications 2 - -diff --git a/test/Semantics/0839_C843.f90 b/test/Semantics/0839_C843.f90 -new file mode 100644 -index 0000000..9747dfc ---- /dev/null -+++ b/test/Semantics/0839_C843.f90 -@@ -0,0 +1,25 @@ -+! RUN: %python %S/test_errors.py %s %flang_fc1 -+! Test C843: An entity with the INTENT attribute shall be a dummy data object -+! or a dummy procedure pointer. -+ -+program main -+ integer :: x -+ ! ERROR: INTENT attributes may apply only to a dummy argument -+ integer, intent(in) :: a -+ call test(x) -+ x = test_func(x) -+end program main -+ -+subroutine test(a) -+ integer, intent(in) :: a -+ ! ERROR: INTENT attributes may apply only to a dummy argument -+ integer, intent(in) :: b -+end subroutine test -+ -+integer function test_func (a) -+ ! ICE -+ ! integer, intent(in) :: test_func -+ integer, intent(in) :: a -+ ! ERROR: INTENT attributes may apply only to a dummy argument -+ integer, intent(in) :: b -+end function test_func -diff --git a/test/Semantics/0840_C844.f90 b/test/Semantics/0840_C844.f90 -new file mode 100644 -index 0000000..d28e136 ---- /dev/null -+++ b/test/Semantics/0840_C844.f90 -@@ -0,0 +1,9 @@ -+! RUN: %python %S/test_errors.py %s %flang_fc1 -+! Test C844: (R826) A nonpointer object with the INTENT (IN) attribute shall -+! not appear in a variable definition context (19.6.7). -+ -+subroutine test(a) -+ integer, intent(in) :: a -+ ! ERROR: Left-hand side of assignment is not modifiable -+ a = 1 -+end subroutine test -diff --git a/test/Semantics/0841_C845.f90 b/test/Semantics/0841_C845.f90 -new file mode 100644 -index 0000000..811b182 ---- /dev/null -+++ b/test/Semantics/0841_C845.f90 -@@ -0,0 +1,10 @@ -+! RUN: %python %S/test_errors.py %s %flang_fc1 -+! Test C845: A pointer with the INTENT (IN) attribute shall not appear in a -+! pointer association context (19.6.8). -+ -+subroutine test(p, t) -+ integer, pointer, intent(in) :: p -+ integer, target :: t -+ ! Do not raised any error! -+ p => t -+end subroutine test -diff --git a/test/Semantics/0842_C846.f90 b/test/Semantics/0842_C846.f90 -new file mode 100644 -index 0000000..344a328 ---- /dev/null -+++ b/test/Semantics/0842_C846.f90 -@@ -0,0 +1,19 @@ -+! RUN: %python %S/test_errors.py %s %flang_fc1 -+! Test C846: An INTENT (OUT) dummy argument of a nonintrinsic procedure shall -+! not be an allocatable coarray or have a subobject that is an allocatable -+! coarray. -+ -+module types -+ type :: t -+ integer :: a -+ integer, codimension[:], allocatable :: t_coarray(:, :) -+ end type -+end module types -+ -+subroutine test(a, b) -+ use types -+ ! ERROR: An INTENT(OUT) dummy argument may not be, or contain, an ALLOCATABLE coarray -+ integer, codimension[:], allocatable, intent(out) :: a(:, :) -+ ! ERROR: An INTENT(OUT) dummy argument may not be, or contain, an ALLOCATABLE coarray -+ type(t), intent(out) :: b -+end subroutine test -diff --git a/test/Semantics/0843_C847.f90 b/test/Semantics/0843_C847.f90 -new file mode 100644 -index 0000000..9257fde ---- /dev/null -+++ b/test/Semantics/0843_C847.f90 -@@ -0,0 +1,12 @@ -+! RUN: %python %S/test_errors.py %s %flang_fc1 -+! Test C847: An entity with the INTENT (OUT) attribute shall not be of, or have -+! a subcomponent of, type EVENT_TYPE (16.10.2.10) or LOCK_TYPE (16.10.2.19) -+! from the intrinsic module ISO_FORTRAN_ENV. -+ -+subroutine test(a, b) -+ use, intrinsic :: iso_fortran_env, only : lock_type, event_type -+ ! ERROR: An INTENT(OUT) dummy argument may not be, or contain, EVENT_TYPE or LOCK_TYPE -+ type(lock_type), intent(out) :: a -+ ! ERROR: An INTENT(OUT) dummy argument may not be, or contain, EVENT_TYPE or LOCK_TYPE -+ type(event_type), intent(out) :: b -+end subroutine test -diff --git a/test/Semantics/0844_C849.f90 b/test/Semantics/0844_C849.f90 -new file mode 100644 -index 0000000..df2ca03 ---- /dev/null -+++ b/test/Semantics/0844_C849.f90 -@@ -0,0 +1,8 @@ -+! RUN: %python %S/test_errors.py %s %flang_fc1 -+! Test C849: An entity with the OPTIONAL attribute shall be a dummy argument. -+ -+subroutine test(a) -+ real, optional :: a -+ ! ERROR: OPTIONAL attribute may apply only to a dummy argument -+ real, optional :: b -+end subroutine -diff --git a/test/Semantics/0845_C850.f90 b/test/Semantics/0845_C850.f90 -new file mode 100644 -index 0000000..84b629f ---- /dev/null -+++ b/test/Semantics/0845_C850.f90 -@@ -0,0 +1,29 @@ -+! RUN: %python %S/test_errors.py %s %flang_fc1 -+! Test C850: An entity with the PARAMETER attribute shall not be a variable, a -+! coarray, or a procedure. -+ -+subroutine test(x, y) -+ intrinsic :: abs -+ integer :: x -+ integer, codimension[:], allocatable :: y(:, :) -+ integer :: a, b -+ integer, codimension[:], allocatable :: c -+ parameter (a = 1) -+ ! ERROR: Must be a constant value -+ parameter (b = x) -+ ! ERROR: Must be a constant value -+ parameter (c = y) -+ ! ERROR: Missing initialization for parameter 'd' -+ ! ERROR: Named constant 'd' array must have constant or implied shape -+ integer, codimension[:], allocatable, parameter :: d(:, :) -+end subroutine test -+ -+program main -+ ! ERROR: Must be a constant value -+ integer, parameter :: a = test_f() -+end program main -+ -+function test_f() -+ integer :: test_f -+ test_f = -1 -+end function test_f -diff --git a/test/Semantics/0846_C851.f90 b/test/Semantics/0846_C851.f90 -new file mode 100644 -index 0000000..90a360b ---- /dev/null -+++ b/test/Semantics/0846_C851.f90 -@@ -0,0 +1,17 @@ -+! RUN: %python %S/test_errors.py %s %flang_fc1 -+! Test C851: An expression that specifies a length type parameter or array -+! bound of a named constant shall be a constant expression. -+ -+subroutine test() -+ character(15) :: a = "aaaaa" -+ character, parameter :: b = "bbbbbbbbbbbbbbb" -+ ! ERROR: Must be a constant value -+ character(15), parameter :: c = a -+ character, parameter :: d = b -+ -+ integer :: e(5) = (/ 1, 2, 3, 4, 5 /) -+ integer, parameter :: f(5) = (/ 6, 7, 8, 9, 10 /) -+ ! ERROR: Must be a constant value -+ integer, parameter :: g(5) = e -+ integer, parameter :: h(5) = f -+end subroutine -diff --git a/test/Semantics/0847_C852.f90 b/test/Semantics/0847_C852.f90 -new file mode 100644 -index 0000000..54deb26 ---- /dev/null -+++ b/test/Semantics/0847_C852.f90 -@@ -0,0 +1,15 @@ -+! RUN: %python %S/test_errors.py %s %flang_fc1 -+! Test C852: An entity with the POINTER attribute shall not have the -+! ALLOCATABLE, INTRINSIC, or TARGET attribute, and shall not be a coarray. -+ -+subroutine test() -+ integer, pointer :: a -+ ! ERROR: 'b' may not have both the POINTER and ALLOCATABLE attributes -+ integer, pointer, allocatable :: b -+ ! ERROR: 'c' may not have both the POINTER and INTRINSIC attributes -+ integer, pointer, intrinsic :: c -+ ! ERROR: 'd' may not have both the POINTER and TARGET attributes -+ integer, pointer, target :: d -+ ! ERROR: 'e' may not have the POINTER attribute because it is a coarray -+ character(len = 20), pointer :: e[*] -+end subroutine test -diff --git a/test/Semantics/0848_C854.f90 b/test/Semantics/0848_C854.f90 -new file mode 100644 -index 0000000..b94c63c ---- /dev/null -+++ b/test/Semantics/0848_C854.f90 -@@ -0,0 +1,11 @@ -+! RUN: %python %S/test_errors.py %s %flang_fc1 -+! Test C854: The PROTECTED attribute shall be specified only in the -+! specification part of a module. -+ -+! ERROR: Could not parse 0848_C854.f90 -+subroutine test() -+ integer, protected :: a -+ integer :: b = 1 -+ b = b + 1 -+ protected :: b -+end subroutine test -diff --git a/test/Semantics/0849_C855.f90 b/test/Semantics/0849_C855.f90 -new file mode 100644 -index 0000000..6d1cccd ---- /dev/null -+++ b/test/Semantics/0849_C855.f90 -@@ -0,0 +1,12 @@ -+! RUN: %python %S/test_errors.py %s %flang_fc1 -+! Test C855: An entity with the PROTECTED attribute shall be a procedure pointer -+! or variable. -+ -+module m -+ integer, protected :: a -+ procedure(test), pointer, protected :: test_ptr -+ contains -+ subroutine test() -+ integer :: b -+ end subroutine test -+end module m -diff --git a/test/Semantics/0850_C856.f90 b/test/Semantics/0850_C856.f90 -new file mode 100644 -index 0000000..b7c3467 ---- /dev/null -+++ b/test/Semantics/0850_C856.f90 -@@ -0,0 +1,9 @@ -+! RUN: %python %S/test_errors.py %s %flang_fc1 -+! Test C856: An entity with the PROTECTED attribute shall not be in a common -+! block. -+ -+module m -+ integer, protected :: a -+ ! Do not raised any error! -+ common /b/ a -+end module m -diff --git a/test/Semantics/0851_C857.f90 b/test/Semantics/0851_C857.f90 -new file mode 100644 -index 0000000..b8edec2 ---- /dev/null -+++ b/test/Semantics/0851_C857.f90 -@@ -0,0 +1,23 @@ -+! RUN: %python %S/test_errors.py %s %flang_fc1 -+! Test C857: A nonpointer object that has the PROTECTED attribute and is -+! accessed by use association shall not appear in a variable definition context -+! (19.6.7) or as a data-target or initial-data-target. -+ -+module m -+ type :: t -+ integer :: a -+ end type t -+ -+ integer, protected :: b -+ type(t), protected, target :: x -+end module -+ -+program main -+ use m -+ ! Do not raised any error! -+ type(t), pointer :: y => x -+ ! ERROR: Must be a constant value -+ type(t), target :: z = x -+ ! ERROR: Left-hand side of assignment is not modifiable -+ b = 1 -+end program main -diff --git a/test/Semantics/0852_C858.f90 b/test/Semantics/0852_C858.f90 -new file mode 100644 -index 0000000..43f28b7 ---- /dev/null -+++ b/test/Semantics/0852_C858.f90 -@@ -0,0 +1,14 @@ -+! RUN: %python %S/test_errors.py %s %flang_fc1 -+! Test C858: A pointer that has the PROTECTED attribute and is accessed by use -+! association shall not appear in a pointer association context (19.6.8). -+ -+module m -+ integer, pointer, protected :: a -+end module m -+ -+program main -+ use m -+ integer, target :: x -+ ! Do not raised any error! -+ a => x -+end program main -diff --git a/test/Semantics/0853_C860.f90 b/test/Semantics/0853_C860.f90 -new file mode 100644 -index 0000000..16abd09 ---- /dev/null -+++ b/test/Semantics/0853_C860.f90 -@@ -0,0 +1,19 @@ -+! RUN: %python %S/test_errors.py %s %flang_fc1 -+! Test C860: The SAVE attribute shall not be specified for a dummy argument, a -+! function result, an automatic data object, or an object that is in a common -+! block. -+ -+subroutine test_s(a, n, m) -+ ! ERROR: SAVE attribute may not be applied to dummy argument 'a' -+ integer, save :: a -+ integer :: b -+ integer :: n, m -+ ! ERROR: SAVE attribute may not be applied to automatic data object 'temp' -+ real, dimension(n,m), save :: temp -+ common /c/ b -+end subroutine test_s -+ -+function test_f() -+ ! ERROR: SAVE attribute may not be applied to function result 'test_f' -+ integer, save :: test_f -+end function test_f -diff --git a/test/Semantics/0854_C861.f90 b/test/Semantics/0854_C861.f90 -new file mode 100644 -index 0000000..eff97ac ---- /dev/null -+++ b/test/Semantics/0854_C861.f90 -@@ -0,0 +1,8 @@ -+! RUN: %python %S/test_errors.py %s %flang_fc1 -+! Test C861: An entity with the TARGET attribute shall be a variable. -+ -+! ERROR: Could not parse 0854_C861.f90 -+subroutine test() -+ integer, target :: a -+ integer, target :: 1 -+end subroutine test -diff --git a/test/Semantics/0855_C862.f90 b/test/Semantics/0855_C862.f90 -new file mode 100644 -index 0000000..f353449 ---- /dev/null -+++ b/test/Semantics/0855_C862.f90 -@@ -0,0 +1,8 @@ -+! RUN: %python %S/test_errors.py %s %flang_fc1 -+! Test C862: An entity with the TARGET attribute shall not have the POINTER -+! attribute. -+ -+subroutine test() -+ ! ERROR: 'a' may not have both the POINTER and TARGET attributes -+ integer, target, pointer :: a -+end subroutine -diff --git a/test/Semantics/result-08.md b/test/Semantics/result-08.md -index be41906..33c5faf 100644 ---- a/test/Semantics/result-08.md -+++ b/test/Semantics/result-08.md -@@ -38,3 +38,20 @@ - | C840 | OK | ERROR | ERROR | - | C841 | ERROR | ERROR | ERROR | - | C842 | ERROR | ERROR | ERROR | -+| C843 | ERROR / ICE | ERROR | ERROR | -+| C844 | ERROR | ERROR | ERROR | -+| C845 | OK | ERROR | ERROR | -+| C846 | ERROR | ERROR | ERROR | -+| C847 | ERROR | ERROR | ERROR (LOCK_TYPE) / OK (EVENT_TYPE) | -+| C849 | ERROR | ERROR | ERROR | -+| C850 | ERROR | ERROR | ERROR | -+| C851 | ERROR | ERROR | ERROR | -+| C852 | ERROR | ERROR | ERROR | -+| C854 | ERROR | ERROR | ERROR | -+| C855 | --- | --- | --- | -+| C856 | OK | ERROR | ERROR | -+| C857 | ERROR (OK in some cases) | ERROR | ERROR | -+| C858 | OK | ERROR | OK | -+| C860 | ERROR | ERROR | ERROR | -+| C861 | ERROR | ERROR | ERROR | -+| C862 | ERROR | ERROR | ERROR | diff --git a/15-add-test-cases-for-types-2.patch b/15-add-test-cases-for-types-2.patch deleted file mode 100644 index b5cfc41b8f1649217e03a5f3a6019c6f77b477ba..0000000000000000000000000000000000000000 --- a/15-add-test-cases-for-types-2.patch +++ /dev/null @@ -1,478 +0,0 @@ -commit 116893b8bed7e1f61e5461f2cca34462054021b3 -Author: MinchaoLiang -Date: Wed Dec 7 23:04:03 2022 +0800 - - add test cases for types 2 - -diff --git a/test/Semantics/0741_C752_array.f90 b/test/Semantics/0741_C752_array.f90 -new file mode 100644 -index 0000000..935c633 ---- /dev/null -+++ b/test/Semantics/0741_C752_array.f90 -@@ -0,0 +1,14 @@ -+! RUN: %python %S/test_errors.py %s %flang_fc1 -+! Test C752:If the CONTIGUOUS attribute is specified, the component shall be an array with the POINTER attribute. -+ -+module types -+ type :: t -+ ! ERROR: CONTIGUOUS POINTER must be an array -+ ! ERROR: A CONTIGUOUS component must be an array with the POINTER attribute -+ real,contiguous,pointer :: S -+ end type -+end module types -+program main -+use types -+implicit none -+end -\ No newline at end of file -diff --git a/test/Semantics/0742_C752_contiguous.f90 b/test/Semantics/0742_C752_contiguous.f90 -new file mode 100644 -index 0000000..12d32d6 ---- /dev/null -+++ b/test/Semantics/0742_C752_contiguous.f90 -@@ -0,0 +1,13 @@ -+! RUN: %python %S/test_errors.py %s %flang_fc1 -+! Test C752:If the CONTIGUOUS attribute is specified, the component shall be an array with the POINTER attribute. -+ -+module types -+ type :: t -+ ! ERROR: A CONTIGUOUS component must be an array with the POINTER attribute -+ real,contiguous :: S(10) -+ end type -+end module types -+program main -+use types -+implicit none -+end -\ No newline at end of file -diff --git a/test/Semantics/0743_C753_real.f90 b/test/Semantics/0743_C753_real.f90 -new file mode 100644 -index 0000000..4820722 ---- /dev/null -+++ b/test/Semantics/0743_C753_real.f90 -@@ -0,0 +1,13 @@ -+! RUN: %python %S/test_errors.py %s %flang_fc1 -+! Test C753:The * char-length option is permitted only if the component is of type character. -+ -+module types -+ type :: t -+ ! ERROR: REAL*5 is not a supported type -+ real *5 :: C -+ end type -+end module types -+program main -+use types -+implicit none -+end -\ No newline at end of file -diff --git a/test/Semantics/0744_C753_logical.f90 b/test/Semantics/0744_C753_logical.f90 -new file mode 100644 -index 0000000..13e4ae4 ---- /dev/null -+++ b/test/Semantics/0744_C753_logical.f90 -@@ -0,0 +1,13 @@ -+! RUN: %python %S/test_errors.py %s %flang_fc1 -+! Test C753:The * char-length option is permitted only if the component is of type character. -+ -+module types -+ type :: t -+ ! ERROR: LOGICAL*5 is not a supported type -+ logical *5 :: C -+ end type -+end module types -+program main -+use types -+implicit none -+end -\ No newline at end of file -diff --git a/test/Semantics/0745_C754_functions.f90 b/test/Semantics/0745_C754_functions.f90 -new file mode 100644 -index 0000000..d71af36 ---- /dev/null -+++ b/test/Semantics/0745_C754_functions.f90 -@@ -0,0 +1,24 @@ -+! RUN: %python %S/test_errors.py %s %flang_fc1 -+! Test C754:Each type-param-value within a component-def-stmt shall be a colon or a specification expression -+! in which there are no references to specification functions or the intrinsic functions ALLOCATED, -+! ASSOCIATED, EXTENDS_TYPE_OF, PRESENT, or SAME_TYPE_AS, every specification inquiry -+! reference is a constant expression, and the value does not depend on the value of a variable. -+ -+module types -+ type t1 -+ real c -+ end type -+ type, extends(t1) :: t2 -+ end type -+ class(t1),pointer :: p,q -+ type :: t -+ ! ERROR: Polymorphic argument requires an explicit interface -+ ! ERROR: Polymorphic argument requires an explicit interface -+ ! ERROR: Invalid specification expression: reference to impure function 'c_sizeof' -+ character (int(c_sizeof(same_type_of(p,q)))) :: C -+ end type -+end module types -+program main -+use types -+implicit none -+end -\ No newline at end of file -diff --git a/test/Semantics/0746_C754_variable.f90 b/test/Semantics/0746_C754_variable.f90 -new file mode 100644 -index 0000000..fc6dd70 ---- /dev/null -+++ b/test/Semantics/0746_C754_variable.f90 -@@ -0,0 +1,17 @@ -+! RUN: %python %S/test_errors.py %s %flang_fc1 -+! Test C754:Each type-param-value within a component-def-stmt shall be a colon or a specification expression -+! in which there are no references to specification functions or the intrinsic functions ALLOCATED, -+! ASSOCIATED, EXTENDS_TYPE_OF, PRESENT, or SAME_TYPE_AS, every specification inquiry -+! reference is a constant expression, and the value does not depend on the value of a variable. -+ -+module types -+ integer :: a -+ type :: t -+ ! ERROR: not yet implemented: derived type specification expression 'int(a,kind=8)' that is neither constant nor a length type parameter -+ character *(a) :: C -+ end type -+end module types -+program main -+use types -+implicit none -+end -\ No newline at end of file -diff --git a/test/Semantics/0747_C755_public.f90 b/test/Semantics/0747_C755_public.f90 -new file mode 100644 -index 0000000..04a84d3 ---- /dev/null -+++ b/test/Semantics/0747_C755_public.f90 -@@ -0,0 +1,21 @@ -+! RUN: %python %S/test_errors.py %s %flang_fc1 -+! Test C755:The same proc-component-attr-spec shall not appear more -+! than once in a given proc-component-def-stmt -+ -+module m -+implicit none -+ type :: t -+ real:: x -+ contains -+ ! WARNING: Attribute 'PUBLIC' cannot be used more than once -+ procedure,public,public::add -+ end type -+ contains -+ type(t) function add(this) -+ class(t)::this -+ end function add -+end module m -+program main -+use m -+implicit none -+end -\ No newline at end of file -diff --git a/test/Semantics/0748_C755_private.f90 b/test/Semantics/0748_C755_private.f90 -new file mode 100644 -index 0000000..8a603aa ---- /dev/null -+++ b/test/Semantics/0748_C755_private.f90 -@@ -0,0 +1,21 @@ -+! RUN: %python %S/test_errors.py %s %flang_fc1 -+! Test C755:The same proc-component-attr-spec shall not appear more -+! than once in a given proc-component-def-stmt -+ -+module m -+implicit none -+ type :: t -+ real:: x -+ contains -+ ! WARNING: Attribute 'PRIVATE' cannot be used more than once -+ procedure,private,private::add -+ end type -+ contains -+ type(t) function add(this) -+ class(t)::this -+ end function add -+end module m -+program main -+use m -+implicit none -+end -\ No newline at end of file -diff --git a/test/Semantics/0749_C755_nopass.f90 b/test/Semantics/0749_C755_nopass.f90 -new file mode 100644 -index 0000000..85fe83d ---- /dev/null -+++ b/test/Semantics/0749_C755_nopass.f90 -@@ -0,0 +1,21 @@ -+! RUN: %python %S/test_errors.py %s %flang_fc1 -+! Test C755:The same proc-component-attr-spec shall not appear more -+! than once in a given proc-component-def-stmt -+ -+module m -+implicit none -+ type :: t -+ real :: x -+ contains -+ ! WARNING: Attribute 'NOPASS' cannot be used more than once -+ procedure,nopass,nopass :: add -+ end type -+ contains -+ type(t) function add(this) -+ class(t) :: this -+ end function add -+end module m -+program main -+use m -+implicit none -+end -\ No newline at end of file -diff --git a/test/Semantics/0750_C755_pointer.f90 b/test/Semantics/0750_C755_pointer.f90 -new file mode 100644 -index 0000000..091ab0d ---- /dev/null -+++ b/test/Semantics/0750_C755_pointer.f90 -@@ -0,0 +1,20 @@ -+! RUN: %python %S/test_errors.py %s %flang_fc1 -+! Test C755:The same proc-component-attr-spec shall not appear more -+! than once in a given proc-component-def-stmt -+ -+module m -+implicit none -+ type t -+ ! WARNING: Attribute 'POINTER' cannot be used more than once -+ procedure(interface1),pointer,pointer,nopass::p -+ end type t -+ abstract interface -+ integer function interface1(a) -+ real,intent(in)::a -+ end function interface1 -+ end interface -+end module m -+program main -+use m -+implicit none -+end -\ No newline at end of file -diff --git a/test/Semantics/0751_C756.f90 b/test/Semantics/0751_C756.f90 -new file mode 100644 -index 0000000..1dd5eab ---- /dev/null -+++ b/test/Semantics/0751_C756.f90 -@@ -0,0 +1,19 @@ -+! RUN: %python %S/test_errors.py %s %flang_fc1 -+! Test C756:POINTER shall appear in each proc-component-attr-spec-list. -+ -+module m -+implicit none -+ type t -+ ! ERROR: Procedure component 'p' must have POINTER attribute -+ procedure(interface1),nopass :: p -+ end type t -+ abstract interface -+ integer function interface1(a) -+ real,intent(in)::a -+ end function interface1 -+ end interface -+end module m -+program main -+use m -+implicit none -+end -\ No newline at end of file -diff --git a/test/Semantics/0752_C757.f90 b/test/Semantics/0752_C757.f90 -new file mode 100644 -index 0000000..3173929 ---- /dev/null -+++ b/test/Semantics/0752_C757.f90 -@@ -0,0 +1,19 @@ -+! RUN: %python %S/test_errors.py %s %flang_fc1 -+! Test C757:If the procedure pointer component has an implicit interface or -+! has no arguments, NOPASS shall be specified. -+ -+module m -+implicit none -+ type t -+ ! ERROR: Procedure component 'p' with no dummy arguments must have NOPASS attribute -+ procedure(interface1),pointer :: p -+ end type t -+ abstract interface -+ integer function interface1() -+ end function interface1 -+ end interface -+end module m -+program main -+use m -+implicit none -+end -\ No newline at end of file -diff --git a/test/Semantics/0753_C758.f90 b/test/Semantics/0753_C758.f90 -new file mode 100644 -index 0000000..73d7b9d ---- /dev/null -+++ b/test/Semantics/0753_C758.f90 -@@ -0,0 +1,20 @@ -+! RUN: %python %S/test_errors.py %s %flang_fc1 -+! Test C758: If PASS (arg-name) appears, the interface of the procedure -+! pointer component shall have a dummy argument named arg-name. -+ -+module m -+implicit none -+ type t -+ ! ERROR: 'b' is not a dummy argument of procedure interface 'interface1' -+ procedure(interface1),pointer,pass(b)::p -+ end type t -+ abstract interface -+ integer function interface1(a) -+ real,intent(in)::a -+ end function interface1 -+ end interface -+end module m -+program main -+use m -+implicit none -+end -\ No newline at end of file -diff --git a/test/Semantics/0754_C759.f90 b/test/Semantics/0754_C759.f90 -new file mode 100644 -index 0000000..0da43df ---- /dev/null -+++ b/test/Semantics/0754_C759.f90 -@@ -0,0 +1,18 @@ -+! RUN: %python %S/test_errors.py %s %flang_fc1 -+! Test C759: PASS and NOPASS shall not both appear in the same proc-component-attr-spec-list. -+ -+module m -+implicit none -+ type t -+ ! ERROR: Attributes 'PASS' and 'NOPASS' conflict with each other -+ procedure(interface1),pointer,nopass,pass :: p -+ end type t -+ abstract interface -+ integer function interface1() -+ end function interface1 -+ end interface -+end module m -+program main -+use m -+implicit none -+end -\ No newline at end of file -diff --git a/test/Semantics/0755_C761.f90 b/test/Semantics/0755_C761.f90 -new file mode 100644 -index 0000000..1f7bee1 ---- /dev/null -+++ b/test/Semantics/0755_C761.f90 -@@ -0,0 +1,19 @@ -+! RUN: %python %S/test_errors.py %s %flang_fc1 -+! Test C761: If component-initialization appears, a double-colon separator shall -+! appear before the component-decl-list -+ -+module m -+implicit none -+ type t -+ ! ERROR: expected PROCEDURE declarations -+ procedure(interface1),pointer,nopass p => null() -+ end type t -+ abstract interface -+ integer function interface1() -+ end function interface1 -+ end interface -+end module m -+program main -+use m -+implicit none -+end -\ No newline at end of file -diff --git a/test/Semantics/0756_C763_pointer.f90 b/test/Semantics/0756_C763_pointer.f90 -new file mode 100644 -index 0000000..1a1c373 ---- /dev/null -+++ b/test/Semantics/0756_C763_pointer.f90 -@@ -0,0 +1,16 @@ -+! RUN: %python %S/test_errors.py %s %flang_fc1 -+! Test C763:If => appears in component-initialization, POINTER shall appear in the -+! component-attr-spec-list. If = appears in component-initialization, neither -+! POINTER nor ALLOCATABLE shall appear in the component-attr-spec-list. -+ -+module m -+implicit none -+ type t -+ ! ERROR: 'k' is not a pointer but is initialized like one -+ integer :: k => null -+ end type t -+end module m -+program main -+use m -+implicit none -+end -\ No newline at end of file -diff --git a/test/Semantics/0757_C763_equal.f90 b/test/Semantics/0757_C763_equal.f90 -new file mode 100644 -index 0000000..b3c24ed ---- /dev/null -+++ b/test/Semantics/0757_C763_equal.f90 -@@ -0,0 +1,16 @@ -+! RUN: %python %S/test_errors.py %s %flang_fc1 -+! Test C763:If => appears in component-initialization, POINTER shall appear in the -+! component-attr-spec-list. If = appears in component-initialization, neither -+! POINTER nor ALLOCATABLE shall appear in the component-attr-spec-list. -+ -+module m -+implicit none -+ type t -+ ! ERROR: 'k' is a pointer but is not initialized like one -+ integer, pointer :: k = 5 -+ end type t -+end module m -+program main -+use m -+implicit none -+end -\ No newline at end of file -diff --git a/test/Semantics/0758_C763_allocatable.f90 b/test/Semantics/0758_C763_allocatable.f90 -new file mode 100644 -index 0000000..1702a77 ---- /dev/null -+++ b/test/Semantics/0758_C763_allocatable.f90 -@@ -0,0 +1,16 @@ -+! RUN: %python %S/test_errors.py %s %flang_fc1 -+! Test C763:If => appears in component-initialization, POINTER shall appear in the -+! component-attr-spec-list. If = appears in component-initialization, neither -+! POINTER nor ALLOCATABLE shall appear in the component-attr-spec-list. -+ -+module m -+implicit none -+ type t -+ ! ERROR: Allocatable object 'k' cannot be initialized -+ integer, allocatable :: k = 5 -+ end type t -+end module m -+program main -+use m -+implicit none -+end -\ No newline at end of file -diff --git a/test/Semantics/result-15.md b/test/Semantics/result-15.md -new file mode 100644 -index 0000000..6131933 ---- /dev/null -+++ b/test/Semantics/result-15.md -@@ -0,0 +1,20 @@ -+| Constraint | flang-new | gfortran | ifort | -+| :--------------: | :-------: | :------: | :---: | -+| C752 array | ERROR | ERROR | ERROR | -+| C752 contiguous | ERROR | ERROR | ERROR | -+| C753 real | ERROR | ERROR | ERROR | -+| C753 logical | ERROR | ERROR | ERROR | -+| C754 functions | ERROR | ERROR | ERROR | -+| C754 variable | ERROR | ERROR | ERROR | -+| C755 public | WARNING | ERROR | ERROR | -+| C755 private | WARNING | ERROR | ERROR | -+| C755 nopass | WARNING | ERROR | ERROR | -+| C755 pointer | WARNING | ERROR | ERROR | -+| C756 | ERROR | ERROR | ERROR | -+| C757 | ERROR | ERROR | ERROR | -+| C758 | ERROR | ERROR | ERROR | -+| C759 | ERROR | ERROR | ERROR | -+| C761 | ERROR | ERROR | ERROR | -+| C763 pointer | ERROR | ERROR | ERROR | -+| C763 equal | ERROR | ERROR | ERROR | -+| C763 allocatable | ERROR | ERROR | ERROR | diff --git a/16-add-c-and-cxx-memory-align-investigation.patch b/16-add-c-and-cxx-memory-align-investigation.patch deleted file mode 100644 index 8d759814ba18f152da043443e58ffeba264761dc..0000000000000000000000000000000000000000 --- a/16-add-c-and-cxx-memory-align-investigation.patch +++ /dev/null @@ -1,1200 +0,0 @@ -From b3b3bc0a58cc7146aff1087dff5ab4da52a9dae1 Mon Sep 17 00:00:00 2001 -From: huwei3 -Date: Tue, 13 Dec 2022 20:37:18 +0800 -Subject: [PATCH] add-c-and-cxx-memory-align-investigation - - -diff --git a/test/c_cxx_align_examples/c-and-cxx-align1.c b/test/c_cxx_align_examples/c-and-cxx-align1.c -new file mode 100644 -index 0000000..f257e55 ---- /dev/null -+++ b/test/c_cxx_align_examples/c-and-cxx-align1.c -@@ -0,0 +1,27 @@ -+#include -+#include -+int main() -+{ -+ char a; -+ short b; -+ int c; -+ long d; -+ long long e; -+ float f; -+ double g; -+ long double h; -+ int * ptr_one; -+ void * ptr_two; -+ -+ printf("%d\n", _Alignof(a) ); -+ printf("%d\n", _Alignof(b) ); -+ printf("%d\n", _Alignof(c) ); -+ printf("%d\n", _Alignof(d) ); -+ printf("%d\n", _Alignof(e) ); -+ printf("%d\n", _Alignof(f) ); -+ printf("%d\n", _Alignof(g) ); -+ printf("%d\n", _Alignof(h) ); -+ printf("%d\n", _Alignof( ptr_one ) ); -+ printf("%d\n", _Alignof( ptr_two ) ); -+ return 0; -+} -diff --git a/test/c_cxx_align_examples/c-and-cxx-align10.cpp b/test/c_cxx_align_examples/c-and-cxx-align10.cpp -new file mode 100644 -index 0000000..2a3babf ---- /dev/null -+++ b/test/c_cxx_align_examples/c-and-cxx-align10.cpp -@@ -0,0 +1,15 @@ -+#include -+#include -+using namespace std; -+ -+struct S -+{ -+ short f[3]; -+}; -+ -+int main() -+{ -+ cout<< "sizeof(S)=" << sizeof( S ) < -+#include -+using namespace std; -+ -+#pragma pack(push,1) //后边可以改为1,2,4,8 -+struct node -+{ -+ char m1; -+ long m2; -+}; -+#pragma pack(pop) -+ -+ -+int main() -+{ -+ char a; -+ short b; -+ int c; -+ double d[2]; -+ struct node s; -+ printf("a address=%p\n", &a ); -+ printf("b address=%p\n", &b ); -+ printf("c address=%p\n", &c ); -+ printf("d[0] address=%p\n", &( d[0] ) ); -+ printf("d[1] address=%p\n", &( d[1] ) ); -+ printf("s address=%p\n", &s ); -+ printf("s.m2 address=%p\n", &(s.m2) ); -+ -+ -+ return 0; -+} -+ -diff --git a/test/c_cxx_align_examples/c-and-cxx-align19.c b/test/c_cxx_align_examples/c-and-cxx-align19.c -new file mode 100644 -index 0000000..2e40d9f ---- /dev/null -+++ b/test/c_cxx_align_examples/c-and-cxx-align19.c -@@ -0,0 +1,18 @@ -+#include -+#include -+int main() -+{ -+ int a; -+ long c; -+ -+ printf("_Alignof(char)=%d\n", _Alignof(char) ); -+ printf("_Alignof(short)=%d\n", _Alignof(short) ); -+ printf("_Alignof(int)=%d\n", _Alignof(int) ); -+ printf("_Alignof(long)=%d\n", _Alignof(long) ); -+ printf("_Alignof(long)=%d\n", _Alignof(long long) ); -+ printf("_Alignof(float)=%d\n", _Alignof(float) ); -+ printf("_Alignof(double)=%d\n", _Alignof(double) ); -+ printf("_Alignof(long double)=%d\n", _Alignof(long double) ); -+ return 0; -+} -+ -diff --git a/test/c_cxx_align_examples/c-and-cxx-align2.cpp b/test/c_cxx_align_examples/c-and-cxx-align2.cpp -new file mode 100644 -index 0000000..a2dae4c ---- /dev/null -+++ b/test/c_cxx_align_examples/c-and-cxx-align2.cpp -@@ -0,0 +1,33 @@ -+#include -+#include -+using namespace std; -+ -+int main() -+{ -+ bool test; -+ char a; -+ short b; -+ int c; -+ long d; -+ long long e; -+ float f; -+ double g; -+ long double h; -+ int * ptr_one; -+ void * ptr_two; -+ -+ printf("%d\n", alignof(test) ); -+ printf("%d\n", alignof(a) ); -+ printf("%d\n", alignof(b) ); -+ printf("%d\n", alignof(c) ); -+ printf("%d\n", alignof(d) ); -+ printf("%d\n", alignof(e) ); -+ printf("%d\n", alignof(f) ); -+ printf("%d\n", alignof(g) ); -+ printf("%d\n", alignof(h) ); -+ printf("%d\n", alignof( ptr_one ) ); -+ printf("%d\n", alignof( ptr_two ) ); -+ printf("%d\n", alignof( int ) ); -+ return 0; -+} -+ -diff --git a/test/c_cxx_align_examples/c-and-cxx-align20.c b/test/c_cxx_align_examples/c-and-cxx-align20.c -new file mode 100644 -index 0000000..cb77bf3 ---- /dev/null -+++ b/test/c_cxx_align_examples/c-and-cxx-align20.c -@@ -0,0 +1,17 @@ -+#include -+#include -+int main() -+{ -+ int a; -+ long c; -+ -+ printf("__alignof__(char)=%d\n", __alignof__(char) ); -+ printf("__alignof__(short)=%d\n", __alignof__(short) ); -+ printf("__alignof__(int)=%d\n", __alignof__(int) ); -+ printf("__alignof__(long)=%d\n", __alignof__(long) ); -+ printf("__alignof__(long)=%d\n", __alignof__(long long) ); -+ printf("__alignof__(float)=%d\n", __alignof__(float) ); -+ printf("__alignof__(double)=%d\n", __alignof__(double) ); -+ printf("__alignof__(long double)=%d\n", __alignof__(long double) ); -+ return 0; -+} -diff --git a/test/c_cxx_align_examples/c-and-cxx-align21.c b/test/c_cxx_align_examples/c-and-cxx-align21.c -new file mode 100644 -index 0000000..08a3394 ---- /dev/null -+++ b/test/c_cxx_align_examples/c-and-cxx-align21.c -@@ -0,0 +1,11 @@ -+#include -+ -+int main() -+{ -+ int a; -+ printf( "_Alignof(a)=%d\n" ,_Alignof(a) ); -+ _Alignas(8) int b; -+ printf( "_Alignof(b)=%d\n" ,_Alignof(b) ); -+ return 0; -+} -+ -diff --git a/test/c_cxx_align_examples/c-and-cxx-align22.c b/test/c_cxx_align_examples/c-and-cxx-align22.c -new file mode 100644 -index 0000000..225aec1 ---- /dev/null -+++ b/test/c_cxx_align_examples/c-and-cxx-align22.c -@@ -0,0 +1,17 @@ -+#include -+#include -+int main() -+{ -+ int a; -+ long c; -+ -+ printf("alignof(char)=%d\n", alignof(char) ); -+ printf("alignof(short)=%d\n", alignof(short) ); -+ printf("alignof(int)=%d\n", alignof(int) ); -+ printf("alignof(long)=%d\n", alignof(long) ); -+ printf("alignof(long)=%d\n", alignof(long long) ); -+ printf("alignof(float)=%d\n", alignof(float) ); -+ printf("alignof(double)=%d\n", alignof(double) ); -+ printf("alignof(long double)=%d\n", alignof(long double) ); -+ return 0; -+} -diff --git a/test/c_cxx_align_examples/c-and-cxx-align23.cpp b/test/c_cxx_align_examples/c-and-cxx-align23.cpp -new file mode 100644 -index 0000000..81dbcee ---- /dev/null -+++ b/test/c_cxx_align_examples/c-and-cxx-align23.cpp -@@ -0,0 +1,26 @@ -+#include -+ -+struct Foo -+{ -+ int i; -+ float f; -+ char c; -+}; -+struct alignas(alignof(long double)) Foo2 -+{ -+}; -+struct Empty {}; -+struct alignas(64) Empty64 {}; -+ -+int main() -+{ -+ std::cout << "Alignment of" "\n" -+ "- char : " << alignof(char) << "\n" -+ "- pointer : " << alignof(int*) << "\n" -+ "- class Foo : " << alignof(Foo) << "\n" -+ "- class Foo2 : " << alignof(Foo2) << "\n" -+ "- empty class : " << alignof(Empty) << "\n" -+ "- empty class\n" -+ " with alignas(64): " << alignof(Empty64) << "\n"; -+} -+//https://en.cppreference.com/w/cpp/language/alignof -diff --git a/test/c_cxx_align_examples/c-and-cxx-align24.cpp b/test/c_cxx_align_examples/c-and-cxx-align24.cpp -new file mode 100644 -index 0000000..6dc2591 ---- /dev/null -+++ b/test/c_cxx_align_examples/c-and-cxx-align24.cpp -@@ -0,0 +1,14 @@ -+#include -+ -+struct Empty {}; -+ -+struct alignas(64) Empty64 {}; -+ -+int main() -+{ -+ std::cout << "Alignment of" "\n" -+ "- empty class : " << alignof(Empty) << "\n" -+ "- empty class\n" -+ " with alignas(64): " << alignof(Empty64) << "\n"; -+} -+//https://en.cppreference.com/w/cpp/language/alignof -diff --git a/test/c_cxx_align_examples/c-and-cxx-align25.cpp b/test/c_cxx_align_examples/c-and-cxx-align25.cpp -new file mode 100644 -index 0000000..b941aa9 ---- /dev/null -+++ b/test/c_cxx_align_examples/c-and-cxx-align25.cpp -@@ -0,0 +1,50 @@ -+#include -+#include -+ -+template -+struct MyAllocator -+{ -+ char data[N]; -+ void* p; -+ std::size_t sz; -+ MyAllocator() : p(data), sz(N) {} -+ template -+ T* aligned_alloc(std::size_t a = alignof(T)) -+ { -+ if (std::align(a, sizeof(T), p, sz)) -+ { -+ T* result = reinterpret_cast(p); -+ p = (char*)p + sizeof(T); -+ sz -= sizeof(T); -+ return result; -+ } -+ return nullptr; -+ } -+}; -+ -+int main() -+{ -+ MyAllocator<64> a; -+ std::cout << "allocated a.data at " << (void*)a.data -+ << " (" << sizeof a.data << " bytes)\n"; -+ -+ // allocate a char -+ if (char* p = a.aligned_alloc()) { -+ *p = 'a'; -+ std::cout << "allocated a char at " << (void*)p << '\n'; -+ } -+ -+ // allocate an int -+ if (int* p = a.aligned_alloc()) { -+ *p = 1; -+ std::cout << "allocated an int at " << (void*)p << '\n'; -+ } -+ -+ // allocate an int, aligned at 32-byte boundary -+ if (int* p = a.aligned_alloc(32)) { -+ *p = 2; -+ std::cout << "allocated an int at " << (void*)p << " (32 byte alignment)\n"; -+ } -+} -+ -+//https://en.cppreference.com/w/cpp/memory/align -diff --git a/test/c_cxx_align_examples/c-and-cxx-align26.cpp b/test/c_cxx_align_examples/c-and-cxx-align26.cpp -new file mode 100644 -index 0000000..d63d88e ---- /dev/null -+++ b/test/c_cxx_align_examples/c-and-cxx-align26.cpp -@@ -0,0 +1,16 @@ -+#include -+using namespace std; -+ -+typedef struct test_32 -+{ -+ char a; -+ char b; -+ double c; -+}test_32; -+ -+int main() -+{ -+ -+ cout< -+using namespace std; -+ -+#pragma pack(4) -+ -+typedef struct test_32 -+{ -+ char a; -+ char b; -+ double c; -+}test_32; -+ -+int main() -+{ -+ -+ cout<< sizeof(test_32)< -+using namespace std; -+ -+#pragma pack(16) -+ -+typedef struct test_32 -+{ -+ char a; -+ char b; -+ double c; -+}test_32; -+ -+int main() -+{ -+ -+ cout< -+using namespace std; -+ -+struct first -+{ -+ short f[3]; -+}; -+ -+struct __attribute__ ((aligned (8))) second -+{ -+ short f[3]; -+}; -+ -+int main() -+{ -+ cout<< sizeof( first ) < -+#include -+using namespace std; -+ -+int main() -+{ -+ const bool test=false; -+ const char a=1; -+ const short b=1; -+ const int c=2; -+ const long d=3; -+ const long long e=3; -+ const float f=2.3; -+ const double g=1.2; -+ const long double h=2.2; -+ const int * ptr_one=&c; -+ const void * ptr_two=&b; -+ -+ printf("%d\n", alignof(test) ); -+ printf("%d\n", alignof(a) ); -+ printf("%d\n", alignof(b) ); -+ printf("%d\n", alignof(c) ); -+ printf("%d\n", alignof(d) ); -+ printf("%d\n", alignof(e) ); -+ printf("%d\n", alignof(f) ); -+ printf("%d\n", alignof(g) ); -+ printf("%d\n", alignof(h) ); -+ printf("%d\n", alignof( ptr_one ) ); -+ printf("%d\n", alignof( ptr_two ) ); -+ printf("%d\n", alignof( int ) ); -+ return 0; -+} -+ -diff --git a/test/c_cxx_align_examples/c-and-cxx-align30.cpp b/test/c_cxx_align_examples/c-and-cxx-align30.cpp -new file mode 100644 -index 0000000..08e8c82 ---- /dev/null -+++ b/test/c_cxx_align_examples/c-and-cxx-align30.cpp -@@ -0,0 +1,13 @@ -+#include -+using namespace std; -+ -+int main() -+{ -+ char a; -+ char b __attribute__((aligned(8))); -+ cout << sizeof(a) < -+ -+void test() -+{ -+ printf("test"); -+} -+void __attribute__ ((aligned (8)))one() -+{ -+ printf("one"); -+} -+int main() -+{ -+ printf("__alignof__(test)=%d\n", __alignof__(test) ); -+ printf("__alignof__(one)=%d\n", __alignof__(one) ); -+ return 0; -+} -diff --git a/test/c_cxx_align_examples/c-and-cxx-align32.cpp b/test/c_cxx_align_examples/c-and-cxx-align32.cpp -new file mode 100644 -index 0000000..401ce2f ---- /dev/null -+++ b/test/c_cxx_align_examples/c-and-cxx-align32.cpp -@@ -0,0 +1,14 @@ -+#include -+using namespace std; -+ -+int main() -+{ -+ __attribute__((aligned(1))) -+ int a; -+ cout << alignof(a) < -+void test() -+{ -+ printf("test"); -+} -+void one() -+{ -+ printf("one"); -+} -+int main() -+{ -+ printf("__alignof__(test)=%d\n", __alignof__(test) ); -+ printf("address=%p\n", &test); -+ printf("__alignof__(one)=%d\n", __alignof__(one) ); -+ printf("address=%p\n", &one); -+ return 0; -+} -+ -diff --git a/test/c_cxx_align_examples/c-and-cxx-align34.cpp b/test/c_cxx_align_examples/c-and-cxx-align34.cpp -new file mode 100644 -index 0000000..0ec684d ---- /dev/null -+++ b/test/c_cxx_align_examples/c-and-cxx-align34.cpp -@@ -0,0 +1,15 @@ -+#include -+using namespace std; -+ -+struct S -+{ -+ char c; -+ long double a; -+}; -+ -+ -+int main() -+{ -+ cout<< sizeof( S ) < -+#include -+using namespace std; -+ -+int main() -+{ -+ static bool test; -+ static char a; -+ static short b; -+ static int c; -+ static long d; -+ static long long e; -+ static float f; -+ static double g; -+ static long double h; -+ static int * ptr_one; -+ static void * ptr_two; -+ -+ printf("%d\n", alignof(test) ); -+ printf("%d\n", alignof(a) ); -+ printf("%d\n", alignof(b) ); -+ printf("%d\n", alignof(c) ); -+ printf("%d\n", alignof(d) ); -+ printf("%d\n", alignof(e) ); -+ printf("%d\n", alignof(f) ); -+ printf("%d\n", alignof(g) ); -+ printf("%d\n", alignof(h) ); -+ printf("%d\n", alignof( ptr_one ) ); -+ printf("%d\n", alignof( ptr_two ) ); -+ printf("%d\n", alignof( int ) ); -+ return 0; -+} -+ -diff --git a/test/c_cxx_align_examples/c-and-cxx-align5.cpp b/test/c_cxx_align_examples/c-and-cxx-align5.cpp -new file mode 100644 -index 0000000..004345e ---- /dev/null -+++ b/test/c_cxx_align_examples/c-and-cxx-align5.cpp -@@ -0,0 +1,32 @@ -+#include -+#include -+using namespace std; -+ -+int main() -+{ -+ bool test; -+ char a; -+ short b; -+ int c; -+ long d; -+ long long e; -+ float f; -+ double g; -+ long double h; -+ int * ptr_one; -+ void * ptr_two; -+ -+ printf("%d\n", sizeof(test) ); -+ printf("%d\n", sizeof(a) ); -+ printf("%d\n", sizeof(b) ); -+ printf("%d\n", sizeof(c) ); -+ printf("%d\n", sizeof(d) ); -+ printf("%d\n", sizeof(e) ); -+ printf("%d\n", sizeof(f) ); -+ printf("%d\n", sizeof(g) ); -+ printf("%d\n", sizeof(h) ); -+ printf("%d\n", sizeof( ptr_one ) ); -+ printf("%d\n", sizeof( ptr_two ) ); -+ return 0; -+} -+ -diff --git a/test/c_cxx_align_examples/c-and-cxx-align6.cpp b/test/c_cxx_align_examples/c-and-cxx-align6.cpp -new file mode 100644 -index 0000000..272374e ---- /dev/null -+++ b/test/c_cxx_align_examples/c-and-cxx-align6.cpp -@@ -0,0 +1,32 @@ -+#include -+#include -+using namespace std; -+ -+int main() -+{ -+ bool test; -+ char a; -+ short b; -+ int c; -+ long d; -+ long long e; -+ float f; -+ double g; -+ long double h; -+ int * ptr_one; -+ void * ptr_two; -+ -+ printf("%d\n", __alignof__(test) ); -+ printf("%d\n", __alignof__(a) ); -+ printf("%d\n", __alignof__(b) ); -+ printf("%d\n", __alignof__(c) ); -+ printf("%d\n", __alignof__(d) ); -+ printf("%d\n", __alignof__(e) ); -+ printf("%d\n", __alignof__(f) ); -+ printf("%d\n", __alignof__(g) ); -+ printf("%d\n", __alignof__(h) ); -+ printf("%d\n", __alignof__( ptr_one ) ); -+ printf("%d\n", __alignof__( ptr_two ) ); -+ return 0; -+} -+ -diff --git a/test/c_cxx_align_examples/c-and-cxx-align7.cpp b/test/c_cxx_align_examples/c-and-cxx-align7.cpp -new file mode 100644 -index 0000000..3dabed2 ---- /dev/null -+++ b/test/c_cxx_align_examples/c-and-cxx-align7.cpp -@@ -0,0 +1,17 @@ -+#include -+#include -+using namespace std; -+ -+enum Foo -+{ -+ a, b, c = 10, d, e = 1, f, g = f + c -+}; -+ -+int main() -+{ -+ -+ cout< -+#include -+using namespace std; -+int test; -+int main() -+{ -+ int b=1; -+ cout << alignof(b) < -+#include -+using namespace std; -+ -+int main() -+{ -+ bool first; -+ bool second[3]; -+ int * ptr; -+ int * test[3]; -+ printf("sizeof(first)=%d alignof(first)=%d\n", sizeof(first), alignof(first) ); -+ printf("sizeof(second)=%d alignof(second)=%d\n", sizeof(second), alignof(second) ); -+ printf("sizeof(ptr)=%d alignof(ptr)=%d\n", sizeof(ptr), alignof(ptr) ); -+ printf("sizeof(test)=%d alignof(test)=%d\n", sizeof(test), alignof(test) ); -+ return 0; -+} -+ -diff --git a/test/c_cxx_align_examples/run-compiler-c-cxx-align1.sh b/test/c_cxx_align_examples/run-compiler-c-cxx-align1.sh -new file mode 100644 -index 0000000..d5b8b64 ---- /dev/null -+++ b/test/c_cxx_align_examples/run-compiler-c-cxx-align1.sh -@@ -0,0 +1,2 @@ -+#!/bin/bash -+gcc -std=c11 -w c-and-cxx-align1.c -o c-and-cxx-align1.out -diff --git a/test/c_cxx_align_examples/run-compiler-c-cxx-align10.sh b/test/c_cxx_align_examples/run-compiler-c-cxx-align10.sh -new file mode 100644 -index 0000000..9bf61ff ---- /dev/null -+++ b/test/c_cxx_align_examples/run-compiler-c-cxx-align10.sh -@@ -0,0 +1,2 @@ -+#!/bin/bash -+g++ -std=c++11 -w c-and-cxx-align10.cpp -o c-and-cxx-align10.out -diff --git a/test/c_cxx_align_examples/run-compiler-c-cxx-align11.sh b/test/c_cxx_align_examples/run-compiler-c-cxx-align11.sh -new file mode 100644 -index 0000000..bb03a36 ---- /dev/null -+++ b/test/c_cxx_align_examples/run-compiler-c-cxx-align11.sh -@@ -0,0 +1,2 @@ -+#!/bin/bash -+g++ -std=c++11 -w c-and-cxx-align11.cpp -o c-and-cxx-align11.out -diff --git a/test/c_cxx_align_examples/run-compiler-c-cxx-align12.sh b/test/c_cxx_align_examples/run-compiler-c-cxx-align12.sh -new file mode 100644 -index 0000000..1e91e49 ---- /dev/null -+++ b/test/c_cxx_align_examples/run-compiler-c-cxx-align12.sh -@@ -0,0 +1,2 @@ -+#!/bin/bash -+g++ -std=c++11 -w c-and-cxx-align12.cpp -o c-and-cxx-align12.out -diff --git a/test/c_cxx_align_examples/run-compiler-c-cxx-align13.sh b/test/c_cxx_align_examples/run-compiler-c-cxx-align13.sh -new file mode 100644 -index 0000000..254fedc ---- /dev/null -+++ b/test/c_cxx_align_examples/run-compiler-c-cxx-align13.sh -@@ -0,0 +1,2 @@ -+#!/bin/bash -+g++ -std=c++11 -w c-and-cxx-align13.cpp -o c-and-cxx-align13.out -diff --git a/test/c_cxx_align_examples/run-compiler-c-cxx-align14.sh b/test/c_cxx_align_examples/run-compiler-c-cxx-align14.sh -new file mode 100644 -index 0000000..df40f0b ---- /dev/null -+++ b/test/c_cxx_align_examples/run-compiler-c-cxx-align14.sh -@@ -0,0 +1,2 @@ -+#!/bin/bash -+g++ -std=c++11 -w c-and-cxx-align14.cpp -o c-and-cxx-align14.out -diff --git a/test/c_cxx_align_examples/run-compiler-c-cxx-align15.sh b/test/c_cxx_align_examples/run-compiler-c-cxx-align15.sh -new file mode 100644 -index 0000000..d11c8d2 ---- /dev/null -+++ b/test/c_cxx_align_examples/run-compiler-c-cxx-align15.sh -@@ -0,0 +1,2 @@ -+#!/bin/bash -+g++ -std=c++11 -w c-and-cxx-align15.cpp -o c-and-cxx-align15.out -diff --git a/test/c_cxx_align_examples/run-compiler-c-cxx-align16.sh b/test/c_cxx_align_examples/run-compiler-c-cxx-align16.sh -new file mode 100644 -index 0000000..efc607d ---- /dev/null -+++ b/test/c_cxx_align_examples/run-compiler-c-cxx-align16.sh -@@ -0,0 +1,2 @@ -+#!/bin/bash -+g++ -std=c++11 -w c-and-cxx-align16.cpp -o c-and-cxx-align16.out -diff --git a/test/c_cxx_align_examples/run-compiler-c-cxx-align17.sh b/test/c_cxx_align_examples/run-compiler-c-cxx-align17.sh -new file mode 100644 -index 0000000..f9e3d87 ---- /dev/null -+++ b/test/c_cxx_align_examples/run-compiler-c-cxx-align17.sh -@@ -0,0 +1,2 @@ -+#!/bin/bash -+gcc -std=c11 -w c-and-cxx-align17.c -o c-and-cxx-align17.out -diff --git a/test/c_cxx_align_examples/run-compiler-c-cxx-align18.sh b/test/c_cxx_align_examples/run-compiler-c-cxx-align18.sh -new file mode 100644 -index 0000000..268a1b4 ---- /dev/null -+++ b/test/c_cxx_align_examples/run-compiler-c-cxx-align18.sh -@@ -0,0 +1,2 @@ -+#!/bin/bash -+g++ c-and-cxx-align18.cpp -g -o c-and-cxx-align18.out -diff --git a/test/c_cxx_align_examples/run-compiler-c-cxx-align19.sh b/test/c_cxx_align_examples/run-compiler-c-cxx-align19.sh -new file mode 100644 -index 0000000..f44aff1 ---- /dev/null -+++ b/test/c_cxx_align_examples/run-compiler-c-cxx-align19.sh -@@ -0,0 +1,2 @@ -+#!/bin/bash -+gcc -std=c11 -w c-and-cxx-align19.c -o c-and-cxx-align19.out -diff --git a/test/c_cxx_align_examples/run-compiler-c-cxx-align2.sh b/test/c_cxx_align_examples/run-compiler-c-cxx-align2.sh -new file mode 100644 -index 0000000..230d78e ---- /dev/null -+++ b/test/c_cxx_align_examples/run-compiler-c-cxx-align2.sh -@@ -0,0 +1,2 @@ -+#!/bin/bash -+g++ -std=c++11 -w c-and-cxx-align2.cpp -o c-and-cxx-align2.out -diff --git a/test/c_cxx_align_examples/run-compiler-c-cxx-align20.sh b/test/c_cxx_align_examples/run-compiler-c-cxx-align20.sh -new file mode 100644 -index 0000000..15a086d ---- /dev/null -+++ b/test/c_cxx_align_examples/run-compiler-c-cxx-align20.sh -@@ -0,0 +1,2 @@ -+#!/bin/bash -+gcc -std=c11 -w c-and-cxx-align20.c -o c-and-cxx-align20.out -diff --git a/test/c_cxx_align_examples/run-compiler-c-cxx-align21.sh b/test/c_cxx_align_examples/run-compiler-c-cxx-align21.sh -new file mode 100644 -index 0000000..1edecdd ---- /dev/null -+++ b/test/c_cxx_align_examples/run-compiler-c-cxx-align21.sh -@@ -0,0 +1,2 @@ -+#!/bin/bash -+gcc -std=c11 -w c-and-cxx-align21.c -o c-and-cxx-align21.out -diff --git a/test/c_cxx_align_examples/run-compiler-c-cxx-align22.sh b/test/c_cxx_align_examples/run-compiler-c-cxx-align22.sh -new file mode 100644 -index 0000000..e84fea4 ---- /dev/null -+++ b/test/c_cxx_align_examples/run-compiler-c-cxx-align22.sh -@@ -0,0 +1,2 @@ -+#!/bin/bash -+gcc -std=c11 -w c-and-cxx-align22.c -o c-and-cxx-align22.out -diff --git a/test/c_cxx_align_examples/run-compiler-c-cxx-align23.sh b/test/c_cxx_align_examples/run-compiler-c-cxx-align23.sh -new file mode 100644 -index 0000000..8a679c5 ---- /dev/null -+++ b/test/c_cxx_align_examples/run-compiler-c-cxx-align23.sh -@@ -0,0 +1,2 @@ -+#!/bin/bash -+g++ -std=c++11 -w c-and-cxx-align23.cpp -o c-and-cxx-align23.out -diff --git a/test/c_cxx_align_examples/run-compiler-c-cxx-align24.sh b/test/c_cxx_align_examples/run-compiler-c-cxx-align24.sh -new file mode 100644 -index 0000000..a611b66 ---- /dev/null -+++ b/test/c_cxx_align_examples/run-compiler-c-cxx-align24.sh -@@ -0,0 +1,2 @@ -+#!/bin/bash -+g++ -std=c++11 -w c-and-cxx-align24.cpp -o c-and-cxx-align24.out -diff --git a/test/c_cxx_align_examples/run-compiler-c-cxx-align25.sh b/test/c_cxx_align_examples/run-compiler-c-cxx-align25.sh -new file mode 100644 -index 0000000..02ea108 ---- /dev/null -+++ b/test/c_cxx_align_examples/run-compiler-c-cxx-align25.sh -@@ -0,0 +1,2 @@ -+#!/bin/bash -+g++ -std=c++11 -w c-and-cxx-align25.cpp -o c-and-cxx-align25.out -diff --git a/test/c_cxx_align_examples/run-compiler-c-cxx-align26.sh b/test/c_cxx_align_examples/run-compiler-c-cxx-align26.sh -new file mode 100644 -index 0000000..fba1ad1 ---- /dev/null -+++ b/test/c_cxx_align_examples/run-compiler-c-cxx-align26.sh -@@ -0,0 +1,2 @@ -+#!/bin/bash -+g++ -std=c++11 -w c-and-cxx-align26.cpp -o c-and-cxx-align26.out -diff --git a/test/c_cxx_align_examples/run-compiler-c-cxx-align27.sh b/test/c_cxx_align_examples/run-compiler-c-cxx-align27.sh -new file mode 100644 -index 0000000..9b39006 ---- /dev/null -+++ b/test/c_cxx_align_examples/run-compiler-c-cxx-align27.sh -@@ -0,0 +1,2 @@ -+#!/bin/bash -+g++ -std=c++11 -w c-and-cxx-align27.cpp -o c-and-cxx-align27.out -diff --git a/test/c_cxx_align_examples/run-compiler-c-cxx-align28.sh b/test/c_cxx_align_examples/run-compiler-c-cxx-align28.sh -new file mode 100644 -index 0000000..7aa34fe ---- /dev/null -+++ b/test/c_cxx_align_examples/run-compiler-c-cxx-align28.sh -@@ -0,0 +1,2 @@ -+#!/bin/bash -+g++ -std=c++11 -w c-and-cxx-align28.cpp -o c-and-cxx-align28.out -diff --git a/test/c_cxx_align_examples/run-compiler-c-cxx-align29.sh b/test/c_cxx_align_examples/run-compiler-c-cxx-align29.sh -new file mode 100644 -index 0000000..d92959d ---- /dev/null -+++ b/test/c_cxx_align_examples/run-compiler-c-cxx-align29.sh -@@ -0,0 +1,2 @@ -+#!/bin/bash -+g++ -std=c++11 -w c-and-cxx-align29.cpp -o c-and-cxx-align29.out -diff --git a/test/c_cxx_align_examples/run-compiler-c-cxx-align3.sh b/test/c_cxx_align_examples/run-compiler-c-cxx-align3.sh -new file mode 100644 -index 0000000..a0734bd ---- /dev/null -+++ b/test/c_cxx_align_examples/run-compiler-c-cxx-align3.sh -@@ -0,0 +1,2 @@ -+#!/bin/bash -+g++ -std=c++11 -w c-and-cxx-align3.cpp -o c-and-cxx-align3.out -diff --git a/test/c_cxx_align_examples/run-compiler-c-cxx-align30.sh b/test/c_cxx_align_examples/run-compiler-c-cxx-align30.sh -new file mode 100644 -index 0000000..2b0532c ---- /dev/null -+++ b/test/c_cxx_align_examples/run-compiler-c-cxx-align30.sh -@@ -0,0 +1,2 @@ -+#!/bin/bash -+g++ -std=c++11 -w c-and-cxx-align30.cpp -o c-and-cxx-align30.out -diff --git a/test/c_cxx_align_examples/run-compiler-c-cxx-align31.sh b/test/c_cxx_align_examples/run-compiler-c-cxx-align31.sh -new file mode 100644 -index 0000000..e4b18c2 ---- /dev/null -+++ b/test/c_cxx_align_examples/run-compiler-c-cxx-align31.sh -@@ -0,0 +1,2 @@ -+#!/bin/bash -+gcc -std=c11 -w c-and-cxx-align31.c -o c-and-cxx-align31.out -diff --git a/test/c_cxx_align_examples/run-compiler-c-cxx-align32.sh b/test/c_cxx_align_examples/run-compiler-c-cxx-align32.sh -new file mode 100644 -index 0000000..29f84c2 ---- /dev/null -+++ b/test/c_cxx_align_examples/run-compiler-c-cxx-align32.sh -@@ -0,0 +1,2 @@ -+#!/bin/bash -+g++ -std=c++11 -w c-and-cxx-align32.cpp -o c-and-cxx-align32.out -diff --git a/test/c_cxx_align_examples/run-compiler-c-cxx-align33.sh b/test/c_cxx_align_examples/run-compiler-c-cxx-align33.sh -new file mode 100644 -index 0000000..68d0916 ---- /dev/null -+++ b/test/c_cxx_align_examples/run-compiler-c-cxx-align33.sh -@@ -0,0 +1,2 @@ -+#!/bin/bash -+gcc -w c-and-cxx-align33.c -o c-and-cxx-align33.out -diff --git a/test/c_cxx_align_examples/run-compiler-c-cxx-align34.sh b/test/c_cxx_align_examples/run-compiler-c-cxx-align34.sh -new file mode 100644 -index 0000000..efd53c4 ---- /dev/null -+++ b/test/c_cxx_align_examples/run-compiler-c-cxx-align34.sh -@@ -0,0 +1,2 @@ -+#!/bin/bash -+g++ -w c-and-cxx-align34.cpp -o c-and-cxx-align34.out -diff --git a/test/c_cxx_align_examples/run-compiler-c-cxx-align4.sh b/test/c_cxx_align_examples/run-compiler-c-cxx-align4.sh -new file mode 100644 -index 0000000..6cb6456 ---- /dev/null -+++ b/test/c_cxx_align_examples/run-compiler-c-cxx-align4.sh -@@ -0,0 +1,2 @@ -+#!/bin/bash -+g++ -std=c++11 -w c-and-cxx-align4.cpp -o c-and-cxx-align4.out -diff --git a/test/c_cxx_align_examples/run-compiler-c-cxx-align5.sh b/test/c_cxx_align_examples/run-compiler-c-cxx-align5.sh -new file mode 100644 -index 0000000..8061a8d ---- /dev/null -+++ b/test/c_cxx_align_examples/run-compiler-c-cxx-align5.sh -@@ -0,0 +1,2 @@ -+#!/bin/bash -+g++ -std=c++11 -w c-and-cxx-align5.cpp -o c-and-cxx-align5.out -diff --git a/test/c_cxx_align_examples/run-compiler-c-cxx-align6.sh b/test/c_cxx_align_examples/run-compiler-c-cxx-align6.sh -new file mode 100644 -index 0000000..8cc0cd0 ---- /dev/null -+++ b/test/c_cxx_align_examples/run-compiler-c-cxx-align6.sh -@@ -0,0 +1,2 @@ -+#!/bin/bash -+g++ -std=c++11 -w c-and-cxx-align6.cpp -o c-and-cxx-align6.out -diff --git a/test/c_cxx_align_examples/run-compiler-c-cxx-align7.sh b/test/c_cxx_align_examples/run-compiler-c-cxx-align7.sh -new file mode 100644 -index 0000000..425b8a4 ---- /dev/null -+++ b/test/c_cxx_align_examples/run-compiler-c-cxx-align7.sh -@@ -0,0 +1,2 @@ -+#!/bin/bash -+g++ -std=c++11 -w c-and-cxx-align7.cpp -o c-and-cxx-align7.out -diff --git a/test/c_cxx_align_examples/run-compiler-c-cxx-align8.sh b/test/c_cxx_align_examples/run-compiler-c-cxx-align8.sh -new file mode 100644 -index 0000000..aafdc66 ---- /dev/null -+++ b/test/c_cxx_align_examples/run-compiler-c-cxx-align8.sh -@@ -0,0 +1,2 @@ -+#!/bin/bash -+g++ -std=c++11 -w c-and-cxx-align8.cpp -o c-and-cxx-align8.out -diff --git a/test/c_cxx_align_examples/run-compiler-c-cxx-align9.sh b/test/c_cxx_align_examples/run-compiler-c-cxx-align9.sh -new file mode 100644 -index 0000000..b083500 ---- /dev/null -+++ b/test/c_cxx_align_examples/run-compiler-c-cxx-align9.sh -@@ -0,0 +1,2 @@ -+#!/bin/bash -+g++ -std=c++11 -w c-and-cxx-align9.cpp -o c-and-cxx-align9.out --- -2.37.1 (Apple Git-137.1) - diff --git a/17-add-fortran-memory-align-investigation.patch b/17-add-fortran-memory-align-investigation.patch deleted file mode 100644 index cc620179db75f7dae717c4e900cad15d5edb094b..0000000000000000000000000000000000000000 --- a/17-add-fortran-memory-align-investigation.patch +++ /dev/null @@ -1,1731 +0,0 @@ -From affa7e06a123005fcdc782d6b540b067f50a36b3 Mon Sep 17 00:00:00 2001 -From: huwei3 -Date: Sun, 25 Dec 2022 19:05:34 +0800 -Subject: [PATCH] add-fortran-memory-align-investigation - - -diff --git a/test/fortran_align_examples/fortran-align-classic-flang1.f90 b/test/fortran_align_examples/fortran-align-classic-flang1.f90 -new file mode 100644 -index 0000000..2f8b716 ---- /dev/null -+++ b/test/fortran_align_examples/fortran-align-classic-flang1.f90 -@@ -0,0 +1,19 @@ -+program main -+ implicit none -+ logical(kind=1) :: a -+ logical(kind=2) :: b -+ logical(kind=4) :: c -+ logical(kind=8) :: d -+ print * , kind(a) -+ print * , kind(b) -+ print * , kind(c) -+ print * , kind(d) -+end program main -+ -+! Reference -+! https://github.com/flang-compiler/flang -+! ISO/IEC 1539-1:2010 Information technology — Programming languages -+! — Fortran — Part 1: Base language. -+! ISO/IEC 1539-1:2018 Information technology — Programming languages -+! — Fortran — Part 1: Base language. -+! ISO-IECJTC1-SC22-WG5_N2146_Fortran_2018_Draft_International_Standard_for_Ballot. -diff --git a/test/fortran_align_examples/fortran-align-classic-flang10.f90 b/test/fortran_align_examples/fortran-align-classic-flang10.f90 -new file mode 100644 -index 0000000..c9b1e2c ---- /dev/null -+++ b/test/fortran_align_examples/fortran-align-classic-flang10.f90 -@@ -0,0 +1,27 @@ -+program main -+ implicit none -+ real, dimension (:,:), allocatable :: darray -+ integer :: s1, s2 -+ integer :: i, j -+ print*, "Enter the size of the array:" -+ s1=2 -+ s2=2 -+ ! allocate memory -+ allocate ( darray(s1,s2) ) -+ -+ do i = 1, s1 -+ do j = 1, s2 -+ darray(i,j) = i*j -+ print*, "darray(",i,",",j,") = ", darray(i,j) -+ end do -+ end do -+ -+ write(*,*) 'addr darray(1,1)' , loc( darray(1,1) ) -+ write(*,*) 'addr darray(2,1)' , loc( darray(2,1) ) -+ write(*,*) 'addr darray(1,2)' , loc( darray(1,2) ) -+ write(*,*) 'addr darray(2,2)' , loc( darray(2,2) ) -+ deallocate (darray) -+end program main -+ -+! Reference -+! https://iowiki.com/fortran/fortran_dynamic_arrays.html -diff --git a/test/fortran_align_examples/fortran-align-classic-flang11.f90 b/test/fortran_align_examples/fortran-align-classic-flang11.f90 -new file mode 100644 -index 0000000..85e24f7 ---- /dev/null -+++ b/test/fortran_align_examples/fortran-align-classic-flang11.f90 -@@ -0,0 +1,24 @@ -+program ex0810 -+ implicit none -+ integer :: a, b -+ !Define a and b as the first and second variables in the global variables -+ common a, b -+ a=1 -+ b=2 -+ call ShowCommon() -+ write(*,*) , 'common begin a addr=', loc(a) -+ write(*,*) , 'common begin b addr=', loc(b) -+ stop -+end program ex0810 -+ -+subroutine ShowCommon() -+ implicit none -+ integer :: num1, num2 -+ !Define num1 and num2 as the first and second variables in the global variables -+ common num1, num2 -+ write(*,*) num1, num2 -+ return -+end subroutine ShowCommon -+ -+! Reference -+! 彭国伦,Fortran95程序设计[M]. 北京: 中国电力出版社, 2002: 169-170. -diff --git a/test/fortran_align_examples/fortran-align-classic-flang12.f90 b/test/fortran_align_examples/fortran-align-classic-flang12.f90 -new file mode 100644 -index 0000000..3c626c3 ---- /dev/null -+++ b/test/fortran_align_examples/fortran-align-classic-flang12.f90 -@@ -0,0 +1,26 @@ -+program main -+ implicit none -+ real, dimension (:,:), allocatable :: darray -+ integer :: s1, s2 -+ integer :: i, j -+ print*, "Enter the size of the array:" -+ s1=2 -+ s2=2 -+ allocate ( darray(s1,s2) ) -+ !dir$ assume_aligned darray:64 -+ do i = 1, s1 -+ do j = 1, s2 -+ darray(i,j) = i*j -+ print*, "darray(",i,",",j,") = ", darray(i,j) -+ end do -+ end do -+ -+ write(*,*) 'addr darray(1,1)' , loc( darray(1,1) ) -+ write(*,*) 'addr darray(2,1)' , loc( darray(2,1) ) -+ write(*,*) 'addr darray(1,2)' , loc( darray(1,2) ) -+ write(*,*) 'addr darray(2,2)' , loc( darray(2,2) ) -+ deallocate (darray) -+end program main -+ -+! Reference -+! https://iowiki.com/fortran/fortran_dynamic_arrays.html -diff --git a/test/fortran_align_examples/fortran-align-classic-flang13.f90 b/test/fortran_align_examples/fortran-align-classic-flang13.f90 -new file mode 100644 -index 0000000..07e492c ---- /dev/null -+++ b/test/fortran_align_examples/fortran-align-classic-flang13.f90 -@@ -0,0 +1,27 @@ -+program main -+ implicit none -+ real, dimension (:,:), allocatable :: darray -+ integer :: s1, s2 -+ integer :: i, j -+ print*, "Enter the size of the array:" -+ s1=2 -+ s2=2 -+ ! allocate memory -+ allocate ( darray(s1,s2) ) -+ !dir$ attributes align : 64 : darray -+ do i = 1, s1 -+ do j = 1, s2 -+ darray(i,j) = i*j -+ print*, "darray(",i,",",j,") = ", darray(i,j) -+ end do -+ end do -+ -+ write(*,*) 'addr darray(1,1)' , loc( darray(1,1) ) -+ write(*,*) 'addr darray(2,1)' , loc( darray(2,1) ) -+ write(*,*) 'addr darray(1,2)' , loc( darray(1,2) ) -+ write(*,*) 'addr darray(2,2)' , loc( darray(2,2) ) -+ deallocate (darray) -+end program main -+ -+! Reference -+! https://iowiki.com/fortran/fortran_dynamic_arrays.html -diff --git a/test/fortran_align_examples/fortran-align-classic-flang2.f90 b/test/fortran_align_examples/fortran-align-classic-flang2.f90 -new file mode 100644 -index 0000000..6b25778 ---- /dev/null -+++ b/test/fortran_align_examples/fortran-align-classic-flang2.f90 -@@ -0,0 +1,15 @@ -+program main -+ implicit none -+ character(kind=1) :: a -+ character(kind=2) :: b -+ print * , kind(a) -+ print * , kind(b) -+end program main -+ -+! Reference -+! https://github.com/flang-compiler/flang -+! ISO/IEC 1539-1:2010 Information technology — Programming languages -+! — Fortran — Part 1: Base language. -+! ISO/IEC 1539-1:2018 Information technology — Programming languages -+! — Fortran — Part 1: Base language. -+! ISO-IECJTC1-SC22-WG5_N2146_Fortran_2018_Draft_International_Standard_for_Ballot. -diff --git a/test/fortran_align_examples/fortran-align-classic-flang3.f90 b/test/fortran_align_examples/fortran-align-classic-flang3.f90 -new file mode 100644 -index 0000000..d61fb74 ---- /dev/null -+++ b/test/fortran_align_examples/fortran-align-classic-flang3.f90 -@@ -0,0 +1,19 @@ -+program main -+ implicit none -+ integer(kind=1) :: a -+ integer(kind=2) :: b -+ integer(kind=4) :: c -+ integer(kind=8) :: d -+ print * , kind(a) -+ print * , kind(b) -+ print * , kind(c) -+ print * , kind(d) -+end program main -+ -+! Reference -+! https://github.com/flang-compiler/flang -+! ISO/IEC 1539-1:2010 Information technology — Programming languages -+! — Fortran — Part 1: Base language. -+! ISO/IEC 1539-1:2018 Information technology — Programming languages -+! — Fortran — Part 1: Base language. -+! ISO-IECJTC1-SC22-WG5_N2146_Fortran_2018_Draft_International_Standard_for_Ballot. -diff --git a/test/fortran_align_examples/fortran-align-classic-flang4.f90 b/test/fortran_align_examples/fortran-align-classic-flang4.f90 -new file mode 100644 -index 0000000..cd5ddc6 ---- /dev/null -+++ b/test/fortran_align_examples/fortran-align-classic-flang4.f90 -@@ -0,0 +1,15 @@ -+program main -+ implicit none -+ real(kind=4) :: c -+ real(kind=8) :: d -+ print * , kind(c) -+ print * , kind(d) -+end program main -+ -+! Reference -+! https://github.com/flang-compiler/flang -+! ISO/IEC 1539-1:2010 Information technology — Programming languages -+! — Fortran — Part 1: Base language. -+! ISO/IEC 1539-1:2018 Information technology — Programming languages -+! — Fortran — Part 1: Base language. -+! ISO-IECJTC1-SC22-WG5_N2146_Fortran_2018_Draft_International_Standard_for_Ballot. -diff --git a/test/fortran_align_examples/fortran-align-classic-flang5.f90 b/test/fortran_align_examples/fortran-align-classic-flang5.f90 -new file mode 100644 -index 0000000..968ae51 ---- /dev/null -+++ b/test/fortran_align_examples/fortran-align-classic-flang5.f90 -@@ -0,0 +1,15 @@ -+program main -+ implicit none -+ complex(kind=4) :: c -+ complex(kind=8) :: d -+ print * , kind(c) -+ print * , kind(d) -+end program main -+ -+! Reference -+! https://github.com/flang-compiler/flang -+! ISO/IEC 1539-1:2010 Information technology — Programming languages -+! — Fortran — Part 1: Base language. -+! ISO/IEC 1539-1:2018 Information technology — Programming languages -+! — Fortran — Part 1: Base language. -+! ISO-IECJTC1-SC22-WG5_N2146_Fortran_2018_Draft_International_Standard_for_Ballot. -diff --git a/test/fortran_align_examples/fortran-align-classic-flang6.f90 b/test/fortran_align_examples/fortran-align-classic-flang6.f90 -new file mode 100644 -index 0000000..9861c35 ---- /dev/null -+++ b/test/fortran_align_examples/fortran-align-classic-flang6.f90 -@@ -0,0 +1,16 @@ -+program main -+ implicit none -+ !modify kine -+ integer(kind=4) :: test(1000) -+ write (*,*) 'location test=', loc(test) -+ write (*,*) 'location test[1]=', loc(test(1)) -+ write (*,*) 'location test[2]=', loc(test(2)) -+end program main -+ -+! Reference -+! https://github.com/flang-compiler/flang -+! ISO/IEC 1539-1:2010 Information technology — Programming languages -+! — Fortran — Part 1: Base language. -+! ISO/IEC 1539-1:2018 Information technology — Programming languages -+! — Fortran — Part 1: Base language. -+! ISO-IECJTC1-SC22-WG5_N2146_Fortran_2018_Draft_International_Standard_for_Ballot. -diff --git a/test/fortran_align_examples/fortran-align-classic-flang7.f90 b/test/fortran_align_examples/fortran-align-classic-flang7.f90 -new file mode 100644 -index 0000000..0c8bef5 ---- /dev/null -+++ b/test/fortran_align_examples/fortran-align-classic-flang7.f90 -@@ -0,0 +1,20 @@ -+program main -+ implicit none -+ type demo -+ integer(kind=4) :: a(3) -+ real(kind=4) :: b -+ logical(kind=1) :: c -+ end type -+ type(demo) :: test -+ write (*,*) 'location c=', loc(test%c) -+ write (*,*) 'location b=', loc(test%b) -+ write (*,*) 'location a=', loc(test%a) -+end program main -+ -+! Reference -+! https://github.com/flang-compiler/flang -+! ISO/IEC 1539-1:2010 Information technology — Programming languages -+! — Fortran — Part 1: Base language. -+! ISO/IEC 1539-1:2018 Information technology — Programming languages -+! — Fortran — Part 1: Base language. -+! ISO-IECJTC1-SC22-WG5_N2146_Fortran_2018_Draft_International_Standard_for_Ballot. -diff --git a/test/fortran_align_examples/fortran-align-classic-flang8.f90 b/test/fortran_align_examples/fortran-align-classic-flang8.f90 -new file mode 100644 -index 0000000..b9df3b6 ---- /dev/null -+++ b/test/fortran_align_examples/fortran-align-classic-flang8.f90 -@@ -0,0 +1,23 @@ -+program main -+ call one() -+ call two() -+ write( *, *), 'subroutine-one-addr=', loc(one) -+ write( *, *) , 'subroutine-two-addr=', loc(two) -+end program main -+ -+subroutine one() -+ integer :: a=3 -+ print * , a -+end subroutine one -+ -+subroutine two() -+ print * , 'two' -+end subroutine two -+ -+! Reference -+! https://github.com/flang-compiler/flang -+! ISO/IEC 1539-1:2010 Information technology — Programming languages -+! — Fortran — Part 1: Base language. -+! ISO/IEC 1539-1:2018 Information technology — Programming languages -+! — Fortran — Part 1: Base language. -+! ISO-IECJTC1-SC22-WG5_N2146_Fortran_2018_Draft_International_Standard_for_Ballot. -diff --git a/test/fortran_align_examples/fortran-align-classic-flang9.f90 b/test/fortran_align_examples/fortran-align-classic-flang9.f90 -new file mode 100644 -index 0000000..116b419 ---- /dev/null -+++ b/test/fortran_align_examples/fortran-align-classic-flang9.f90 -@@ -0,0 +1,32 @@ -+program main -+ integer(kind=4) :: a=2 -+ integer(kind=4) :: b=3 -+ integer(kind=4) :: c -+ integer(kind=4) :: d -+ write(*,*) myadd(a,b) -+ write(*,*) mymuli(a,b) -+ write( *, *), 'function-myadd-addr=', loc(myadd) -+ write( *, *) , 'function-mymuli-addr=', loc(testadd) -+end program main -+ -+function myadd(first, second) -+ integer(kind=4):: first , second -+ integer(kind=4):: myadd -+ myadd= first + second -+ return -+end function myadd -+ -+function mymuli(first , second) -+ integer(kind=4):: first , second -+ integer(kind=4):: mymuli -+ mymuli= first*second -+ return -+end function mymuli -+ -+! Reference -+! https://github.com/flang-compiler/flang -+! ISO/IEC 1539-1:2010 Information technology — Programming languages -+! — Fortran — Part 1: Base language. -+! ISO/IEC 1539-1:2018 Information technology — Programming languages -+! — Fortran — Part 1: Base language. -+! ISO-IECJTC1-SC22-WG5_N2146_Fortran_2018_Draft_International_Standard_for_Ballot. -diff --git a/test/fortran_align_examples/fortran-align-gfortran1.f90 b/test/fortran_align_examples/fortran-align-gfortran1.f90 -new file mode 100644 -index 0000000..e42b466 ---- /dev/null -+++ b/test/fortran_align_examples/fortran-align-gfortran1.f90 -@@ -0,0 +1,21 @@ -+program main -+ implicit none -+ logical(kind=1) :: a -+ logical(kind=2) :: b -+ logical(kind=4) :: c -+ logical(kind=8) :: d -+ logical(kind=16) :: e -+ print * , kind(a) -+ print * , kind(b) -+ print * , kind(c) -+ print * , kind(d) -+ print * , kind(e) -+end program main -+ -+! Reference -+! Using GNU Fortran , For gcc version 10.4.0 -+! ISO/IEC 1539-1:2010 Information technology — Programming languages -+! — Fortran — Part 1: Base language. -+! ISO/IEC 1539-1:2018 Information technology — Programming languages -+! — Fortran — Part 1: Base language. -+! ISO-IECJTC1-SC22-WG5_N2146_Fortran_2018_Draft_International_Standard_for_Ballot. -diff --git a/test/fortran_align_examples/fortran-align-gfortran10.f90 b/test/fortran_align_examples/fortran-align-gfortran10.f90 -new file mode 100644 -index 0000000..0b702cc ---- /dev/null -+++ b/test/fortran_align_examples/fortran-align-gfortran10.f90 -@@ -0,0 +1,31 @@ -+program main -+ integer(kind=4) :: a=2 -+ integer(kind=4) :: b=3 -+ integer(kind=4) :: c -+ integer(kind=4) :: d -+ write(*,*) myadd(a,b) -+ write(*,*) mymuli(a,b) -+ write( *, *), 'function-myadd-addr=', loc(myadd) -+ write( *, *) , 'function-mymuli-addr=', loc(testadd) -+end program main -+ -+function myadd(first, second) -+ integer(kind=4):: first , second -+ integer(kind=4):: myadd -+ myadd= first + second -+ return -+end function myadd -+ -+function mymuli(first , second) -+ integer(kind=4):: first , second -+ integer(kind=4):: mymuli -+ mymuli= first*second -+ return -+end function mymuli -+! Reference -+! Using GNU Fortran , For gcc version 10.4.0 -+! ISO/IEC 1539-1:2010 Information technology — Programming languages -+! — Fortran — Part 1: Base language. -+! ISO/IEC 1539-1:2018 Information technology — Programming languages -+! — Fortran — Part 1: Base language. -+! ISO-IECJTC1-SC22-WG5_N2146_Fortran_2018_Draft_International_Standard_for_Ballot. -diff --git a/test/fortran_align_examples/fortran-align-gfortran11.f90 b/test/fortran_align_examples/fortran-align-gfortran11.f90 -new file mode 100644 -index 0000000..2388f6a ---- /dev/null -+++ b/test/fortran_align_examples/fortran-align-gfortran11.f90 -@@ -0,0 +1,28 @@ -+program main -+ implicit none -+ real, dimension (:,:), allocatable :: darray -+ integer :: s1, s2 -+ integer :: i, j -+ print*, "Enter the size of the array:" -+ s1=2 -+ s2=2 -+ ! allocate memory -+ allocate ( darray(s1,s2) ) -+ -+ do i = 1, s1 -+ do j = 1, s2 -+ darray(i,j) = i*j -+ print*, "darray(",i,",",j,") = ", darray(i,j) -+ end do -+ end do -+ -+ write(*,*) 'addr darray(1,1)' , loc( darray(1,1) ) -+ write(*,*) 'addr darray(2,1)' , loc( darray(2,1) ) -+ write(*,*) 'addr darray(1,2)' , loc( darray(1,2) ) -+ write(*,*) 'addr darray(2,2)' , loc( darray(2,2) ) -+ deallocate (darray) -+end program main -+ -+ -+! Reference -+! https://iowiki.com/fortran/fortran_dynamic_arrays.html -diff --git a/test/fortran_align_examples/fortran-align-gfortran12.f90 b/test/fortran_align_examples/fortran-align-gfortran12.f90 -new file mode 100644 -index 0000000..6a43ea0 ---- /dev/null -+++ b/test/fortran_align_examples/fortran-align-gfortran12.f90 -@@ -0,0 +1,24 @@ -+program ex0810 -+ implicit none -+ integer :: a, b -+ common a, b -+ a=1 -+ b=2 -+ call ShowCommon() -+ write(*,*) , 'common begin a addr=', loc(a) -+ write(*,*) , 'common begin b addr=', loc(b) -+ -+ stop -+ -+end program ex0810 -+ -+subroutine ShowCommon() -+ implicit none -+ integer :: num1, num2 -+ common num1, num2 -+ write(*,*) num1, num2 -+ return -+ -+end subroutine ShowCommon -+! Reference -+! 彭国伦,Fortran95程序设计[M]. 北京: 中国电力出版社, 2002: 169-170. -diff --git a/test/fortran_align_examples/fortran-align-gfortran13.f90 b/test/fortran_align_examples/fortran-align-gfortran13.f90 -new file mode 100644 -index 0000000..ffe1f64 ---- /dev/null -+++ b/test/fortran_align_examples/fortran-align-gfortran13.f90 -@@ -0,0 +1,14 @@ -+program main -+ implicit none -+ character(kind=1) ::a -+ integer(kind=8) :: b -+ common a, b -+ a='a' -+ b=2 -+ write(*,*) , 'common begin a addr=', loc(a) -+ write(*,*) , 'common begin b addr=', loc(b) -+ -+end program main -+ -+! Reference -+! 彭国伦,Fortran95程序设计[M]. 北京: 中国电力出版社, 2002: 169-170. -diff --git a/test/fortran_align_examples/fortran-align-gfortran2.f90 b/test/fortran_align_examples/fortran-align-gfortran2.f90 -new file mode 100644 -index 0000000..787c7ba ---- /dev/null -+++ b/test/fortran_align_examples/fortran-align-gfortran2.f90 -@@ -0,0 +1,12 @@ -+program main -+ implicit none -+ character(kind=1) :: a -+ print * , kind(a) -+end program main -+! Reference -+! Using GNU Fortran , For gcc version 10.4.0 -+! ISO/IEC 1539-1:2010 Information technology — Programming languages -+! — Fortran — Part 1: Base language. -+! ISO/IEC 1539-1:2018 Information technology — Programming languages -+! — Fortran — Part 1: Base language. -+! ISO-IECJTC1-SC22-WG5_N2146_Fortran_2018_Draft_International_Standard_for_Ballot. -diff --git a/test/fortran_align_examples/fortran-align-gfortran3.f90 b/test/fortran_align_examples/fortran-align-gfortran3.f90 -new file mode 100644 -index 0000000..e55e06d ---- /dev/null -+++ b/test/fortran_align_examples/fortran-align-gfortran3.f90 -@@ -0,0 +1,20 @@ -+program main -+ implicit none -+ integer(kind=1) :: a -+ integer(kind=2) :: b -+ integer(kind=4) :: c -+ integer(kind=8) :: d -+ integer(kind=16) :: e -+ print * , kind(a) -+ print * , kind(b) -+ print * , kind(c) -+ print * , kind(d) -+ print * , kind(e) -+end program main -+! Reference -+! Using GNU Fortran , For gcc version 10.4.0 -+! ISO/IEC 1539-1:2010 Information technology — Programming languages -+! — Fortran — Part 1: Base language. -+! ISO/IEC 1539-1:2018 Information technology — Programming languages -+! — Fortran — Part 1: Base language. -+! ISO-IECJTC1-SC22-WG5_N2146_Fortran_2018_Draft_International_Standard_for_Ballot. -diff --git a/test/fortran_align_examples/fortran-align-gfortran4.f90 b/test/fortran_align_examples/fortran-align-gfortran4.f90 -new file mode 100644 -index 0000000..c902d2c ---- /dev/null -+++ b/test/fortran_align_examples/fortran-align-gfortran4.f90 -@@ -0,0 +1,20 @@ -+program main -+ integer(kind=1) :: a -+ integer(kind=2) :: b -+ integer(kind=4) :: c -+ integer(kind=8) :: d -+ -+ write (*,*) 'location a=', loc(a) -+ write (*,*) 'location b=', loc(b) -+ write (*,*) 'location c=', loc(c) -+ write (*,*) 'location d=', loc(d) -+end program main -+ -+ -+! Reference -+! Using GNU Fortran , For gcc version 10.4.0 -+! ISO/IEC 1539-1:2010 Information technology — Programming languages -+! — Fortran — Part 1: Base language. -+! ISO/IEC 1539-1:2018 Information technology — Programming languages -+! — Fortran — Part 1: Base language. -+! ISO-IECJTC1-SC22-WG5_N2146_Fortran_2018_Draft_International_Standard_for_Ballot. -diff --git a/test/fortran_align_examples/fortran-align-gfortran5.f90 b/test/fortran_align_examples/fortran-align-gfortran5.f90 -new file mode 100644 -index 0000000..66d5988 ---- /dev/null -+++ b/test/fortran_align_examples/fortran-align-gfortran5.f90 -@@ -0,0 +1,16 @@ -+program main -+ implicit none -+ real(kind=4) :: c -+ real(kind=8) :: d -+ real(kind=16) :: e -+ print * , kind(c) -+ print * , kind(d) -+ print * , kind(e) -+end program main -+! Reference -+! Using GNU Fortran , For gcc version 10.4.0 -+! ISO/IEC 1539-1:2010 Information technology — Programming languages -+! — Fortran — Part 1: Base language. -+! ISO/IEC 1539-1:2018 Information technology — Programming languages -+! — Fortran — Part 1: Base language. -+! ISO-IECJTC1-SC22-WG5_N2146_Fortran_2018_Draft_International_Standard_for_Ballot. -diff --git a/test/fortran_align_examples/fortran-align-gfortran6.f90 b/test/fortran_align_examples/fortran-align-gfortran6.f90 -new file mode 100644 -index 0000000..7fc8c47 ---- /dev/null -+++ b/test/fortran_align_examples/fortran-align-gfortran6.f90 -@@ -0,0 +1,18 @@ -+program main -+ implicit none -+ complex(kind=4) :: c -+ complex(kind=8) :: d -+ complex(kind=16) :: e -+ print * , kind(c) -+ print * , kind(d) -+ print * , kind(e) -+end program main -+ -+ -+! Reference -+! Using GNU Fortran , For gcc version 10.4.0 -+! ISO/IEC 1539-1:2010 Information technology — Programming languages -+! — Fortran — Part 1: Base language. -+! ISO/IEC 1539-1:2018 Information technology — Programming languages -+! — Fortran — Part 1: Base language. -+! ISO-IECJTC1-SC22-WG5_N2146_Fortran_2018_Draft_International_Standard_for_Ballot. -diff --git a/test/fortran_align_examples/fortran-align-gfortran7.f90 b/test/fortran_align_examples/fortran-align-gfortran7.f90 -new file mode 100644 -index 0000000..ed34923 ---- /dev/null -+++ b/test/fortran_align_examples/fortran-align-gfortran7.f90 -@@ -0,0 +1,14 @@ -+program main -+ implicit none -+ integer(kind=4) :: test(1000) -+ write (*,*) 'location test=', loc(test) -+ write (*,*) 'location test[1]=', loc(test(1)) -+ write (*,*) 'location test[2]=', loc(test(2)) -+end program main -+! Reference -+! Using GNU Fortran , For gcc version 10.4.0 -+! ISO/IEC 1539-1:2010 Information technology — Programming languages -+! — Fortran — Part 1: Base language. -+! ISO/IEC 1539-1:2018 Information technology — Programming languages -+! — Fortran — Part 1: Base language. -+! ISO-IECJTC1-SC22-WG5_N2146_Fortran_2018_Draft_International_Standard_for_Ballot. -diff --git a/test/fortran_align_examples/fortran-align-gfortran8.f90 b/test/fortran_align_examples/fortran-align-gfortran8.f90 -new file mode 100644 -index 0000000..6fd62c8 ---- /dev/null -+++ b/test/fortran_align_examples/fortran-align-gfortran8.f90 -@@ -0,0 +1,19 @@ -+program main -+ implicit none -+ type demo -+ integer(kind=4) :: a(3) -+ real(kind=4) :: b -+ logical(kind=1) :: c -+ end type -+ type(demo) :: test -+ write (*,*) 'location c=', loc(test%c) -+ write (*,*) 'location b=', loc(test%b) -+ write (*,*) 'location a=', loc(test%a) -+end program main -+! Reference -+! Using GNU Fortran , For gcc version 10.4.0 -+! ISO/IEC 1539-1:2010 Information technology — Programming languages -+! — Fortran — Part 1: Base language. -+! ISO/IEC 1539-1:2018 Information technology — Programming languages -+! — Fortran — Part 1: Base language. -+! ISO-IECJTC1-SC22-WG5_N2146_Fortran_2018_Draft_International_Standard_for_Ballot. -diff --git a/test/fortran_align_examples/fortran-align-gfortran9.f90 b/test/fortran_align_examples/fortran-align-gfortran9.f90 -new file mode 100644 -index 0000000..6ff8b2f ---- /dev/null -+++ b/test/fortran_align_examples/fortran-align-gfortran9.f90 -@@ -0,0 +1,23 @@ -+program main -+ call one() -+ call two() -+ write( *, *), 'subroutine-one-addr=', loc(one) -+ write( *, *) , 'subroutine-two-addr=', loc(two) -+ -+end program main -+ -+subroutine one() -+ integer :: a=3 -+ print * , a -+end subroutine one -+ -+subroutine two() -+ print * , 'two' -+end subroutine two -+! Reference -+! Using GNU Fortran , For gcc version 10.4.0 -+! ISO/IEC 1539-1:2010 Information technology — Programming languages -+! — Fortran — Part 1: Base language. -+! ISO/IEC 1539-1:2018 Information technology — Programming languages -+! — Fortran — Part 1: Base language. -+! ISO-IECJTC1-SC22-WG5_N2146_Fortran_2018_Draft_International_Standard_for_Ballot. -diff --git a/test/fortran_align_examples/fortran-align-ifort1.f90 b/test/fortran_align_examples/fortran-align-ifort1.f90 -new file mode 100644 -index 0000000..1298b36 ---- /dev/null -+++ b/test/fortran_align_examples/fortran-align-ifort1.f90 -@@ -0,0 +1,20 @@ -+program main -+ implicit none -+ logical(kind=1) :: a -+ logical(kind=2) :: b -+ logical(kind=4) :: c -+ logical(kind=8) :: d -+ print * , kind(a) -+ print * , kind(b) -+ print * , kind(c) -+ print * , kind(d) -+ -+end program main -+ -+! Reference -+! Intel® Fortran Compiler Classic and Intel® Fortran Compiler Developer Guide and Reference. -+! ISO/IEC 1539-1:2010 Information technology — Programming languages -+! — Fortran — Part 1: Base language. -+! ISO/IEC 1539-1:2018 Information technology — Programming languages -+! — Fortran — Part 1: Base language. -+! ISO-IECJTC1-SC22-WG5_N2146_Fortran_2018_Draft_International_Standard_for_Ballot. -diff --git a/test/fortran_align_examples/fortran-align-ifort10.f90 b/test/fortran_align_examples/fortran-align-ifort10.f90 -new file mode 100644 -index 0000000..c5e65a3 ---- /dev/null -+++ b/test/fortran_align_examples/fortran-align-ifort10.f90 -@@ -0,0 +1,23 @@ -+program main -+ call one() -+ call two() -+ write( *, *), 'subroutine-one-addr=', loc(one) -+ write( *, *) , 'subroutine-two-addr=', loc(two) -+ -+end program main -+ -+subroutine one() -+ integer :: a=3 -+ print * , a -+end subroutine one -+ -+subroutine two() -+ print * , 'two' -+end subroutine two -+! Reference -+! Intel® Fortran Compiler Classic and Intel® Fortran Compiler Developer Guide and Reference. -+! ISO/IEC 1539-1:2010 Information technology — Programming languages -+! — Fortran — Part 1: Base language. -+! ISO/IEC 1539-1:2018 Information technology — Programming languages -+! — Fortran — Part 1: Base language. -+! ISO-IECJTC1-SC22-WG5_N2146_Fortran_2018_Draft_International_Standard_for_Ballot. -diff --git a/test/fortran_align_examples/fortran-align-ifort11.f90 b/test/fortran_align_examples/fortran-align-ifort11.f90 -new file mode 100644 -index 0000000..c9b1e2c ---- /dev/null -+++ b/test/fortran_align_examples/fortran-align-ifort11.f90 -@@ -0,0 +1,27 @@ -+program main -+ implicit none -+ real, dimension (:,:), allocatable :: darray -+ integer :: s1, s2 -+ integer :: i, j -+ print*, "Enter the size of the array:" -+ s1=2 -+ s2=2 -+ ! allocate memory -+ allocate ( darray(s1,s2) ) -+ -+ do i = 1, s1 -+ do j = 1, s2 -+ darray(i,j) = i*j -+ print*, "darray(",i,",",j,") = ", darray(i,j) -+ end do -+ end do -+ -+ write(*,*) 'addr darray(1,1)' , loc( darray(1,1) ) -+ write(*,*) 'addr darray(2,1)' , loc( darray(2,1) ) -+ write(*,*) 'addr darray(1,2)' , loc( darray(1,2) ) -+ write(*,*) 'addr darray(2,2)' , loc( darray(2,2) ) -+ deallocate (darray) -+end program main -+ -+! Reference -+! https://iowiki.com/fortran/fortran_dynamic_arrays.html -diff --git a/test/fortran_align_examples/fortran-align-ifort12.f90 b/test/fortran_align_examples/fortran-align-ifort12.f90 -new file mode 100644 -index 0000000..7baf338 ---- /dev/null -+++ b/test/fortran_align_examples/fortran-align-ifort12.f90 -@@ -0,0 +1,24 @@ -+program ex0810 -+ implicit none -+ integer :: a, b -+ common a, b -+ a=1 -+ b=2 -+ call ShowCommon() -+ write(*,*) , 'common begin a addr=', loc(a) -+ write(*,*) , 'common begin b addr=', loc(b) -+ -+ stop -+ -+end program ex0810 -+ -+subroutine ShowCommon() -+ implicit none -+ integer :: num1, num2 -+ common num1, num2 -+ write(*,*) num1, num2 -+ return -+ -+end subroutine ShowCommon -+! Reference -+! 彭国伦,Fortran95程序设计[M]. 北京: 中国电力出版社, 2002: 169-170. -diff --git a/test/fortran_align_examples/fortran-align-ifort13.f90 b/test/fortran_align_examples/fortran-align-ifort13.f90 -new file mode 100644 -index 0000000..44fca4f ---- /dev/null -+++ b/test/fortran_align_examples/fortran-align-ifort13.f90 -@@ -0,0 +1,19 @@ -+program main -+ type demo -+ integer(kind=8) :: a(3) -+ logical(kind=1) :: c -+ real(kind=8) :: b -+ end type -+ type(demo) :: test -+ write (*,*) 'location c=', loc(test%c) -+ write (*,*) 'location b=', loc(test%b) -+ write (*,*) 'location a=', loc(test%a) -+end program main -+ -+! Reference -+! Intel® Fortran Compiler Classic and Intel® Fortran Compiler Developer Guide and Reference. -+! ISO/IEC 1539-1:2010 Information technology — Programming languages -+! — Fortran — Part 1: Base language. -+! ISO/IEC 1539-1:2018 Information technology — Programming languages -+! — Fortran — Part 1: Base language. -+! ISO-IECJTC1-SC22-WG5_N2146_Fortran_2018_Draft_International_Standard_for_Ballot. -diff --git a/test/fortran_align_examples/fortran-align-ifort14.f90 b/test/fortran_align_examples/fortran-align-ifort14.f90 -new file mode 100644 -index 0000000..d5ea141 ---- /dev/null -+++ b/test/fortran_align_examples/fortran-align-ifort14.f90 -@@ -0,0 +1,14 @@ -+program main -+ integer(4) :: test(1000) -+ write (*,*) 'location test=', loc(test) -+ write (*,*) 'location test[1]=', loc(test(1)) -+ write (*,*) 'location test[2]=', loc(test(2)) -+end program main -+ -+! Reference -+! Intel® Fortran Compiler Classic and Intel® Fortran Compiler Developer Guide and Reference. -+! ISO/IEC 1539-1:2010 Information technology — Programming languages -+! — Fortran — Part 1: Base language. -+! ISO/IEC 1539-1:2018 Information technology — Programming languages -+! — Fortran — Part 1: Base language. -+! ISO-IECJTC1-SC22-WG5_N2146_Fortran_2018_Draft_International_Standard_for_Ballot. -diff --git a/test/fortran_align_examples/fortran-align-ifort15.f90 b/test/fortran_align_examples/fortran-align-ifort15.f90 -new file mode 100644 -index 0000000..ac5edc1 ---- /dev/null -+++ b/test/fortran_align_examples/fortran-align-ifort15.f90 -@@ -0,0 +1,14 @@ -+program main -+ implicit none -+ character(kind=1) ::a -+ integer(kind=8) :: b -+ common a, b -+ a='a' -+ b=2 -+ write(*,*) , 'common begin a addr=', loc(a) -+ write(*,*) , 'common begin b addr=', loc(b) -+ -+end program main -+ -+! Reference -+! 彭国伦,Fortran95程序设计[M]. 北京: 中国电力出版社, 2002: 169-170. -diff --git a/test/fortran_align_examples/fortran-align-ifort16.f90 b/test/fortran_align_examples/fortran-align-ifort16.f90 -new file mode 100644 -index 0000000..6b2fcea ---- /dev/null -+++ b/test/fortran_align_examples/fortran-align-ifort16.f90 -@@ -0,0 +1,20 @@ -+program main -+ implicit none -+ type demo -+ logical(kind=1) :: c -+ real(kind=4) :: b -+ integer(kind=8) :: a(3) -+ end type -+ type(demo) :: test -+ write (*,*) 'location c=', loc(test%c) -+ write (*,*) 'location b=', loc(test%b) -+ write (*,*) 'location a=', loc(test%a) -+end program main -+ -+! Reference -+! Intel® Fortran Compiler Classic and Intel® Fortran Compiler Developer Guide and Reference. -+! ISO/IEC 1539-1:2010 Information technology — Programming languages -+! — Fortran — Part 1: Base language. -+! ISO/IEC 1539-1:2018 Information technology — Programming languages -+! — Fortran — Part 1: Base language. -+! ISO-IECJTC1-SC22-WG5_N2146_Fortran_2018_Draft_International_Standard_for_Ballot. -diff --git a/test/fortran_align_examples/fortran-align-ifort17.f90 b/test/fortran_align_examples/fortran-align-ifort17.f90 -new file mode 100644 -index 0000000..6b2fcea ---- /dev/null -+++ b/test/fortran_align_examples/fortran-align-ifort17.f90 -@@ -0,0 +1,20 @@ -+program main -+ implicit none -+ type demo -+ logical(kind=1) :: c -+ real(kind=4) :: b -+ integer(kind=8) :: a(3) -+ end type -+ type(demo) :: test -+ write (*,*) 'location c=', loc(test%c) -+ write (*,*) 'location b=', loc(test%b) -+ write (*,*) 'location a=', loc(test%a) -+end program main -+ -+! Reference -+! Intel® Fortran Compiler Classic and Intel® Fortran Compiler Developer Guide and Reference. -+! ISO/IEC 1539-1:2010 Information technology — Programming languages -+! — Fortran — Part 1: Base language. -+! ISO/IEC 1539-1:2018 Information technology — Programming languages -+! — Fortran — Part 1: Base language. -+! ISO-IECJTC1-SC22-WG5_N2146_Fortran_2018_Draft_International_Standard_for_Ballot. -diff --git a/test/fortran_align_examples/fortran-align-ifort18.f90 b/test/fortran_align_examples/fortran-align-ifort18.f90 -new file mode 100644 -index 0000000..4d97967 ---- /dev/null -+++ b/test/fortran_align_examples/fortran-align-ifort18.f90 -@@ -0,0 +1,19 @@ -+program main -+ type :: demo -+ sequence -+ character(kind=1) :: a -+ integer(kind=8) :: b -+ end type -+ type(demo) :: test -+ write (*,*) 'location a=', loc(test%a) -+ write (*,*) 'location b=', loc(test%b) -+end program main -+ -+ -+! Reference -+! Intel® Fortran Compiler Classic and Intel® Fortran Compiler Developer Guide and Reference. -+! ISO/IEC 1539-1:2010 Information technology — Programming languages -+! — Fortran — Part 1: Base language. -+! ISO/IEC 1539-1:2018 Information technology — Programming languages -+! — Fortran — Part 1: Base language. -+! ISO-IECJTC1-SC22-WG5_N2146_Fortran_2018_Draft_International_Standard_for_Ballot. -diff --git a/test/fortran_align_examples/fortran-align-ifort19.f90 b/test/fortran_align_examples/fortran-align-ifort19.f90 -new file mode 100644 -index 0000000..c9b1e2c ---- /dev/null -+++ b/test/fortran_align_examples/fortran-align-ifort19.f90 -@@ -0,0 +1,27 @@ -+program main -+ implicit none -+ real, dimension (:,:), allocatable :: darray -+ integer :: s1, s2 -+ integer :: i, j -+ print*, "Enter the size of the array:" -+ s1=2 -+ s2=2 -+ ! allocate memory -+ allocate ( darray(s1,s2) ) -+ -+ do i = 1, s1 -+ do j = 1, s2 -+ darray(i,j) = i*j -+ print*, "darray(",i,",",j,") = ", darray(i,j) -+ end do -+ end do -+ -+ write(*,*) 'addr darray(1,1)' , loc( darray(1,1) ) -+ write(*,*) 'addr darray(2,1)' , loc( darray(2,1) ) -+ write(*,*) 'addr darray(1,2)' , loc( darray(1,2) ) -+ write(*,*) 'addr darray(2,2)' , loc( darray(2,2) ) -+ deallocate (darray) -+end program main -+ -+! Reference -+! https://iowiki.com/fortran/fortran_dynamic_arrays.html -diff --git a/test/fortran_align_examples/fortran-align-ifort2.f90 b/test/fortran_align_examples/fortran-align-ifort2.f90 -new file mode 100644 -index 0000000..2def020 ---- /dev/null -+++ b/test/fortran_align_examples/fortran-align-ifort2.f90 -@@ -0,0 +1,13 @@ -+program main -+ implicit none -+ character(kind=1) :: a -+ print * , kind(a) -+ -+end program main -+! Reference -+! Intel® Fortran Compiler Classic and Intel® Fortran Compiler Developer Guide and Reference. -+! ISO/IEC 1539-1:2010 Information technology — Programming languages -+! — Fortran — Part 1: Base language. -+! ISO/IEC 1539-1:2018 Information technology — Programming languages -+! — Fortran — Part 1: Base language. -+! ISO-IECJTC1-SC22-WG5_N2146_Fortran_2018_Draft_International_Standard_for_Ballot. -diff --git a/test/fortran_align_examples/fortran-align-ifort20.f90 b/test/fortran_align_examples/fortran-align-ifort20.f90 -new file mode 100644 -index 0000000..2251662 ---- /dev/null -+++ b/test/fortran_align_examples/fortran-align-ifort20.f90 -@@ -0,0 +1,33 @@ -+program main -+ integer(kind=4) :: a=2 -+ integer(kind=4) :: b=3 -+ integer(kind=4) :: c -+ integer(kind=4) :: d -+ write(*,*) myadd(a,b) -+ write(*,*) mymuli(a,b) -+ write( *, *), 'function-myadd-addr=', loc(myadd) -+ write( *, *) , 'function-mymuli-addr=', loc(testadd) -+end program main -+ -+function myadd(first, second) -+ integer(kind=4):: first , second -+ integer(kind=4):: myadd -+ myadd= first + second -+ return -+end function myadd -+ -+function mymuli(first , second) -+ integer(kind=4):: first , second -+ integer(kind=4):: mymuli -+ mymuli= first*second -+ return -+end function mymuli -+ -+ -+! Reference -+! Intel® Fortran Compiler Classic and Intel® Fortran Compiler Developer Guide and Reference. -+! ISO/IEC 1539-1:2010 Information technology — Programming languages -+! — Fortran — Part 1: Base language. -+! ISO/IEC 1539-1:2018 Information technology — Programming languages -+! — Fortran — Part 1: Base language. -+! ISO-IECJTC1-SC22-WG5_N2146_Fortran_2018_Draft_International_Standard_for_Ballot. -diff --git a/test/fortran_align_examples/fortran-align-ifort21.f90 b/test/fortran_align_examples/fortran-align-ifort21.f90 -new file mode 100644 -index 0000000..c9b1e2c ---- /dev/null -+++ b/test/fortran_align_examples/fortran-align-ifort21.f90 -@@ -0,0 +1,27 @@ -+program main -+ implicit none -+ real, dimension (:,:), allocatable :: darray -+ integer :: s1, s2 -+ integer :: i, j -+ print*, "Enter the size of the array:" -+ s1=2 -+ s2=2 -+ ! allocate memory -+ allocate ( darray(s1,s2) ) -+ -+ do i = 1, s1 -+ do j = 1, s2 -+ darray(i,j) = i*j -+ print*, "darray(",i,",",j,") = ", darray(i,j) -+ end do -+ end do -+ -+ write(*,*) 'addr darray(1,1)' , loc( darray(1,1) ) -+ write(*,*) 'addr darray(2,1)' , loc( darray(2,1) ) -+ write(*,*) 'addr darray(1,2)' , loc( darray(1,2) ) -+ write(*,*) 'addr darray(2,2)' , loc( darray(2,2) ) -+ deallocate (darray) -+end program main -+ -+! Reference -+! https://iowiki.com/fortran/fortran_dynamic_arrays.html -diff --git a/test/fortran_align_examples/fortran-align-ifort22.f90 b/test/fortran_align_examples/fortran-align-ifort22.f90 -new file mode 100644 -index 0000000..621cc9c ---- /dev/null -+++ b/test/fortran_align_examples/fortran-align-ifort22.f90 -@@ -0,0 +1,19 @@ -+program main -+ integer(kind=1) :: a -+ integer(kind=2) :: b -+ integer(kind=4) :: c -+ integer(kind=8) :: d -+ -+ write (*,*) 'location a=', loc(a) -+ write (*,*) 'location b=', loc(b) -+ write (*,*) 'location c=', loc(c) -+ write (*,*) 'location d=', loc(d) -+end program main -+ -+! Reference -+! Intel® Fortran Compiler Classic and Intel® Fortran Compiler Developer Guide and Reference. -+! ISO/IEC 1539-1:2010 Information technology — Programming languages -+! — Fortran — Part 1: Base language. -+! ISO/IEC 1539-1:2018 Information technology — Programming languages -+! — Fortran — Part 1: Base language. -+! ISO-IECJTC1-SC22-WG5_N2146_Fortran_2018_Draft_International_Standard_for_Ballot. -diff --git a/test/fortran_align_examples/fortran-align-ifort23.f90 b/test/fortran_align_examples/fortran-align-ifort23.f90 -new file mode 100644 -index 0000000..c9b1e2c ---- /dev/null -+++ b/test/fortran_align_examples/fortran-align-ifort23.f90 -@@ -0,0 +1,27 @@ -+program main -+ implicit none -+ real, dimension (:,:), allocatable :: darray -+ integer :: s1, s2 -+ integer :: i, j -+ print*, "Enter the size of the array:" -+ s1=2 -+ s2=2 -+ ! allocate memory -+ allocate ( darray(s1,s2) ) -+ -+ do i = 1, s1 -+ do j = 1, s2 -+ darray(i,j) = i*j -+ print*, "darray(",i,",",j,") = ", darray(i,j) -+ end do -+ end do -+ -+ write(*,*) 'addr darray(1,1)' , loc( darray(1,1) ) -+ write(*,*) 'addr darray(2,1)' , loc( darray(2,1) ) -+ write(*,*) 'addr darray(1,2)' , loc( darray(1,2) ) -+ write(*,*) 'addr darray(2,2)' , loc( darray(2,2) ) -+ deallocate (darray) -+end program main -+ -+! Reference -+! https://iowiki.com/fortran/fortran_dynamic_arrays.html -diff --git a/test/fortran_align_examples/fortran-align-ifort3.f90 b/test/fortran_align_examples/fortran-align-ifort3.f90 -new file mode 100644 -index 0000000..3943db8 ---- /dev/null -+++ b/test/fortran_align_examples/fortran-align-ifort3.f90 -@@ -0,0 +1,18 @@ -+program main -+ implicit none -+ integer(kind=1) :: a -+ integer(kind=2) :: b -+ integer(kind=4) :: c -+ integer(kind=8) :: d -+ print * , kind(a) -+ print * , kind(b) -+ print * , kind(c) -+ print * , kind(d) -+end program main -+! Reference -+! Intel® Fortran Compiler Classic and Intel® Fortran Compiler Developer Guide and Reference. -+! ISO/IEC 1539-1:2010 Information technology — Programming languages -+! — Fortran — Part 1: Base language. -+! ISO/IEC 1539-1:2018 Information technology — Programming languages -+! — Fortran — Part 1: Base language. -+! ISO-IECJTC1-SC22-WG5_N2146_Fortran_2018_Draft_International_Standard_for_Ballot. -diff --git a/test/fortran_align_examples/fortran-align-ifort4.f90 b/test/fortran_align_examples/fortran-align-ifort4.f90 -new file mode 100644 -index 0000000..c0e3174 ---- /dev/null -+++ b/test/fortran_align_examples/fortran-align-ifort4.f90 -@@ -0,0 +1,20 @@ -+program main -+ integer(kind=1) :: a -+ integer(kind=2) :: b -+ integer(kind=4) :: c -+ integer(kind=8) :: d -+ -+ write (*,*) 'location a=', loc(a) -+ write (*,*) 'location b=', loc(b) -+ write (*,*) 'location c=', loc(c) -+ write (*,*) 'location d=', loc(d) -+end program main -+ -+ -+! Reference -+! Intel® Fortran Compiler Classic and Intel® Fortran Compiler Developer Guide and Reference. -+! ISO/IEC 1539-1:2010 Information technology — Programming languages -+! — Fortran — Part 1: Base language. -+! ISO/IEC 1539-1:2018 Information technology — Programming languages -+! — Fortran — Part 1: Base language. -+! ISO-IECJTC1-SC22-WG5_N2146_Fortran_2018_Draft_International_Standard_for_Ballot. -diff --git a/test/fortran_align_examples/fortran-align-ifort5.f90 b/test/fortran_align_examples/fortran-align-ifort5.f90 -new file mode 100644 -index 0000000..f0ea6e6 ---- /dev/null -+++ b/test/fortran_align_examples/fortran-align-ifort5.f90 -@@ -0,0 +1,16 @@ -+program main -+ implicit none -+ real(kind=4) :: c -+ real(kind=8) :: d -+ real(kind=16) :: e -+ print * , kind(c) -+ print * , kind(d) -+ print * , kind(e) -+end program main -+! Reference -+! Intel® Fortran Compiler Classic and Intel® Fortran Compiler Developer Guide and Reference. -+! ISO/IEC 1539-1:2010 Information technology — Programming languages -+! — Fortran — Part 1: Base language. -+! ISO/IEC 1539-1:2018 Information technology — Programming languages -+! — Fortran — Part 1: Base language. -+! ISO-IECJTC1-SC22-WG5_N2146_Fortran_2018_Draft_International_Standard_for_Ballot. -diff --git a/test/fortran_align_examples/fortran-align-ifort6.f90 b/test/fortran_align_examples/fortran-align-ifort6.f90 -new file mode 100644 -index 0000000..623e92a ---- /dev/null -+++ b/test/fortran_align_examples/fortran-align-ifort6.f90 -@@ -0,0 +1,18 @@ -+program main -+ implicit none -+ complex(kind=4) :: c -+ complex(kind=8) :: d -+ complex(kind=16) :: e -+ print * , kind(c) -+ print * , kind(d) -+ print * , kind(e) -+end program main -+ -+ -+! Reference -+! Intel® Fortran Compiler Classic and Intel® Fortran Compiler Developer Guide and Reference. -+! ISO/IEC 1539-1:2010 Information technology — Programming languages -+! — Fortran — Part 1: Base language. -+! ISO/IEC 1539-1:2018 Information technology — Programming languages -+! — Fortran — Part 1: Base language. -+! ISO-IECJTC1-SC22-WG5_N2146_Fortran_2018_Draft_International_Standard_for_Ballot. -diff --git a/test/fortran_align_examples/fortran-align-ifort7.f90 b/test/fortran_align_examples/fortran-align-ifort7.f90 -new file mode 100644 -index 0000000..42f4713 ---- /dev/null -+++ b/test/fortran_align_examples/fortran-align-ifort7.f90 -@@ -0,0 +1,14 @@ -+program main -+ implicit none -+ integer(kind=4) :: test(1000) -+ write (*,*) 'location test=', loc(test) -+ write (*,*) 'location test[1]=', loc(test(1)) -+ write (*,*) 'location test[2]=', loc(test(2)) -+end program main -+! Reference -+! Intel® Fortran Compiler Classic and Intel® Fortran Compiler Developer Guide and Reference. -+! ISO/IEC 1539-1:2010 Information technology — Programming languages -+! — Fortran — Part 1: Base language. -+! ISO/IEC 1539-1:2018 Information technology — Programming languages -+! — Fortran — Part 1: Base language. -+! ISO-IECJTC1-SC22-WG5_N2146_Fortran_2018_Draft_International_Standard_for_Ballot. -diff --git a/test/fortran_align_examples/fortran-align-ifort8.f90 b/test/fortran_align_examples/fortran-align-ifort8.f90 -new file mode 100644 -index 0000000..f03362b ---- /dev/null -+++ b/test/fortran_align_examples/fortran-align-ifort8.f90 -@@ -0,0 +1,19 @@ -+program main -+ implicit none -+ type demo -+ integer(kind=4) :: a(3) -+ real(kind=4) :: b -+ logical(kind=1) :: c -+ end type -+ type(demo) :: test -+ write (*,*) 'location c=', loc(test%c) -+ write (*,*) 'location b=', loc(test%b) -+ write (*,*) 'location a=', loc(test%a) -+end program main -+! Reference -+! Intel® Fortran Compiler Classic and Intel® Fortran Compiler Developer Guide and Reference. -+! ISO/IEC 1539-1:2010 Information technology — Programming languages -+! — Fortran — Part 1: Base language. -+! ISO/IEC 1539-1:2018 Information technology — Programming languages -+! — Fortran — Part 1: Base language. -+! ISO-IECJTC1-SC22-WG5_N2146_Fortran_2018_Draft_International_Standard_for_Ballot. -diff --git a/test/fortran_align_examples/fortran-align-ifort9.f90 b/test/fortran_align_examples/fortran-align-ifort9.f90 -new file mode 100644 -index 0000000..c5e65a3 ---- /dev/null -+++ b/test/fortran_align_examples/fortran-align-ifort9.f90 -@@ -0,0 +1,23 @@ -+program main -+ call one() -+ call two() -+ write( *, *), 'subroutine-one-addr=', loc(one) -+ write( *, *) , 'subroutine-two-addr=', loc(two) -+ -+end program main -+ -+subroutine one() -+ integer :: a=3 -+ print * , a -+end subroutine one -+ -+subroutine two() -+ print * , 'two' -+end subroutine two -+! Reference -+! Intel® Fortran Compiler Classic and Intel® Fortran Compiler Developer Guide and Reference. -+! ISO/IEC 1539-1:2010 Information technology — Programming languages -+! — Fortran — Part 1: Base language. -+! ISO/IEC 1539-1:2018 Information technology — Programming languages -+! — Fortran — Part 1: Base language. -+! ISO-IECJTC1-SC22-WG5_N2146_Fortran_2018_Draft_International_Standard_for_Ballot. -diff --git a/test/fortran_align_examples/run-compiler-classic-flang1.sh b/test/fortran_align_examples/run-compiler-classic-flang1.sh -new file mode 100644 -index 0000000..12a1e9e ---- /dev/null -+++ b/test/fortran_align_examples/run-compiler-classic-flang1.sh -@@ -0,0 +1,2 @@ -+#!/bin/bash -+flang fortran-align-classic-flang1.f90 -o fortran-align-classic-flang1.out -diff --git a/test/fortran_align_examples/run-compiler-classic-flang10.sh b/test/fortran_align_examples/run-compiler-classic-flang10.sh -new file mode 100644 -index 0000000..8baf7d2 ---- /dev/null -+++ b/test/fortran_align_examples/run-compiler-classic-flang10.sh -@@ -0,0 +1,2 @@ -+#!/bin/bash -+flang fortran-align-classic-flang10.f90 -o fortran-align-classic-flang10.out -diff --git a/test/fortran_align_examples/run-compiler-classic-flang11.sh b/test/fortran_align_examples/run-compiler-classic-flang11.sh -new file mode 100644 -index 0000000..2cc7957 ---- /dev/null -+++ b/test/fortran_align_examples/run-compiler-classic-flang11.sh -@@ -0,0 +1,2 @@ -+#!/bin/bash -+flang fortran-align-classic-flang11.f90 -o fortran-align-classic-flang11.out -diff --git a/test/fortran_align_examples/run-compiler-classic-flang12.sh b/test/fortran_align_examples/run-compiler-classic-flang12.sh -new file mode 100644 -index 0000000..f754362 ---- /dev/null -+++ b/test/fortran_align_examples/run-compiler-classic-flang12.sh -@@ -0,0 +1,2 @@ -+#!/bin/bash -+flang fortran-align-classic-flang12.f90 -o fortran-align-classic-flang12.out -diff --git a/test/fortran_align_examples/run-compiler-classic-flang13.sh b/test/fortran_align_examples/run-compiler-classic-flang13.sh -new file mode 100644 -index 0000000..04b436a ---- /dev/null -+++ b/test/fortran_align_examples/run-compiler-classic-flang13.sh -@@ -0,0 +1,2 @@ -+#!/bin/bash -+flang fortran-align-classic-flang13.f90 -o fortran-align-classic-flang13.out -diff --git a/test/fortran_align_examples/run-compiler-classic-flang2.sh b/test/fortran_align_examples/run-compiler-classic-flang2.sh -new file mode 100644 -index 0000000..bf6fcde ---- /dev/null -+++ b/test/fortran_align_examples/run-compiler-classic-flang2.sh -@@ -0,0 +1,2 @@ -+#!/bin/bash -+flang fortran-align-classic-flang2.f90 -o fortran-align-classic-flang2.out -diff --git a/test/fortran_align_examples/run-compiler-classic-flang3.sh b/test/fortran_align_examples/run-compiler-classic-flang3.sh -new file mode 100644 -index 0000000..6a19ba2 ---- /dev/null -+++ b/test/fortran_align_examples/run-compiler-classic-flang3.sh -@@ -0,0 +1,2 @@ -+#!/bin/bash -+flang fortran-align-classic-flang3.f90 -o fortran-align-classic-flang3.out -diff --git a/test/fortran_align_examples/run-compiler-classic-flang4.sh b/test/fortran_align_examples/run-compiler-classic-flang4.sh -new file mode 100644 -index 0000000..5b38e03 ---- /dev/null -+++ b/test/fortran_align_examples/run-compiler-classic-flang4.sh -@@ -0,0 +1,2 @@ -+#!/bin/bash -+flang fortran-align-classic-flang4.f90 -o fortran-align-classic-flang4.out -diff --git a/test/fortran_align_examples/run-compiler-classic-flang5.sh b/test/fortran_align_examples/run-compiler-classic-flang5.sh -new file mode 100644 -index 0000000..a167366 ---- /dev/null -+++ b/test/fortran_align_examples/run-compiler-classic-flang5.sh -@@ -0,0 +1,2 @@ -+#!/bin/bash -+flang fortran-align-classic-flang5.f90 -o fortran-align-classic-flang5.out -diff --git a/test/fortran_align_examples/run-compiler-classic-flang6.sh b/test/fortran_align_examples/run-compiler-classic-flang6.sh -new file mode 100644 -index 0000000..f52057d ---- /dev/null -+++ b/test/fortran_align_examples/run-compiler-classic-flang6.sh -@@ -0,0 +1,2 @@ -+#!/bin/bash -+flang fortran-align-classic-flang6.f90 -o fortran-align-classic-flang6.out -diff --git a/test/fortran_align_examples/run-compiler-classic-flang7.sh b/test/fortran_align_examples/run-compiler-classic-flang7.sh -new file mode 100644 -index 0000000..2c46e7e ---- /dev/null -+++ b/test/fortran_align_examples/run-compiler-classic-flang7.sh -@@ -0,0 +1,2 @@ -+#!/bin/bash -+flang fortran-align-classic-flang7.f90 -o fortran-align-classic-flang7.out -diff --git a/test/fortran_align_examples/run-compiler-classic-flang8.sh b/test/fortran_align_examples/run-compiler-classic-flang8.sh -new file mode 100644 -index 0000000..5f81dbd ---- /dev/null -+++ b/test/fortran_align_examples/run-compiler-classic-flang8.sh -@@ -0,0 +1,2 @@ -+#!/bin/bash -+flang fortran-align-classic-flang8.f90 -o fortran-align-classic-flang8.out -diff --git a/test/fortran_align_examples/run-compiler-classic-flang9.sh b/test/fortran_align_examples/run-compiler-classic-flang9.sh -new file mode 100644 -index 0000000..633f628 ---- /dev/null -+++ b/test/fortran_align_examples/run-compiler-classic-flang9.sh -@@ -0,0 +1,2 @@ -+#!/bin/bash -+flang fortran-align-classic-flang9.f90 -o fortran-align-classic-flang9.out -diff --git a/test/fortran_align_examples/run-compiler-gfortran1.sh b/test/fortran_align_examples/run-compiler-gfortran1.sh -new file mode 100644 -index 0000000..27ee121 ---- /dev/null -+++ b/test/fortran_align_examples/run-compiler-gfortran1.sh -@@ -0,0 +1,2 @@ -+#!/bin/bash -+gfortran fortran-align-gfortran1.f90 -o fortran-align-gfortran1.out -diff --git a/test/fortran_align_examples/run-compiler-gfortran10.sh b/test/fortran_align_examples/run-compiler-gfortran10.sh -new file mode 100644 -index 0000000..3b35a28 ---- /dev/null -+++ b/test/fortran_align_examples/run-compiler-gfortran10.sh -@@ -0,0 +1,2 @@ -+#!/bin/bash -+gfortran fortran-align-gfortran10.f90 -o fortran-align-gfortran10.out -diff --git a/test/fortran_align_examples/run-compiler-gfortran11.sh b/test/fortran_align_examples/run-compiler-gfortran11.sh -new file mode 100644 -index 0000000..65cd547 ---- /dev/null -+++ b/test/fortran_align_examples/run-compiler-gfortran11.sh -@@ -0,0 +1,2 @@ -+#!/bin/bash -+gfortran fortran-align-gfortran11.f90 -o fortran-align-gfortran11.out -diff --git a/test/fortran_align_examples/run-compiler-gfortran12.sh b/test/fortran_align_examples/run-compiler-gfortran12.sh -new file mode 100644 -index 0000000..f247b42 ---- /dev/null -+++ b/test/fortran_align_examples/run-compiler-gfortran12.sh -@@ -0,0 +1,2 @@ -+#!/bin/bash -+gfortran fortran-align-gfortran12.f90 -o fortran-align-gfortran12.out -diff --git a/test/fortran_align_examples/run-compiler-gfortran13.sh b/test/fortran_align_examples/run-compiler-gfortran13.sh -new file mode 100644 -index 0000000..b546f47 ---- /dev/null -+++ b/test/fortran_align_examples/run-compiler-gfortran13.sh -@@ -0,0 +1,2 @@ -+#!/bin/bash -+gfortran fortran-align-gfortran13.f90 -o fortran-align-gfortran13.out -diff --git a/test/fortran_align_examples/run-compiler-gfortran2.sh b/test/fortran_align_examples/run-compiler-gfortran2.sh -new file mode 100644 -index 0000000..df994b7 ---- /dev/null -+++ b/test/fortran_align_examples/run-compiler-gfortran2.sh -@@ -0,0 +1,2 @@ -+#!/bin/bash -+gfortran fortran-align-gfortran2.f90 -o fortran-align-gfortran2.out -diff --git a/test/fortran_align_examples/run-compiler-gfortran3.sh b/test/fortran_align_examples/run-compiler-gfortran3.sh -new file mode 100644 -index 0000000..826e8a1 ---- /dev/null -+++ b/test/fortran_align_examples/run-compiler-gfortran3.sh -@@ -0,0 +1,2 @@ -+#!/bin/bash -+gfortran fortran-align-gfortran3.f90 -o fortran-align-gfortran3.out -diff --git a/test/fortran_align_examples/run-compiler-gfortran4.sh b/test/fortran_align_examples/run-compiler-gfortran4.sh -new file mode 100644 -index 0000000..4ea0773 ---- /dev/null -+++ b/test/fortran_align_examples/run-compiler-gfortran4.sh -@@ -0,0 +1,2 @@ -+#!/bin/bash -+gfortran fortran-align-gfortran4.f90 -o fortran-align-gfortran4.out -diff --git a/test/fortran_align_examples/run-compiler-gfortran5.sh b/test/fortran_align_examples/run-compiler-gfortran5.sh -new file mode 100644 -index 0000000..af742ee ---- /dev/null -+++ b/test/fortran_align_examples/run-compiler-gfortran5.sh -@@ -0,0 +1,2 @@ -+#!/bin/bash -+gfortran fortran-align-gfortran5.f90 -o fortran-align-gfortran5.out -diff --git a/test/fortran_align_examples/run-compiler-gfortran6.sh b/test/fortran_align_examples/run-compiler-gfortran6.sh -new file mode 100644 -index 0000000..f90cc00 ---- /dev/null -+++ b/test/fortran_align_examples/run-compiler-gfortran6.sh -@@ -0,0 +1,2 @@ -+#!/bin/bash -+gfortran fortran-align-gfortran6.f90 -o fortran-align-gfortran6.out -diff --git a/test/fortran_align_examples/run-compiler-gfortran7.sh b/test/fortran_align_examples/run-compiler-gfortran7.sh -new file mode 100644 -index 0000000..e979089 ---- /dev/null -+++ b/test/fortran_align_examples/run-compiler-gfortran7.sh -@@ -0,0 +1,2 @@ -+#!/bin/bash -+gfortran fortran-align-gfortran7.f90 -o fortran-align-gfortran7.out -diff --git a/test/fortran_align_examples/run-compiler-gfortran8.sh b/test/fortran_align_examples/run-compiler-gfortran8.sh -new file mode 100644 -index 0000000..fc8fe2f ---- /dev/null -+++ b/test/fortran_align_examples/run-compiler-gfortran8.sh -@@ -0,0 +1,2 @@ -+#!/bin/bash -+gfortran fortran-align-gfortran8.f90 -o fortran-align-gfortran8.out -diff --git a/test/fortran_align_examples/run-compiler-gfortran9.sh b/test/fortran_align_examples/run-compiler-gfortran9.sh -new file mode 100644 -index 0000000..5ef2717 ---- /dev/null -+++ b/test/fortran_align_examples/run-compiler-gfortran9.sh -@@ -0,0 +1,2 @@ -+#!/bin/bash -+gfortran fortran-align-gfortran9.f90 -o fortran-align-gfortran9.out -diff --git a/test/fortran_align_examples/run-compiler-ifort1.sh b/test/fortran_align_examples/run-compiler-ifort1.sh -new file mode 100644 -index 0000000..a6b8071 ---- /dev/null -+++ b/test/fortran_align_examples/run-compiler-ifort1.sh -@@ -0,0 +1,2 @@ -+#!/bin/bash -+ifort fortran-align-ifort1.f90 -o fortran-align-ifort1.out -diff --git a/test/fortran_align_examples/run-compiler-ifort10.sh b/test/fortran_align_examples/run-compiler-ifort10.sh -new file mode 100644 -index 0000000..1cdd5a7 ---- /dev/null -+++ b/test/fortran_align_examples/run-compiler-ifort10.sh -@@ -0,0 +1,2 @@ -+#!/bin/bash -+ifort fortran-align-ifort10.f90 -o fortran-align-ifort10.out -diff --git a/test/fortran_align_examples/run-compiler-ifort11.sh b/test/fortran_align_examples/run-compiler-ifort11.sh -new file mode 100644 -index 0000000..0441f12 ---- /dev/null -+++ b/test/fortran_align_examples/run-compiler-ifort11.sh -@@ -0,0 +1,2 @@ -+#!/bin/bash -+ifort fortran-align-ifort11.f90 -o fortran-align-ifort11.out -diff --git a/test/fortran_align_examples/run-compiler-ifort12.sh b/test/fortran_align_examples/run-compiler-ifort12.sh -new file mode 100644 -index 0000000..795cc7a ---- /dev/null -+++ b/test/fortran_align_examples/run-compiler-ifort12.sh -@@ -0,0 +1,2 @@ -+#!/bin/bash -+ifort fortran-align-ifort12.f90 -o fortran-align-ifort12.out -diff --git a/test/fortran_align_examples/run-compiler-ifort13.sh b/test/fortran_align_examples/run-compiler-ifort13.sh -new file mode 100644 -index 0000000..00dd1ad ---- /dev/null -+++ b/test/fortran_align_examples/run-compiler-ifort13.sh -@@ -0,0 +1,3 @@ -+#!/bin/bash -+#ifort fortran-align-ifort13.f90 -o fortran-align-ifort13.out -+ifort fortran-align-ifort13.f90 -o fortran-align-ifort13.out -align none -diff --git a/test/fortran_align_examples/run-compiler-ifort14.sh b/test/fortran_align_examples/run-compiler-ifort14.sh -new file mode 100644 -index 0000000..34dae77 ---- /dev/null -+++ b/test/fortran_align_examples/run-compiler-ifort14.sh -@@ -0,0 +1,5 @@ -+#!/bin/bash -+#ifort fortran-align-ifort14.f90 -o fortran-align-ifort14.out -+ifort fortran-align-ifort14.f90 -o fortran-align-ifort14.out -align array16byte -+#ifort fortran-align-ifort14.f90 -o fortran-align-ifort14.out -align array32byte -+#ifort fortran-align-ifort14.f90 -o fortran-align-ifort14.out -align array128byte -diff --git a/test/fortran_align_examples/run-compiler-ifort15.sh b/test/fortran_align_examples/run-compiler-ifort15.sh -new file mode 100644 -index 0000000..cd97d0f ---- /dev/null -+++ b/test/fortran_align_examples/run-compiler-ifort15.sh -@@ -0,0 +1,6 @@ -+#!/bin/bash -+#ifort fortran-align-ifort15.f90 -o fortran-align-ifort15.out -+#ifort fortran-align-ifort15.f90 -o fortran-align-ifort15.out -align commons -+ifort fortran-align-ifort15.f90 -o fortran-align-ifort15.out -align dcommons -+#ifort fortran-align-ifort15.f90 -o fortran-align-ifort15.out -align qcommons -+#ifort fortran-align-ifort15.f90 -o fortran-align-ifort15.out -align zcommons -diff --git a/test/fortran_align_examples/run-compiler-ifort16.sh b/test/fortran_align_examples/run-compiler-ifort16.sh -new file mode 100644 -index 0000000..af5441f ---- /dev/null -+++ b/test/fortran_align_examples/run-compiler-ifort16.sh -@@ -0,0 +1,4 @@ -+#!/bin/bash -+#ifort fortran-align-ifort16.f90 -o fortran-align-ifort16.out -+ifort fortran-align-ifort16.f90 -o fortran-align-ifort16.out -align norecords -+#ifort fortran-align-ifort16.f90 -o fortran-align-ifort16.out -align records -diff --git a/test/fortran_align_examples/run-compiler-ifort17.sh b/test/fortran_align_examples/run-compiler-ifort17.sh -new file mode 100644 -index 0000000..945849f ---- /dev/null -+++ b/test/fortran_align_examples/run-compiler-ifort17.sh -@@ -0,0 +1,3 @@ -+#!/bin/bash -+#ifort fortran-align-ifort17.f90 -o fortran-align-ifort17.out -+ifort fortran-align-ifort17.f90 -o fortran-align-ifort17.out -align rec2byte -diff --git a/test/fortran_align_examples/run-compiler-ifort18.sh b/test/fortran_align_examples/run-compiler-ifort18.sh -new file mode 100644 -index 0000000..249de55 ---- /dev/null -+++ b/test/fortran_align_examples/run-compiler-ifort18.sh -@@ -0,0 +1,4 @@ -+#!/bin/bash -+#ifort fortran-align-ifort18.f90 -o fortran-align-ifort18.out -+ifort fortran-align-ifort18.f90 -o fortran-align-ifort18.out -align sequence -+#ifort fortran-align-ifort18.f90 -o fortran-align-ifort18.out -align nosequence -diff --git a/test/fortran_align_examples/run-compiler-ifort19.sh b/test/fortran_align_examples/run-compiler-ifort19.sh -new file mode 100644 -index 0000000..c474e6b ---- /dev/null -+++ b/test/fortran_align_examples/run-compiler-ifort19.sh -@@ -0,0 +1,4 @@ -+#!/bin/bash -+#ifort fortran-align-ifort19.f90 -o fortran-align-ifort19.out -+ifort fortran-align-ifort19.f90 -o fortran-align-ifort19.out -qno-opt-dynamic-align -+#ifort fortran-align-ifort19.f90 -o fortran-align-ifort19.out -qopt-dynamic-align -diff --git a/test/fortran_align_examples/run-compiler-ifort2.sh b/test/fortran_align_examples/run-compiler-ifort2.sh -new file mode 100644 -index 0000000..0ea2714 ---- /dev/null -+++ b/test/fortran_align_examples/run-compiler-ifort2.sh -@@ -0,0 +1,2 @@ -+#!/bin/bash -+ifort fortran-align-ifort2.f90 -o fortran-align-ifort2.out -diff --git a/test/fortran_align_examples/run-compiler-ifort20.sh b/test/fortran_align_examples/run-compiler-ifort20.sh -new file mode 100644 -index 0000000..1aa5d5a ---- /dev/null -+++ b/test/fortran_align_examples/run-compiler-ifort20.sh -@@ -0,0 +1,5 @@ -+#!/bin/bash -+#ifort fortran-align-ifort20.f90 -o fortran-align-ifort20.out -+ifort fortran-align-ifort20.f90 -o fortran-align-ifort20.out -falign-functions=32 -+#ifort fortran-align-ifort20.f90 -o fortran-align-ifort20.out -falign-functions=64 -+#ifort fortran-align-ifort20.f90 -o fortran-align-ifort20.out -fno-align-functions -diff --git a/test/fortran_align_examples/run-compiler-ifort21.sh b/test/fortran_align_examples/run-compiler-ifort21.sh -new file mode 100644 -index 0000000..61e311e ---- /dev/null -+++ b/test/fortran_align_examples/run-compiler-ifort21.sh -@@ -0,0 +1,4 @@ -+#!/bin/bash -+#ifort fortran-align-ifort21.f90 -o fortran-align-ifort21.out -+ifort fortran-align-ifort21.f90 -o fortran-align-ifort21.out -falign-loops=32 -+#ifort fortran-align-ifort21.f90 -o fortran-align-ifort21.out -falign-loops=128 -diff --git a/test/fortran_align_examples/run-compiler-ifort22.sh b/test/fortran_align_examples/run-compiler-ifort22.sh -new file mode 100644 -index 0000000..2e506d9 ---- /dev/null -+++ b/test/fortran_align_examples/run-compiler-ifort22.sh -@@ -0,0 +1,4 @@ -+#!/bin/bash -+#ifort fortran-align-ifort22.f90 -o fortran-align-ifort22.out -+ifort fortran-align-ifort22.f90 -o fortran-align-ifort22.out -mbranches-within-32B-boundaries -+#ifort fortran-align-ifort22.f90 -o fortran-align-ifort22.out -mno-branches-within-32B-boundaries -diff --git a/test/fortran_align_examples/run-compiler-ifort23.sh b/test/fortran_align_examples/run-compiler-ifort23.sh -new file mode 100644 -index 0000000..ce6218f ---- /dev/null -+++ b/test/fortran_align_examples/run-compiler-ifort23.sh -@@ -0,0 +1,4 @@ -+#!/bin/bash -+#ifort fortran-align-ifort23.f90 -o fortran-align-ifort23.out -+ifort fortran-align-ifort23.f90 -o fortran-align-ifort23.out -qopt-dynamic-align -+#ifort fortran-align-ifort23.f90 -o fortran-align-ifort23.out -qno-opt-dynamic-align -diff --git a/test/fortran_align_examples/run-compiler-ifort3.sh b/test/fortran_align_examples/run-compiler-ifort3.sh -new file mode 100644 -index 0000000..6460389 ---- /dev/null -+++ b/test/fortran_align_examples/run-compiler-ifort3.sh -@@ -0,0 +1,2 @@ -+#!/bin/bash -+ifort fortran-align-ifort3.f90 -o fortran-align-ifort3.out -diff --git a/test/fortran_align_examples/run-compiler-ifort4.sh b/test/fortran_align_examples/run-compiler-ifort4.sh -new file mode 100644 -index 0000000..ebd9420 ---- /dev/null -+++ b/test/fortran_align_examples/run-compiler-ifort4.sh -@@ -0,0 +1,2 @@ -+#!/bin/bash -+ifort fortran-align-ifort4.f90 -o fortran-align-ifort4.out -diff --git a/test/fortran_align_examples/run-compiler-ifort5.sh b/test/fortran_align_examples/run-compiler-ifort5.sh -new file mode 100644 -index 0000000..2689ca2 ---- /dev/null -+++ b/test/fortran_align_examples/run-compiler-ifort5.sh -@@ -0,0 +1,2 @@ -+#!/bin/bash -+ifort fortran-align-ifort5.f90 -o fortran-align-ifort5.out -diff --git a/test/fortran_align_examples/run-compiler-ifort6.sh b/test/fortran_align_examples/run-compiler-ifort6.sh -new file mode 100644 -index 0000000..165bac9 ---- /dev/null -+++ b/test/fortran_align_examples/run-compiler-ifort6.sh -@@ -0,0 +1,2 @@ -+#!/bin/bash -+ifort fortran-align-ifort6.f90 -o fortran-align-ifort6.out -diff --git a/test/fortran_align_examples/run-compiler-ifort7.sh b/test/fortran_align_examples/run-compiler-ifort7.sh -new file mode 100644 -index 0000000..ec0fa01 ---- /dev/null -+++ b/test/fortran_align_examples/run-compiler-ifort7.sh -@@ -0,0 +1,2 @@ -+#!/bin/bash -+ifort fortran-align-ifort7.f90 -o fortran-align-ifort7.out -diff --git a/test/fortran_align_examples/run-compiler-ifort8.sh b/test/fortran_align_examples/run-compiler-ifort8.sh -new file mode 100644 -index 0000000..da6db13 ---- /dev/null -+++ b/test/fortran_align_examples/run-compiler-ifort8.sh -@@ -0,0 +1,2 @@ -+#!/bin/bash -+ifort fortran-align-ifort8.f90 -o fortran-align-ifort8.out -diff --git a/test/fortran_align_examples/run-compiler-ifort9.sh b/test/fortran_align_examples/run-compiler-ifort9.sh -new file mode 100644 -index 0000000..53a6626 ---- /dev/null -+++ b/test/fortran_align_examples/run-compiler-ifort9.sh -@@ -0,0 +1,2 @@ -+#!/bin/bash -+ifort fortran-align-ifort9.f90 -o fortran-align-ifort9.out --- -2.37.1 (Apple Git-137.1) - diff --git a/18-add-test-cases-for-attribute-declarations-and-specifications-3.patch b/18-add-test-cases-for-attribute-declarations-and-specifications-3.patch deleted file mode 100644 index 9b141a1bf2a927c09fc8839ed4248076221d36c6..0000000000000000000000000000000000000000 --- a/18-add-test-cases-for-attribute-declarations-and-specifications-3.patch +++ /dev/null @@ -1,349 +0,0 @@ -commit 694dda91063d30ded6d09bf3d51074c5f9c482f3 -Author: wzw -Date: Mon Jan 23 13:50:24 2023 +0800 - - [flang] Add test cases for attribute declarations and specifications 3 - Add test cases for attribute declarations and specifications 3 - -diff --git a/test/Semantics/0856_C863.f90 b/test/Semantics/0856_C863.f90 -new file mode 100644 -index 0000000..3c6b318 ---- /dev/null -+++ b/test/Semantics/0856_C863.f90 -@@ -0,0 +1,10 @@ -+! RUN: %python %S/test_errors.py %s %flang_fc1 -+! Test C863: An entity with the VALUE attribute shall be a dummy data object. -+! It shall not be an assumed-size array, a coarray, or a variable with a coarray -+! ultimate component. -+ -+subroutine test(x) -+ integer, value :: x -+ ! ERROR: VALUE attribute may apply only to a dummy argument -+ integer, value :: y -+end subroutine test -diff --git a/test/Semantics/0857_C864.f90 b/test/Semantics/0857_C864.f90 -new file mode 100644 -index 0000000..e65cb01 ---- /dev/null -+++ b/test/Semantics/0857_C864.f90 -@@ -0,0 +1,16 @@ -+! RUN: %python %S/test_errors.py %s %flang_fc1 -+! Test C864: An entity with the VALUE attribute shall not have the ALLOCATABLE, -+! INTENT (INOUT), INTENT (OUT), POINTER, or VOLATILE attributes. -+ -+subroutine test(a, b, c, d, e) -+ ! ERROR: VALUE attribute may not apply to an ALLOCATABLE -+ integer, value, allocatable :: a -+ ! ERROR: VALUE attribute may not apply to an INTENT(IN OUT) argument -+ integer, value, intent(inout) :: b -+ ! ERROR: VALUE attribute may not apply to an INTENT(OUT) argument -+ integer, value, intent(out) :: c -+ ! ERROR: VALUE attribute may not apply to a POINTER -+ integer, value, pointer :: d -+ ! ERROR: VALUE attribute may not apply to a VOLATILE -+ integer, value, volatile :: e -+end subroutine test -diff --git a/test/Semantics/0858_C865.f90 b/test/Semantics/0858_C865.f90 -new file mode 100644 -index 0000000..317d44a ---- /dev/null -+++ b/test/Semantics/0858_C865.f90 -@@ -0,0 +1,19 @@ -+! RUN: %python %S/test_errors.py %s %flang_fc1 -+! Test C865: A dummy argument of a procedure with the BIND attribute shall not -+! have both the OPTIONAL and VALUE attributes. -+ -+program main -+ use , intrinsic :: iso_c_binding, only : c_char, c_int, c_null_char -+ interface -+ integer function test(a, b) bind(C, name="test") -+ import :: c_char, c_int -+ implicit none -+ ! ERROR: Function cannot have both an explicit type prefix and a RESULT suffix -+ integer :: test = 1 -+ ! ERROR: VALUE attribute may not apply to an assumed-size array -+ ! ERROR: VALUE attribute may not apply to an array in a BIND(C) procedure -+ character(kind=c_char,len=1), value :: a(*) -+ character(kind=c_char,len=1), optional :: b(*) -+ end function test -+ end interface -+end program main -diff --git a/test/Semantics/0859_C866.f90 b/test/Semantics/0859_C866.f90 -new file mode 100644 -index 0000000..b9832fe ---- /dev/null -+++ b/test/Semantics/0859_C866.f90 -@@ -0,0 +1,8 @@ -+! RUN: %python %S/test_errors.py %s %flang_fc1 -+! Test C866: An entity with the VOLATILE attribute shall be a variable -+! that is not an INTENT (IN) dummy argument. -+ -+subroutine test(a) -+ ! ERROR: VOLATILE attribute may not apply to an INTENT(IN) argument -+ integer, volatile, intent(in) :: a -+end subroutine test -diff --git a/test/Semantics/0860_C867.f90 b/test/Semantics/0860_C867.f90 -new file mode 100644 -index 0000000..8da6de4 ---- /dev/null -+++ b/test/Semantics/0860_C867.f90 -@@ -0,0 +1,14 @@ -+! RUN: %python %S/test_errors.py %s %flang_fc1 -+! Test C867: The VOLATILE attribute shall not be specified for a coarray, or a -+! variable with a coarray ultimate component, that is accessed by use (14.2.2) -+! or host (19.5.1.4) association. -+ -+module m -+ ! ERROR: VOLATILE attribute may not apply to a coarray accessed by USE or host association -+ character(len = 20) :: a[*] -+end module m -+ -+program main -+ use m -+ volatile :: a -+end program main -diff --git a/test/Semantics/0861_C869.f90 b/test/Semantics/0861_C869.f90 -new file mode 100644 -index 0000000..651703b ---- /dev/null -+++ b/test/Semantics/0861_C869.f90 -@@ -0,0 +1,15 @@ -+! RUN: %python %S/test_errors.py %s %flang_fc1 -+! Test C869: (R827) An access-stmt shall appear only in the specification-part -+! of a module. Only one accessibility statement with an omitted access-id-list -+! is permitted in the specification-part of a module. -+ -+module m -+ private :: a -+end module m -+ -+ -+program main -+ use m -+ ! ERROR: PRIVATE statement may only appear in the specification part of a module -+ private :: x -+end program main -diff --git a/test/Semantics/0862_C872.f90 b/test/Semantics/0862_C872.f90 -new file mode 100644 -index 0000000..51fbb19 ---- /dev/null -+++ b/test/Semantics/0862_C872.f90 -@@ -0,0 +1,14 @@ -+! RUN: %python %S/test_errors.py %s %flang_fc1 -+! Test C872: The name of a module shall appear at most once in all of the -+! access-stmts in a module. -+ -+module m1 -+ integer :: x -+end module m1 -+ -+module m2 -+ use m1 -+ private :: m1 -+ ! ERROR: The accessibility of 'm1' has already been specified as PRIVATE -+ public :: m1 -+end module m2 -diff --git a/test/Semantics/0863_C873.f90 b/test/Semantics/0863_C873.f90 -new file mode 100644 -index 0000000..55e162b ---- /dev/null -+++ b/test/Semantics/0863_C873.f90 -@@ -0,0 +1,12 @@ -+! RUN: %python %S/test_errors.py %s %flang_fc1 -+! Test C873: (R832) If the language-binding-spec has a NAME= specifier, the -+! bind-entity-list shall consist of a single bind-entity. -+ -+module test_type -+ type, bind(c) :: a -+ integer(4) :: j = -1 -+ end type a -+ ! ERROR: Two entities have the same BIND(C) name 'test' -+ type(a), bind(c, name="test") :: x, y -+end module test_type -+ -diff --git a/test/Semantics/0864_C874.f90 b/test/Semantics/0864_C874.f90 -new file mode 100644 -index 0000000..18e5498 ---- /dev/null -+++ b/test/Semantics/0864_C874.f90 -@@ -0,0 +1,8 @@ -+! RUN: %python %S/test_errors.py %s %flang_fc1 -+! Test C874: A data-stmt-object or data-i-do-object shall not be a coindexed variable. -+ -+subroutine test() -+ character(len=10), save :: a[*] -+ ! ERROR: Data object must not be a coindexed variable -+ data a[1] / 'aaaaa' / -+end subroutine test -diff --git a/test/Semantics/0865_C875.f90 b/test/Semantics/0865_C875.f90 -new file mode 100644 -index 0000000..f983ebb ---- /dev/null -+++ b/test/Semantics/0865_C875.f90 -@@ -0,0 +1,11 @@ -+! RUN: %python %S/test_errors.py %s %flang_fc1 -+! Test C875: (R839) A data-stmt-object that is a variable shall be a -+! designator. Each subscript, section subscript, substring starting point, and -+! substring ending point in the variable shall be a constant expression. -+ -+program main -+ integer, dimension(0:9) :: a -+ integer :: x = 5 -+ ! ERROR: Data object must have constant subscripts -+ data a(0:x) / 5 * 0 / -+end program main -diff --git a/test/Semantics/0866_C882.f90 b/test/Semantics/0866_C882.f90 -new file mode 100644 -index 0000000..344e28e ---- /dev/null -+++ b/test/Semantics/0866_C882.f90 -@@ -0,0 +1,9 @@ -+! RUN: %python %S/test_errors.py %s %flang_fc1 -+! Test C882: (R844) The data-stmt-repeat shall be positive or zero. If the -+! data-stmt-repeat is a named constant, it shall have been defined previously. -+ -+! ERROR: Could not parse 0870_C882.f90 -+program main -+ integer, dimension(5) :: a -+ data a / -5 * 3 / -+end program main -diff --git a/test/Semantics/0867_C883.f90 b/test/Semantics/0867_C883.f90 -new file mode 100644 -index 0000000..0d20ede ---- /dev/null -+++ b/test/Semantics/0867_C883.f90 -@@ -0,0 +1,12 @@ -+! RUN: %python %S/test_errors.py %s %flang_fc1 -+! Test C883: (R845) If a DATA statement constant value is a named constant or a -+! structure constructor, the named constant or derived type shall have been -+! defined previously. -+ -+program main -+ integer, dimension(3) :: x, y -+ integer, parameter :: a = 10 -+ data x / 3 * a / -+ ! ERROR: DATA statement value 'int(b,kind=4)' for 'y(1_8)' is not a constant -+ data y / 3 * b / -+end program main -diff --git a/test/Semantics/0868_C884.f90 b/test/Semantics/0868_C884.f90 -new file mode 100644 -index 0000000..9a4a5a5 ---- /dev/null -+++ b/test/Semantics/0868_C884.f90 -@@ -0,0 +1,17 @@ -+! RUN: %python %S/test_errors.py %s %flang_fc1 -+! Test C884: (R845) If a data-stmt-constant is a structure-constructor, it -+! shall be a constant expression. -+ -+program main -+ type t -+ integer :: a, b -+ end type t -+ -+ type(t) :: x, y -+ integer, parameter :: m = 10 -+ integer :: n = 20 -+ -+ ! ERROR: DATA statement value 't(a=n,b=n)' for 'x' is not a constant -+ data x / t(a=n, b=n) / -+ data y / t(a=m, b=m) / -+end program main -diff --git a/test/Semantics/0869_C885.f90 b/test/Semantics/0869_C885.f90 -new file mode 100644 -index 0000000..ff6e5e7 ---- /dev/null -+++ b/test/Semantics/0869_C885.f90 -@@ -0,0 +1,17 @@ -+! RUN: %python %S/test_errors.py %s %flang_fc1 -+! Test C885: (R846) int-constant-subobject shall be of type integer. -+ -+program main -+ type t -+ integer :: a -+ character :: b -+ end type t -+ -+ type(t), parameter :: m = t(a=5, b='a') -+ integer, dimension(5) :: x, y -+ -+ data x / m % a * 5 / -+ ! ERROR: Must have INTEGER type, but is CHARACTER(KIND=1,LEN=1_8) -+ data y / m % b * 5 / -+ -+end program main -diff --git a/test/Semantics/0870_C886.f90 b/test/Semantics/0870_C886.f90 -new file mode 100644 -index 0000000..2508543 ---- /dev/null -+++ b/test/Semantics/0870_C886.f90 -@@ -0,0 +1,17 @@ -+! RUN: %python %S/test_errors.py %s %flang_fc1 -+! Test C886: (R847) constant-subobject shall be a subobject of a constant. -+ -+program main -+ type t -+ integer :: a -+ end type t -+ -+ type(t) :: m = t(a=5) -+ type(t), parameter :: n = t(a = 5) -+ integer, dimension(5) :: x, y -+ -+ ! ERROR: DATA statement value 'm%a' for 'x(1_8)' is not a constant -+ data x / 5 * m % a / -+ data y / 5 * n % a / -+ -+end program main -diff --git a/test/Semantics/0871_C887.f90 b/test/Semantics/0871_C887.f90 -new file mode 100644 -index 0000000..6011dea ---- /dev/null -+++ b/test/Semantics/0871_C887.f90 -@@ -0,0 +1,16 @@ -+! RUN: %python %S/test_errors.py %s %flang_fc1 -+! Test C887: (R847) Any subscript, substring starting point, or substring ending -+! point shall be a constant expression. -+ -+program main -+ character(len=10), parameter :: a = 'abcdefghik' -+ character(len=5) :: b, c, d -+ integer :: x1 = 3, y1 = 7 -+ integer, parameter :: x2 = 3, y2 = 7 -+ -+ ! ERROR: DATA statement value '%SET_LENGTH(a(int(x1,kind=8):int(y1,kind=8)),5_8)' for 'b' is not a constant -+ data b / a(x1 : y1) / -+ data c / a(x2 : y2) / -+ data d / a(3 : 7) / -+ -+end program main -diff --git a/test/Semantics/result-08.md b/test/Semantics/result-08.md -index 33c5faf..7313234 100644 ---- a/test/Semantics/result-08.md -+++ b/test/Semantics/result-08.md -@@ -49,9 +49,25 @@ - | C852 | ERROR | ERROR | ERROR | - | C854 | ERROR | ERROR | ERROR | - | C855 | --- | --- | --- | --| C856 | OK | ERROR | ERROR | -+| C856 | ERROR | ERROR | ERROR | - | C857 | ERROR (OK in some cases) | ERROR | ERROR | - | C858 | OK | ERROR | OK | - | C860 | ERROR | ERROR | ERROR | - | C861 | ERROR | ERROR | ERROR | - | C862 | ERROR | ERROR | ERROR | -+| C863 | ERROR | ERROR | ERROR | -+| C864 | ERROR | ERROR | ERROR | -+| C865 | ERROR | ERROR | ERROR | -+| C866 | ERROR | ERROR | ERROR | -+| C867 | ERROR | OK | ERROR | -+| C869 | ERROR | ERROR | ERROR | -+| C872 | ERROR | ERROR | ERROR | -+| C873 | ERROR | ERROR | ERROR | -+| C874 | ERROR | ERROR | ERROR | -+| C875 | ERROR | ERROR | ERROR | -+| C882 | ERROR | ERROR | ERROR | -+| C883 | ERROR | ERROR | ERROR | -+| C884 | ERROR | ERROR | ERROR | -+| C885 | ERROR | ERROR | ERROR | -+| C886 | ERROR | ERROR | ERROR | -+| C887 | ERROR | ERROR | ERROR | diff --git a/19-add-test-cases-for-types-3.patch b/19-add-test-cases-for-types-3.patch deleted file mode 100644 index 748d070b6e6cdcc09a4b521064384480098b9d9b..0000000000000000000000000000000000000000 --- a/19-add-test-cases-for-types-3.patch +++ /dev/null @@ -1,501 +0,0 @@ -commit c4239f85e62267499ac03d21d55b47b8a77b5689 -Author: MinchaoLiang -Date: Fri Jan 20 12:28:42 2023 +0800 - - add test cases for types 3 - -diff --git a/test/Semantics/0759_C764.f90 b/test/Semantics/0759_C764.f90 -new file mode 100644 -index 0000000..0d22270 ---- /dev/null -+++ b/test/Semantics/0759_C764.f90 -@@ -0,0 +1,14 @@ -+! Test C764:If initial-data-target appears in a component-initialization in a -+! component-decl, component-name shall be data-pointer-initialization compatible with it. -+ -+module m -+implicit none -+ type t -+ ! ERROR: No explicit type declared for 'avc' -+ integer,pointer :: k=> avc -+ end type t -+end module m -+program main -+use m -+implicit none -+end -\ No newline at end of file -diff --git a/test/Semantics/0760_C765_target.f90 b/test/Semantics/0760_C765_target.f90 -new file mode 100644 -index 0000000..71dcb4b ---- /dev/null -+++ b/test/Semantics/0760_C765_target.f90 -@@ -0,0 +1,16 @@ -+! Test C765:A designator that is an initial-data-target shall designate a nonallocatable, noncoindexed -+! variable that has the TARGET and SAVE attributes and does not have a vector subscript. Every subscript, -+! section subscript, substring starting point, and substring ending point in designator shall be a constant expression. -+ -+module m -+implicit none -+ ! ERROR: An initial data target may not be a reference to an object 'a' that lacks the TARGET attribute -+ real :: a -+ type t -+ real,pointer :: b=>a -+ end type t -+end module m -+program main -+use m -+implicit none -+end -\ No newline at end of file -diff --git a/test/Semantics/0761_C765_allocatable.f90 b/test/Semantics/0761_C765_allocatable.f90 -new file mode 100644 -index 0000000..04650e2 ---- /dev/null -+++ b/test/Semantics/0761_C765_allocatable.f90 -@@ -0,0 +1,16 @@ -+! Test C765:A designator that is an initial-data-target shall designate a nonallocatable, noncoindexed -+! variable that has the TARGET and SAVE attributes and does not have a vector subscript. Every subscript, -+! section subscript, substring starting point, and substring ending point in designator shall be a constant expression. -+ -+module m -+implicit none -+ ! ERROR: An initial data target may not be a reference to an ALLOCATABLE 'a' -+ real,target,save,allocatable :: a -+ type t -+ real,pointer :: b=>a -+ end type t -+end module m -+program main -+use m -+implicit none -+end -\ No newline at end of file -diff --git a/test/Semantics/0763_C768.f90 b/test/Semantics/0763_C768.f90 -new file mode 100644 -index 0000000..5628e63 ---- /dev/null -+++ b/test/Semantics/0763_C768.f90 -@@ -0,0 +1,21 @@ -+! Test C768:If => procedure-name appears in a type-bound-proc-decl, -+!the double-colon separator shall appear. -+ -+module m -+implicit none -+ type v -+ real :: k = 0., n = 0. -+ contains -+ !Semantic check result: OK. -+ procedure g => f -+ end type v -+ contains -+ real function f( this ) -+ class(v), intent(in) :: this -+ f = this%k+this%n -+ end function f -+end module m -+program main -+use m -+implicit none -+end -\ No newline at end of file -diff --git a/test/Semantics/0764_C769.f90 b/test/Semantics/0764_C769.f90 -new file mode 100644 -index 0000000..8cc77b5 ---- /dev/null -+++ b/test/Semantics/0764_C769.f90 -@@ -0,0 +1,18 @@ -+! Test C769:The procedure-name shall be the name of an accessible module procedure or an -+! external procedure that has an explicit interface. -+ -+module m -+implicit none -+ type v -+ real :: k = 0., n = 0. -+ contains -+ !ERROR:The binding of 'g' ('p') must be either an accessible module procedure or an external procedure with an explicit interface -+ !ERROR:No explicit type declared for 'p' -+ procedure:: g => p -+ end type v -+ contains -+end module m -+program main -+use m -+implicit none -+end -\ No newline at end of file -diff --git a/test/Semantics/0765_C770.f90 b/test/Semantics/0765_C770.f90 -new file mode 100644 -index 0000000..78ce8d0 ---- /dev/null -+++ b/test/Semantics/0765_C770.f90 -@@ -0,0 +1,21 @@ -+! Test C770:A binding-name in a type-bound-proc-decl in a derived type definition shall not be the -+! same as any other binding-name within that derived type definition. -+ -+module m -+implicit none -+ type v -+ real :: k = 0., n = 0. -+ contains -+ !ERROR:Type parameter, component, or procedure binding 'k' already defined in this type -+ procedure:: k => f -+ end type v -+ contains -+ real function f( this ) -+ class(v), intent(in) :: this -+ f = this%k+this%n -+ end function f -+end module m -+program main -+use m -+implicit none -+end -\ No newline at end of file -diff --git a/test/Semantics/0766_C771.f90 b/test/Semantics/0766_C771.f90 -new file mode 100644 -index 0000000..102a349 ---- /dev/null -+++ b/test/Semantics/0766_C771.f90 -@@ -0,0 +1,29 @@ -+! Test C771:Within the specification-part of a module, each type-bound-generic-stmt shall specify, -+! either implicitly or explicitly, the same accessibility as every other type-bound-generic-stmt with -+! that generic-spec in the same derived type. -+ -+module m -+implicit none -+ type v -+ real :: k = 0., n = 0. -+ contains -+ procedure,pass :: f3 -+ procedure,pass :: f2 -+ !ERROR:'operator(*)' does not have the same accessibility as its previous declaration -+ generic,public:: operator(*) => f2 -+ generic,private:: operator(*) => f3 -+ end type v -+ contains -+ real function f3(a,b) -+ class(v), intent(in) :: a -+ class(v), intent(in) :: b -+ end function f3 -+ real function f2(a,b) -+ class(v), intent(in) :: a -+ class(v), intent(in) :: b -+ end function f2 -+end module m -+program main -+use m -+implicit none -+end -\ No newline at end of file -diff --git a/test/Semantics/0768_C773.f90 b/test/Semantics/0768_C773.f90 -new file mode 100644 -index 0000000..43f5ec8 ---- /dev/null -+++ b/test/Semantics/0768_C773.f90 -@@ -0,0 +1,29 @@ -+! Test C773:A binding-name in a type-bound GENERIC statement shall not specify a specific binding that was -+! inherited or specified previously for the same generic identifier in that derived type definition. -+ -+module m -+implicit none -+ type v -+ real :: k = 0., n = 0. -+ contains -+ procedure,pass :: f2 -+ procedure,pass :: f -+ generic:: assignment(=) => f -+ !ERROR:Binding name 'f' was already specified for generic 'assignment(=)' -+ generic:: assignment(=) => f -+ generic:: operator(*) => f2 -+ end type v -+ contains -+ subroutine f(a,b) -+ class(v), intent(out) :: a -+ class(v), intent(in) :: b -+ end subroutine f -+ real function f2(a,b) -+ class(v), intent(in) :: a -+ class(v), intent(in) :: b -+ end function f2 -+end module m -+program main -+use m -+implicit none -+end -\ No newline at end of file -diff --git a/test/Semantics/0773_C778_nopass.f90 b/test/Semantics/0773_C778_nopass.f90 -new file mode 100644 -index 0000000..709540b ---- /dev/null -+++ b/test/Semantics/0773_C778_nopass.f90 -@@ -0,0 +1,20 @@ -+! Test C778:The same binding-attr shall not appear more than once in a given binding-attr-list. -+ -+module m -+implicit none -+ type v -+ real :: k = 0., n = 0. -+ contains -+ !WARNING:Attribute 'NOPASS' cannot be used more than once -+ procedure,nopass,nopass:: g => f -+ end type v -+ contains -+ real function f( this ) -+ class(v), intent(in) :: this -+ f = this%k+this%n -+ end function f -+end module m -+program main -+use m -+implicit none -+end -\ No newline at end of file -diff --git a/test/Semantics/0774_C778_non_overridable.f90 b/test/Semantics/0774_C778_non_overridable.f90 -new file mode 100644 -index 0000000..0499814 ---- /dev/null -+++ b/test/Semantics/0774_C778_non_overridable.f90 -@@ -0,0 +1,20 @@ -+! Test C778:The same binding-attr shall not appear more than once in a given binding-attr-list. -+ -+module m -+implicit none -+ type v -+ real :: k = 0., n = 0. -+ contains -+ !WARNING:Attribute 'NON_OVERRIDABLE' cannot be used more than once -+ procedure,non_overridable,non_overridable:: g => f -+ end type v -+ contains -+ real function f( this ) -+ class(v), intent(in) :: this -+ f = this%k+this%n -+ end function f -+end module m -+program main -+use m -+implicit none -+end -\ No newline at end of file -diff --git a/test/Semantics/0775_C778_public.f90 b/test/Semantics/0775_C778_public.f90 -new file mode 100644 -index 0000000..e21c53f ---- /dev/null -+++ b/test/Semantics/0775_C778_public.f90 -@@ -0,0 +1,20 @@ -+! Test C778:The same binding-attr shall not appear more than once in a given binding-attr-list. -+ -+module m -+implicit none -+ type v -+ real :: k = 0., n = 0. -+ contains -+ !WARNING:Attribute 'PUBLIC' cannot be used more than once -+ procedure,public,public:: g => f -+ end type v -+ contains -+ real function f( this ) -+ class(v), intent(in) :: this -+ f = this%k+this%n -+ end function f -+end module m -+program main -+use m -+implicit none -+end -\ No newline at end of file -diff --git a/test/Semantics/0776_C778_private.f90 b/test/Semantics/0776_C778_private.f90 -new file mode 100644 -index 0000000..9b15419 ---- /dev/null -+++ b/test/Semantics/0776_C778_private.f90 -@@ -0,0 +1,20 @@ -+! Test C778:The same binding-attr shall not appear more than once in a given binding-attr-list. -+ -+module m -+implicit none -+ type v -+ real :: k = 0., n = 0. -+ contains -+ !WARNING:Attribute 'PRIVATE' cannot be used more than once -+ procedure,private,private:: g => f -+ end type v -+ contains -+ real function f( this ) -+ class(v), intent(in) :: this -+ f = this%k+this%n -+ end function f -+end module m -+program main -+use m -+implicit none -+end -\ No newline at end of file -diff --git a/test/Semantics/0777_C778_pass.f90 b/test/Semantics/0777_C778_pass.f90 -new file mode 100644 -index 0000000..86f28ee ---- /dev/null -+++ b/test/Semantics/0777_C778_pass.f90 -@@ -0,0 +1,20 @@ -+! Test C778:The same binding-attr shall not appear more than once in a given binding-attr-list. -+ -+module m -+implicit none -+ type v -+ real :: k = 0., n = 0. -+ contains -+ !WARNING:Attribute 'PASS' cannot be used more than once -+ procedure,pass(p),pass(p):: g => f -+ end type v -+ contains -+ real function f( this,p ) -+ class(v), intent(in) :: this,p -+ f = this%k+this%n -+ end function f -+end module m -+program main -+use m -+implicit none -+end -\ No newline at end of file -diff --git a/test/Semantics/0778_C779.f90 b/test/Semantics/0778_C779.f90 -new file mode 100644 -index 0000000..da3ec22 ---- /dev/null -+++ b/test/Semantics/0778_C779.f90 -@@ -0,0 +1,24 @@ -+! Test C779:If the interface of the binding has no dummy argument of the type being defined, NOPASS shall appear. -+ -+module m -+implicit none -+ type v -+ integer:: m(1:2,1:2) -+ contains -+ !ERROR:Passed-object dummy argument 't' of procedure 'g' must be of type 'v' but is 'INTEGER(4)' -+ procedure:: g => load -+ end type v -+ contains -+ subroutine load ( t, U ) -+ integer,intent(out) :: t -+ type(v), intent(out), allocatable :: U ( : ) -+ t = 2 -+ allocate(U(t)) -+ U(1)% m = reshape ( [ 0, 1, 1, 0 ], [ 2, 2 ] ) -+ U (2)%m = reshape ( [ 0, 1, 1, 0 ], [ 2, 2 ] ) -+ end subroutine load -+end module m -+program main -+use m -+implicit none -+end -\ No newline at end of file -diff --git a/test/Semantics/0779_C780.f90 b/test/Semantics/0779_C780.f90 -new file mode 100644 -index 0000000..aae5307 ---- /dev/null -+++ b/test/Semantics/0779_C780.f90 -@@ -0,0 +1,20 @@ -+! Test C780: If PASS (arg-name) appears, the interface of the binding shall have a dummy argument named arg-name. -+ -+module m -+implicit none -+ type v -+ real :: k = 0., n = 0. -+ contains -+ !ERROR:'j' is not a dummy argument of procedure interface 'f' -+ procedure,pass(j):: g => f -+ end type v -+ contains -+ real function f( this,p ) -+ class(v), intent(in) :: this,p -+ f = this%k+this%n -+ end function f -+end module m -+program main -+use m -+implicit none -+end -\ No newline at end of file -diff --git a/test/Semantics/0780_C781.f90 b/test/Semantics/0780_C781.f90 -new file mode 100644 -index 0000000..00c00fd ---- /dev/null -+++ b/test/Semantics/0780_C781.f90 -@@ -0,0 +1,20 @@ -+! Test C781: PASS and NOPASS shall not both appear in the same binding-attr-list. -+ -+module m -+implicit none -+ type v -+ real :: k = 0., n = 0. -+ contains -+ !ERROR:Attributes 'PASS' and 'NOPASS' conflict with each other -+ procedure,nopass,pass:: g => f -+ end type v -+ contains -+ real function f( this ) -+ class(v), intent(in) :: this -+ f = this%k+this%n -+ end function f -+end module m -+program main -+use m -+implicit none -+end -\ No newline at end of file -diff --git a/test/Semantics/0781_C782.f90 b/test/Semantics/0781_C782.f90 -new file mode 100644 -index 0000000..60d56e3 ---- /dev/null -+++ b/test/Semantics/0781_C782.f90 -@@ -0,0 +1,20 @@ -+! Test C782:NON_OVERRIDABLE and DEFERRED shall not both appear in the same binding-attr-list. -+ -+module m -+implicit none -+ type v -+ real :: k = 0., n = 0. -+ contains -+ !ERROR:DEFERRED is only allowed when an interface-name is provided -+ procedure,non_overridable,deferred:: g => f -+ end type v -+ contains -+ real function f( this ) -+ class(v), intent(in) :: this -+ f = this%k+this%n -+ end function f -+end module m -+program main -+use m -+implicit none -+end -\ No newline at end of file -diff --git a/test/Semantics/result-08.md b/test/Semantics/result-19.md -new file mode 100644 -index 0000000..0d1e8cf ---- /dev/null -+++ b/test/Semantics/result-19.md -@@ -0,0 +1,22 @@ -+| Constraint | flang-new | gfortran | ifort | -+| :------------------: | :-------: | :------: | :---: | -+| C764 | ERROR | ERROR | ERROR | -+| C765 target | ERROR | ERROR | ERROR | -+| C765 allocatable | ERROR | ERROR | ERROR | -+| C768 | OK | ERROR | OK | -+| C769 | ERROR | ERROR | ERROR | -+| C770 | ERROR | ERROR | ERROR | -+| C771 | ERROR | ERROR | ERROR | -+| C773 | ERROR | ERROR | ERROR | -+| C775 | ERROR | ERROR | ERROR | -+| C776 | ERROR | ERROR | ERROR | -+| C777 | ERROR | ERROR | ERROR | -+| C778 nopass | WARNING | ERROR | ERROR | -+| C778 non_overridable | WARNING | ERROR | ERROR | -+| C778 public | WARNING | ERROR | ERROR | -+| C778 private | WARNING | ERROR | ERROR | -+| C778 pass | WARNING | ERROR | ERROR | -+| C779 | ERROR | ERROR | ERROR | -+| C780 | ERROR | ERROR | ERROR | -+| C781 | ERROR | ERROR | ERROR | -+| C782 | ERROR | ERROR | ERROR | diff --git a/2-inline_f90_str_copy_klen.patch b/2-inline_f90_str_copy_klen.patch deleted file mode 100644 index 3f59568a03aa1b87af218a7917939db72ae7ead8..0000000000000000000000000000000000000000 --- a/2-inline_f90_str_copy_klen.patch +++ /dev/null @@ -1,677 +0,0 @@ -commit ba10b360a6960b0f9e1157502f33c68543e73bcb -Author: wzw <51215902151@stu.ecnu.edu.cn> -Date: Thu Sep 8 11:07:41 2022 +0800 - - [flang2] Add inline_f90_str_copy_klen to framework for inline f90-prefix - runtime call - - This patch adds a function named inline_f90_str_copy_klen to the - framework for inlining f90-prefix runtime call. This function is - an inline implementation of f90_str_copy_klen, which is for - copying and concatenation of several strings. - -diff --git a/docs/inline_f90_str_copy_klen.txt b/docs/inline_f90_str_copy_klen.txt -new file mode 100644 -index 00000000..d68a564d ---- /dev/null -+++ b/docs/inline_f90_str_copy_klen.txt -@@ -0,0 +1,73 @@ -+------------------------------ -+Introduction: -+This functionality is implemented in a frame which allows flang to inline f90-prefix runtime call before writing out the generated IR. This implementation is the inlining of the "f90_str_copy_klen" function which is used to concatenate and copy several strings to the target string. -+ -+------------------------------ -+Implementation: -+This function first traverses the generated IR instructions in flang2. If the "I_CALL" instruction is found, the called function is judged to confirm whether it is a function that can be inlined like "f90_str_copy_klen". -+When implementing the "inline_f90_str_copy_klen" function, we will use the pointer to record the address, length and character index of the target string and the input string. For each input string, if the index of the target string is less than the length value, the characters in the input string are copied to the target string in order until the current input string has been completely copied or the index of the target string is equal to length value. According to the above method, all the input strings are traversed in order. If the index of the target string is still less than the length value after the traversal is completed, the remaining characters are supplemented with spaces. We will generate the IR instruction corresponding to this method to replace the "f90_str_copy_klen" and "I_CALL" instructions to achieve inlining. -+ -+------------------------------ -+Correctness test: -+Our code tests the implementation of the function in ten cases based on the number of input strings and the length of each string: -+ 1. a = b -+ 1.1 len(a) < len(b) -+ 1.2 len(a) = len(b) -+ 1.3 len(a) > len(b) -+ 2. a = b // c // d -+ 2.1 len(a) < len(b) -+ 2.2 len(a) = len(b) -+ 2.3 len(b) < len(a) < len(b) + len(c) -+ 2.4 len(a) = len(b) + len(c) -+ 2.5 len(b) + len(c) < len(a) < len(b) + len(c) + len(d) -+ 2.6 len(a) = len(b) + len(c) + len(d) -+ 2.7 len(a) > len(b) + len(c) + len(d) -+The tested string also contains some special characters whose ASCII code is less than 32. And our tests have shown that this function can be used normally. -+ -+------------------------------ -+Performance test: -+To demonstrate the degree of optimization obtained by inlining the "f90_str_copy_klen" function, we repeated "d=a//b//c" in the function 100 million times. According to the statistical results, the running time of this function before inlining takes about 7 seconds, and after inlining optimization, the running time of this function only takes about 0.8 seconds. -+ -+! Performance test case: -+main.f90: -+program main -+ integer :: i -+ character(20) :: a, b, c, d -+ a = "aaaaaaaaaaaaaaa" -+ b = "aaaaaaaaaaaaaaa" -+ c = "aaaaaaaaaaaaaaa" -+ do i = 1, 100000000 -+ call test(a, b, c, d, 20) -+ enddo -+end -+ -+test.f90: -+subroutine test(a, b, c, d, n) -+ integer :: n -+ character(n) :: a, b, c, d -+ d = a // b // c -+end subroutine -+ -+! How to test: -+Run time before inline: -+$ flang main.f90 -c -+$ flang test.f90 -O3 -c -+$ flang test.o main.o -+$ time ./a.out -+ -+The following is the result without inline: -+real 0m7.936s -+user 0m7.880s -+sys 0m0.004s -+ -+Run time after inline: -+$ flang main.f90 -c -+$ flang test.f90 -O3 -c -Mx,218,0x1 -+$ flang test.o main.o -+$ time ./a.out -+ -+The following is the result after inline: -+real 0m0.807s -+user 0m0.807s -+sys 0m0.000s -+ -diff --git a/test/f90_correct/inc/inline_f90_str_copy_klen.mk b/test/f90_correct/inc/inline_f90_str_copy_klen.mk -new file mode 100644 -index 00000000..a2f1f193 ---- /dev/null -+++ b/test/f90_correct/inc/inline_f90_str_copy_klen.mk -@@ -0,0 +1,22 @@ -+# -+# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -+# See https://llvm.org/LICENSE.txt for license information. -+# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -+# -+ -+$(TEST): run -+ -+ -+build: $(SRC)/$(TEST).f90 -+ -$(RM) $(TEST).$(EXESUFFIX) core *.d *.mod FOR*.DAT FTN* ftn* fort.* -+ @echo ------------------------------------ building test $@ -+ -$(FC) -c $(FFLAGS) $(LDFLAGS) $(SRC)/$(TEST).f90 -Mx,218,0x1 -o $(TEST).$(OBJX) -+ -$(FC) $(FFLAGS) $(LDFLAGS) $(TEST).$(OBJX) $(LIBS) -o $(TEST).$(EXESUFFIX) -+ -+ -+run: -+ @echo ------------------------------------ executing test $(TEST) -+ $(TEST).$(EXESUFFIX) -+ -+verify: ; -+ -diff --git a/test/f90_correct/inc/inline_f90_str_copy_klen_2.mk b/test/f90_correct/inc/inline_f90_str_copy_klen_2.mk -new file mode 100644 -index 00000000..a2f1f193 ---- /dev/null -+++ b/test/f90_correct/inc/inline_f90_str_copy_klen_2.mk -@@ -0,0 +1,22 @@ -+# -+# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -+# See https://llvm.org/LICENSE.txt for license information. -+# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -+# -+ -+$(TEST): run -+ -+ -+build: $(SRC)/$(TEST).f90 -+ -$(RM) $(TEST).$(EXESUFFIX) core *.d *.mod FOR*.DAT FTN* ftn* fort.* -+ @echo ------------------------------------ building test $@ -+ -$(FC) -c $(FFLAGS) $(LDFLAGS) $(SRC)/$(TEST).f90 -Mx,218,0x1 -o $(TEST).$(OBJX) -+ -$(FC) $(FFLAGS) $(LDFLAGS) $(TEST).$(OBJX) $(LIBS) -o $(TEST).$(EXESUFFIX) -+ -+ -+run: -+ @echo ------------------------------------ executing test $(TEST) -+ $(TEST).$(EXESUFFIX) -+ -+verify: ; -+ -diff --git a/test/f90_correct/lit/inline_f90_str_copy_klen.sh b/test/f90_correct/lit/inline_f90_str_copy_klen.sh -new file mode 100644 -index 00000000..3880a96e ---- /dev/null -+++ b/test/f90_correct/lit/inline_f90_str_copy_klen.sh -@@ -0,0 +1,9 @@ -+# -+# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -+# See https://llvm.org/LICENSE.txt for license information. -+# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -+ -+# Shared lit script for each tests. Run bash commands that run tests with make. -+ -+# RUN: KEEP_FILES=%keep FLAGS=%flags TEST_SRC=%s MAKE_FILE_DIR=%S/.. bash %S/runmake | tee %t -+# RUN: cat %t | FileCheck %S/runmake -diff --git a/test/f90_correct/lit/inline_f90_str_copy_klen_2.sh b/test/f90_correct/lit/inline_f90_str_copy_klen_2.sh -new file mode 100644 -index 00000000..3880a96e ---- /dev/null -+++ b/test/f90_correct/lit/inline_f90_str_copy_klen_2.sh -@@ -0,0 +1,9 @@ -+# -+# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -+# See https://llvm.org/LICENSE.txt for license information. -+# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -+ -+# Shared lit script for each tests. Run bash commands that run tests with make. -+ -+# RUN: KEEP_FILES=%keep FLAGS=%flags TEST_SRC=%s MAKE_FILE_DIR=%S/.. bash %S/runmake | tee %t -+# RUN: cat %t | FileCheck %S/runmake -diff --git a/test/f90_correct/src/inline_f90_str_copy_klen.f90 b/test/f90_correct/src/inline_f90_str_copy_klen.f90 -new file mode 100644 -index 00000000..f2550a46 ---- /dev/null -+++ b/test/f90_correct/src/inline_f90_str_copy_klen.f90 -@@ -0,0 +1,73 @@ -+! Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -+! See https://llvm.org/LICENSE.txt for license information. -+! SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -+ -+! Program to test the inline of f90_strcmp_klen -+ -+program main -+ character(5) :: s1, s1_1, ans1 -+ character(3) :: s1_2 -+ character(8) :: s1_3 -+ character(9) :: s2, ans2 -+ character(11) :: s2_1, s2_2, s2_3 -+ character(9) :: s2_4 -+ character(6) :: s2_5 -+ character(3) :: s2_6, s2_7, s2_8 -+ character(2) :: s2_9 -+ -+ s1 = "aaaaa" -+ s1_1 = "bbbbb" -+ s1_2 = "ccc" -+ s1_3 = "ddddddd" -+ -+ s1 = s1_1 -+ print *, s1 -+ -+ s1 = s1_2 -+ print *, s1 -+ -+ s1 = s1_3 -+ print *, s1 -+ -+ s2 = "zzzzzzzzz" -+ s2_1 = "aaaaaaaaaaa" -+ s2_2 = "bbbbbbbbbbb" -+ s2_3 = "ccccccccccc" -+ s2_4 = "ddddddddd" -+ s2_5 = "eeeeee" -+ s2_6 = "fff" -+ s2_7 = "ggg" -+ s2_8 = "hh" -+ s2_9 = "i" -+ -+ s2 = s2_1 // s2_2 // s2_3 -+ print *, s2 -+ -+ s2 = s2_4 // s2_2 // s2_3 -+ print *, s2 -+ -+ s2 = s2_5 // s2_2 // s2_3 -+ print *, s2 -+ -+ s2 = s2_6 // s2_5 // s2_3 -+ print *, s2 -+ -+ s2 = s2_6 // s2_7 // s2_3 -+ print *, s2 -+ -+ s2 = s2_6 // s2_7 // s2_8 -+ print *, s2 -+ -+ s2 = s2_6 // s2_7 // s2_9 -+ print *, s2 -+ -+ print *, "PASS" -+ -+contains -+ function str_ne(s, t) result(res) -+ character(*) :: s, t -+ logical :: res -+ res = .false. -+ if (s /= t) res = .true. -+ end -+end -diff --git a/test/f90_correct/src/inline_f90_str_copy_klen_2.f90 b/test/f90_correct/src/inline_f90_str_copy_klen_2.f90 -new file mode 100644 -index 00000000..e0a19a35 ---- /dev/null -+++ b/test/f90_correct/src/inline_f90_str_copy_klen_2.f90 -@@ -0,0 +1,23 @@ -+! Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -+! See https://llvm.org/LICENSE.txt for license information. -+! SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -+ -+! Program to test the inline of f90_strcmp_klen when there is no constants -+! in procedure where the string compare exists. -+ -+program main -+ integer :: i -+ character(20) :: a, b, c, d -+ a = "aaaaaaaaaaaaaaa" -+ b = "aaaaaaaaaaaaaaa" -+ c = "aaaaaaaaaaaaaaa" -+ do i = 1, 100000000 -+ call test(a, b, c, d, 20) -+ enddo -+end -+subroutine test(a, b, c, d, n) -+ integer :: n -+ character(n) :: a, b, c, d -+ d = a // b // c -+end subroutine -+ -diff --git a/tools/flang2/flang2exe/inline_runtime.cpp b/tools/flang2/flang2exe/inline_runtime.cpp -index 429b84c4..14ff4a0e 100644 ---- a/tools/flang2/flang2exe/inline_runtime.cpp -+++ b/tools/flang2/flang2exe/inline_runtime.cpp -@@ -14,6 +14,7 @@ - #include - #include - #include -+#include - - enum OT_CC_NAMES { - NONE = 0, -@@ -56,7 +57,10 @@ static void store_result_bb(SPTR, OPERAND *, OPERAND *, OPERAND *); - static void process_strlen_lt_zero(OPERAND *); - static INSTR_LIST *loop_s1_cmp_s2(OPERAND *, OPERAND *, OPERAND *, OPERAND *, - int); -+static INSTR_LIST *loop_copy_character(SPTR, OPERAND *, OPERAND *, OPERAND *, -+ OPERAND *, int ); - static INSTR_LIST *inline_f90_strcmp_klen(); -+static INSTR_LIST *inline_f90_str_copy_klen(); - static void init_inline_runtime_call(); - - static SPTR -@@ -758,6 +762,337 @@ inline_f90_strcmp_klen() - return runtime_instr; - } - -+static INSTR_LIST * -+loop_copy_character(SPTR input_str_select_next, OPERAND *input_len_opnd, -+ OPERAND *input_iter_opnd, OPERAND *target_len_opnd, -+ OPERAND *target_iter_opnd, int index){ -+ -+ INSTR_LIST *instr1, *input_index_instr, *target_index_instr; -+ INSTR_LIST *space_instr, *space_i8; -+ TMPS *input_len_tmps; -+ OPERAND *curr0_opnd, *curr1_opnd, *curr2_opnd; -+ OPERAND *target_str_opnd = runtime_instr->operands->next->next; -+ OPERAND *str_copy_str_op = runtime_instr->operands->next->next->next->next; -+ OPERAND *str_copy_len_op = str_copy_str_op->next; -+ -+ for (int i = 0; i < index; ++i){ -+ str_copy_str_op = str_copy_str_op->next->next; -+ str_copy_len_op = str_copy_len_op->next->next; -+ } -+ -+ LL_Type *i1_ty = make_int_lltype(1); -+ LL_Type *i8_ty = make_int_lltype(8); -+ LL_Type *i32_ty = make_int_lltype(32); -+ LL_Type *i64_ty = make_int_lltype(64); -+ LL_Type *ptr_i8_ty = make_ptr_lltype(i8_ty); -+ -+ // -------------------------------------------------------------------- -+ // %1 = bitcast [1 x i8]* "space_sym" to i8* -+ curr0_opnd = make_var_op(getstring(" ", 1)); -+ curr_instr = -+ gen_new_instr(curr_instr, I_BITCAST, ptr_i8_ty, curr0_opnd, NULL, NULL); -+ -+ // %2 = load volatile i8, i8* %1 -+ curr0_opnd = make_tmp_op(ptr_i8_ty, curr_instr->tmps); -+ curr_instr = gen_new_instr(curr_instr, I_LOAD, i8_ty, curr0_opnd, NULL, NULL); -+ curr_instr->flags = LOOP_BACKEDGE_FLAG; -+ space_i8 = curr_instr; -+ -+ // %3 = zext i8 %2 to i32 -+ curr0_opnd = make_tmp_op(i8_ty, curr_instr->tmps); -+ curr_instr = -+ gen_new_instr(curr_instr, I_ZEXT, i32_ty, curr0_opnd, NULL, NULL); -+ space_instr = curr_instr; -+ -+ // store i64 %input_len_tmps, i64* input_len -+ input_len_tmps = str_copy_len_op->tmps; -+ if (input_len_tmps) -+ curr0_opnd = make_tmp_op(i64_ty, input_len_tmps); -+ else -+ curr0_opnd = mirror_nontmp_op(str_copy_len_op); -+ curr_instr = gen_new_st(curr_instr, curr0_opnd, input_len_opnd); -+ -+ process_strlen_lt_zero(input_len_opnd); -+ -+ // store i64 0, i64* %input_iter -+ curr0_opnd = make_constval_op(i64_ty, 0, 0); -+ curr_instr = gen_new_st(curr_instr, curr0_opnd, input_iter_opnd); -+ -+ // -------------------------------------------------------------------- -+ // Label for_loop_start -+ SPTR for_loop_start = mklabel("for_loop_start"); -+ curr0_opnd = make_label_op(for_loop_start); -+ curr_instr = gen_new_instr(curr_instr, I_NONE, NULL, curr0_opnd, NULL, NULL); -+ -+ // -------------------------------------------------------------------- -+ // %4 = load i64, i64* %target_len -+ curr_instr = gen_new_instr(curr_instr, I_LOAD, i64_ty, target_len_opnd, -+ NULL, NULL); -+ instr1 = curr_instr; -+ -+ // %5 = load i64, i64* %target_iter_opnd -+ curr_instr = gen_new_instr(curr_instr, I_LOAD, i64_ty, target_iter_opnd, -+ NULL, NULL); -+ target_index_instr = curr_instr; -+ -+ // %6 = icmp slt i64 %5, %4 -+ curr0_opnd = make_ot_cc_op(OT_SLT); -+ curr1_opnd = make_tmp_op(i64_ty, target_index_instr->tmps); -+ curr2_opnd = make_tmp_op(i64_ty, instr1->tmps); -+ curr_instr = gen_new_instr(curr_instr, I_ICMP, i1_ty, curr0_opnd, curr1_opnd, -+ curr2_opnd); -+ -+ // br i1 %6, label %compare_input_index_len, label %input_str_select_next -+ SPTR compare_input_index_len = mklabel("compare_input_index_len"); -+ curr0_opnd = make_tmp_op(i1_ty, curr_instr->tmps); -+ curr1_opnd = make_target_op(compare_input_index_len); -+ curr2_opnd = make_target_op(input_str_select_next); -+ curr_instr = -+ gen_new_instr(curr_instr, I_BR, NULL, curr0_opnd, curr1_opnd, curr2_opnd); -+ -+ // -------------------------------------------------------------------- -+ // Label compare_input_index_len -+ curr0_opnd = make_label_op(compare_input_index_len); -+ curr_instr = gen_new_instr(curr_instr, I_NONE, NULL, curr0_opnd, NULL, NULL); -+ -+ // %7 = load i64, i64* %input_len -+ curr_instr = gen_new_instr(curr_instr, I_LOAD, i64_ty, input_len_opnd, NULL, -+ NULL); -+ instr1 = curr_instr; -+ -+ // %8 = load i64, i64* %input_iter -+ curr_instr = gen_new_instr(curr_instr, I_LOAD, i64_ty, input_iter_opnd, NULL, -+ NULL); -+ input_index_instr = curr_instr; -+ -+ // %9 = icmp slt i64 %8, %7 -+ curr0_opnd = make_ot_cc_op(OT_SLT); -+ curr1_opnd = make_tmp_op(i64_ty, input_index_instr->tmps); -+ curr2_opnd = make_tmp_op(i64_ty, instr1->tmps); -+ curr_instr = gen_new_instr(curr_instr, I_ICMP, i1_ty, curr0_opnd, curr1_opnd, -+ curr2_opnd); -+ -+ // br i1 %6, label %input_str_copy, label %input_str_select_next -+ SPTR input_str_copy = mklabel("input_str_copy"); -+ curr0_opnd = make_tmp_op(i1_ty, curr_instr->tmps); -+ curr1_opnd = make_target_op(input_str_copy); -+ curr2_opnd = make_target_op(input_str_select_next); -+ curr_instr = gen_new_instr(curr_instr, I_BR, NULL, curr0_opnd, curr1_opnd, -+ curr2_opnd); -+ -+ // -------------------------------------------------------------------- -+ // Label input_str_copy -+ curr0_opnd = make_label_op(input_str_copy); -+ curr_instr = gen_new_instr(curr_instr, I_NONE, NULL, curr0_opnd, NULL, NULL); -+ -+ // %10 = getelementptr i8, i8* target_str, i64 %8 -+ curr0_opnd = make_tmp_op(ptr_i8_ty, target_str_opnd->tmps->info.idef->tmps); -+ curr1_opnd = make_tmp_op(i64_ty, target_index_instr->tmps); -+ curr_instr = gen_new_instr(curr_instr, I_GEP, ptr_i8_ty, curr0_opnd, -+ curr1_opnd, NULL); -+ target_index_instr = curr_instr; -+ -+ // %11 = getelementptr i8, i8* str_copy_str, i64 %5 -+ curr0_opnd = make_tmp_op(ptr_i8_ty, str_copy_str_op->tmps->info.idef->tmps); -+ curr1_opnd = make_tmp_op(i64_ty, input_index_instr->tmps); -+ curr_instr = gen_new_instr(curr_instr, I_GEP, ptr_i8_ty, curr0_opnd, -+ curr1_opnd, NULL); -+ -+ // %12 = load volatile i8, i8* %11 -+ curr0_opnd = make_tmp_op(ptr_i8_ty, curr_instr->tmps); -+ curr_instr = gen_new_instr(curr_instr, I_LOAD, i8_ty, curr0_opnd, NULL, NULL); -+ // curr_instr->flags = LOOP_BACKEDGE_FLAG; -+ input_index_instr = curr_instr; -+ -+ // -------------------------------------------------------------------- -+ // store i8 %12, i8* target[%10] -+ curr0_opnd = make_tmp_op(i8_ty, input_index_instr->tmps); -+ curr1_opnd = make_tmp_op(ptr_i8_ty, target_index_instr->tmps); -+ curr_instr = gen_new_st(curr_instr, curr0_opnd, curr1_opnd); -+ -+ // br label %inc_iter_label -+ SPTR inc_iter_label = mklabel("inc_iter_label"); -+ curr0_opnd = make_target_op(inc_iter_label); -+ curr_instr = gen_new_instr(curr_instr, I_BR, NULL, curr0_opnd, NULL, NULL); -+ -+ // -------------------------------------------------------------------- -+ // Label inc_iter_label -+ curr0_opnd = make_label_op(inc_iter_label); -+ curr_instr = gen_new_instr(curr_instr, I_NONE, NULL, curr0_opnd, NULL, NULL); -+ -+ curr0_opnd = make_constval_op(i64_ty, 1, 0); -+ inc_loop_iter(target_iter_opnd, i64_ty, curr0_opnd); -+ inc_loop_iter(input_iter_opnd, i64_ty, curr0_opnd); -+ -+ // br label %for_loop_start -+ curr0_opnd = make_target_op(for_loop_start); -+ curr_instr = gen_new_instr(curr_instr, I_BR, NULL, curr0_opnd, NULL, NULL); -+ -+ return curr_instr; -+} -+ -+static INSTR_LIST * -+inline_f90_str_copy_klen(){ -+ dbg_line_op = runtime_instr->dbg_line_op; -+ OPERAND *input_str_opnd = runtime_instr->operands->next->next->next->next; -+ OPERAND *target_str_opnd = runtime_instr->operands->next->next; -+ OPERAND *target_len_opnd, *input_len_opnd; -+ OPERAND *target_iter_opnd, *input_iter_opnd; -+ OPERAND *curr0_opnd, *curr1_opnd, *curr2_opnd; -+ -+ INSTR_LIST *target_len, *input_len, *target_iter, *input_iter; -+ INSTR_LIST *target_str_index, *space_i8, *space_instr; -+ INSTR_LIST *head_instr; -+ INSTR_LIST *prev_instr = runtime_instr->prev; -+ -+ TMPS *target_len_tmps = runtime_instr->operands->next->next->next->tmps; -+ -+ std::vector str_copy_str_op, str_copy_len_op; -+ -+ LL_Type *i1_ty = make_int_lltype(1); -+ LL_Type *i8_ty = make_int_lltype(8); -+ LL_Type *i32_ty = make_int_lltype(32); -+ LL_Type *i64_ty = make_int_lltype(64); -+ LL_Type *ptr_i8_ty = make_ptr_lltype(i8_ty); -+ LL_Type *ptr_i64_ty = make_ptr_lltype(i64_ty); -+ -+ // Allocate space for target_len, input_len, target_iter, input_iter -+ target_len = gen_alloca_instr(ptr_i64_ty); -+ input_len = gen_alloca_instr(ptr_i64_ty); -+ target_iter = gen_alloca_instr(ptr_i64_ty); -+ input_iter = gen_alloca_instr(ptr_i64_ty); -+ -+ // Link allocas instructions -+ link_instrs(target_len, input_len); -+ link_instrs(input_len, target_iter); -+ link_instrs(target_iter, input_iter); -+ // Insert allocas -+ link_instrs(input_iter, top_instr->next); -+ link_instrs(top_instr, target_len); -+ -+ // Make tmp operands for allocas -+ target_len_opnd = make_tmp_op(ptr_i64_ty, target_len->tmps); -+ input_len_opnd = make_tmp_op(ptr_i64_ty, input_len->tmps); -+ target_iter_opnd = make_tmp_op(ptr_i64_ty, target_iter->tmps); -+ input_iter_opnd = make_tmp_op(ptr_i64_ty, input_iter->tmps); -+ -+ // store i64 %target_len_tmps, i64* %target_len -+ if (target_len_tmps) -+ curr0_opnd = make_tmp_op(i64_ty, target_len_tmps); -+ else -+ curr0_opnd = mirror_nontmp_op(runtime_instr->operands->next->next->next); -+ curr0_opnd->next = target_len_opnd; -+ curr_instr = gen_instr(I_STORE, NULL, NULL, curr0_opnd); -+ head_instr = curr_instr; -+ -+ process_strlen_lt_zero(target_len_opnd); -+ -+ // %0 = load i64, i64* %target_len -+ curr_instr = gen_new_instr(curr_instr, I_LOAD, i64_ty, target_len_opnd, NULL, NULL); -+ target_len = curr_instr; -+ -+ // store i64 0, i64* %target_iter -+ curr0_opnd = make_constval_op(i64_ty, 0, 0); -+ curr_instr = gen_new_st(curr_instr, curr0_opnd, target_iter_opnd); -+ -+ // %1 = bitcast [1 x i8]* "space_sym" to i8* -+ curr0_opnd = make_var_op(getstring(" ", 1)); -+ curr_instr = -+ gen_new_instr(curr_instr, I_BITCAST, ptr_i8_ty, curr0_opnd, NULL, NULL); -+ -+ // %2 = load volatile i8, i8* %1 -+ curr0_opnd = make_tmp_op(ptr_i8_ty, curr_instr->tmps); -+ curr_instr = gen_new_instr(curr_instr, I_LOAD, i8_ty, curr0_opnd, NULL, NULL); -+ curr_instr->flags = LOOP_BACKEDGE_FLAG; -+ space_i8 = curr_instr; -+ -+ // %3 = zext i8 %2 to i32 -+ curr0_opnd = make_tmp_op(i8_ty, curr_instr->tmps); -+ curr_instr = -+ gen_new_instr(curr_instr, I_ZEXT, i32_ty, curr0_opnd, NULL, NULL); -+ space_instr = curr_instr; -+ -+ while (input_str_opnd){ -+ str_copy_str_op.push_back(input_str_opnd); -+ str_copy_len_op.push_back(input_str_opnd->next); -+ input_str_opnd = input_str_opnd->next->next; -+ } -+ -+ SPTR str_copy_input_end = mklabel("str_copy_input_end"); -+ SPTR str_copy_end = mklabel("str_copy_end"); -+ SPTR input_str_select_next; -+ SPTR input_str_select = mklabel("input_str_select"); -+ -+ for (unsigned int i = 0; i < str_copy_str_op.size(); ++i, input_str_select = input_str_select_next){ -+ if (i < str_copy_str_op.size() - 1){ -+ input_str_select_next = mklabel("input_str_select"); -+ } else { -+ input_str_select_next = str_copy_input_end; -+ } -+ -+ // Lable input_str_select -+ curr0_opnd = make_label_op(input_str_select); -+ curr_instr = gen_new_instr(curr_instr, I_NONE, NULL, curr0_opnd, NULL, NULL); -+ curr_instr = loop_copy_character(input_str_select_next, input_len_opnd, input_iter_opnd, -+ target_len_opnd, target_iter_opnd, i); -+ } -+ -+ // -------------------------------------------------------------------- -+ // label str_copy_input_end -+ curr0_opnd = make_label_op(str_copy_input_end); -+ curr_instr = gen_new_instr(curr_instr, I_NONE, NULL, curr0_opnd, NULL, NULL); -+ -+ // %4 = load i64, i64* %target_iter -+ curr_instr = gen_new_instr(curr_instr, I_LOAD, i64_ty, target_iter_opnd, NULL, NULL); -+ target_str_index = curr_instr; -+ -+ // %5 = icmp slt i64 %4, %0 -+ curr0_opnd = make_ot_cc_op(OT_SLT); -+ curr1_opnd = make_tmp_op(i64_ty, target_str_index->tmps); -+ curr2_opnd = make_tmp_op(i64_ty, target_len->tmps); -+ curr_instr = gen_new_instr(curr_instr, I_ICMP, i1_ty, curr0_opnd, curr1_opnd, -+ curr2_opnd); -+ -+ // br i1 %5, label %write_space, label %str_copy_end -+ SPTR write_space = mklabel("write_space"); -+ curr0_opnd = make_tmp_op(i1_ty, curr_instr->tmps); -+ curr1_opnd = make_target_op(write_space); -+ curr2_opnd = make_target_op(str_copy_end); -+ curr_instr = gen_new_instr(curr_instr, I_BR, NULL, curr0_opnd, curr1_opnd, -+ curr2_opnd); -+ -+ // Label write_space -+ curr0_opnd = make_label_op(write_space); -+ curr_instr = gen_new_instr(curr_instr, I_NONE, NULL, curr0_opnd, NULL, NULL); -+ -+ // %6 = getelementptr i8, i8* target_str, i64 %4 -+ curr0_opnd = make_tmp_op(ptr_i8_ty, target_str_opnd->tmps->info.idef->tmps); -+ curr1_opnd = make_tmp_op(i64_ty, target_str_index->tmps); -+ curr_instr = gen_new_instr(curr_instr, I_GEP, ptr_i8_ty, curr0_opnd, -+ curr1_opnd, NULL); -+ -+ // store i8 %2, i8* target[%6] -+ curr0_opnd = make_tmp_op(i8_ty, space_i8->tmps); -+ curr1_opnd = make_tmp_op(ptr_i8_ty, curr_instr->tmps); -+ curr_instr = gen_new_st(curr_instr, curr0_opnd, curr1_opnd); -+ -+ curr0_opnd = make_constval_op(i64_ty, 1, 0); -+ inc_loop_iter(target_iter_opnd, i64_ty, curr0_opnd); -+ -+ // br label %str_copy_input_end -+ curr0_opnd = make_target_op(str_copy_input_end); -+ curr_instr = gen_new_instr(curr_instr, I_BR, NULL, curr0_opnd, NULL, NULL); -+ -+ // -------------------------------------------------------------------- -+ // Label %str_copy_end -+ curr0_opnd = make_label_op(str_copy_end); -+ curr_instr = gen_new_instr(curr_instr, I_NONE, NULL, curr0_opnd, NULL, NULL); -+ -+ link_instrs(prev_instr, head_instr); -+ link_instrs(curr_instr, runtime_instr->next); -+ return runtime_instr; -+} -+ - INSTR_LIST * - emit_inline_runtime_call(INSTR_LIST *top, INSTR_LIST *instr, - INLINE_RUNTIME_ID inline_runtime_id) -@@ -772,6 +1107,9 @@ emit_inline_runtime_call(INSTR_LIST *top, INSTR_LIST *instr, - case F90_STRCMP_KLEN: - prev_instr = inline_f90_strcmp_klen(); - break; -+ case F90_STR_COPY_KLEN: -+ prev_instr = inline_f90_str_copy_klen(); -+ break; - } - - return prev_instr; -@@ -782,6 +1120,8 @@ init_inline_runtime_call() - { - std::string f90_strcmp_klen = "@f90_strcmp_klen"; - inline_calls[f90_strcmp_klen] = F90_STRCMP_KLEN; -+ std::string f90_str_copy_klen = "@f90_str_copy_klen"; -+ inline_calls[f90_str_copy_klen] = F90_STR_COPY_KLEN; - } - - INLINE_RUNTIME_ID -diff --git a/tools/flang2/flang2exe/inline_runtime.h b/tools/flang2/flang2exe/inline_runtime.h -index 79ca0a66..29985ac6 100644 ---- a/tools/flang2/flang2exe/inline_runtime.h -+++ b/tools/flang2/flang2exe/inline_runtime.h -@@ -16,6 +16,7 @@ - enum INLINE_RUNTIME_ID { - NONE_ID = 0, - F90_STRCMP_KLEN, -+ F90_STR_COPY_KLEN, - }; - - INLINE_RUNTIME_ID get_inline_runtime_id(INSTR_LIST *instrs); diff --git a/20-add-align-prgma-for-derived-type.patch b/20-add-align-prgma-for-derived-type.patch deleted file mode 100644 index cde50824c8461376b35a56113bec0ce3c0a1dd98..0000000000000000000000000000000000000000 --- a/20-add-align-prgma-for-derived-type.patch +++ /dev/null @@ -1,767 +0,0 @@ -From 2e0b17c3cc9b949dc7ad0f5403c4664a0d159dac Mon Sep 17 00:00:00 2001 -From: yinjiawei2023 -Date: Thu, 1 Jun 2023 22:27:41 +0800 -Subject: [PATCH] [flang] Add align pragma for derived type - -This patch add align pragma for derived type, -and add some test cases for this pragma. ---- - test/directives/align_derived_type.f90 | 200 ++++++++++++++++++++++++ - test/directives/align_not_supported.f90 | 35 +++++ - tools/flang1/flang1exe/dtypeutl.c | 21 +++ - tools/flang1/flang1exe/exterf.c | 8 +- - tools/flang1/flang1exe/global.h | 2 +- - tools/flang1/flang1exe/interf.c | 1 + - tools/flang1/flang1exe/lowersym.c | 6 +- - tools/flang1/utils/symtab/sharedefs.h | 6 +- - tools/flang1/utils/symtab/symtab.in.h | 1 + - tools/flang2/docs/xflag.n | 5 +- - tools/flang2/flang2exe/cgmain.cpp | 39 ++++- - tools/flang2/flang2exe/dtypeutl.cpp | 5 +- - tools/flang2/flang2exe/llassem.cpp | 27 +++- - tools/flang2/flang2exe/upper.cpp | 1 + - tools/flang2/utils/symtab/sharedefs.h | 6 +- - tools/flang2/utils/symtab/symtab.in.h | 1 + - tools/shared/miscutil.c | 10 +- - tools/shared/pragma.c | 24 ++- - tools/shared/sharedefs.h | 6 +- - tools/shared/utils/sharedefs.h | 6 +- - 20 files changed, 385 insertions(+), 25 deletions(-) - create mode 100644 test/directives/align_derived_type.f90 - create mode 100644 test/directives/align_not_supported.f90 - -diff --git a/test/directives/align_derived_type.f90 b/test/directives/align_derived_type.f90 -new file mode 100644 -index 0000000..b71c425 ---- /dev/null -+++ b/test/directives/align_derived_type.f90 -@@ -0,0 +1,200 @@ -+! RUN: %flang -O0 -S -emit-llvm %s -o - | FileCheck %s -+ -+! CHECK: %struct[[BLOCK1:\.BSS[0-9]+]] = type <{ [264 x i8] }> -+! CHECK: %struct[[BLOCK2:\.BSS[0-9]+]] = type <{ [520 x i8] }> -+! CHECK: %struct[[BLOCK3:\.BSS[0-9]+]] = type <{ [1032 x i8] }> -+! CHECK: %struct[[BLOCK4:\.BSS[0-9]+]] = type <{ [2056 x i8] }> -+! CHECK: %struct[[BLOCK5:_module_align_derived_[0-9]+_]] = type <{ [136 x i8] }> -+! CHECK: @[[BLOCK1]] = internal global %struct[[BLOCK1]] zeroinitializer, align 256 -+! CHECK: @[[BLOCK2]] = internal global %struct[[BLOCK2]] zeroinitializer, align 512 -+! CHECK: @[[BLOCK3]] = internal global %struct[[BLOCK3]] zeroinitializer, align 1024 -+! CHECK: @[[BLOCK4]] = internal global %struct[[BLOCK4]] zeroinitializer, align 2048 -+! CHECK: @[[BLOCK5]] = common global %struct[[BLOCK5]] zeroinitializer, align 128 -+ -+module module_align_derived -+implicit none -+ -+ !dir$ align 128 -+ type T1 -+ integer(kind=2) :: f1 -+ integer(kind=4) :: f2 -+ end type T1 -+ -+ !dir$ align 128 -+ type T2 -+ integer(kind=2) :: f1 -+ integer(kind=4) :: f2 -+ end type T2 -+ -+ type(T1) :: v1 -+ type(T2) :: v2 -+ -+ interface -+ module subroutine module_interface_subroutine() -+ end subroutine module_interface_subroutine -+ end interface -+ -+end module module_align_derived -+ -+submodule (module_align_derived) submodule_align_derived -+ -+ contains -+ module subroutine module_interface_subroutine() -+ -+ !dir$ align 256 -+ type T3 -+ integer(kind=2) :: f1 -+ integer(kind=4) :: f2 -+ end type T3 -+ -+ !dir$ align 256 -+ type T4 -+ integer(kind=2) :: f1 -+ integer(kind=4) :: f2 -+ end type T4 -+ -+ type(T3) :: v3 -+ type(T4) :: v4 -+ -+ v3%f1 = 101 -+! CHECK: store i16 101, ptr @[[BLOCK1]], align -+ -+ v3%f2 = 102 -+! CHECK: %[[TEMP:[0-9]+]] = getelementptr i8, ptr @[[BLOCK1]], i64 4 -+! CHECK: store i32 102, ptr %[[TEMP]], align -+ -+ v4%f1 = 103 -+! CHECK: %[[TEMP:[0-9]+]] = getelementptr i8, ptr @[[BLOCK1]], i64 256 -+! CHECK: store i16 103, ptr %[[TEMP]], align -+ -+ v4%f2 = 104 -+! CHECK: %[[TEMP:[0-9]+]] = getelementptr i8, ptr @[[BLOCK1]], i64 260 -+! CHECK: store i32 104, ptr %[[TEMP]], align -+ -+ end subroutine module_interface_subroutine -+end submodule submodule_align_derived -+ -+ -+ -+program align -+use module_align_derived -+implicit none -+ -+ !dir$ align 512 -+ type T5 -+ integer(kind=2) :: f1 -+ integer(kind=4) :: f2 -+ end type T5 -+ -+ !dir$ align 512 -+ type T6 -+ integer(kind=2) :: f1 -+ integer(kind=4) :: f2 -+ end type T6 -+ -+ type(T5) :: v5 -+ type(T6) :: v6 -+ -+ v5%f1 = 201 -+! CHECK: store i16 201, ptr @[[BLOCK2]], align -+ -+ v5%f2 = 202 -+! CHECK: %[[TEMP:[0-9]+]] = getelementptr i8, ptr @[[BLOCK2]], i64 4 -+! CHECK: store i32 202, ptr %[[TEMP]], align -+ -+ v6%f1 = 203 -+! CHECK: %[[TEMP:[0-9]+]] = getelementptr i8, ptr @[[BLOCK2]], i64 512 -+! CHECK: store i16 203, ptr %[[TEMP]], align -+ -+ v6%f2 = 204 -+! CHECK: %[[TEMP:[0-9]+]] = getelementptr i8, ptr @[[BLOCK2]], i64 516 -+! CHECK: store i32 204, ptr %[[TEMP]], align -+ -+ v1%f1 = 81 -+! CHECK: store i16 81, ptr @[[BLOCK5]], align -+ -+ v1%f2 = 82 -+! CHECK: %[[TEMP:[0-9]+]] = getelementptr i8, ptr @[[BLOCK5]], i64 4 -+! CHECK: store i32 82, ptr %[[TEMP]], align -+ -+ v2%f1 = 83 -+! CHECK: %[[TEMP:[0-9]+]] = getelementptr i8, ptr @[[BLOCK5]], i64 128 -+! CHECK: store i16 83, ptr %[[TEMP]], align -+ -+ v2%f2 = 84 -+! CHECK: %[[TEMP:[0-9]+]] = getelementptr i8, ptr @[[BLOCK5]], i64 132 -+! CHECK: store i32 84, ptr %[[TEMP]], align -+ -+end program align -+ -+ -+subroutine subroutine_align() -+ -+ !dir$ align 1024 -+ type T7 -+ integer(kind=2) :: f1 -+ integer(kind=4) :: f2 -+ end type T7 -+ -+ !dir$ align 1024 -+ type T8 -+ integer(kind=2) :: f1 -+ integer(kind=4) :: f2 -+ end type T8 -+ -+ type(T7) :: v7 -+ type(T8) :: v8 -+ -+ v7%f1 = 401 -+! CHECK: store i16 401, ptr @[[BLOCK3]], align -+ -+ v7%f2 = 402 -+! CHECK: %[[TEMP:[0-9]+]] = getelementptr i8, ptr @[[BLOCK3]], i64 4 -+! CHECK: store i32 402, ptr %[[TEMP]], align -+ -+ v8%f1 = 403 -+! CHECK: %[[TEMP:[0-9]+]] = getelementptr i8, ptr @[[BLOCK3]], i64 1024 -+! CHECK: store i16 403, ptr %[[TEMP]], align -+ -+ v8%f2 = 404 -+! CHECK: %[[TEMP:[0-9]+]] = getelementptr i8, ptr @[[BLOCK3]], i64 1028 -+! CHECK: store i32 404, ptr %[[TEMP]], align -+ -+ return -+end subroutine subroutine_align -+ -+ -+function function_align() -+ -+ !dir$ align 2048 -+ type T9 -+ integer(kind=2) :: f1 -+ integer(kind=4) :: f2 -+ end type T9 -+ -+ !dir$ align 2048 -+ type T10 -+ integer(kind=2) :: f1 -+ integer(kind=4) :: f2 -+ end type T10 -+ -+ type(T9) :: v9 -+ type(T10) :: v10 -+ -+ v9%f1 = 801 -+! CHECK: store i16 801, ptr @[[BLOCK4]], align -+ -+ v9%f2 = 802 -+! CHECK: %[[TEMP:[0-9]+]] = getelementptr i8, ptr @[[BLOCK4]], i64 4 -+! CHECK: store i32 802, ptr %[[TEMP]], align -+ -+ v10%f1 = 803 -+! CHECK: %[[TEMP:[0-9]+]] = getelementptr i8, ptr @[[BLOCK4]], i64 2048 -+! CHECK: store i16 803, ptr %[[TEMP]], align -+ -+ v10%f2 = 804 -+! CHECK: %[[TEMP:[0-9]+]] = getelementptr i8, ptr @[[BLOCK4]], i64 2052 -+! CHECK: store i32 804, ptr %[[TEMP]], align -+ -+ return -+end function function_align -diff --git a/test/directives/align_not_supported.f90 b/test/directives/align_not_supported.f90 -new file mode 100644 -index 0000000..7232078 ---- /dev/null -+++ b/test/directives/align_not_supported.f90 -@@ -0,0 +1,35 @@ -+! RUN: %flang -O0 -c %s 2>&1 | FileCheck %s -+ -+program align -+implicit none -+ -+ !dir$ align alignment -+ type T1 -+ integer(kind=2) :: f1 -+ integer(kind=4) :: f2 -+ end type T1 -+! CHECK: F90-W-0280-Syntax error in directive ALIGN: allow int alignment only -+ -+ !dir$ align -3 -+ type T2 -+ integer(kind=2) :: f1 -+ integer(kind=4) :: f2 -+ end type T2 -+! CHECK: F90-W-0280-Syntax error in directive ALIGN: allow int alignment only -+ -+ !dir$ align 0 -+ type T3 -+ integer(kind=2) :: f1 -+ integer(kind=4) :: f2 -+ end type T3 -+! CHECK: F90-W-0280-Syntax error in directive ALIGN: allow power of 2 alignment only -+ -+ !dir$ align 3 -+ type T4 -+ integer(kind=2) :: f1 -+ integer(kind=4) :: f2 -+ end type T4 -+! CHECK: F90-W-0280-Syntax error in directive ALIGN: allow power of 2 alignment only -+ -+ -+end program align -diff --git a/tools/flang1/flang1exe/dtypeutl.c b/tools/flang1/flang1exe/dtypeutl.c -index 1cc6993..33fa5bc 100644 ---- a/tools/flang1/flang1exe/dtypeutl.c -+++ b/tools/flang1/flang1exe/dtypeutl.c -@@ -1227,6 +1227,8 @@ alignment(DTYPE dtype) - case TY_STRUCT: - case TY_UNION: - case TY_DERIVED: -+ if (DTA(dtype) > DTY(dtype + 4)) -+ return DTA(dtype); - return DTY(dtype + 4); - - default: -@@ -1393,6 +1395,25 @@ get_type(int n, TY_KIND v1, int v2) - } - if (dtype == 0) { - dtype = STG_NEXT_SIZE(stb.dt, n); -+ -+ /* handle the possible !dir$ align XX, -+ * -+ * flang1 reaches here only when creating -+ * new dtype. So flang1 should handle the -+ * possible align pragma for new type here. -+ * -+ * flang1 should store the alignment from flg.x[251] -+ * to DTA, later it will updates the dtype alignment -+ * when in alignment() or lower_put_datatype(). -+ * -+ * Note that this pragma should only be used to -+ * this strucutre, so flang1 need to clear the flg.x[251] -+ */ -+ if (flg.x[251]) { -+ DTA(dtype) = flg.x[251] - 1; -+ flg.x[251] = 0; -+ } -+ - DTY(dtype) = v1; - DTY(dtype + 1) = v2; - if (v1 == TY_CHAR || is_nchar) { -diff --git a/tools/flang1/flang1exe/exterf.c b/tools/flang1/flang1exe/exterf.c -index 140ebc2..51f412d 100644 ---- a/tools/flang1/flang1exe/exterf.c -+++ b/tools/flang1/flang1exe/exterf.c -@@ -2109,8 +2109,12 @@ export_dt(int dtype) - case TY_STRUCT: - case TY_DERIVED: - /* print dtype and descriptor entry */ -- lzprintf(outlz, " %d %d %d %d", (int)DTY(dtype + 1), (int)DTY(dtype + 2), -- (int)DTY(dtype + 3), (int)DTY(dtype + 4)); -+ lzprintf(outlz, " %d %d %d", (int)DTY(dtype + 1), (int)DTY(dtype + 2), -+ (int)DTY(dtype + 3)); -+ if (DTA(dtype) > DTY(dtype + 4)) -+ lzprintf(outlz, " %d", (int)DTA(dtype)); -+ else -+ lzprintf(outlz, " %d", (int)DTY(dtype + 4)); - break; - - case TY_CHAR: -diff --git a/tools/flang1/flang1exe/global.h b/tools/flang1/flang1exe/global.h -index 6554cbd..947cc0d 100644 ---- a/tools/flang1/flang1exe/global.h -+++ b/tools/flang1/flang1exe/global.h -@@ -184,7 +184,7 @@ typedef struct { - LOGICAL endian; - LOGICAL terse; - int dollar; /* defines the char to which '$' is translated */ -- int x[251]; /* x flags */ -+ int x[252]; /* x flags */ - LOGICAL quad; /* quad align "unconstrained objects" if sizeof >= 16 */ - int anno; - LOGICAL qa; /* TRUE => -qa appeared on command line */ -diff --git a/tools/flang1/flang1exe/interf.c b/tools/flang1/flang1exe/interf.c -index 8d1c573..ac77826 100644 ---- a/tools/flang1/flang1exe/interf.c -+++ b/tools/flang1/flang1exe/interf.c -@@ -2170,6 +2170,7 @@ import(lzhandle *fdlz, WantPrivates wantPrivates, int ivsn) - DTY(new_id + 3) = get_num(10); /* (old) tag */ - DTY(new_id + 4) = get_num(10); /* align */ - DTY(new_id + 5) = 0; /* ICT */ -+ DTA(new_id) = DTY(new_id + 4); - break; - case TY_CHAR: - case TY_NCHAR: -diff --git a/tools/flang1/flang1exe/lowersym.c b/tools/flang1/flang1exe/lowersym.c -index 1705447..87c22be 100644 ---- a/tools/flang1/flang1exe/lowersym.c -+++ b/tools/flang1/flang1exe/lowersym.c -@@ -2632,7 +2632,11 @@ lower_put_datatype(int dtype, int usage) - putsym("member", DTY(dtype + 1)); - putval("size", DTY(dtype + 2)); - putsym("tag", DTY(dtype + 3)); -- putval("align", DTY(dtype + 4)); -+ -+ if (DTA(dtype) > DTY(dtype + 4)) -+ putval("align", DTA(dtype)); -+ else -+ putval("align", DTY(dtype + 4)); - break; - - case TY_NUMERIC: -diff --git a/tools/flang1/utils/symtab/sharedefs.h b/tools/flang1/utils/symtab/sharedefs.h -index 30ae371..50495fc 100644 ---- a/tools/flang1/utils/symtab/sharedefs.h -+++ b/tools/flang1/utils/symtab/sharedefs.h -@@ -30,21 +30,21 @@ - - /* declare: - * struct{ -- * dt* stg_base; -+ * dt* stg_base, *stg_align; - * unsigned int stg_size, stg_avail, stg_free, stg_cleared, - * stg_dtsize; - * void* stg_sidecar; * }name; */ - - /* declare the stg_ members; useful in a struct that also has other members */ - #define STG_MEMBERS(dt) \ -- dt *stg_base; \ -+ dt *stg_base, *stg_align; \ - unsigned int stg_size, stg_avail, stg_free, stg_cleared, stg_dtsize, \ - stg_freelink_offset, stg_flags; \ - const char *stg_name; \ - void *stg_sidecar - - /* to statically initialize STG_MEMBERS */ --#define STG_INIT NULL, 0, 0, 0, 0, 0, 0, 0, NULL, NULL -+#define STG_INIT NULL, NULL, 0, 0, 0, 0, 0, 0, 0, NULL, NULL - - /* declare a struct with the stg_members */ - #define STG_DECLARE(name, dt) \ -diff --git a/tools/flang1/utils/symtab/symtab.in.h b/tools/flang1/utils/symtab/symtab.in.h -index 29c3d06..f8c820a 100644 ---- a/tools/flang1/utils/symtab/symtab.in.h -+++ b/tools/flang1/utils/symtab/symtab.in.h -@@ -51,6 +51,7 @@ - - - #define DTY(d) (stb.dt.stg_base[d]) -+#define DTA(d) (stb.dt.stg_align[d]) - - /* for fast DT checking -- define table indexed by TY_ */ - extern short dttypes[TY_MAX+1]; -diff --git a/tools/flang2/docs/xflag.n b/tools/flang2/docs/xflag.n -index 4108e59..f5e3745 100644 ---- a/tools/flang2/docs/xflag.n -+++ b/tools/flang2/docs/xflag.n -@@ -5549,6 +5549,9 @@ where, n = flg.x[249] - .XF "250:" - Set number of bigbuffers for multi-buffer memory management for AMD GPU. - (moved to 202) -+ - .XF "251:" --(NOT available - check declaration in global.h for flg.x[], all compilers) -+Reserved to save an derived type alignment passed by pragma `!dir$ align XX` - -+.XF "252:" -+(NOT available - check declaration in global.h for flg.x[], all compilers) -\ No newline at end of file -diff --git a/tools/flang2/flang2exe/cgmain.cpp b/tools/flang2/flang2exe/cgmain.cpp -index 3c08aa2..ac0d963 100644 ---- a/tools/flang2/flang2exe/cgmain.cpp -+++ b/tools/flang2/flang2exe/cgmain.cpp -@@ -12065,7 +12065,7 @@ gen_address_operand(int addr_op, int nme, bool lda, LL_Type *llt_expected, - static OPERAND * - gen_acon_expr(int ilix, LL_Type *expected_type) - { -- SPTR sptr; -+ SPTR sptr, ag; - DTYPE dtype; - ISZ_T idx; - LL_Type *ty1; -@@ -12103,6 +12103,7 @@ gen_acon_expr(int ilix, LL_Type *expected_type) - /* Handle pointer constants with no base symbol table pointer. - * This also becomes a pointer-sized integer */ - sptr = SymConval1(opnd); -+ dtype = DTYPEG(sptr); - if (!sptr) { - num = ACONOFFG(opnd); - ISZ_2_INT64(num, val); -@@ -12111,11 +12112,30 @@ gen_acon_expr(int ilix, LL_Type *expected_type) - sym_is_refd(sptr); - idx = (STYPEG(sptr) == ST_STRUCT || STYPEG(sptr) == ST_ARRAY - || ACONOFFG(opnd) < 0) ? 0 : ACONOFFG(opnd); -- process_sptr_offset(sptr, variable_offset_in_aggregate(sptr, idx)); -+ if (DTA(dtype)) { -+ /* handle the flang1's pragma !dir$ align -+ * adjust the sptr's offset in ag to be aligned with -+ * sptr's alignment. -+ * */ -+ process_sptr_offset(sptr, idx + ALIGN( -+ variable_offset_in_aggregate(sptr, 0), -+ DTA(dtype))); -+ }else { -+ process_sptr_offset(sptr, variable_offset_in_aggregate(sptr, idx)); -+ } - idx = ACONOFFG(opnd); /* byte offset */ - - ty1 = make_lltype_from_dtype(DT_ADDR); -- idx = variable_offset_in_aggregate(sptr, idx); -+ if (DTA(dtype)) { -+ /* handle the flang1's pragma !dir$ align -+ * adjust the sptr's offset in ag to be aligned with -+ * sptr's alignment. -+ * */ -+ idx += ALIGN(variable_offset_in_aggregate(sptr, 0), DTA(dtype)); -+ }else { -+ idx = variable_offset_in_aggregate(sptr, idx); -+ } -+ - if (idx) { - base_op = gen_sptr(sptr); - index_op = NULL; -@@ -12138,6 +12158,19 @@ gen_acon_expr(int ilix, LL_Type *expected_type) - } - } - -+ if (DTA(dtype)) { -+ /* handle the flang1 pragma !dir$ align -+ * Here we record the sptr's alignment -+ * to its belonging ag, so its ag's alignment -+ * can be aligned to this alignment -+ */ -+ char gname[MXIDLN + 50]; -+ sprintf(gname, "struct%s", get_llvm_name(sptr)); -+ ag = find_ag(gname); -+ if (DTA(dtype) >= AG_ALIGN(ag)) -+ AG_ALIGN(ag) = DTA(dtype) + 1; -+ } -+ - if (operand->ll_type && VOLG(sptr)) - operand->flags |= OPF_VOLATILE; - return operand; -diff --git a/tools/flang2/flang2exe/dtypeutl.cpp b/tools/flang2/flang2exe/dtypeutl.cpp -index 7c247df..46cd9f8 100644 ---- a/tools/flang2/flang2exe/dtypeutl.cpp -+++ b/tools/flang2/flang2exe/dtypeutl.cpp -@@ -504,7 +504,10 @@ alignment(DTYPE dtype) - - case TY_STRUCT: - case TY_UNION: -- return DTyAlgTyAlign(dtype); -+ align_bits = DTyAlgTyAlign(dtype); -+ if (DTA(dtype) > align_bits) -+ return DTA(dtype); -+ return align_bits; - - default: - interr("alignment: bad dtype ", ty, ERR_Severe); -diff --git a/tools/flang2/flang2exe/llassem.cpp b/tools/flang2/flang2exe/llassem.cpp -index ef0440e..1aa2822 100644 ---- a/tools/flang2/flang2exe/llassem.cpp -+++ b/tools/flang2/flang2exe/llassem.cpp -@@ -1168,6 +1168,13 @@ assemble_end(void) - fprintf(ASMFIL, "%%struct%s = type < { %s } > \n", name, typed); - fprintf(ASMFIL, "@%s = %s global %%struct%s ", name, - AG_ISMOD(gblsym) ? "external" : "common", name); -+ -+ /* handle the flang1 pragma !dir$ align -+ * Here we refer common block's alignment from -+ * its belonging ag's alignment -+ */ -+ align_value = AG_ALIGN(tdefsym) > align_value ? -+ AG_ALIGN(tdefsym) : align_value; - fprintf(ASMFIL, "%s, align %d", - AG_ISMOD(gblsym) ? "" : " zeroinitializer", align_value); - for (llObjtodbgFirst(listp, &i); !llObjtodbgAtEnd(&i); -@@ -1492,12 +1499,24 @@ write_bss(void) - char *bss_nm = bss_name; - - if (gbl.bss_addr) { -+ char gname[MXIDLN + 50]; -+ int align; -+ SPTR ag; -+ -+ /* handle the flang1 pragma !dir$ align -+ * Here we refer bss's alignment from -+ * its belonging ag's alignment -+ */ -+ sprintf(gname, "struct%s", bss_nm); -+ ag = find_ag(gname); -+ align = AG_ALIGN(ag) > 32 ? AG_ALIGN(ag) : 32; -+ - fprintf(ASMFIL, "%%struct%s = type <{[%" ISZ_PF "d x i8]}>\n", bss_nm, - gbl.bss_addr); - fprintf(ASMFIL, - "@%s = %s %%struct%s <{[%" ISZ_PF "d x i8] " -- "zeroinitializer }> , align 32", -- bss_nm, type_str, bss_nm, gbl.bss_addr); -+ "zeroinitializer }> , align %d", -+ bss_nm, type_str, bss_nm, gbl.bss_addr, align); - ll_write_object_dbg_references(ASMFIL, cpu_llvm_module, bss_dbg_list); - bss_dbg_list = NULL; - fputc('\n', ASMFIL); -@@ -4263,6 +4282,10 @@ assn_static_off(SPTR sptr, DTYPE dtype, ISZ_T size) - } else { - a = align_unconstrained(dtype); - } -+ -+ if (DTA(dtype) > a) -+ a = DTA(dtype); -+ - addr = ALIGN(addr, a); - ADDRESSP(sptr, addr); - if (DINITG(sptr)) { -diff --git a/tools/flang2/flang2exe/upper.cpp b/tools/flang2/flang2exe/upper.cpp -index d11655d..664b868 100644 ---- a/tools/flang2/flang2exe/upper.cpp -+++ b/tools/flang2/flang2exe/upper.cpp -@@ -1708,6 +1708,7 @@ read_datatype(void) - dt = get_type(6, dval, NOSYM); - datatypexref[dtype] = dt; - DTySetAlgTy(dt, member, size, tag, align, 0); -+ DTA(dt) = align; - break; - case TY_CHAR: - size = getval("len"); -diff --git a/tools/flang2/utils/symtab/sharedefs.h b/tools/flang2/utils/symtab/sharedefs.h -index 30ae371..50495fc 100644 ---- a/tools/flang2/utils/symtab/sharedefs.h -+++ b/tools/flang2/utils/symtab/sharedefs.h -@@ -30,21 +30,21 @@ - - /* declare: - * struct{ -- * dt* stg_base; -+ * dt* stg_base, *stg_align; - * unsigned int stg_size, stg_avail, stg_free, stg_cleared, - * stg_dtsize; - * void* stg_sidecar; * }name; */ - - /* declare the stg_ members; useful in a struct that also has other members */ - #define STG_MEMBERS(dt) \ -- dt *stg_base; \ -+ dt *stg_base, *stg_align; \ - unsigned int stg_size, stg_avail, stg_free, stg_cleared, stg_dtsize, \ - stg_freelink_offset, stg_flags; \ - const char *stg_name; \ - void *stg_sidecar - - /* to statically initialize STG_MEMBERS */ --#define STG_INIT NULL, 0, 0, 0, 0, 0, 0, 0, NULL, NULL -+#define STG_INIT NULL, NULL, 0, 0, 0, 0, 0, 0, 0, NULL, NULL - - /* declare a struct with the stg_members */ - #define STG_DECLARE(name, dt) \ -diff --git a/tools/flang2/utils/symtab/symtab.in.h b/tools/flang2/utils/symtab/symtab.in.h -index 884aa31..889850e 100644 ---- a/tools/flang2/utils/symtab/symtab.in.h -+++ b/tools/flang2/utils/symtab/symtab.in.h -@@ -29,6 +29,7 @@ - #define DT_CPTR DT_ADDR - - #define DTY(d) (stb.dt.stg_base[d]) -+#define DTA(d) (stb.dt.stg_align[d]) - - /* for fast DT checking -- define table indexed by TY_ */ - extern short dttypes[TY_MAX+1]; -diff --git a/tools/shared/miscutil.c b/tools/shared/miscutil.c -index 05dd030..e747680 100644 ---- a/tools/shared/miscutil.c -+++ b/tools/shared/miscutil.c -@@ -147,6 +147,8 @@ stg_alloc_base(STG *stg, int dtsize, BIGUINT64 size, const char *name) - stg->stg_cleared = 0; - stg->stg_name = name; - stg->stg_base = (void *)sccalloc(stg->stg_dtsize * size); -+ stg->stg_align = (void *)sccalloc(stg->stg_dtsize * size); -+ memset(stg->stg_align, 0, stg->stg_dtsize * size); - } else { - invalid_size("stg_alloc", dtsize, size, name); - } -@@ -210,8 +212,10 @@ stg_delete(STG *stg) - if (DBGBIT(7,0x10)) - fprintf(gbl.dbgfil, "stg_delete(stg=%p, dtsize=%d, size=%d, name=%s)\n", - stg, stg->stg_dtsize, stg->stg_size, stg->stg_name); -- if (stg->stg_base) -+ if (stg->stg_base) { - sccfree((char *)stg->stg_base); -+ sccfree((char *)stg->stg_align); -+ } - memset(stg, 0, sizeof(STG)); - } /* stg_delete */ - -@@ -256,6 +260,10 @@ stg_need(STG *stg) - thisstg->stg_size = newsize; - thisstg->stg_base = (void *)sccrelal( - (char *)thisstg->stg_base, newsize * thisstg->stg_dtsize); -+ thisstg->stg_align = (void *)sccrelal( -+ (char *)thisstg->stg_align, newsize * thisstg->stg_dtsize); -+ memset((char*)thisstg->stg_align + oldsize * thisstg->stg_dtsize, 0, -+ (newsize - oldsize) * thisstg->stg_dtsize); - } - /* we have to clear all newly allocated elements, in case there - * are sidecars with the NOCLEAR flag set, so they get initially cleared */ -diff --git a/tools/shared/pragma.c b/tools/shared/pragma.c -index 0956139..4105b3b 100644 ---- a/tools/shared/pragma.c -+++ b/tools/shared/pragma.c -@@ -994,7 +994,29 @@ do_sw(void) - case SW_ESCTYALIAS: - break; - case SW_ALIGN: -- break; -+ /* declaration align XX */ -+ if (gtok() != T_INT) { -+ int backup_nowarn = gbl.nowarn; -+ gbl.nowarn = false; -+ error((error_code_t)280, ERR_Warning, lineno, \ -+ "ALIGN: allow int alignment only", 0); -+ gbl.nowarn = backup_nowarn; -+ return true; -+ } -+ -+ /* check whether the alignment is power of 2 */ -+ if (itok <= 0 || ((itok & (itok - 1)) != 0)) { -+ int backup_nowarn = gbl.nowarn; -+ gbl.nowarn = false; -+ error((error_code_t)280, ERR_Warning, lineno, \ -+ "ALIGN: allow power of 2 alignment only", 0); -+ gbl.nowarn = backup_nowarn; -+ return true; -+ } -+ -+ TR1("SW_ALIGN alignment[%d]\n", itok); -+ flg.x[251] = itok; -+ return true; - case SW_BOUNDS: - if (no_specified) { - bclr(DIR_OFFSET(currdir, x[70]), 0x02); -diff --git a/tools/shared/sharedefs.h b/tools/shared/sharedefs.h -index 30ae371..50495fc 100644 ---- a/tools/shared/sharedefs.h -+++ b/tools/shared/sharedefs.h -@@ -30,21 +30,21 @@ - - /* declare: - * struct{ -- * dt* stg_base; -+ * dt* stg_base, *stg_align; - * unsigned int stg_size, stg_avail, stg_free, stg_cleared, - * stg_dtsize; - * void* stg_sidecar; * }name; */ - - /* declare the stg_ members; useful in a struct that also has other members */ - #define STG_MEMBERS(dt) \ -- dt *stg_base; \ -+ dt *stg_base, *stg_align; \ - unsigned int stg_size, stg_avail, stg_free, stg_cleared, stg_dtsize, \ - stg_freelink_offset, stg_flags; \ - const char *stg_name; \ - void *stg_sidecar - - /* to statically initialize STG_MEMBERS */ --#define STG_INIT NULL, 0, 0, 0, 0, 0, 0, 0, NULL, NULL -+#define STG_INIT NULL, NULL, 0, 0, 0, 0, 0, 0, 0, NULL, NULL - - /* declare a struct with the stg_members */ - #define STG_DECLARE(name, dt) \ -diff --git a/tools/shared/utils/sharedefs.h b/tools/shared/utils/sharedefs.h -index a941cde..45093b9 100644 ---- a/tools/shared/utils/sharedefs.h -+++ b/tools/shared/utils/sharedefs.h -@@ -38,21 +38,21 @@ - - /* declare: - * struct{ -- * dt* stg_base; -+ * dt* stg_base, *stg_align; - * unsigned int stg_size, stg_avail, stg_free, stg_cleared, - * stg_dtsize; - * void* stg_sidecar; * }name; */ - - /* declare the stg_ members; useful in a struct that also has other members */ - #define STG_MEMBERS(dt) \ -- dt *stg_base; \ -+ dt *stg_base, *stg_align; \ - unsigned int stg_size, stg_avail, stg_free, stg_cleared, stg_dtsize, \ - stg_freelink_offset, stg_flags; \ - char *stg_name; \ - void *stg_sidecar - - /* to statically initialize STG_MEMBERS */ --#define STG_INIT NULL, 0, 0, 0, 0, 0, 0, 0, NULL, NULL -+#define STG_INIT NULL, NULL, 0, 0, 0, 0, 0, 0, 0, NULL, NULL - - /* declare a struct with the stg_members */ - #define STG_DECLARE(name, dt) \ --- -2.25.1 - diff --git a/21-add-align-prgma-for-fix-shape-array-character-type.patch b/21-add-align-prgma-for-fix-shape-array-character-type.patch deleted file mode 100644 index 0f60c382fc63fa216ab1a47e285e6475ddc58d15..0000000000000000000000000000000000000000 --- a/21-add-align-prgma-for-fix-shape-array-character-type.patch +++ /dev/null @@ -1,468 +0,0 @@ -From 4ff3f25edbc9fe18b159b121e3323c1ec68bdc52 Mon Sep 17 00:00:00 2001 -From: yinjiawei2023 -Date: Thu, 1 Jun 2023 22:50:53 +0800 -Subject: [PATCH] [flang] Add align pragma for fix shape array/character - -This patch add align pragma for fix shape array/character, -and add some test cases for this pragma. ---- - test/directives/align_array_type.f90 | 157 +++++++++++++++++++++++ - test/directives/align_character_type.f90 | 111 ++++++++++++++++ - tools/flang1/flang1exe/dtypeutl.c | 7 +- - tools/flang1/flang1exe/exterf.c | 18 +++ - tools/flang1/flang1exe/interf.c | 2 + - tools/flang1/flang1exe/lowersym.c | 18 +++ - tools/flang2/flang2exe/dtypeutl.cpp | 7 +- - tools/flang2/flang2exe/upper.cpp | 5 +- - 8 files changed, 322 insertions(+), 3 deletions(-) - create mode 100644 test/directives/align_array_type.f90 - create mode 100644 test/directives/align_character_type.f90 - -diff --git a/test/directives/align_array_type.f90 b/test/directives/align_array_type.f90 -new file mode 100644 -index 0000000..5335a9b ---- /dev/null -+++ b/test/directives/align_array_type.f90 -@@ -0,0 +1,157 @@ -+! RUN: %flang -O0 -S -emit-llvm %s -o - | FileCheck %s -+ -+! CHECK: %struct[[BLOCK1:\.BSS[0-9]+]] = type <{ [356 x i8] }> -+! CHECK: %struct[[BLOCK2:\.BSS[0-9]+]] = type <{ [612 x i8] }> -+! CHECK: %struct[[BLOCK3:\.BSS[0-9]+]] = type <{ [1124 x i8] }> -+! CHECK: %struct[[BLOCK4:\.BSS[0-9]+]] = type <{ [2148 x i8] }> -+! CHECK: %struct[[BLOCK5:_module_align_array_[0-9]+_]] = type <{ [228 x i8] }> -+! CHECK: @[[BLOCK1]] = internal global %struct[[BLOCK1]] zeroinitializer, align 256 -+! CHECK: @[[BLOCK2]] = internal global %struct[[BLOCK2]] zeroinitializer, align 512 -+! CHECK: @[[BLOCK3]] = internal global %struct[[BLOCK3]] zeroinitializer, align 1024 -+! CHECK: @[[BLOCK4]] = internal global %struct[[BLOCK4]] zeroinitializer, align 2048 -+! CHECK: @[[BLOCK5]] = common global %struct[[BLOCK5]] zeroinitializer, align 128 -+ -+module module_align_array -+implicit none -+ -+ !dir$ align 128 -+ integer, dimension (5,5) :: v1 -+ -+ !dir$ align 128 -+ integer, dimension (5,5) :: v2 -+ -+ interface -+ module subroutine module_interface_subroutine() -+ end subroutine module_interface_subroutine -+ end interface -+ -+end module module_align_array -+ -+submodule (module_align_array) submodule_align_array -+ -+ contains -+ module subroutine module_interface_subroutine() -+ -+ !dir$ align 256 -+ integer, dimension (5,5) :: v3 -+ -+ !dir$ align 256 -+ integer, dimension (5,5) :: v4 -+ -+ -+ v3(1, 1) = 101 -+! CHECK: store i32 101, ptr @[[BLOCK1]], align -+ -+ v3(5, 5) = 102 -+! CHECK: %[[TEMP:[0-9]+]] = getelementptr i8, ptr @[[BLOCK1]], i64 96 -+! CHECK: store i32 102, ptr %[[TEMP]], align -+ -+ v4(1, 1) = 103 -+! CHECK: %[[TEMP:[0-9]+]] = getelementptr i8, ptr @[[BLOCK1]], i64 256 -+! CHECK: store i32 103, ptr %[[TEMP]], align -+ -+ v4(5, 5) = 104 -+! CHECK: %[[TEMP:[0-9]+]] = getelementptr i8, ptr @[[BLOCK1]], i64 352 -+! CHECK: store i32 104, ptr %[[TEMP]], align -+ -+ end subroutine module_interface_subroutine -+end submodule submodule_align_array -+ -+ -+ -+program align -+use module_align_array -+implicit none -+ -+ !dir$ align 512 -+ integer, dimension (5,5) :: v5 -+ -+ !dir$ align 512 -+ integer, dimension (5,5) :: v6 -+ -+ -+ v5(1, 1) = 201 -+! CHECK: store i32 201, ptr @[[BLOCK2]], align -+ -+ v5(5, 5) = 202 -+! CHECK: %[[TEMP:[0-9]+]] = getelementptr i8, ptr @[[BLOCK2]], i64 96 -+! CHECK: store i32 202, ptr %[[TEMP]], align -+ -+ v6(1, 1) = 203 -+! CHECK: %[[TEMP:[0-9]+]] = getelementptr i8, ptr @[[BLOCK2]], i64 512 -+! CHECK: store i32 203, ptr %[[TEMP]], align -+ -+ v6(5, 5) = 204 -+! CHECK: %[[TEMP:[0-9]+]] = getelementptr i8, ptr @[[BLOCK2]], i64 608 -+! CHECK: store i32 204, ptr %[[TEMP]], align -+ -+ v1(1, 1) = 81 -+! CHECK: store i32 81, ptr @[[BLOCK5]], align -+ -+ v1(5, 5) = 82 -+! CHECK: %[[TEMP:[0-9]+]] = getelementptr i8, ptr @[[BLOCK5]], i64 96 -+! CHECK: store i32 82, ptr %[[TEMP]], align -+ -+ v2(1, 1) = 83 -+! CHECK: %[[TEMP:[0-9]+]] = getelementptr i8, ptr @[[BLOCK5]], i64 128 -+! CHECK: store i32 83, ptr %[[TEMP]], align -+ -+ v2(5, 5) = 84 -+! CHECK: %[[TEMP:[0-9]+]] = getelementptr i8, ptr @[[BLOCK5]], i64 224 -+! CHECK: store i32 84, ptr %[[TEMP]], align -+ -+end program align -+ -+ -+subroutine subroutine_align() -+ -+ !dir$ align 1024 -+ integer, dimension (5,5) :: v7 -+ -+ !dir$ align 1024 -+ integer, dimension (5,5) :: v8 -+ -+ v7(1, 1) = 401 -+! CHECK: store i32 401, ptr @[[BLOCK3]], align -+ -+ v7(5, 5) = 402 -+! CHECK: %[[TEMP:[0-9]+]] = getelementptr i8, ptr @[[BLOCK3]], i64 96 -+! CHECK: store i32 402, ptr %[[TEMP]], align -+ -+ v8(1, 1) = 403 -+! CHECK: %[[TEMP:[0-9]+]] = getelementptr i8, ptr @[[BLOCK3]], i64 1024 -+! CHECK: store i32 403, ptr %[[TEMP]], align -+ -+ v8(5, 5) = 404 -+! CHECK: %[[TEMP:[0-9]+]] = getelementptr i8, ptr @[[BLOCK3]], i64 1120 -+! CHECK: store i32 404, ptr %[[TEMP]], align -+ -+ return -+end subroutine subroutine_align -+ -+ -+function function_align() -+ -+ !dir$ align 2048 -+ integer, dimension (5,5) :: v9 -+ -+ !dir$ align 2048 -+ integer, dimension (5,5) :: v10 -+ -+ v9(1, 1) = 801 -+! CHECK: store i32 801, ptr @[[BLOCK4]], align -+ -+ v9(5, 5) = 802 -+! CHECK: %[[TEMP:[0-9]+]] = getelementptr i8, ptr @[[BLOCK4]], i64 96 -+! CHECK: store i32 802, ptr %[[TEMP]], align -+ -+ v10(1, 1) = 803 -+! CHECK: %[[TEMP:[0-9]+]] = getelementptr i8, ptr @[[BLOCK4]], i64 2048 -+! CHECK: store i32 803, ptr %[[TEMP]], align -+ -+ v10(5, 5) = 804 -+! CHECK: %[[TEMP:[0-9]+]] = getelementptr i8, ptr @[[BLOCK4]], i64 2144 -+! CHECK: store i32 804, ptr %[[TEMP]], align -+ -+ return -+end function function_align -diff --git a/test/directives/align_character_type.f90 b/test/directives/align_character_type.f90 -new file mode 100644 -index 0000000..adc96c6 ---- /dev/null -+++ b/test/directives/align_character_type.f90 -@@ -0,0 +1,111 @@ -+! RUN: %flang -O0 -S -emit-llvm %s -o - | FileCheck %s -+ -+! CHECK: %struct[[BLOCK1:_module_align_character_[0-9]+_]] = type <{ [138 x i8] } -+! CHECK: @[[BLOCK1]] = common global %struct[[BLOCK1]] zeroinitializer, align 512 -+ -+module module_align_character -+implicit none -+ -+ !dir$ align 128 -+ character(len=10) :: v1 -+ -+ !dir$ align 128 -+ character(len=10) :: v2 -+ -+ interface -+ module subroutine module_interface_subroutine() -+ end subroutine module_interface_subroutine -+ end interface -+ -+end module module_align_character -+ -+submodule (module_align_character) submodule_align_character -+ -+ contains -+ module subroutine module_interface_subroutine() -+ -+ !dir$ align 256 -+ character(len=10) :: v3 -+! CHECK: %[[V3:v3_[0-9]+]] = alloca [10 x i8], align 256 -+ -+ !dir$ align 256 -+ character(len=10) :: v4 -+! CHECK: %[[V4:v4_[0-9]+]] = alloca [10 x i8], align 256 -+ -+ v3 = "101" -+! CHECK: store volatile i64 %{{[0-9]+}}, ptr %[[V3]], align -+ -+ v4 = "102" -+! CHECK: store volatile i64 %{{[0-9]+}}, ptr %[[V4]], align -+ -+ end subroutine module_interface_subroutine -+end submodule submodule_align_character -+ -+ -+ -+program align -+use module_align_character -+implicit none -+ -+ !dir$ align 512 -+ character(len=10) :: v5 -+! CHECK: %[[V5:v5_[0-9]+]] = alloca [10 x i8], align 512 -+ -+ !dir$ align 512 -+ character(len=10) :: v6 -+! CHECK: %[[V6:v6_[0-9]+]] = alloca [10 x i8], align 512 -+ -+ v5 = "201" -+! CHECK: store volatile i64 %{{[0-9]+}}, ptr %[[V5]], align -+ -+ v6 = "202" -+! CHECK: store volatile i64 %{{[0-9]+}}, ptr %[[V6]], align -+ -+ v1 = "81" -+! CHECK: store volatile i64 %{{[0-9]+}}, ptr @[[BLOCK1]], align -+ -+ v2 = "82" -+! CHECK: %[[TEMP:[0-9]+]] = getelementptr i8, ptr @[[BLOCK1]], i64 512 -+! CHECK: store volatile i64 %{{[0-9]+}}, ptr %[[TEMP]], align -+ -+end program align -+ -+ -+subroutine subroutine_align() -+ -+ !dir$ align 1024 -+ character(len=10) :: v7 -+! CHECK: %[[V7:v7_[0-9]+]] = alloca [10 x i8], align 1024 -+ -+ !dir$ align 1024 -+ character(len=10) :: v8 -+! CHECK: %[[V8:v8_[0-9]+]] = alloca [10 x i8], align 1024 -+ -+ v7 = "401" -+! CHECK: store volatile i64 %{{[0-9]+}}, ptr %[[V7]], align -+ -+ v8 = "402" -+! CHECK: store volatile i64 %{{[0-9]+}}, ptr %[[V8]], align -+ -+ return -+end subroutine subroutine_align -+ -+ -+function function_align() -+ -+ !dir$ align 2048 -+ character(len=10) :: v9 -+! CHECK: %[[V9:v9_[0-9]+]] = alloca [10 x i8], align 2048 -+ -+ !dir$ align 2048 -+ character(len=10) :: v10 -+! CHECK: %[[V10:v10_[0-9]+]] = alloca [10 x i8], align 2048 -+ -+ v9 = "801" -+! CHECK: store volatile i64 %{{[0-9]+}}, ptr %[[V9]], align -+ -+ v10 = "802" -+! CHECK: store volatile i64 %{{[0-9]+}}, ptr %[[V10]], align -+ -+ return -+end function function_align -diff --git a/tools/flang1/flang1exe/dtypeutl.c b/tools/flang1/flang1exe/dtypeutl.c -index 33fa5bc..fa280d9 100644 ---- a/tools/flang1/flang1exe/dtypeutl.c -+++ b/tools/flang1/flang1exe/dtypeutl.c -@@ -1213,7 +1213,10 @@ alignment(DTYPE dtype) - case TY_CHAR: - case TY_NCHAR: - case TY_PTR: -- return dtypeinfo[ty].align; -+ align_val = dtypeinfo[ty].align; -+ if (DTA(dtype) > align_val) -+ return DTA(dtype); -+ return align_val; - case TY_INT8: - case TY_LOG8: - if (!flg.dalign || XBIT(119, 0x100000)) -@@ -1222,6 +1225,8 @@ alignment(DTYPE dtype) - - case TY_ARRAY: - align_val = alignment((int)DTY(dtype + 1)); -+ if (DTA(dtype) > align_val) -+ return DTA(dtype); - return align_val; - - case TY_STRUCT: -diff --git a/tools/flang1/flang1exe/exterf.c b/tools/flang1/flang1exe/exterf.c -index 51f412d..21e8444 100644 ---- a/tools/flang1/flang1exe/exterf.c -+++ b/tools/flang1/flang1exe/exterf.c -@@ -2104,6 +2104,15 @@ export_dt(int dtype) - } - } else /* 'null' descriptor */ - lzprintf(outlz, " %d", 0); -+ -+ /* If align pragma value is smaller than its original alignment, -+ * then align pragma should have no effect -+ */ -+ if (DTA(dtype) == alignment(dtype)) -+ lzprintf(outlz, " %d", (int)DTA(dtype)); -+ else -+ lzprintf(outlz, " %d", 0); -+ - break; - case TY_UNION: - case TY_STRUCT: -@@ -2120,6 +2129,15 @@ export_dt(int dtype) - case TY_CHAR: - case TY_NCHAR: - lzprintf(outlz, " %d", (int)DTY(dtype + 1)); -+ -+ /* If align pragma value is smaller than its original alignment, -+ * then align pragma should have no effect -+ */ -+ if (DTA(dtype) == alignment(dtype)) -+ lzprintf(outlz, " %d", (int)DTA(dtype)); -+ else -+ lzprintf(outlz, " %d", 0); -+ - break; - - case TY_PROC: -diff --git a/tools/flang1/flang1exe/interf.c b/tools/flang1/flang1exe/interf.c -index ac77826..39dde48 100644 ---- a/tools/flang1/flang1exe/interf.c -+++ b/tools/flang1/flang1exe/interf.c -@@ -2160,6 +2160,7 @@ import(lzhandle *fdlz, WantPrivates wantPrivates, int ivsn) - ADD_EXTNTAST(new_id, i) = get_num(10); - } - } -+ DTA(new_id) = get_num(10); /* align */ - break; - case TY_UNION: - case TY_STRUCT: -@@ -2176,6 +2177,7 @@ import(lzhandle *fdlz, WantPrivates wantPrivates, int ivsn) - case TY_NCHAR: - stringlen = get_num(10); - new_id = get_type(2, TY_NONE, stringlen); -+ DTA(new_id) = get_num(10); /* align */ - /* use TY_NONE to avoid 'sharing' character data types */ - DTY(new_id) = pd->ty; - break; -diff --git a/tools/flang1/flang1exe/lowersym.c b/tools/flang1/flang1exe/lowersym.c -index 87c22be..0285d1a 100644 ---- a/tools/flang1/flang1exe/lowersym.c -+++ b/tools/flang1/flang1exe/lowersym.c -@@ -2594,6 +2594,15 @@ lower_put_datatype(int dtype, int usage) - } - } - } -+ -+ /* If align pragma value is smaller than its original alignment, -+ * then align pragma should have no effect -+ */ -+ if (DTA(dtype) == alignment(dtype)) -+ putval("align", DTA(dtype)); -+ else -+ putval("align", 0); -+ - break; - case TY_NCHAR: - putwhich("kcharacter", "k"); -@@ -2955,6 +2964,15 @@ lower_put_datatype(int dtype, int usage) - } - } - putsym("numelm", numelm); -+ -+ /* If align pragma value is smaller than its original alignment, -+ * then align pragma should have no effect -+ */ -+ if (DTA(dtype) == alignment(dtype)) -+ putval("align", DTA(dtype)); -+ else -+ putval("align", 0); -+ - break; - - default: -diff --git a/tools/flang2/flang2exe/dtypeutl.cpp b/tools/flang2/flang2exe/dtypeutl.cpp -index 46cd9f8..95c6af8 100644 ---- a/tools/flang2/flang2exe/dtypeutl.cpp -+++ b/tools/flang2/flang2exe/dtypeutl.cpp -@@ -488,7 +488,10 @@ alignment(DTYPE dtype) - case TY_LOG128: - case TY_FLOAT128: - case TY_CMPLX128: -- return dtypeinfo[ty].align; -+ align_bits = dtypeinfo[ty].align; -+ if (DTA(dtype) > align_bits) -+ return DTA(dtype); -+ return align_bits; - case TY_INT8: - case TY_UINT8: - case TY_LOG8: -@@ -498,6 +501,8 @@ alignment(DTYPE dtype) - - case TY_ARRAY: - align_bits = alignment(DTySeqTyElement(dtype)); -+ if (DTA(dtype) > align_bits) -+ return DTA(dtype); - return align_bits; - case TY_VECT: - return alignment(DTySeqTyElement(dtype)); -diff --git a/tools/flang2/flang2exe/upper.cpp b/tools/flang2/flang2exe/upper.cpp -index 664b868..7ddeeac 100644 ---- a/tools/flang2/flang2exe/upper.cpp -+++ b/tools/flang2/flang2exe/upper.cpp -@@ -1721,7 +1721,9 @@ read_datatype(void) - } else if (size == -4) { - datatypexref[dtype] = DT_DEFERCHAR; - } else { -- datatypexref[dtype] = get_type(2, dval, size); -+ dt = get_type(2, dval, size); -+ DTA(dt) = getval("align"); -+ datatypexref[dtype] = dt; - } - break; - case TY_NCHAR: -@@ -1754,6 +1756,7 @@ read_datatype(void) - } - AD_ZBASE(ad) = getval("zbase"); - AD_NUMELM(ad) = getSptrVal("numelm"); -+ DTA(dt) = getval("align"); - datatypexref[dtype] = dt; - break; - case TY_PTR: --- -2.25.1 - diff --git a/22-fix-import-use.patch b/22-fix-import-use.patch deleted file mode 100644 index 4e2b0a739aff6c05ee87fd0aef1a1d1441310cdd..0000000000000000000000000000000000000000 --- a/22-fix-import-use.patch +++ /dev/null @@ -1,146 +0,0 @@ -commit 1756c26ed8a0a6ee46b0b0bcb3edc49f6578ddeb -Author: q00576763 -Date: Thu Jun 1 16:32:51 2023 +0800 - - [Huawei][Flang1] Fix the string operation of file name - - Offering: BiSheng - - This bug came from 0bcbadbf3f7f056b298a7724b9689ebacbdae4e9, which uses - strdup to allocate non-const versions of const string, but does not - change the use of the original string. The use of original string (file - name) terminates the string by removing the last directory. So, we need - to replace the use of original string with the allocated string. - -diff --git a/test/f90_correct/inc/import_mod_from_user.mk b/test/f90_correct/inc/import_mod_from_user.mk -new file mode 100644 -index 00000000..aff318dc ---- /dev/null -+++ b/test/f90_correct/inc/import_mod_from_user.mk -@@ -0,0 +1,30 @@ -+# -+# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -+# See https://llvm.org/LICENSE.txt for license information. -+# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -+# -+ -+$(TEST): run -+ -+build: $(SRC)/$(TEST).f90 -+ -$(RM) $(TEST).$(EXESUFFIX) core *.d *.mod FOR*.DAT FTN* ftn* fort.* -+ @echo ------------------------------------ building test $@ -+ -$(MKDIR) import_mod_from_user_dir1 -+ -$(CD) import_mod_from_user_dir1 -+ -$(CP) $(SRC)/import_mod_from_user_dir1_m2.f90 . -+ -$(FC) -c import_mod_from_user_dir1_m2.f90 -+ -$(CD) .. -+ -$(MKDIR) import_mod_from_user_dir2 -+ -$(CD) import_mod_from_user_dir2 -+ -$(CP) $(SRC)/import_mod_from_user_dir2* . -+ -$(FC) -c import_mod_from_user_dir2_m2.f90 -+ -$(FC) -c import_mod_from_user_dir2_m1.f90 -+ -$(CD) .. -+ -$(FC) -c -I./import_mod_from_user_dir1 -I./import_mod_from_user_dir2 $(SRC)/$(TEST).f90 -o $(TEST).$(OBJX) -+ -$(FC) $(FFLAGS) $(LDFLAGS) $(TEST).$(OBJX) $(LIBS) -o $(TEST).$(EXESUFFIX) -+ -+run: -+ @echo ------------------------------------ executing test $(TEST) -+ $(TEST).$(EXESUFFIX) -+ -+verify: ; -diff --git a/test/f90_correct/lit/import_mod_from_user.sh b/test/f90_correct/lit/import_mod_from_user.sh -new file mode 100644 -index 00000000..3880a96e ---- /dev/null -+++ b/test/f90_correct/lit/import_mod_from_user.sh -@@ -0,0 +1,9 @@ -+# -+# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -+# See https://llvm.org/LICENSE.txt for license information. -+# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -+ -+# Shared lit script for each tests. Run bash commands that run tests with make. -+ -+# RUN: KEEP_FILES=%keep FLAGS=%flags TEST_SRC=%s MAKE_FILE_DIR=%S/.. bash %S/runmake | tee %t -+# RUN: cat %t | FileCheck %S/runmake -diff --git a/test/f90_correct/makefile b/test/f90_correct/makefile -index 0fcd0e24..0116f806 100644 ---- a/test/f90_correct/makefile -+++ b/test/f90_correct/makefile -@@ -26,6 +26,8 @@ COMP_CHECK=python $(HOMEQA)/../tools/check_compilation.py - - RM=rm -f - CP=cp -f -+CD=cd -+MKDIR=mkdir - UNAME := $(shell uname -a) - - INCLUDES=$(BASE_DIR)/inc -diff --git a/test/f90_correct/src/import_mod_from_user.f90 b/test/f90_correct/src/import_mod_from_user.f90 -new file mode 100644 -index 00000000..1f94b156 ---- /dev/null -+++ b/test/f90_correct/src/import_mod_from_user.f90 -@@ -0,0 +1,16 @@ -+! -+! Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -+! See https://llvm.org/LICENSE.txt for license information. -+! SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -+! -+! Test for the import module from the correct path. -+ -+module import_mod_from_user -+contains -+ subroutine sub() -+ use import_source2 -+ end -+end -+ -+ print *, "PASS" -+end -diff --git a/test/f90_correct/src/import_mod_from_user_dir1_m2.f90 b/test/f90_correct/src/import_mod_from_user_dir1_m2.f90 -new file mode 100644 -index 00000000..0d8e44cd ---- /dev/null -+++ b/test/f90_correct/src/import_mod_from_user_dir1_m2.f90 -@@ -0,0 +1,12 @@ -+module import_source -+contains -+ subroutine sub1() -+ end -+ -+ subroutine sub3() -+ end -+ -+ function func() result(funit) -+ integer :: funit -+ end -+end -diff --git a/test/f90_correct/src/import_mod_from_user_dir2_m1.f90 b/test/f90_correct/src/import_mod_from_user_dir2_m1.f90 -new file mode 100644 -index 00000000..63854d67 ---- /dev/null -+++ b/test/f90_correct/src/import_mod_from_user_dir2_m1.f90 -@@ -0,0 +1,3 @@ -+module import_source2 -+ use import_source, only : func, sub1 -+end -diff --git a/test/f90_correct/src/import_mod_from_user_dir2_m2.f90 b/test/f90_correct/src/import_mod_from_user_dir2_m2.f90 -new file mode 100644 -index 00000000..0e9f00ee ---- /dev/null -+++ b/test/f90_correct/src/import_mod_from_user_dir2_m2.f90 -@@ -0,0 +1,13 @@ -+module import_source -+contains -+ subroutine sub1() -+ end -+ -+ subroutine sub2(m) -+ integer, intent(out) :: m -+ end -+ -+ function func() result(funit) -+ integer :: funit -+ end -+end diff --git a/23-fix-bug-about-sizeof-for-data-with-Bind-C.patch b/23-fix-bug-about-sizeof-for-data-with-Bind-C.patch deleted file mode 100644 index 38178049bbcddf3c9a76921ef8ade035eee1c3d6..0000000000000000000000000000000000000000 --- a/23-fix-bug-about-sizeof-for-data-with-Bind-C.patch +++ /dev/null @@ -1,167 +0,0 @@ -From 8c7c92dd89826946443deeae34bd371ec930e924 Mon Sep 17 00:00:00 2001 -From: xieyihui -Date: Mon, 11 Sep 2023 11:45:05 +0800 -Subject: [PATCH] Fix bug about sizeof for data with Bind(C) - -diff --git a/test/f90_correct/inc/sizeof_for_cdata.mk b/test/f90_correct/inc/sizeof_for_cdata.mk -new file mode 100644 -index 00000000..fa97d0c6 ---- /dev/null -+++ b/test/f90_correct/inc/sizeof_for_cdata.mk -@@ -0,0 +1,28 @@ -+# -+# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -+# See https://llvm.org/LICENSE.txt for license information. -+# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -+# -+ -+########## Make rule for test sizeof_for_cdata ######## -+ -+ -+sizeof_for_cdata: run -+ -+ -+build: $(SRC)/sizeof_for_cdata.f90 -+ -$(RM) sizeof_for_cdata.$(EXESUFFIX) core *.d *.mod FOR*.DAT FTN* ftn* fort.* -+ @echo ------------------------------------ building test $@ -+ -$(CC) -c $(CFLAGS) $(SRC)/check.c -o check.$(OBJX) -+ -$(FC) -c $(FFLAGS) $(LDFLAGS) $(SRC)/sizeof_for_cdata.f90 -o sizeof_for_cdata.$(OBJX) -+ -$(FC) $(FFLAGS) $(LDFLAGS) sizeof_for_cdata.$(OBJX) check.$(OBJX) $(LIBS) -o sizeof_for_cdata.$(EXESUFFIX) -+ -+ -+run: -+ @echo ------------------------------------ executing test sizeof_for_cdata -+ sizeof_for_cdata.$(EXESUFFIX) -+ -+verify: ; -+ -+sizeof_for_cdata.run: run -+ -diff --git a/test/f90_correct/lit/sizeof_for_cdata.sh b/test/f90_correct/lit/sizeof_for_cdata.sh -new file mode 100644 -index 00000000..33c953a1 ---- /dev/null -+++ b/test/f90_correct/lit/sizeof_for_cdata.sh -@@ -0,0 +1,9 @@ -+# -+# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -+# See https://llvm.org/LICENSE.txt for license information. -+# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -+ -+# Shared lit script for each tests. Run bash commands that run tests with make. -+ -+# RUN: KEEP_FILES=%keep FLAGS=%flags TEST_SRC=%s MAKE_FILE_DIR=%S/.. bash %S/runmake | tee %t -+# RUN: cat %t | FileCheck %S/runmake -diff --git a/test/f90_correct/src/sizeof_for_cdata.f90 b/test/f90_correct/src/sizeof_for_cdata.f90 -new file mode 100644 -index 00000000..93ea734e ---- /dev/null -+++ b/test/f90_correct/src/sizeof_for_cdata.f90 -@@ -0,0 +1,33 @@ -+ -+module test -+ use ISO_C_BINDING -+ type, bind(C) :: addrinfo -+ integer(KIND=C_INT) :: flag1, flag2, flag3, flag4 -+ integer(KIND=C_SIZE_T) :: addrlen -+ type(C_PTR) :: addr, name, next -+ end type addrinfo -+ -+ interface -+ type(C_PTR) function memset(s, c, n) bind(C, name="memset") -+ use ISO_C_BINDING -+ type(C_PTR), intent(IN), value :: s -+ integer(KIND=C_INT), intent(IN), value :: c -+ integer(KIND=C_SIZE_T), intent(IN), value :: n -+ end function memset -+ end interface -+ -+ contains -+ subroutine test1 -+ implicit none -+ type(addrinfo), target :: hints -+ type(C_PTR) :: ptr -+ INTEGER(KIND=4) :: my_integer -+ ptr = memset(c_loc(hints), my_integer, SIZEOF(hints)) -+ end subroutine -+end module -+program main -+ use test -+ implicit none -+ call test1() -+ print *, "PASS" -+end program main -\ No newline at end of file -diff --git a/tools/flang1/flang1exe/semant.c b/tools/flang1/flang1exe/semant.c -index b2c8d2ae..6b20ca78 100644 ---- a/tools/flang1/flang1exe/semant.c -+++ b/tools/flang1/flang1exe/semant.c -@@ -121,6 +121,7 @@ static LOGICAL is_entry; - static LOGICAL is_exe_stmt; - static LOGICAL entry_seen; -+static LOGICAL is_cfunc; - static LOGICAL seen_options; - static int adjlen; /* ast of adjustable length specifier */ - static int assumlen; /* non-zero if '*' present */ - static struct { -@@ -1283,6 +1284,7 @@ semant1(int rednum, SST *top) - sem.pgphase = PHASE_SPEC; - } - sem.gdtype = -1; -+ is_cfunc = FALSE; - lenspec[0].kind = 0; - goto statement_shared; - /* -@@ -4842,6 +4844,10 @@ semant1(int rednum, SST *top) - */ - sem.stag_dtype = DTYPEG(sptr); - sem.gdtype = sem.ogdtype = sem.stag_dtype; -+ if(CFUNCG(sptr)) -+ is_cfunc = TRUE; -+ else -+ is_cfunc = FALSE; - defer_put_kind_type_param(0, 0, NULL, sem.stag_dtype, 0, 2); - } else { - sem.stag_dtype = DTYPEG(sptr); -@@ -9654,8 +9660,11 @@ semant1(int rednum, SST *top) - STYPEP(sptr, ST_IDENT); /* stype will be filled in later*/ - /* ...else stype will be set by the actions for */ - -- if (!dtypeset) -+ if (!dtypeset) { - dtype = sem.gdtype; -+ if (is_cfunc) -+ CFUNCP(sptr, 1); -+ } - if (dtype > 0) - DTYPEP(sptr, dtype); - if (stype == ST_ARRAY) { -diff --git a/tools/flang1/flang1exe/semfunc.c b/tools/flang1/flang1exe/semfunc.c -index 1750ddfd..9a58ef6c 100644 ---- a/tools/flang1/flang1exe/semfunc.c -+++ b/tools/flang1/flang1exe/semfunc.c -@@ -10798,14 +10798,14 @@ ref_pd(SST *stktop, ITEM *list) - (void)mkarg(ARG_STK(0), &dum); - XFR_ARGAST(0); - ast = ARG_AST(0); -+ sptr = 0; -+ if (A_TYPEG(ast) == A_MEM) { -+ sptr = A_SPTRG(A_MEMG(ast)); -+ } else if (A_TYPEG(ast) == A_ID) { -+ sptr = A_SPTRG(ast); -+ } - -- if (pdtype == PD_c_sizeof) { -- sptr = 0; -- if (A_TYPEG(ast) == A_MEM) { -- sptr = A_SPTRG(A_MEMG(ast)); -- } else if (A_TYPEG(ast) == A_ID) { -- sptr = A_SPTRG(ast); -- } -+ if (pdtype == PD_c_sizeof || CFUNCG(sptr)) { - if (sptr) { - if (POINTERG(sptr) || ALLOCG(sptr) || CLASSG(sptr) || ASSUMSHPG(sptr) || - ASUMSZG(sptr) || --- -2.25.1 - diff --git a/24-fix-retun-dynamic-multidimensional-array-bug.patch b/24-fix-retun-dynamic-multidimensional-array-bug.patch deleted file mode 100644 index 1bb48b9bcf24f386961203e5334095b4665dc732..0000000000000000000000000000000000000000 --- a/24-fix-retun-dynamic-multidimensional-array-bug.patch +++ /dev/null @@ -1,101 +0,0 @@ -From 25e1718a506935e4f2e1abe1ad28ca828820dca1 Mon Sep 17 00:00:00 2001 -From: xieyihui -Date: Mon, 11 Sep 2023 17:18:51 +0800 -Subject: [PATCH] fix retun dynamic multidimensional array bug - -diff --git a/test/f90_correct/inc/ret_dynamic_data.mk b/test/f90_correct/inc/ret_dynamic_data.mk -new file mode 100644 -index 00000000..46d5e641 ---- /dev/null -+++ b/test/f90_correct/inc/ret_dynamic_data.mk -@@ -0,0 +1,28 @@ -+# -+# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -+# See https://llvm.org/LICENSE.txt for license information. -+# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -+# -+ -+########## Make rule for test ret_dynamic_data ######## -+ -+ -+ret_dynamic_data: run -+ -+ -+build: $(SRC)/ret_dynamic_data.f90 -+ -$(RM) ret_dynamic_data.$(EXESUFFIX) core *.d *.mod FOR*.DAT FTN* ftn* fort.* -+ @echo ------------------------------------ building test $@ -+ -$(CC) -c $(CFLAGS) $(SRC)/check.c -o check.$(OBJX) -+ -$(FC) -c $(FFLAGS) $(LDFLAGS) $(SRC)/ret_dynamic_data.f90 -o ret_dynamic_data.$(OBJX) -+ -$(FC) $(FFLAGS) $(LDFLAGS) ret_dynamic_data.$(OBJX) check.$(OBJX) $(LIBS) -o ret_dynamic_data.$(EXESUFFIX) -+ -+ -+run: -+ @echo ------------------------------------ executing test ret_dynamic_data -+ ret_dynamic_data.$(EXESUFFIX) -+ -+verify: ; -+ -+ret_dynamic_data.run: run -+ -diff --git a/test/f90_correct/lit/ret_dynamic_data.sh b/test/f90_correct/lit/ret_dynamic_data.sh -new file mode 100644 -index 00000000..33c953a1 ---- /dev/null -+++ b/test/f90_correct/lit/ret_dynamic_data.sh -@@ -0,0 +1,9 @@ -+# -+# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -+# See https://llvm.org/LICENSE.txt for license information. -+# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -+ -+# Shared lit script for each tests. Run bash commands that run tests with make. -+ -+# RUN: KEEP_FILES=%keep FLAGS=%flags TEST_SRC=%s MAKE_FILE_DIR=%S/.. bash %S/runmake | tee %t -+# RUN: cat %t | FileCheck %S/runmake -diff --git a/test/f90_correct/src/ret_dynamic_data.f90 b/test/f90_correct/src/ret_dynamic_data.f90 -new file mode 100644 -index 00000000..b00732a4 ---- /dev/null -+++ b/test/f90_correct/src/ret_dynamic_data.f90 -@@ -0,0 +1,23 @@ -+Module test -+Implicit None -+Interface -+ Function f() -+ Integer, Pointer :: f(:, :) -+ End Function -+ End Interface -+ Type :: t -+ Procedure (f), Nopass, Pointer :: p -+ End Type -+End Module -+Program main -+ Use test -+ Type (t) :: x -+ x%p => f -+ If (any(x%p()/=42)) Stop 'FAIL' -+ print *, "PASS" -+End Program -+Function f() -+ Integer, Pointer :: f(:, :) -+ Allocate (f(1,1)) -+ f(1, 1) = 42 -+End Function -\ No newline at end of file -diff --git a/tools/flang1/flang1exe/lowersym.c b/tools/flang1/flang1exe/lowersym.c -index f32d7005..b1001829 100644 ---- a/tools/flang1/flang1exe/lowersym.c -+++ b/tools/flang1/flang1exe/lowersym.c -@@ -5549,7 +5549,8 @@ llvm_check_retval_inargs(int sptr) - dtype = DTYPEG(fval); - fix_class_args(sptr); - if (DTYPEG(sptr) != DT_NONE && makefvallocal(RU_FUNC, fval)) { -- SCP(fval, SC_LOCAL); -+ if (!ALLOCATTRG(sptr) && !POINTERG(sptr)) -+ SCP(fval, SC_LOCAL); - if (is_iso_cptr(DTYPEG(fval))) { - DTYPEP(fval, DT_CPTR); - } --- -2.25.1 - diff --git a/25-add-align-pragma-for-scalar-variables.patch b/25-add-align-pragma-for-scalar-variables.patch deleted file mode 100644 index a90821b82dc983f4db3619eb29884690b467605a..0000000000000000000000000000000000000000 --- a/25-add-align-pragma-for-scalar-variables.patch +++ /dev/null @@ -1,833 +0,0 @@ -From 05c275912c20ff744b7434e5cabed43ff042a3eb Mon Sep 17 00:00:00 2001 -From: HuQingYuan -Date: Wed, 25 Oct 2023 13:33:21 +0800 -Subject: [PATCH] add align pragma for scalar variables - ---- - test/directives/align_pragma_function_var.f90 | 46 ++++++++++++ - .../align_pragma_local_var_init.f90 | 14 ++++ - .../align_pragma_local_var_no_init.f90 | 12 +++ - .../align_pragma_module_var_init.f90 | 51 +++++++++++++ - .../align_pragma_module_var_no_init.f90 | 42 +++++++++++ - .../align_pragma_subroutine_var.f90 | 36 +++++++++ - tools/flang1/flang1exe/exterf.c | 4 + - tools/flang1/flang1exe/global.h | 10 +++ - tools/flang1/flang1exe/lowersym.c | 6 ++ - tools/flang1/flang1exe/main.c | 2 + - tools/flang1/flang1exe/parser.c | 9 ++- - tools/flang1/flang1exe/scan.c | 15 ++++ - tools/flang1/flang1exe/symtab.c | 75 +++++++++++++++++++ - tools/flang1/utils/symtab/symtab.in.h | 5 ++ - tools/flang1/utils/symtab/symtab.n | 4 + - tools/flang2/flang2exe/llassem.cpp | 56 +++++++++++--- - tools/flang2/flang2exe/upper.cpp | 51 ++++++++++++- - tools/flang2/utils/symtab/symtab.n | 4 + - tools/shared/pragma.c | 8 +- - 19 files changed, 437 insertions(+), 13 deletions(-) - create mode 100644 test/directives/align_pragma_function_var.f90 - create mode 100644 test/directives/align_pragma_local_var_init.f90 - create mode 100644 test/directives/align_pragma_local_var_no_init.f90 - create mode 100644 test/directives/align_pragma_module_var_init.f90 - create mode 100644 test/directives/align_pragma_module_var_no_init.f90 - create mode 100644 test/directives/align_pragma_subroutine_var.f90 - -diff --git a/test/directives/align_pragma_function_var.f90 b/test/directives/align_pragma_function_var.f90 -new file mode 100644 -index 0000000..76daea2 ---- /dev/null -+++ b/test/directives/align_pragma_function_var.f90 -@@ -0,0 +1,46 @@ -+! RUN: %flang -O0 -S -emit-llvm %s -o - | FileCheck %s -+ -+! CHECK: %struct.[[BLOCK1:STATICS[0-9]+]] = type <{ [132 x i8] }> -+! CHECK: @.[[BLOCK1]] = internal global %struct.[[BLOCK1]] <{ [132 x i8] {{[^,]+}} }>, align 128 -+integer(kind=4) function function_init() -+ !dir$ align 128 -+ integer(kind=4) :: a128 = 10 -+ !dir$ align 128 -+ integer(kind=4) :: b128 = 20 -+! CHECK: {{[^g]+}}getelementptr {{[^,]+}}, {{[^,]+}}, i64 128 -+ a128 = a128 + 1 -+! CHECK: {{[^g]+}}getelementptr {{[^,]+}}, {{[^,]+}}, i64 128 -+ b128 = b128 + 2 -+! CHECK: {{[^g]+}}getelementptr {{[^,]+}}, {{[^,]+}}, i64 128 -+ function_init = a128 + b128 -+end function function_init -+ -+ -+integer(kind=4) function function_no_init() -+! CHECK: {{[^=]+}} = alloca i32, align 128 -+ !dir$ align 128 -+ integer(kind=4) :: a128 -+! CHECK: {{[^=]+}} = alloca i32, align 128 -+ !dir$ align 128 -+ integer(kind=4) :: b128 -+ -+ a128 = 1 -+ b128 = 2 -+ -+ function_no_init = a128 + b128 -+end function function_no_init -+ -+ -+program MainProgram -+ implicit none -+ -+ -+ integer(kind=4) :: res -+ integer(kind=4) :: function_init -+ integer(kind=4) :: function_no_init -+ -+ res = function_init() -+ res = function_no_init() -+ -+end program MainProgram -+ -diff --git a/test/directives/align_pragma_local_var_init.f90 b/test/directives/align_pragma_local_var_init.f90 -new file mode 100644 -index 0000000..a1ae402 ---- /dev/null -+++ b/test/directives/align_pragma_local_var_init.f90 -@@ -0,0 +1,14 @@ -+! RUN: %flang -O0 -S -emit-llvm %s -o - | FileCheck %s -+! CHECK: %struct.[[BLOCK1:STATICS[0-9]+]] = type <{ [1028 x i8] }> -+! CHECK: @.[[BLOCK1]] = internal global %struct.[[BLOCK1]] <{ [1028 x i8] {{[^,]+}} }>, align 1024 -+program MainProgram -+ implicit none -+! CHECK: {{[^g]+}}getelementptr {{[^,]+}}, {{[^,]+}}, i64 1024 -+! CHECK: {{[^g]+}}getelementptr {{[^,]+}}, {{[^,]+}}, i64 1024 -+ !dir$ align 1024 -+ integer(kind=4) :: a1024 =30 -+ !dir$ align 1024 -+ integer(kind=4) :: b1024 =40 -+ a1024 = a1024 + b1024 -+ -+end program MainProgram -diff --git a/test/directives/align_pragma_local_var_no_init.f90 b/test/directives/align_pragma_local_var_no_init.f90 -new file mode 100644 -index 0000000..fe163fd ---- /dev/null -+++ b/test/directives/align_pragma_local_var_no_init.f90 -@@ -0,0 +1,12 @@ -+! RUN: %flang -O0 -S -emit-llvm %s -o - | FileCheck %s -+program main -+ implicit none -+! CHECK: {{[^=]+}} = alloca i64, align 256 -+! CHECK: {{[^=]+}} = alloca i64, align 256 -+ -+ !dir$ align 256 -+ integer(kind=8) :: d,e -+ -+ d=e -+ -+end program main -diff --git a/test/directives/align_pragma_module_var_init.f90 b/test/directives/align_pragma_module_var_init.f90 -new file mode 100644 -index 0000000..02fc0a3 ---- /dev/null -+++ b/test/directives/align_pragma_module_var_init.f90 -@@ -0,0 +1,51 @@ -+! RUN: %flang -O0 -S -emit-llvm %s -o - | FileCheck %s -+ -+! CHECK: %struct.[[BLOCK1:STATICS[0-9]+]] = type <{ [260 x i8] }> -+! CHECK: %struct[[STRUCT1:[^=]+]] = type <{ [516 x i8] }> -+ -+! CHECK: @.[[BLOCK1]] = internal global %struct.[[BLOCK1]] <{ [260 x i8] {{[^,]+}} }>, align 256 -+! CHECK: @[[STRUCT1]] = global %struct[[STRUCT1]] <{ [516 x i8] {{[^,]+}} }>, align 512 -+ -+module module_align -+ implicit none -+ -+ !dir$ align 128 -+ integer :: a128 = 123 -+ -+ !dir$ align 512 -+ integer :: b512 = 234 -+ -+ interface -+ module subroutine module_interface_subroutine() -+ end subroutine module_interface_subroutine -+ end interface -+ -+end module module_align -+ -+submodule (module_align) submodule_align -+ -+contains -+ module subroutine module_interface_subroutine() -+ -+ -+ !dir$ align 256 -+ integer :: a256 = 12 -+ -+ !dir$ align 128 -+ integer :: b128 = 14 -+ -+! CHECK: {{[^g]+}}getelementptr {{[^,]+}}, {{[^,]+}}, i64 256 -+! CHECK: {{[^g]+}}getelementptr {{[^,]+}}, {{[^,]+}}, i64 512 -+ a128 = 12 + a256 -+ b512 = 23 + b128 -+ -+ -+ end subroutine module_interface_subroutine -+end submodule submodule_align -+ -+program MainProgram -+ -+ use module_align -+ call module_interface_subroutine() -+ -+end program MainProgram -diff --git a/test/directives/align_pragma_module_var_no_init.f90 b/test/directives/align_pragma_module_var_no_init.f90 -new file mode 100644 -index 0000000..3bff99e ---- /dev/null -+++ b/test/directives/align_pragma_module_var_no_init.f90 -@@ -0,0 +1,42 @@ -+! RUN: %flang -O0 -S -emit-llvm %s -o - | FileCheck %s -+! CHECK: %struct[[STRUCT1:[^=]+]] = type <{ [1028 x i8] }> -+! CHECK: @[[STRUCT1]] = common global %struct[[STRUCT1]] zeroinitializer, align 1024 -+module MyModule -+ !dir$ align 512 -+ integer(kind=4) :: a512 -+ !dir$ align 512 -+ integer(kind=4) :: b512 -+ -+ integer, dimension (5,5) :: c -+ -+ !dir$ align 128 -+ integer(kind=4) :: d128 -+ -+ integer(kind=4) :: e4 -+ -+ !dir$ align 1024 -+ integer(kind=4) :: f1024 -+ -+contains -+ -+ subroutine InitializeModuleVariables() -+ ! 在子程序中初始化模块变量 -+ a512 = 11 -+ ! CHECK: {{[^g]+}}getelementptr {{[^,]+}}, {{[^,]+}}, i64 512 -+ b512 = 12 -+ ! CHECK: {{[^g]+}}getelementptr {{[^,]+}}, {{[^,]+}}, i64 572 -+ c(3, 3) = 13 -+ ! CHECK: {{[^g]+}}getelementptr {{[^,]+}}, {{[^,]+}}, i64 640 -+ d128 = 14 -+ ! CHECK: {{[^g]+}}getelementptr {{[^,]+}}, {{[^,]+}}, i64 644 -+ e4 = 15 -+ ! CHECK: {{[^g]+}}getelementptr {{[^,]+}}, {{[^,]+}}, i64 1024 -+ f1024 = 16 -+ end subroutine InitializeModuleVariables -+ -+end module MyModule -+ -+program MainProgram -+ use MyModule -+ call InitializeModuleVariables() -+end program MainProgram -diff --git a/test/directives/align_pragma_subroutine_var.f90 b/test/directives/align_pragma_subroutine_var.f90 -new file mode 100644 -index 0000000..7834014 ---- /dev/null -+++ b/test/directives/align_pragma_subroutine_var.f90 -@@ -0,0 +1,36 @@ -+! RUN: %flang -O0 -S -emit-llvm %s -o - | FileCheck %s -+ -+program MainProgram -+ implicit none -+ -+ call subroutine_init() -+ call subroutine_no_init() -+ -+end program MainProgram -+ -+ -+! CHECK: %struct.[[BLOCK1:STATICS[0-9]+]] = type <{ [2052 x i8] }> -+! CHECK: @.[[BLOCK1]] = internal global %struct.[[BLOCK1]] <{ [2052 x i8] {{[^,]+}} }>, align 2048 -+subroutine subroutine_init() -+ !dir$ align 2048 -+ integer(kind=4) :: a2048 = 10 -+ !dir$ align 2048 -+ integer(kind=4) :: b2048 = 20 -+ ! CHECK: {{[^g]+}}getelementptr {{[^,]+}}, {{[^,]+}}, i64 2048 -+ ! CHECK: {{[^g]+}}getelementptr {{[^,]+}}, {{[^,]+}}, i64 2048 -+ a2048 = a2048 + 1 -+ b2048 = b2048 + 2 -+ -+end subroutine subroutine_init -+ -+subroutine subroutine_no_init() -+ ! CHECK: {{[^=]+}} = alloca i32, align 1024 -+ !dir$ align 1024 -+ integer(kind=4) :: a1024 -+ ! CHECK: {{[^=]+}} = alloca i32, align 1024 -+ !dir$ align 1024 -+ integer(kind=4) :: b1024 -+ a1024 = 1 -+ b1024 = 2 -+ -+end subroutine subroutine_no_init -diff --git a/tools/flang1/flang1exe/exterf.c b/tools/flang1/flang1exe/exterf.c -index 21e8444..cae79c9 100644 ---- a/tools/flang1/flang1exe/exterf.c -+++ b/tools/flang1/flang1exe/exterf.c -@@ -2259,6 +2259,10 @@ export_symbol(int sptr) - - scope = SCOPEG(sptr); - stype = STYPEG(sptr); -+ if (stype == ST_VAR) { -+ /* Match the variable with the corresponding align pragma before writing out symbol info */ -+ match_align_pragma(sptr); -+ } - if (!exportmode && stype == ST_UNKNOWN && sptr == gbl.sym_nproc) { - return; - } -diff --git a/tools/flang1/flang1exe/global.h b/tools/flang1/flang1exe/global.h -index 947cc0d..a528627 100644 ---- a/tools/flang1/flang1exe/global.h -+++ b/tools/flang1/flang1exe/global.h -@@ -35,6 +35,13 @@ typedef enum { - RU_BDATA, - } RU_TYPE; - -+/* record an align pragma's alignment value, scope and lineno. */ -+typedef struct ALIGN_PRAGMA { -+ int lineno; -+ int scope; -+ int alignment; -+} ALIGN_PRAGMA; -+ - typedef struct { - int maxsev; /* maximum error severity for this compile */ - int lineno; /* current source line number */ -@@ -134,6 +141,9 @@ typedef struct { - LOGICAL denorm; /* enforce denorm for the current subprogram */ - LOGICAL inomptarget; /* set if it is OpenMP's target region*/ - LOGICAL empty_contains; /* if TRUE, CONTAINS clause has an empty body */ -+ -+ ALIGN_PRAGMA *align_pragma_table; /* store all align pragmas in this unit */ -+ unsigned align_pragma_size; /* Current number of align pragmas */ - } GBL; - - #undef MAXCPUS -diff --git a/tools/flang1/flang1exe/lowersym.c b/tools/flang1/flang1exe/lowersym.c -index 0285d1a..cdc2db9 100644 ---- a/tools/flang1/flang1exe/lowersym.c -+++ b/tools/flang1/flang1exe/lowersym.c -@@ -3814,6 +3814,11 @@ lower_symbol(int sptr) - putbit("f90pointer", 0); /* F90POINTER will denote the POINTER attribute */ - /* but first need to remove FE legacy use */ - putbit("procdescr", IS_PROC_DESCRG(sptr)); -+ if (stype == ST_VAR) { -+ /* print the align pragma value of var */ -+ putval("align-pragma", ALIGN_PRAGMAG(sptr)); -+ } -+ - strip = 1; - break; - -@@ -3868,6 +3873,7 @@ lower_symbol(int sptr) - putbit("copyin", 0); - putbit("resident", 0); - putbit("link", 0); -+ putval("align-pragma", ALIGN_PRAGMAG(sptr)); /* print the align pragma value of cmblk */ - if (BLANKCG(sptr)) { - namelen = 6; - name = "_BLNK_"; -diff --git a/tools/flang1/flang1exe/main.c b/tools/flang1/flang1exe/main.c -index 70290d7..bfa5443 100644 ---- a/tools/flang1/flang1exe/main.c -+++ b/tools/flang1/flang1exe/main.c -@@ -205,7 +205,9 @@ main(int argc, char *argv[]) - break; - } else { - TR(DNAME " PARSER begins\n") -+ reinit_align_pragma(); /* need to reinit align pragma table before parsing a unit*/ - parser(); /* parse and do semantic analysis */ -+ reinit_align_pragma(); /* need to reinit align pragma table after parsing a unit*/ - set_tag(); - } - gbl.func_count++; -diff --git a/tools/flang1/flang1exe/parser.c b/tools/flang1/flang1exe/parser.c -index 21b1ec0..e2fce4d 100644 ---- a/tools/flang1/flang1exe/parser.c -+++ b/tools/flang1/flang1exe/parser.c -@@ -95,7 +95,7 @@ parser(void) - */ - if (maxsev >= 3) - summary(FALSE, FALSE); -- if (gbl.rutype == RU_BDATA) -+ if (gbl.rutype == RU_BDATA) { - /* - * A module specification part was parsed. Either: - * 1. a CONTAINS within the module terminated the first -@@ -104,7 +104,11 @@ parser(void) - * Now, just produce the module-created blockdata - the second - * parse isn't performed. - */ -+ /* match all align pragmas with their corresponding variables -+ * before exiting parser */ -+ match_align_pragma(0); - return; -+ } - /* - * At this point, either: - * 1. a module specification part with errors was parsed, or -@@ -169,6 +173,9 @@ parser(void) - sem.mod_sym = 0; - sem.submod_sym = 0; - } -+ /* match all align pragmas with their corresponding variables -+ * before exiting parser */ -+ match_align_pragma(0); - } - - static void -diff --git a/tools/flang1/flang1exe/scan.c b/tools/flang1/flang1exe/scan.c -index 6c24adb..deb379e 100644 ---- a/tools/flang1/flang1exe/scan.c -+++ b/tools/flang1/flang1exe/scan.c -@@ -994,6 +994,21 @@ again: - *p = '\0'; - } - put_astfil(FR_PRAGMA, currc, TRUE); -+ /* parse and store a new align pragma in first parse */ -+ if (strncmp(currc, "cray", 4) == 0) { -+ char *next_tok = currc + 4; -+ while (*next_tok == ' ' || *next_tok == '\t') { -+ next_tok++; -+ } -+ if (strncmp(next_tok, "align", 5) == 0) { -+ unsigned old_align_pragma_size = gbl.align_pragma_size; -+ p_pragma(currc, gbl.lineno); -+ if (old_align_pragma_size != gbl.align_pragma_size) { -+ ALIGN_PRAGMA *new_align_pragma_ptr = gbl.align_pragma_table + gbl.align_pragma_size - 1; -+ new_align_pragma_ptr->lineno = curr_line; /* set align pragma's lineno to the next line */ -+ } -+ } -+ } - if (XBIT(49, 0x1040000) && strncmp(currc, "cray", 4) == 0) { - int len; - /* T3D/T3E or C90 Cray targets */ -diff --git a/tools/flang1/flang1exe/symtab.c b/tools/flang1/flang1exe/symtab.c -index 5975bd6..7986560 100644 ---- a/tools/flang1/flang1exe/symtab.c -+++ b/tools/flang1/flang1exe/symtab.c -@@ -60,6 +60,7 @@ static void cng_inttyp(int, int); - static void cng_specific(int, int); - static void generate_type_mismatch_errors(SPTR s1, SPTR s2); - static void update_arrdsc(SPTR s, DEC_DEF_MAP *smap, int num_dummies); -+static void adjust_cmblk_align(int var_sptr); /* adjust cmblk's cmblk_align by var's align_pragma */ - /* entry hack? */ - static ENTRY onlyentry; - -@@ -1294,6 +1295,11 @@ symdentry(FILE *file, int sptr) - *p = '\0'; - fprintf(dfil, "declared bounds %s\n", line); - } -+ -+ /* print variable's align pragma value */ -+ if (stype == ST_VAR) { -+ fprintf(dfil, "align_pragma:%d\n", ALIGN_PRAGMAG(sptr)); -+ } - break; - - case ST_STAG: -@@ -3242,6 +3248,9 @@ void rw_sym_state(RW_ROUTINE, RW_FILE) - RW_SCALAR(stb.firstusym); - RW_SCALAR(stb.stg_avail); - RW_SCALAR(stb.stg_cleared); -+ -+ /* match variables and align pragmas before reading or writing symbols */ -+ match_align_pragma(0); - RW_FD(stb.stg_base, SYM, stb.stg_avail); - - RW_SCALAR(stb.namavl); -@@ -3517,3 +3526,69 @@ generate_type_mismatch_errors(SPTR s1, SPTR s2) { - error(1058, ERR_Severe, gbl.lineno, SYMNAME(s1), NULL); - } - -+void -+reinit_align_pragma(void) { -+ FREE(gbl.align_pragma_table); -+ gbl.align_pragma_size = 0; -+} -+ -+/** \brief -+ * When sym_sptr is non-zero, match the variable indexed by sym_sptr and its align pragma. -+ * when sym_sptr is zero, match all align pragmas and their corresponding variables. -+ */ -+void -+match_align_pragma(int sym_sptr) { -+ if (stb.firstusym == SPTR_NULL || stb.firstusym == NME_NULL) { -+ return; -+ } -+ for (int i = 0; i < gbl.align_pragma_size; i++) { -+ ALIGN_PRAGMA *align_pragma_ptr = gbl.align_pragma_table + i; -+ -+ if (sym_sptr != 0) { -+ /* match the variable indexed by sym_sptr and its corresponding align pragma */ -+ if (sym_sptr >= stb.firstusym && sym_sptr <= SPTR_MAX && sym_sptr < stb.stg_avail) { -+ int sym_scope = SCOPEG(sym_sptr); -+ int sym_type = STYPEG(sym_sptr); -+ int sym_lineno = LINENOG(sym_sptr); -+ if (align_pragma_ptr->scope == sym_scope && sym_type == ST_VAR -+ && align_pragma_ptr->lineno == sym_lineno) { -+ // set variable's ALIGN_PRAGMA field -+ ALIGN_PRAGMAP(sym_sptr, align_pragma_ptr->alignment); -+ if (SCG(sym_sptr) == SC_CMBLK) { -+ adjust_cmblk_align(sym_sptr); -+ } -+ } -+ } -+ } else { -+ /* match all align pragmas and their corresponding variables */ -+ for (unsigned int sptr = stb.firstusym; sptr < stb.stg_avail; sptr++) { -+ int sym_scope = SCOPEG(sptr); -+ int sym_type = STYPEG(sptr); -+ int sym_lineno = LINENOG(sptr); -+ if (align_pragma_ptr->scope == sym_scope && sym_type == ST_VAR -+ && align_pragma_ptr->lineno == sym_lineno) { -+ // set variable's ALIGN_PRAGMA field -+ ALIGN_PRAGMAP(sptr, align_pragma_ptr->alignment); -+ if (SCG(sptr) == SC_CMBLK) { -+ adjust_cmblk_align(sptr); -+ } -+ } -+ } -+ } -+ } -+} -+ -+void -+adjust_cmblk_align(int var_sptr) { -+ int cmblk_sptr = CMBLKG(var_sptr); -+ if (cmblk_sptr < stb.firstusym || cmblk_sptr >= stb.stg_avail) { -+ return; -+ } -+ /* Set the cmblk's align pragma value to -+ * the maximum of its variables' align pragma values. -+ * */ -+ unsigned align_pragma_bytes = ALIGN_PRAGMAG(var_sptr); -+ if (CMBLK_ALIGNG(cmblk_sptr) < align_pragma_bytes) { -+ CMBLK_ALIGNP(cmblk_sptr, align_pragma_bytes); -+ } -+} -\ No newline at end of file -diff --git a/tools/flang1/utils/symtab/symtab.in.h b/tools/flang1/utils/symtab/symtab.in.h -index f8c820a..144d3f6 100644 ---- a/tools/flang1/utils/symtab/symtab.in.h -+++ b/tools/flang1/utils/symtab/symtab.in.h -@@ -480,4 +480,9 @@ bool compatible_characteristics(int psptr, int psptr2, - bool cmp_interfaces_strict(SPTR sym1, SPTR sym2, cmp_interface_flags flag); - bool is_used_by_submod(SPTR sym1, SPTR sym2); - -+ -+void match_align_pragma(int sym_sptr); /* match align_pragma and symbol */ -+ -+void reinit_align_pragma(void); /* reinit align pragma table */ -+ - #endif // SYMTAB_H_ -diff --git a/tools/flang1/utils/symtab/symtab.n b/tools/flang1/utils/symtab/symtab.n -index 37251e7..dfd80d6 100644 ---- a/tools/flang1/utils/symtab/symtab.n -+++ b/tools/flang1/utils/symtab/symtab.n -@@ -1252,6 +1252,8 @@ This field is only used for certain cases of allocatable arrays (e.g., - .cw DYNAMIC - arrays - and their descriptors). -+.SE ALIGN_PRAGMA w20 -+Store the variable's alignment value specified by align pragma in the form of '!dir$ align n'. - .SE NMCNST w30 SPTR - If the variable represents the compiler-created temporary for - a named array or structure constant, this field is the sptr -@@ -1351,6 +1353,8 @@ the ARRAY field points to the original array symbol (which is now the only - element in the new common block). - .SE RESERVED_w18 w18 - reserved -+.SE CMBLK_ALIGN w20 -+Store the block's alignment value if it has variable with align pragma. - .SE ALTNAME - Set if the common block has DVF's - also set for common blocks, module variables, subroutines , functions -diff --git a/tools/flang2/flang2exe/llassem.cpp b/tools/flang2/flang2exe/llassem.cpp -index 4ec7802..2f209c0 100644 ---- a/tools/flang2/flang2exe/llassem.cpp -+++ b/tools/flang2/flang2exe/llassem.cpp -@@ -118,6 +118,7 @@ static char * get_struct_from_dsrt(SPTR sptr, DSRT *dsrtp, ISZ_T size, - bool stop_at_sect, ISZ_T addr); - #if DEBUG - static void dump_all_dinits(void); -+static void adjust_statics_align(void); /* set the align value of static's ag */ - - static hashset_t CommonBlockInits; - #endif -@@ -1169,9 +1170,8 @@ assemble_end(void) - fprintf(ASMFIL, "@%s = %s global %%struct%s ", name, - AG_ISMOD(gblsym) ? "external" : "common", name); - -- /* handle the flang1 pragma !dir$ align -- * Here we refer common block's alignment from -- * its belonging ag's alignment -+ /* -+ * refer common block's alignment from its belonging ag's alignment - */ - align_value = AG_ALIGN(tdefsym) > align_value ? - AG_ALIGN(tdefsym) : align_value; -@@ -1524,9 +1524,8 @@ write_bss(void) - int align; - SPTR ag; - -- /* handle the flang1 pragma !dir$ align -- * Here we refer bss's alignment from -- * its belonging ag's alignment -+ /* -+ * refer bss's alignment from its belonging ag's alignment - */ - sprintf(gname, "struct%s", bss_nm); - ag = find_ag(gname); -@@ -1594,6 +1593,8 @@ write_statics(void) - int count = 0; - char *static_nm = static_name; - -+ /* set static's align value before printing */ -+ adjust_statics_align(); - if (lcl_inits) { - if (DBGBIT(5, 32)) { - fprintf(gbl.dbgfil, "write_statics:%s\n", static_nm); -@@ -1610,7 +1611,9 @@ write_statics(void) - fprintf(ASMFIL, "%%struct%s = type <{ %s }>\n", static_nm, type_only); - fprintf(ASMFIL, "@%s = %s %%struct%s <{ ", static_nm, type_str, static_nm); - process_dsrt(lcl_inits, gbl.saddr, typed, false, 0); -- fprintf(ASMFIL, " }>, align 16"); -+ /* refer static's alignment from its belonging ag's alignment */ -+ unsigned align_bytes = AG_ALIGN(gblsym) > 16 ? AG_ALIGN(gblsym) : 16; -+ fprintf(ASMFIL, " }>, align %d", align_bytes); - ll_write_object_dbg_references(ASMFIL, cpu_llvm_module, static_dbg_list); - static_dbg_list = NULL; - fputc('\n', ASMFIL); -@@ -1745,7 +1748,8 @@ write_comm(void) - fprintf(ASMFIL, " } > "); - - DSRTP(sptr, NULL); -- -+ /* refer cmblk's alignment from its belonging ag's alignment */ -+ align_value = AG_ALIGN(cmsym) > align_value ? AG_ALIGN(cmsym) : align_value; - fprintf(ASMFIL, ", align %d", align_value); - - for (cmem = CMEMFG(sptr); cmem > NOSYM; cmem = SYMLKG(cmem)) { -@@ -3206,6 +3210,10 @@ get_ag(SPTR sptr) - if (!XBIT(57, 0x10000000) && CCSYMG(sptr) && PDALNG(sptr) == 4) { - AG_ALIGN(gblsym) = max_cm_align + 1; - } -+ // write cmblk symbol's CMBLK_ALIGN to global symbol's AG_ALIGN -+ if (CMBLK_ALIGNG(sptr) > 0) { -+ AG_ALIGN(gblsym) = CMBLK_ALIGNG(sptr); -+ } - } else if ((stype == ST_ARRAY) & !CFUNCG(sptr)) { - AG_SYMLK(gblsym) = ag_other; - ag_other = gblsym; -@@ -4223,6 +4231,19 @@ unsigned - align_of_var(SPTR sptr) - { - DTYPE dtype = DTYPEG(sptr); -+ if (STYPEG(sptr) == ST_VAR) { -+ /* -+ * return var's align pragma value if align pragma value > dtype's align value -+ */ -+ int align_pragma_bytes = ALIGN_PRAGMAG(sptr); -+ if (align_pragma_bytes > 0) { -+ int standard_align_bytes = align_of(dtype); -+ if (standard_align_bytes > align_pragma_bytes) { -+ return standard_align_bytes; -+ } -+ return align_pragma_bytes; -+ } -+ } - if (!PDALN_IS_DEFAULT(sptr)) - return 1u << PDALNG(sptr); - if (QALNG(sptr)) -@@ -4303,7 +4324,10 @@ assn_static_off(SPTR sptr, DTYPE dtype, ISZ_T size) - } else { - a = align_unconstrained(dtype); - } -- -+ // in static, adjust variable's offset by its ALIGN PRAGMA -+ if (STYPEG(sptr) == ST_VAR && SCG(sptr) == SC_STATIC && ALIGN_PRAGMAG(sptr) > a) { -+ a = ALIGN_PRAGMAG(sptr) - 1; -+ } - if (DTA(dtype) > a) - a = DTA(dtype); - -@@ -6010,3 +6034,17 @@ assem_dinit(void) - /* intentionally empty */ - } - -+void -+adjust_statics_align(void) { -+ for (int sptr = stb.firstusym; sptr < stb.stg_avail; sptr++) { -+ if (STYPEG(sptr) == ST_VAR && SCG(sptr) == SC_STATIC && ALIGN_PRAGMAG(sptr) > 0) { -+ /* get static's ag by its sptr */ -+ char gname[MXIDLN + 50]; -+ sprintf(gname, "struct%s", get_llvm_name((SPTR) sptr)); -+ SPTR ag = find_ag(gname); -+ /* set the align value of static's ag */ -+ if (ALIGN_PRAGMAG(sptr) >= AG_ALIGN(ag)) -+ AG_ALIGN(ag) = ALIGN_PRAGMAG(sptr); -+ } -+ } -+} -diff --git a/tools/flang2/flang2exe/upper.cpp b/tools/flang2/flang2exe/upper.cpp -index 7ddeeac..72b05bc 100644 ---- a/tools/flang2/flang2exe/upper.cpp -+++ b/tools/flang2/flang2exe/upper.cpp -@@ -100,6 +100,7 @@ static void read_global(void); - static int read_CCFF(void); - #include "fdirect.h" - static void read_contained(void); -+static void adjust_cmblk_size(); // adjust cmblk's align and size - - typedef struct CGR_LIST { - struct CGR_LIST *next; -@@ -569,6 +570,8 @@ upper(int stb_processing) - } - fix_symbol(); - fix_datatype(); -+ /* adjust cmblk's size and variables' start addresses by ALIGN_PRAGMA of variables */ -+ adjust_cmblk_size(); - - #if DEBUG - if (DBGBIT(47, 0x200)) { -@@ -2044,6 +2047,7 @@ read_symbol(void) - SPTR sptr = getSptrVal("symbol"); - bool has_alias = false; - char *alias_name; -+ int align_pragma; - #if DEBUG - if (sptr > symbolcount) { - fprintf(stderr, "Symbol count was %d, but new symbol number is %d\n", -@@ -2189,6 +2193,10 @@ read_symbol(void) - f90pointer = getbit("f90pointer"); /* will denote the POINTER attribute */ - /* but need to remove FE legacy use */ - procdesc = getbit("procdescr"); -+ if (stype == ST_VAR) { -+ /* read variable's ALIGN_PRAGMA from stb */ -+ align_pragma = getval("align-pragma"); -+ } - newsptr = get_or_create_symbol(sptr); - if (Class) { - CLASSP(newsptr, Class); -@@ -2211,6 +2219,8 @@ read_symbol(void) - STYPEP(newsptr, ST_STRUCT); - } else { - STYPEP(newsptr, stype); -+ /* set variable's ALIGN_PRAGMA */ -+ ALIGN_PRAGMAP(newsptr, align_pragma); - } - if (Class && stype == ST_ARRAY && isdesc) { - /* put the type that this type descriptor is associated with -@@ -2397,7 +2407,8 @@ read_symbol(void) - resident = getbit("resident"); - acclink = getbit("link"); - } -- -+ /* read cmblk's ALIGN_PRAGMA from stb */ -+ align_pragma = getval("align-pragma"); - newsptr = get_or_create_symbol(sptr); - - STYPEP(newsptr, stype); -@@ -2439,7 +2450,8 @@ read_symbol(void) - ACCRESIDENTP(newsptr, resident); - ACCLINKP(newsptr, acclink); - } -- -+ /* set cmblk's CMBLK_ALIGN */ -+ CMBLK_ALIGNP(newsptr, align_pragma); - SYMLKP(newsptr, gbl.cmblks); - gbl.cmblks = newsptr; - if (modcmn && !fromMod) { -@@ -6540,3 +6552,38 @@ free_modvar_alias_list() - } - } - -+/** -+ * \brief adjust cmblk's size and variables' start addresses by ALIGN_PRAGMA of variables in cmblk -+ * The start address of a variable in the cmblk should be an integer multiple of the variable's ALIGN_PRAGMA. -+ */ -+void adjust_cmblk_size() { -+ if (stb.firstusym == SPTR_NULL || stb.firstusym == NME_NULL) { -+ return; -+ } -+ for (int sptr = stb.firstusym; sptr < stb.stg_avail; sptr++) { -+ if (STYPEG(sptr) != ST_CMBLK) { -+ continue; -+ } -+ int cmblk_sptr = sptr; -+ for (int var_sptr = CMEMFG(cmblk_sptr); -+ var_sptr >= stb.firstusym && cmblk_sptr < stb.stg_avail; var_sptr = SYMLKG(var_sptr)) { -+ if (STYPEG(var_sptr) != ST_VAR) { -+ continue; -+ } -+ unsigned align_pragma_bytes = ALIGN_PRAGMAG(var_sptr); -+ if (align_pragma_bytes <= size_of(DTYPEG(var_sptr))) { -+ continue; -+ } -+ unsigned old_var_address = ADDRESSG(var_sptr); -+ if (old_var_address % align_pragma_bytes == 0) { -+ continue; -+ } -+ unsigned new_var_address = ALIGN(old_var_address, align_pragma_bytes - 1); -+ unsigned add_offset = new_var_address - old_var_address; -+ for (int it_var = var_sptr; it_var > NOSYM; it_var = SYMLKG(it_var)) { -+ ADDRESSP(it_var, ADDRESSG(it_var) + add_offset); -+ } -+ SIZEP(cmblk_sptr, SIZEG(cmblk_sptr) + add_offset); -+ } -+ } -+} -\ No newline at end of file -diff --git a/tools/flang2/utils/symtab/symtab.n b/tools/flang2/utils/symtab/symtab.n -index ea851fa..6a36c55 100644 ---- a/tools/flang2/utils/symtab/symtab.n -+++ b/tools/flang2/utils/symtab/symtab.n -@@ -878,6 +878,8 @@ If this array is a type descriptor, then this is used to link this type - descriptor with the other type descriptors. - .SE ETLS w28 - Extended TLS levels -+.SE ALIGN_PRAGMA w30 -+Store the variable's alignment value specified by align pragma in the form of '!dir$ align n'. - .SE ASSOC_PTR w31 - When set, this is the sptr of a pointer that is initialized with this symbol. - .SE ORIGDUMMY w32 -@@ -1110,6 +1112,8 @@ A value of zero indicates that the common block has not yet been defined. - Pointer to last element of linked list of common block members. - .SE ALTNAME w18 - Set if the common block has DVF's -+.SE CMBLK_ALIGN w20 -+Store the block's alignment value if it has variable with align pragma. - .SE ETLS w28 - Extended TLS levels - .SE THPRVTOPT w30 -diff --git a/tools/shared/pragma.c b/tools/shared/pragma.c -index 4105b3b..e87ccf0 100644 ---- a/tools/shared/pragma.c -+++ b/tools/shared/pragma.c -@@ -1013,7 +1013,13 @@ do_sw(void) - gbl.nowarn = backup_nowarn; - return true; - } -- -+#ifdef PGHPF -+ NEED(gbl.align_pragma_size + 1, gbl.align_pragma_table, ALIGN_PRAGMA, gbl.align_pragma_size, gbl.align_pragma_size + 1); -+ ALIGN_PRAGMA * new_align_pragma_ptr = gbl.align_pragma_table + gbl.align_pragma_size - 1; -+ new_align_pragma_ptr->lineno = lineno; -+ new_align_pragma_ptr->alignment = itok; -+ new_align_pragma_ptr->scope = stb.curr_scope; -+#endif - TR1("SW_ALIGN alignment[%d]\n", itok); - flg.x[251] = itok; - return true; --- -2.34.1 - diff --git a/3-test-interoperability-with-c-fortran-call-c-scalar.patch b/3-test-interoperability-with-c-fortran-call-c-scalar.patch deleted file mode 100644 index 7bd058a5c287ca01200c8328fb8b3c7a4f3e5c57..0000000000000000000000000000000000000000 --- a/3-test-interoperability-with-c-fortran-call-c-scalar.patch +++ /dev/null @@ -1,5011 +0,0 @@ -From 84ab53f956cfdc7d3529b22203c15da098249cee Mon Sep 17 00:00:00 2001 -From: xieyihui -Date: Fri, 18 Nov 2022 12:36:52 +0800 -Subject: [PATCH] Add new test cases about scalar for interoperability with C - about fortran call C - -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func001.c b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func001.c -new file mode 100644 -index 0000000..5acb3c0 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func001.c -@@ -0,0 +1,4 @@ -+#include -+void c_func_(int *a) { -+ printf("%d\n", *a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func002.c b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func002.c -new file mode 100644 -index 0000000..a695d21 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func002.c -@@ -0,0 +1,5 @@ -+#include -+#include -+void c_func_(short *a) { -+ printf("%hd\n", *a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func003.c b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func003.c -new file mode 100644 -index 0000000..c3e2b1b ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func003.c -@@ -0,0 +1,5 @@ -+#include -+#include -+void c_func_(long *a) { -+ printf("%ld\n", *a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func004.c b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func004.c -new file mode 100644 -index 0000000..c83f515 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func004.c -@@ -0,0 +1,5 @@ -+#include -+#include -+void c_func_(long long *a) { -+ printf("%lld\n", *a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func005.c b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func005.c -new file mode 100644 -index 0000000..df53145 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func005.c -@@ -0,0 +1,4 @@ -+#include -+void c_func_(signed char *a) { -+ printf("%c\n", *a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func006.c b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func006.c -new file mode 100644 -index 0000000..bf8fe98 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func006.c -@@ -0,0 +1,5 @@ -+#include -+#include -+void c_func_(size_t *a) { -+ printf("%ld\n", *a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func007.c b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func007.c -new file mode 100644 -index 0000000..1ccc2d3 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func007.c -@@ -0,0 +1,5 @@ -+#include -+#include -+void c_func_(int8_t *a) { -+ printf("%hhd\n", *a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func008.c b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func008.c -new file mode 100644 -index 0000000..5b4a477 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func008.c -@@ -0,0 +1,5 @@ -+#include -+#include -+void c_func_(int16_t *a) { -+ printf("%hd\n", *a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func009.c b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func009.c -new file mode 100644 -index 0000000..ef5dbab ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func009.c -@@ -0,0 +1,5 @@ -+#include -+#include -+void c_func_(int32_t *a) { -+ printf("%d\n", *a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func010.c b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func010.c -new file mode 100644 -index 0000000..ff0c5b2 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func010.c -@@ -0,0 +1,5 @@ -+#include -+#include -+void c_func_(int64_t *a) { -+ printf("%ld\n", *a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func011.c b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func011.c -new file mode 100644 -index 0000000..648e234 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func011.c -@@ -0,0 +1,5 @@ -+#include -+#include -+void c_func_(int_least8_t *a) { -+ printf("%hhd\n", *a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func012.c b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func012.c -new file mode 100644 -index 0000000..175d427 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func012.c -@@ -0,0 +1,5 @@ -+#include -+#include -+void c_func_(int_least16_t *a) { -+ printf("%hd\n", *a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func013.c b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func013.c -new file mode 100644 -index 0000000..3e63c13 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func013.c -@@ -0,0 +1,5 @@ -+#include -+#include -+void c_func_(int_least32_t *a) { -+ printf("%d\n", *a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func014.c b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func014.c -new file mode 100644 -index 0000000..ac6a62b ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func014.c -@@ -0,0 +1,5 @@ -+#include -+#include -+void c_func_(int_least64_t *a) { -+ printf("%ld\n", *a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func015.c b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func015.c -new file mode 100644 -index 0000000..85b98cc ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func015.c -@@ -0,0 +1,5 @@ -+#include -+#include -+void c_func_(int_fast8_t *a) { -+ printf("%hhd\n", *a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func016.c b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func016.c -new file mode 100644 -index 0000000..ce358c3 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func016.c -@@ -0,0 +1,5 @@ -+#include -+#include -+void c_func_(int_fast16_t *a) { -+ printf("%ld\n", *a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func017.c b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func017.c -new file mode 100644 -index 0000000..9576185 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func017.c -@@ -0,0 +1,5 @@ -+#include -+#include -+void c_func_(int_fast32_t *a) { -+ printf("%ld\n", *a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func018.c b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func018.c -new file mode 100644 -index 0000000..84469ba ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func018.c -@@ -0,0 +1,5 @@ -+#include -+#include -+void c_func_(int_fast64_t *a) { -+ printf("%ld\n", *a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func019.c b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func019.c -new file mode 100644 -index 0000000..acd8949 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func019.c -@@ -0,0 +1,5 @@ -+#include -+#include -+void c_func_(intmax_t *a) { -+ printf("%ld\n", *a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func020.c b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func020.c -new file mode 100644 -index 0000000..43c01a7 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func020.c -@@ -0,0 +1,5 @@ -+#include -+#include -+void c_func_(intptr_t *a) { -+ printf("%ld\n", *a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func021.c b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func021.c -new file mode 100644 -index 0000000..af99025 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func021.c -@@ -0,0 +1,4 @@ -+#include -+void c_func_(float *a) { -+ printf("%f\n", *a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func022.c b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func022.c -new file mode 100644 -index 0000000..7ae046f ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func022.c -@@ -0,0 +1,4 @@ -+#include -+void c_func_(double *a) { -+ printf("%0.20f\n", *a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func023.c b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func023.c -new file mode 100644 -index 0000000..be8b2b1 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func023.c -@@ -0,0 +1,4 @@ -+#include -+void c_func_(long double *a) { -+ printf("%0.20Lf\n", *a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func024.c b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func024.c -new file mode 100644 -index 0000000..1e65f36 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func024.c -@@ -0,0 +1,5 @@ -+#include -+#include -+void c_func_(float _Complex *t) { -+ printf("%f + %fi\n", creal(*t), cimag(*t)); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func025.c b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func025.c -new file mode 100644 -index 0000000..b3f9944 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func025.c -@@ -0,0 +1,5 @@ -+#include -+#include -+void c_func_(double _Complex *t) { -+ printf("%0.20lf + %0.20lfi\n", creal(*t), cimag(*t)); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func026.c b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func026.c -new file mode 100644 -index 0000000..c049c6f ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func026.c -@@ -0,0 +1,5 @@ -+#include -+#include -+void c_func_(long double _Complex *t) { -+ printf("%0.20f + %0.20fi\n", creal(*t), cimag(*t)); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func027.c b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func027.c -new file mode 100644 -index 0000000..a3a8596 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func027.c -@@ -0,0 +1,4 @@ -+#include -+void c_func_(_Bool *a) { -+ printf("%d\n", *a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func028.c b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func028.c -new file mode 100644 -index 0000000..0abbf89 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/c_func028.c -@@ -0,0 +1,4 @@ -+#include -+void c_func_(char *a) { -+ printf("%c\n", *a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main001.f90 b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main001.f90 -new file mode 100644 -index 0000000..67065b5 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main001.f90 -@@ -0,0 +1,11 @@ -+! Test fortran call c for the scalar type and the scalar type is int -+! -+program main -+ integer(4) :: my_x = 1 -+ interface -+ subroutine c_func(b) -+ integer(4) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main002.f90 b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main002.f90 -new file mode 100644 -index 0000000..be8e4a6 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main002.f90 -@@ -0,0 +1,11 @@ -+! Test fortran call c for the scalar type and the scalar type is short -+! -+program main -+ integer(2) :: my_x = 1 -+ interface -+ subroutine c_func(b) -+ integer(2) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main003.f90 b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main003.f90 -new file mode 100644 -index 0000000..32fe301 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main003.f90 -@@ -0,0 +1,11 @@ -+! Test fortran call c for the scalar type and the scalar type is long -+! -+program main -+ integer(8) :: my_x = 1 -+ interface -+ subroutine c_func(b) -+ integer(8) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main004.f90 b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main004.f90 -new file mode 100644 -index 0000000..fec8bc8 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main004.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type and the scalar type is -+! long long -+! -+program main -+ integer(8) :: my_x = 1 -+ interface -+ subroutine c_func(b) -+ integer(8) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main005.f90 b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main005.f90 -new file mode 100644 -index 0000000..1c70d24 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main005.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type and the scalar type is -+! signed char -+! -+program main -+ integer(1) :: my_x = 65 -+ interface -+ subroutine c_func(b) -+ integer(1) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main006.f90 b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main006.f90 -new file mode 100644 -index 0000000..1c51bf7 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main006.f90 -@@ -0,0 +1,11 @@ -+! Test fortran call c for the scalar type and the scalar type is size_t -+! -+program main -+ integer(8) :: my_x = 1 -+ interface -+ subroutine c_func(b) -+ integer(8) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main007.f90 b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main007.f90 -new file mode 100644 -index 0000000..1905558 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main007.f90 -@@ -0,0 +1,11 @@ -+! Test fortran call c for the scalar type and the scalar type is int8_t -+! -+program main -+ integer(1) :: my_x = 1 -+ interface -+ subroutine c_func(b) -+ integer(1) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main008.f90 b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main008.f90 -new file mode 100644 -index 0000000..ad502f7 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main008.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type and the scalar type is -+! int16_t -+! -+program main -+ integer(2) :: my_x = 1 -+ interface -+ subroutine c_func(b) -+ integer(2) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main009.f90 b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main009.f90 -new file mode 100644 -index 0000000..ff8e413 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main009.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type and the scalar type is -+! int32_t -+! -+program main -+ integer(4) :: my_x = 1 -+ interface -+ subroutine c_func(b) -+ integer(4) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main010.f90 b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main010.f90 -new file mode 100644 -index 0000000..b2bb503 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main010.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type and the scalar type is -+! int64_t -+! -+program main -+ integer(8) :: my_x = 1 -+ interface -+ subroutine c_func(b) -+ integer(8) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main011.f90 b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main011.f90 -new file mode 100644 -index 0000000..b63979f ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main011.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type and the scalar type is -+! int_least8_t -+! -+program main -+ integer(1) :: my_x = 1 -+ interface -+ subroutine c_func(b) -+ integer(1) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main012.f90 b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main012.f90 -new file mode 100644 -index 0000000..4b57843 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main012.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type and the scalar type is -+! int_least16_t -+! -+program main -+ integer(2) :: my_x = 1 -+ interface -+ subroutine c_func(b) -+ integer(2) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main013.f90 b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main013.f90 -new file mode 100644 -index 0000000..38f4dbf ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main013.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type and the scalar type is -+! int_least32_t -+! -+program main -+ integer(4) :: my_x = 1 -+ interface -+ subroutine c_func(b) -+ integer(4) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main014.f90 b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main014.f90 -new file mode 100644 -index 0000000..76db856 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main014.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type and the scalar type is -+! int_least64_t -+! -+program main -+ integer(8) :: my_x = 1 -+ interface -+ subroutine c_func(b) -+ integer(8) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main015.f90 b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main015.f90 -new file mode 100644 -index 0000000..22edd3a ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main015.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type and the scalar type is -+! int_fast8_t -+! -+program main -+ integer(1) :: my_x = 1 -+ interface -+ subroutine c_func(b) -+ integer(1) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main016.f90 b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main016.f90 -new file mode 100644 -index 0000000..16194de ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main016.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type and the scalar type is -+! int_fast_16_t -+! -+program main -+ integer(8) :: my_x = 1 -+ interface -+ subroutine c_func(b) -+ integer(8) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main017.f90 b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main017.f90 -new file mode 100644 -index 0000000..d26c6f2 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main017.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type and the scalar type is -+! int_fast32_t -+! -+program main -+ integer(8) :: my_x = 1 -+ interface -+ subroutine c_func(b) -+ integer(8) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main018.f90 b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main018.f90 -new file mode 100644 -index 0000000..1fa0b83 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main018.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type and the scalar type is -+! int_fast64_t -+! -+program main -+ integer(8) :: my_x = 1 -+ interface -+ subroutine c_func(b) -+ integer(8) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main019.f90 b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main019.f90 -new file mode 100644 -index 0000000..5e4dd89 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main019.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type and the scalar type is -+! intmax_t -+! -+program main -+ integer(8) :: my_x = 1 -+ interface -+ subroutine c_func(b) -+ integer(8) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main020.f90 b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main020.f90 -new file mode 100644 -index 0000000..12e4c74 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main020.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type and the scalar type is -+! intptr_t -+! -+program main -+ integer(8) :: my_x = 1 -+ interface -+ subroutine c_func(b) -+ integer(8) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main021.f90 b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main021.f90 -new file mode 100644 -index 0000000..d702c52 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main021.f90 -@@ -0,0 +1,11 @@ -+! Test fortran call c for the scalar type and the scalar type is float -+! -+program main -+ real(4) :: my_x = 3.1415926535 -+ interface -+ subroutine c_func(b) -+ real(4) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main022.f90 b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main022.f90 -new file mode 100644 -index 0000000..fb9895b ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main022.f90 -@@ -0,0 +1,11 @@ -+! Test fortran call c for the scalar type and the scalar type is double -+! -+program main -+ real(8) :: my_x = 3.14159265358979 -+ interface -+ subroutine c_func(b) -+ real(8) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main023.f90 b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main023.f90 -new file mode 100644 -index 0000000..bc2c2b7 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main023.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the scalar type and the scalar type is -+! long double -+! -+program main -+ integer, parameter :: K = selected_real_kind(16) -+ real(K) :: my_x = 3.14159265358979 -+ interface -+ subroutine c_func(b) -+ integer, parameter :: K = selected_real_kind(16) -+ real(K) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main024.f90 b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main024.f90 -new file mode 100644 -index 0000000..3b9f2d4 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main024.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type and the scalar type is -+! float _Complex -+! -+program main -+ complex(4) :: my_x = (-12345678.7654321, 1) -+ interface -+ subroutine c_func(b) -+ complex(4) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main025.f90 b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main025.f90 -new file mode 100644 -index 0000000..f4f3f9f ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main025.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type and the scalar type is -+! double _Complex -+! -+program main -+ complex(8) :: my_x = (-3.14159265358979, 1) -+ interface -+ subroutine c_func(b) -+ complex(8) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main026.f90 b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main026.f90 -new file mode 100644 -index 0000000..b02bca6 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main026.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the scalar type and the scalar type is -+! long double _Complex -+! -+program main -+ integer, parameter :: K = selected_real_kind(16) -+ complex(K) :: my_x = (-3.14159265358979, 1) -+ interface -+ subroutine c_func(b) -+ integer, parameter :: K = selected_real_kind(16) -+ complex(K) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main027.f90 b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main027.f90 -new file mode 100644 -index 0000000..e9aaf8e ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main027.f90 -@@ -0,0 +1,11 @@ -+! Test fortran call c for the scalar type and the scalar type is _Bool -+! -+program main -+ logical(1) :: my_x = .FALSE. -+ interface -+ subroutine c_func(b) -+ logical(1) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main028.f90 b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main028.f90 -new file mode 100644 -index 0000000..6fab824 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/fortran_main028.f90 -@@ -0,0 +1,11 @@ -+! Test fortran call c for the scalar type and the scalar type is char -+! -+program main -+ character(1) :: my_x = 'a' -+ interface -+ subroutine c_func(b) -+ character(1) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/result.md b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/result.md -new file mode 100644 -index 0000000..f15fe53 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/result.md -@@ -0,0 +1,29 @@ -+ | test | gfortran | flang | nvfortran| -+ | 001 | PASS | PASS | PASS | -+ | 002 | PASS | PASS | PASS | -+ | 003 | PASS | PASS | PASS | -+ | 004 | PASS | PASS | PASS | -+ | 005 | PASS | PASS | PASS | -+ | 006 | PASS | PASS | PASS | -+ | 007 | PASS | PASS | PASS | -+ | 008 | PASS | PASS | PASS | -+ | 009 | PASS | PASS | PASS | -+ | 010 | PASS | PASS | PASS | -+ | 011 | PASS | PASS | PASS | -+ | 012 | PASS | PASS | PASS | -+ | 013 | PASS | PASS | PASS | -+ | 014 | PASS | PASS | PASS | -+ | 015 | PASS | PASS | PASS | -+ | 016 | PASS | PASS | PASS | -+ | 017 | PASS | PASS | PASS | -+ | 018 | PASS | PASS | PASS | -+ | 019 | PASS | PASS | PASS | -+ | 020 | PASS | PASS | PASS | -+ | 021 | PASS | PASS | PASS | -+ | 022 | PASS | PASS | PASS | -+ | 023 | PASS | PASS | ERROR | -+ | 024 | PASS | PASS | PASS | -+ | 025 | PASS | PASS | PASS | -+ | 026 | PASS | PASS | ERROR | -+ | 027 | PASS | PASS | PASS | -+ | 028 | PASS | PASS | PASS | -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/run.sh b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/run.sh -new file mode 100644 -index 0000000..dbbd62f ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/001_fortran_call_c_scalar/run.sh -@@ -0,0 +1,22 @@ -+for i in {001..028} -+do -+echo "------- test $i ------." -+echo "----- gfortran result:" -+gcc c_func$i.c -c -o c-test.o -+gfortran fortran_main$i.f90 -fno-range-check -c -o fortran-test.o -+gfortran c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+echo "----- flang-new result : " -+clang c_func$i.c -c -o c-test.o -+flang-new fortran_main$i.f90 -c -o fortran-test.o -+flang-new -flang-experimental-exec c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+echo "----- nvfortran result : " -+clang c_func$i.c -c -o c-test.o -+nvfortran fortran_main$i.f90 -c -o fortran-test.o -+nvfortran c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+done -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/c_func001.c b/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/c_func001.c -new file mode 100644 -index 0000000..5acb3c0 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/c_func001.c -@@ -0,0 +1,4 @@ -+#include -+void c_func_(int *a) { -+ printf("%d\n", *a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/c_func002.c b/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/c_func002.c -new file mode 100644 -index 0000000..a695d21 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/c_func002.c -@@ -0,0 +1,5 @@ -+#include -+#include -+void c_func_(short *a) { -+ printf("%hd\n", *a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/c_func003.c b/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/c_func003.c -new file mode 100644 -index 0000000..c3e2b1b ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/c_func003.c -@@ -0,0 +1,5 @@ -+#include -+#include -+void c_func_(long *a) { -+ printf("%ld\n", *a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/c_func004.c b/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/c_func004.c -new file mode 100644 -index 0000000..c83f515 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/c_func004.c -@@ -0,0 +1,5 @@ -+#include -+#include -+void c_func_(long long *a) { -+ printf("%lld\n", *a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/c_func005.c b/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/c_func005.c -new file mode 100644 -index 0000000..df53145 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/c_func005.c -@@ -0,0 +1,4 @@ -+#include -+void c_func_(signed char *a) { -+ printf("%c\n", *a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/c_func006.c b/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/c_func006.c -new file mode 100644 -index 0000000..bf8fe98 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/c_func006.c -@@ -0,0 +1,5 @@ -+#include -+#include -+void c_func_(size_t *a) { -+ printf("%ld\n", *a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/c_func007.c b/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/c_func007.c -new file mode 100644 -index 0000000..1ccc2d3 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/c_func007.c -@@ -0,0 +1,5 @@ -+#include -+#include -+void c_func_(int8_t *a) { -+ printf("%hhd\n", *a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/c_func008.c b/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/c_func008.c -new file mode 100644 -index 0000000..5b4a477 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/c_func008.c -@@ -0,0 +1,5 @@ -+#include -+#include -+void c_func_(int16_t *a) { -+ printf("%hd\n", *a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/c_func009.c b/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/c_func009.c -new file mode 100644 -index 0000000..ef5dbab ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/c_func009.c -@@ -0,0 +1,5 @@ -+#include -+#include -+void c_func_(int32_t *a) { -+ printf("%d\n", *a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/c_func010.c b/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/c_func010.c -new file mode 100644 -index 0000000..ff0c5b2 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/c_func010.c -@@ -0,0 +1,5 @@ -+#include -+#include -+void c_func_(int64_t *a) { -+ printf("%ld\n", *a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/c_func011.c b/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/c_func011.c -new file mode 100644 -index 0000000..648e234 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/c_func011.c -@@ -0,0 +1,5 @@ -+#include -+#include -+void c_func_(int_least8_t *a) { -+ printf("%hhd\n", *a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/c_func012.c b/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/c_func012.c -new file mode 100644 -index 0000000..175d427 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/c_func012.c -@@ -0,0 +1,5 @@ -+#include -+#include -+void c_func_(int_least16_t *a) { -+ printf("%hd\n", *a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/c_func013.c b/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/c_func013.c -new file mode 100644 -index 0000000..3e63c13 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/c_func013.c -@@ -0,0 +1,5 @@ -+#include -+#include -+void c_func_(int_least32_t *a) { -+ printf("%d\n", *a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/c_func014.c b/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/c_func014.c -new file mode 100644 -index 0000000..ac6a62b ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/c_func014.c -@@ -0,0 +1,5 @@ -+#include -+#include -+void c_func_(int_least64_t *a) { -+ printf("%ld\n", *a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/c_func015.c b/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/c_func015.c -new file mode 100644 -index 0000000..85b98cc ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/c_func015.c -@@ -0,0 +1,5 @@ -+#include -+#include -+void c_func_(int_fast8_t *a) { -+ printf("%hhd\n", *a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/c_func016.c b/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/c_func016.c -new file mode 100644 -index 0000000..ce358c3 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/c_func016.c -@@ -0,0 +1,5 @@ -+#include -+#include -+void c_func_(int_fast16_t *a) { -+ printf("%ld\n", *a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/c_func017.c b/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/c_func017.c -new file mode 100644 -index 0000000..9576185 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/c_func017.c -@@ -0,0 +1,5 @@ -+#include -+#include -+void c_func_(int_fast32_t *a) { -+ printf("%ld\n", *a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/c_func018.c b/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/c_func018.c -new file mode 100644 -index 0000000..84469ba ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/c_func018.c -@@ -0,0 +1,5 @@ -+#include -+#include -+void c_func_(int_fast64_t *a) { -+ printf("%ld\n", *a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/c_func019.c b/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/c_func019.c -new file mode 100644 -index 0000000..acd8949 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/c_func019.c -@@ -0,0 +1,5 @@ -+#include -+#include -+void c_func_(intmax_t *a) { -+ printf("%ld\n", *a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/c_func020.c b/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/c_func020.c -new file mode 100644 -index 0000000..43c01a7 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/c_func020.c -@@ -0,0 +1,5 @@ -+#include -+#include -+void c_func_(intptr_t *a) { -+ printf("%ld\n", *a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/c_func021.c b/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/c_func021.c -new file mode 100644 -index 0000000..af99025 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/c_func021.c -@@ -0,0 +1,4 @@ -+#include -+void c_func_(float *a) { -+ printf("%f\n", *a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/c_func022.c b/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/c_func022.c -new file mode 100644 -index 0000000..4b65d00 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/c_func022.c -@@ -0,0 +1,4 @@ -+#include -+void c_func_(double *a) { -+ printf("%0.20lf\n", *a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/c_func023.c b/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/c_func023.c -new file mode 100644 -index 0000000..be8b2b1 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/c_func023.c -@@ -0,0 +1,4 @@ -+#include -+void c_func_(long double *a) { -+ printf("%0.20Lf\n", *a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/c_func024.c b/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/c_func024.c -new file mode 100644 -index 0000000..1e65f36 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/c_func024.c -@@ -0,0 +1,5 @@ -+#include -+#include -+void c_func_(float _Complex *t) { -+ printf("%f + %fi\n", creal(*t), cimag(*t)); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/c_func025.c b/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/c_func025.c -new file mode 100644 -index 0000000..b3f9944 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/c_func025.c -@@ -0,0 +1,5 @@ -+#include -+#include -+void c_func_(double _Complex *t) { -+ printf("%0.20lf + %0.20lfi\n", creal(*t), cimag(*t)); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/c_func026.c b/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/c_func026.c -new file mode 100644 -index 0000000..c049c6f ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/c_func026.c -@@ -0,0 +1,5 @@ -+#include -+#include -+void c_func_(long double _Complex *t) { -+ printf("%0.20f + %0.20fi\n", creal(*t), cimag(*t)); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/c_func027.c b/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/c_func027.c -new file mode 100644 -index 0000000..a3a8596 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/c_func027.c -@@ -0,0 +1,4 @@ -+#include -+void c_func_(_Bool *a) { -+ printf("%d\n", *a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/c_func028.c b/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/c_func028.c -new file mode 100644 -index 0000000..0abbf89 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/c_func028.c -@@ -0,0 +1,4 @@ -+#include -+void c_func_(char *a) { -+ printf("%c\n", *a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/fortran_main001.f90 b/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/fortran_main001.f90 -new file mode 100644 -index 0000000..6f79a57 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/fortran_main001.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the scalar type and the scalar type is int -+! with iso_c_binding -+! -+program main -+ use iso_c_binding -+ integer(C_INT) :: my_x = 1 -+ interface -+ subroutine c_func(b) -+ use iso_c_binding -+ integer(C_INT) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/fortran_main002.f90 b/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/fortran_main002.f90 -new file mode 100644 -index 0000000..61250b0 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/fortran_main002.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the scalar type and the scalar type is short -+! with iso_c_binding -+! -+program main -+ use iso_c_binding -+ integer(C_SHORT) :: my_x = 1 -+ interface -+ subroutine c_func(b) -+ use iso_c_binding -+ integer(C_SHORT) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/fortran_main003.f90 b/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/fortran_main003.f90 -new file mode 100644 -index 0000000..8620d6d ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/fortran_main003.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the scalar type and the scalar type is long -+! with iso_c_binding -+! -+program main -+ use iso_c_binding -+ integer(C_LONG) :: my_x = 1 -+ interface -+ subroutine c_func(b) -+ use iso_c_binding -+ integer(C_LONG) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/fortran_main004.f90 b/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/fortran_main004.f90 -new file mode 100644 -index 0000000..bc27cec ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/fortran_main004.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the scalar type and the scalar type is -+! long long with iso_c_binding -+! -+program main -+ use iso_c_binding -+ integer(C_LONG_LONG) :: my_x = 1 -+ interface -+ subroutine c_func(b) -+ use iso_c_binding -+ integer(C_LONG_LONG) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/fortran_main005.f90 b/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/fortran_main005.f90 -new file mode 100644 -index 0000000..8b74204 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/fortran_main005.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the scalar type and the scalar type is -+! signed char with iso_c_binding -+! -+program main -+ use iso_c_binding -+ integer(C_SIGNED_CHAR) :: my_x = 65 -+ interface -+ subroutine c_func(b) -+ use iso_c_binding -+ integer(C_SIGNED_CHAR) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/fortran_main006.f90 b/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/fortran_main006.f90 -new file mode 100644 -index 0000000..29062ec ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/fortran_main006.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the scalar type and the scalar type is size_t -+! with iso_c_binding -+! -+program main -+ use iso_c_binding -+ integer(C_SIZE_T) :: my_x = 3 -+ interface -+ subroutine c_func(b) -+ use iso_c_binding -+ integer(C_SIZE_T) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/fortran_main007.f90 b/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/fortran_main007.f90 -new file mode 100644 -index 0000000..55d0f75 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/fortran_main007.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the scalar type and the scalar type is int8_t -+! with iso_c_binding -+! -+program main -+ use iso_c_binding -+ integer(C_INT8_T) :: my_x = 1 -+ interface -+ subroutine c_func(b) -+ use iso_c_binding -+ integer(C_INT8_T) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/fortran_main008.f90 b/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/fortran_main008.f90 -new file mode 100644 -index 0000000..436e139 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/fortran_main008.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the scalar type and the scalar type is -+! int16_t with iso_c_binding -+! -+program main -+ use iso_c_binding -+ integer(C_INT16_T) :: my_x = 1 -+ interface -+ subroutine c_func(b) -+ use iso_c_binding -+ integer(C_INT16_T) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/fortran_main009.f90 b/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/fortran_main009.f90 -new file mode 100644 -index 0000000..0a02bc2 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/fortran_main009.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the scalar type and the scalar type is -+! int32_t with iso_c_binding -+! -+program main -+ use iso_c_binding -+ integer(C_INT32_T) :: my_x = 1 -+ interface -+ subroutine c_func(b) -+ use iso_c_binding -+ integer(C_INT32_T) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/fortran_main010.f90 b/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/fortran_main010.f90 -new file mode 100644 -index 0000000..2d29eef ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/fortran_main010.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the scalar type and the scalar type is -+! int64_t with iso_c_binding -+! -+program main -+ use iso_c_binding -+ integer(C_INT64_T) :: my_x = 1 -+ interface -+ subroutine c_func(b) -+ use iso_c_binding -+ integer(C_INT64_T) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/fortran_main011.f90 b/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/fortran_main011.f90 -new file mode 100644 -index 0000000..36b1865 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/fortran_main011.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the scalar type and the scalar type is -+! int_least_8_t with iso_c_binding -+! -+program main -+ use iso_c_binding -+ integer(C_INT_LEAST8_T) :: my_x = 1 -+ interface -+ subroutine c_func(b) -+ use iso_c_binding -+ integer(C_INT_LEAST8_T) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/fortran_main012.f90 b/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/fortran_main012.f90 -new file mode 100644 -index 0000000..4c199ae ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/fortran_main012.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the scalar type and the scalar type is -+! int_least16_t with iso_c_binding -+! -+program main -+ use iso_c_binding -+ integer(C_INT_LEAST16_T) :: my_x = 1 -+ interface -+ subroutine c_func(b) -+ use iso_c_binding -+ integer(C_INT_LEAST16_T) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/fortran_main013.f90 b/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/fortran_main013.f90 -new file mode 100644 -index 0000000..935f899 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/fortran_main013.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the scalar type and the scalar type is -+! int_least32_t with iso_c_binding -+! -+program main -+ use iso_c_binding -+ integer(C_INT_LEAST32_T) :: my_x = 1 -+ interface -+ subroutine c_func(b) -+ use iso_c_binding -+ integer(C_INT_LEAST32_T) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/fortran_main014.f90 b/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/fortran_main014.f90 -new file mode 100644 -index 0000000..71767d8 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/fortran_main014.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the scalar type and the scalar type is -+! int_least64_t with iso_c_binding -+! -+program main -+ use iso_c_binding -+ integer(C_INT_LEAST64_T) :: my_x = 1 -+ interface -+ subroutine c_func(b) -+ use iso_c_binding -+ integer(C_INT_LEAST64_T) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/fortran_main015.f90 b/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/fortran_main015.f90 -new file mode 100644 -index 0000000..a4fa2c8 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/fortran_main015.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the scalar type and the scalar type is -+! int_fast8_t with iso_c_binding -+! -+program main -+ use iso_c_binding -+ integer(C_INT_FAST8_T) :: my_x = 1 -+ interface -+ subroutine c_func(b) -+ use iso_c_binding -+ integer(C_INT_FAST8_T) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/fortran_main016.f90 b/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/fortran_main016.f90 -new file mode 100644 -index 0000000..a249371 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/fortran_main016.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the scalar type and the scalar type is -+! int_fast16_t with iso_c_binding -+! -+program main -+ use iso_c_binding -+ integer(C_INT_FAST16_T) :: my_x = 1 -+ interface -+ subroutine c_func(b) -+ use iso_c_binding -+ integer(C_INT_FAST16_T) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/fortran_main017.f90 b/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/fortran_main017.f90 -new file mode 100644 -index 0000000..5054223 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/fortran_main017.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the scalar type and the scalar type is -+! int_fast32_t with iso_c_binding -+! -+program main -+ use iso_c_binding -+ integer(C_INT_FAST32_T) :: my_x = 1 -+ interface -+ subroutine c_func(b) -+ use iso_c_binding -+ integer(C_INT_FAST32_T) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/fortran_main018.f90 b/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/fortran_main018.f90 -new file mode 100644 -index 0000000..a4c7df9 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/fortran_main018.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the scalar type and the scalar type is -+! int_fast64_t with iso_c_binding -+! -+program main -+ use iso_c_binding -+ integer(C_INT_FAST64_T) :: my_x = 1 -+ interface -+ subroutine c_func(b) -+ use iso_c_binding -+ integer(C_INT_FAST64_T) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/fortran_main019.f90 b/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/fortran_main019.f90 -new file mode 100644 -index 0000000..d01dc8b ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/fortran_main019.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the scalar type and the scalar type is -+! intmax_t with iso_c_binding -+! -+program main -+ use iso_c_binding -+ integer(C_INTMAX_T) :: my_x = 1 -+ interface -+ subroutine c_func(b) -+ use iso_c_binding -+ integer(C_INTMAX_T) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/fortran_main020.f90 b/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/fortran_main020.f90 -new file mode 100644 -index 0000000..8724899 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/fortran_main020.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the scalar type and the scalar type is -+! intptr_t with iso_c_binding -+! -+program main -+ use iso_c_binding -+ integer(C_INTPTR_T) :: my_x = 1 -+ interface -+ subroutine c_func(b) -+ use iso_c_binding -+ integer(C_INTPTR_T) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/fortran_main021.f90 b/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/fortran_main021.f90 -new file mode 100644 -index 0000000..3aa93f5 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/fortran_main021.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the scalar type and the scalar type is float -+! with iso_c_binding -+! -+program main -+ use iso_c_binding -+ real(C_FLOAT) :: my_x = 12345678.7654321 -+ interface -+ subroutine c_func(b) -+ use iso_c_binding -+ real(C_FLOAT) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/fortran_main022.f90 b/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/fortran_main022.f90 -new file mode 100644 -index 0000000..d38e122 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/fortran_main022.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the scalar type and the scalar type is double -+! with iso_c_binding -+! -+program main -+ use iso_c_binding -+ real(C_DOUBLE) :: my_x = 3.14159265358979 -+ interface -+ subroutine c_func(b) -+ use iso_c_binding -+ real(C_DOUBLE) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/fortran_main023.f90 b/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/fortran_main023.f90 -new file mode 100644 -index 0000000..ab97171 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/fortran_main023.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the scalar type and the scalar type is -+! long double with iso_c_binding -+! -+program main -+ use iso_c_binding -+ real(C_LONG_DOUBLE) :: my_x = 3.14159265358979 -+ interface -+ subroutine c_func(b) -+ use iso_c_binding -+ real(C_LONG_DOUBLE) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/fortran_main024.f90 b/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/fortran_main024.f90 -new file mode 100644 -index 0000000..fa413ee ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/fortran_main024.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the scalar type and the scalar type is -+! float _Complex with iso_c_binding -+! -+program main -+ use iso_c_binding -+ complex(C_FLOAT_COMPLEX) :: my_x = (-12345678.7654321, 1) -+ interface -+ subroutine c_func(b) -+ use iso_c_binding -+ complex(C_FLOAT_COMPLEX) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/fortran_main025.f90 b/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/fortran_main025.f90 -new file mode 100644 -index 0000000..1f07917 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/fortran_main025.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the scalar type and the scalar type is -+! double _Complex with iso_c_binding -+! -+program main -+ use iso_c_binding -+ complex(C_DOUBLE_COMPLEX) :: my_x = (-3.14159265358979, 1) -+ interface -+ subroutine c_func(b) -+ use iso_c_binding -+ complex(C_DOUBLE_COMPLEX) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/fortran_main026.f90 b/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/fortran_main026.f90 -new file mode 100644 -index 0000000..7a1d999 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/fortran_main026.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the scalar type and the scalar type is -+! long double _Complex with iso_c_binding -+! -+program main -+ use iso_c_binding -+ complex(C_LONG_DOUBLE_COMPLEX) :: my_x = (-3.14159265358979, 1) -+ interface -+ subroutine c_func(b) -+ use iso_c_binding -+ complex(C_LONG_DOUBLE_COMPLEX) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/fortran_main027.f90 b/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/fortran_main027.f90 -new file mode 100644 -index 0000000..5c5b626 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/fortran_main027.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the scalar type and the scalar type is _Bool -+! with iso_c_binding -+! -+program main -+ use iso_c_binding -+ logical(C_BOOL) :: my_x = .FALSE. -+ interface -+ subroutine c_func(b) -+ use iso_c_binding -+ logical(C_BOOL) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/fortran_main028.f90 b/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/fortran_main028.f90 -new file mode 100644 -index 0000000..cea2d0b ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/fortran_main028.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the scalar type and the scalar type is char -+! with iso_c_binding -+! -+program main -+ use iso_c_binding -+ character(C_CHAR) :: my_x = 'a' -+ interface -+ subroutine c_func(b) -+ use iso_c_binding -+ character(C_CHAR) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/result.md b/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/result.md -new file mode 100644 -index 0000000..858a59c ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/result.md -@@ -0,0 +1,29 @@ -+ | test | gfortran | flang | nvfortran| -+ | 001 | PASS | PASS | PASS | -+ | 002 | PASS | PASS | PASS | -+ | 003 | PASS | PASS | PASS | -+ | 004 | PASS | PASS | PASS | -+ | 005 | PASS | PASS | PASS | -+ | 006 | PASS | PASS | PASS | -+ | 007 | PASS | PASS | PASS | -+ | 008 | PASS | PASS | PASS | -+ | 009 | PASS | PASS | PASS | -+ | 010 | PASS | PASS | PASS | -+ | 011 | PASS | PASS | PASS | -+ | 012 | PASS | PASS | PASS | -+ | 013 | PASS | PASS | PASS | -+ | 014 | PASS | PASS | PASS | -+ | 015 | PASS | PASS | PASS | -+ | 016 | PASS | PASS | PASS | -+ | 017 | PASS | PASS | PASS | -+ | 018 | PASS | PASS | PASS | -+ | 019 | PASS | PASS | PASS | -+ | 020 | PASS | PASS | PASS | -+ | 021 | PASS | PASS | PASS | -+ | 022 | PASS | PASS | PASS | -+ | 023 | PASS | ERROR | ERROR | -+ | 024 | PASS | PASS | PASS | -+ | 025 | PASS | PASS | PASS | -+ | 026 | PASS | ERROR | ERROR | -+ | 027 | PASS | PASS | PASS | -+ | 028 | PASS | PASS | PASS | -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/run.sh b/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/run.sh -new file mode 100644 -index 0000000..dbbd62f ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/002_fortran_call_c_scalar_iso_c_binding/run.sh -@@ -0,0 +1,22 @@ -+for i in {001..028} -+do -+echo "------- test $i ------." -+echo "----- gfortran result:" -+gcc c_func$i.c -c -o c-test.o -+gfortran fortran_main$i.f90 -fno-range-check -c -o fortran-test.o -+gfortran c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+echo "----- flang-new result : " -+clang c_func$i.c -c -o c-test.o -+flang-new fortran_main$i.f90 -c -o fortran-test.o -+flang-new -flang-experimental-exec c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+echo "----- nvfortran result : " -+clang c_func$i.c -c -o c-test.o -+nvfortran fortran_main$i.f90 -c -o fortran-test.o -+nvfortran c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+done -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func001.c b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func001.c -new file mode 100644 -index 0000000..6b34fe7 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func001.c -@@ -0,0 +1,4 @@ -+#include -+void c_func_(int a) { -+ printf("%d\n", a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func002.c b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func002.c -new file mode 100644 -index 0000000..0a82fd6 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func002.c -@@ -0,0 +1,5 @@ -+#include -+#include -+void c_func_(short a) { -+ printf("%hd\n", a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func003.c b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func003.c -new file mode 100644 -index 0000000..e945b70 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func003.c -@@ -0,0 +1,5 @@ -+#include -+#include -+void c_func_(long a) { -+ printf("%ld\n", a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func004.c b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func004.c -new file mode 100644 -index 0000000..6d5f734 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func004.c -@@ -0,0 +1,5 @@ -+#include -+#include -+void c_func_(long long a) { -+ printf("%lld\n", a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func005.c b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func005.c -new file mode 100644 -index 0000000..aa46418 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func005.c -@@ -0,0 +1,4 @@ -+#include -+void c_func_(signed char a) { -+ printf("%c\n", a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func006.c b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func006.c -new file mode 100644 -index 0000000..d78d3d5 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func006.c -@@ -0,0 +1,5 @@ -+#include -+#include -+void c_func_(size_t a) { -+ printf("%ld\n", a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func007.c b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func007.c -new file mode 100644 -index 0000000..2e08462 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func007.c -@@ -0,0 +1,5 @@ -+#include -+#include -+void c_func_(int8_t a) { -+ printf("%hhd\n", a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func008.c b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func008.c -new file mode 100644 -index 0000000..9b10264 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func008.c -@@ -0,0 +1,5 @@ -+#include -+#include -+void c_func_(int16_t a) { -+ printf("%hd\n", a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func009.c b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func009.c -new file mode 100644 -index 0000000..7ed8d51 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func009.c -@@ -0,0 +1,5 @@ -+#include -+#include -+void c_func_(int32_t a) { -+ printf("%d\n", a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func010.c b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func010.c -new file mode 100644 -index 0000000..426f6ae ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func010.c -@@ -0,0 +1,5 @@ -+#include -+#include -+void c_func_(int64_t a) { -+ printf("%ld\n", a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func011.c b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func011.c -new file mode 100644 -index 0000000..660f33e ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func011.c -@@ -0,0 +1,5 @@ -+#include -+#include -+void c_func_(int_least8_t a) { -+ printf("%hhd\n", a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func012.c b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func012.c -new file mode 100644 -index 0000000..abf7d13 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func012.c -@@ -0,0 +1,5 @@ -+#include -+#include -+void c_func_(int_least16_t a) { -+ printf("%hd\n", a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func013.c b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func013.c -new file mode 100644 -index 0000000..638f7d0 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func013.c -@@ -0,0 +1,5 @@ -+#include -+#include -+void c_func_(int_least32_t a) { -+ printf("%d\n", a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func014.c b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func014.c -new file mode 100644 -index 0000000..c0401de ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func014.c -@@ -0,0 +1,5 @@ -+#include -+#include -+void c_func_(int_least64_t a) { -+ printf("%ld\n", a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func015.c b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func015.c -new file mode 100644 -index 0000000..f7b7caa ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func015.c -@@ -0,0 +1,5 @@ -+#include -+#include -+void c_func_(int_fast8_t a) { -+ printf("%hhd\n", a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func016.c b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func016.c -new file mode 100644 -index 0000000..ef70772 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func016.c -@@ -0,0 +1,5 @@ -+#include -+#include -+void c_func_(int_fast16_t a) { -+ printf("%ld\n", a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func017.c b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func017.c -new file mode 100644 -index 0000000..86e6cd6 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func017.c -@@ -0,0 +1,5 @@ -+#include -+#include -+void c_func_(int_fast32_t a) { -+ printf("%ld\n", a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func018.c b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func018.c -new file mode 100644 -index 0000000..c8ae092 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func018.c -@@ -0,0 +1,5 @@ -+#include -+#include -+void c_func_(int_fast64_t a) { -+ printf("%ld\n", a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func019.c b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func019.c -new file mode 100644 -index 0000000..0b0fa15 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func019.c -@@ -0,0 +1,5 @@ -+#include -+#include -+void c_func_(intmax_t a) { -+ printf("%ld\n", a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func020.c b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func020.c -new file mode 100644 -index 0000000..bde599d ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func020.c -@@ -0,0 +1,5 @@ -+#include -+#include -+void c_func_(intptr_t a) { -+ printf("%ld\n", a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func021.c b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func021.c -new file mode 100644 -index 0000000..ae5bf11 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func021.c -@@ -0,0 +1,4 @@ -+#include -+void c_func_(float a) { -+ printf("%f\n", a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func022.c b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func022.c -new file mode 100644 -index 0000000..b3bdc55 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func022.c -@@ -0,0 +1,4 @@ -+#include -+void c_func_(double a) { -+ printf("%0.20lf\n", a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func023.c b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func023.c -new file mode 100644 -index 0000000..af99efc ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func023.c -@@ -0,0 +1,4 @@ -+#include -+void c_func_(long double a) { -+ printf("%0.20Lf\n", a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func024.c b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func024.c -new file mode 100644 -index 0000000..af69eac ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func024.c -@@ -0,0 +1,5 @@ -+#include -+#include -+void c_func_(float _Complex t) { -+ printf("%0.20f + %0.20fi\n", creal(t), cimag(t)); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func025.c b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func025.c -new file mode 100644 -index 0000000..55a85e9 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func025.c -@@ -0,0 +1,5 @@ -+#include -+#include -+void c_func_(double _Complex t) { -+ printf("%0.20lf + %0.20lfi\n", creal(t), cimag(t)); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func026.c b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func026.c -new file mode 100644 -index 0000000..5b7017a ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func026.c -@@ -0,0 +1,5 @@ -+#include -+#include -+void c_func_(long double _Complex t) { -+ printf("%0.20f + %0.20fi\n", creal(t), cimag(t)); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func027.c b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func027.c -new file mode 100644 -index 0000000..ff95fd7 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func027.c -@@ -0,0 +1,4 @@ -+#include -+void c_func_(_Bool a) { -+ printf("%d\n", a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func028.c b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func028.c -new file mode 100644 -index 0000000..b92caf7 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/c_func028.c -@@ -0,0 +1,4 @@ -+#include -+void c_func_(char a) { -+ printf("%c\n", a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main001.f90 b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main001.f90 -new file mode 100644 -index 0000000..68a4e65 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main001.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type with value attribute and the -+! scalar type is int without iso_c_binding -+! -+program main -+ integer :: my_x = 1 -+ interface -+ subroutine c_func(b) -+ integer, value :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main002.f90 b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main002.f90 -new file mode 100644 -index 0000000..f98661e ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main002.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type with value attribute and the -+! scalar type is short without iso_c_binding -+! -+program main -+ integer(2) :: my_x = 1 -+ interface -+ subroutine c_func(b) -+ integer(2), value :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main003.f90 b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main003.f90 -new file mode 100644 -index 0000000..56d73bb ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main003.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type with value attribute and the -+! scalar type is long without iso_c_binding -+! -+program main -+ integer(8) :: my_x = 1 -+ interface -+ subroutine c_func(b) -+ integer(8), value :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main004.f90 b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main004.f90 -new file mode 100644 -index 0000000..bd26e3d ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main004.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type with value attribute and the -+! scalar type is long long without iso_c_binding -+! -+program main -+ integer(8) :: my_x = 1 -+ interface -+ subroutine c_func(b) -+ integer(8), value :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main005.f90 b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main005.f90 -new file mode 100644 -index 0000000..c603a40 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main005.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type with value attribute and the -+! scalar type is signed char without iso_c_binding -+! -+program main -+ integer(1) :: my_x = 65 -+ interface -+ subroutine c_func(b) -+ integer(1), value :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main006.f90 b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main006.f90 -new file mode 100644 -index 0000000..08e4cab ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main006.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type with value attribute and the -+! scalar type is size_t without iso_c_binding -+! -+program main -+ integer(8) :: my_x = 3 -+ interface -+ subroutine c_func(b) -+ integer(8), value :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main007.f90 b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main007.f90 -new file mode 100644 -index 0000000..6fbc4f1 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main007.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type with value attribute and the -+! scalar type is int8_t without iso_c_binding -+! -+program main -+ integer(1) :: my_x = 1 -+ interface -+ subroutine c_func(b) -+ integer(1), value :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main008.f90 b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main008.f90 -new file mode 100644 -index 0000000..dadfeb3 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main008.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type with value attribute and the -+! scalar type is int16_t without iso_c_binding -+! -+program main -+ integer(2) :: my_x = 1 -+ interface -+ subroutine c_func(b) -+ integer(2), value :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main009.f90 b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main009.f90 -new file mode 100644 -index 0000000..b9589e6 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main009.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type with value attribute and the -+! scalar type is int32_t -+! -+program main -+ integer(4) :: my_x = 1 -+ interface -+ subroutine c_func(b) -+ integer(4), value :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main010.f90 b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main010.f90 -new file mode 100644 -index 0000000..a756881 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main010.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type with value attribute and the -+! scalar type is int64_t without iso_c_binding -+! -+program main -+ integer(8) :: my_x = 1 -+ interface -+ subroutine c_func(b) -+ integer(8), value :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main011.f90 b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main011.f90 -new file mode 100644 -index 0000000..58a7483 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main011.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type with value attribute and the -+! scalar type is int_least8_t without iso_c_binding -+! -+program main -+ integer(1) :: my_x = 1 -+ interface -+ subroutine c_func(b) -+ integer(1), value :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main012.f90 b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main012.f90 -new file mode 100644 -index 0000000..a5c8e34 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main012.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type with value attribute and the -+! scalar type is int_least16_t without iso_c_binding -+! -+program main -+ integer(2) :: my_x = 1 -+ interface -+ subroutine c_func(b) -+ integer(2), value :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main013.f90 b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main013.f90 -new file mode 100644 -index 0000000..8705110 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main013.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type with value attribute and the -+! scalar type is int_least32_t without iso_c_binding -+! -+program main -+ integer(4) :: my_x = 1 -+ interface -+ subroutine c_func(b) -+ integer(4), value :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main014.f90 b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main014.f90 -new file mode 100644 -index 0000000..327434e ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main014.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type with value attribute and the -+! scalar type is int_least64_t without iso_c_binding -+! -+program main -+ integer(8) :: my_x = 1 -+ interface -+ subroutine c_func(b) -+ integer(8), value :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main015.f90 b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main015.f90 -new file mode 100644 -index 0000000..b911744 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main015.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type with value attribute and the -+! scalar type is int_fast8_t without iso_c_binding -+! -+program main -+ integer(1) :: my_x = 1 -+ interface -+ subroutine c_func(b) -+ integer(1), value :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main016.f90 b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main016.f90 -new file mode 100644 -index 0000000..43c1d3f ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main016.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type with value attribute and the -+! scalar type is int_fast16_t without iso_c_binding -+! -+program main -+ integer(8) :: my_x = 1 -+ interface -+ subroutine c_func(b) -+ integer(8), value :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main017.f90 b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main017.f90 -new file mode 100644 -index 0000000..dd03c20 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main017.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type with value attribute and the -+! scalar type is int_fast32_t without iso_c_binding -+! -+program main -+ integer(8) :: my_x = 1 -+ interface -+ subroutine c_func(b) -+ integer(8), value :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main018.f90 b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main018.f90 -new file mode 100644 -index 0000000..aed4502 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main018.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type with value attribute and the -+! scalar type is int_fast64_t without iso_c_binding -+! -+program main -+ integer(8) :: my_x = 1 -+ interface -+ subroutine c_func(b) -+ integer(8), value :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main019.f90 b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main019.f90 -new file mode 100644 -index 0000000..47f84e9 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main019.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type with value attribute and the -+! scalar type is intmax_t without iso_c_binding -+! -+program main -+ integer(8) :: my_x = 3 -+ interface -+ subroutine c_func(b) -+ integer(8), value :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main020.f90 b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main020.f90 -new file mode 100644 -index 0000000..2d3d9fa ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main020.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type with value attribute and the -+! scalar type is intptr_t without iso_c_binding -+! -+program main -+ integer(8) :: my_x = 3 -+ interface -+ subroutine c_func(b) -+ integer(8), value :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main021.f90 b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main021.f90 -new file mode 100644 -index 0000000..4bb2e37 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main021.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type with value attribute and the -+! scalar type is float without iso_c_binding -+! -+program main -+ real(4) :: my_x = 12345678.7654321 -+ interface -+ subroutine c_func(b) -+ real(4), value :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main022.f90 b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main022.f90 -new file mode 100644 -index 0000000..33d79e5 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main022.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type with value attribute and the -+! scalar type is double without iso_c_binding -+! -+program main -+ real(8) :: my_x = 3.14159265358979 -+ interface -+ subroutine c_func(b) -+ real(8), value :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main023.f90 b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main023.f90 -new file mode 100644 -index 0000000..9d090e9 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main023.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the scalar type with value attribute and the -+! scalar type is long double without iso_c_binding -+! -+program main -+ integer, parameter :: K = selected_real_kind(16) -+ real(K) :: my_x = 3.14159265358979 -+ interface -+ subroutine c_func(b) -+ integer, parameter :: K = selected_real_kind(16) -+ real(K), value :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main024.f90 b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main024.f90 -new file mode 100644 -index 0000000..7a6d9e4 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main024.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type with value attribute and the -+! scalar type is float _Complex without iso_c_binding -+! -+program main -+ complex(4) :: my_x = (-3.14159265358979, 1) -+ interface -+ subroutine c_func(b) -+ complex(4), value :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main025.f90 b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main025.f90 -new file mode 100644 -index 0000000..cf1ae5c ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main025.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type with value attribute and the -+! scalar type is double _Complex without iso_c_binding -+! -+program main -+ complex(8) :: my_x = (-3.14159265358979, 1) -+ interface -+ subroutine c_func(b) -+ complex(8), value :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main026.f90 b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main026.f90 -new file mode 100644 -index 0000000..e46d83c ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main026.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the scalar type with value attribute and the -+! scalar type is long double _Complex without iso_c_binding -+! -+program main -+ integer, parameter :: K = selected_real_kind(16) -+ complex(K) :: my_x = (-3.14159265358979, 1) -+ interface -+ subroutine c_func(b) -+ integer, parameter :: K = selected_real_kind(16) -+ complex(K), value :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main027.f90 b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main027.f90 -new file mode 100644 -index 0000000..fc3103e ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main027.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type with value attribute and the -+! scalar type is _Bool without iso_c_binding -+! -+program main -+ logical(1) :: my_x = .FALSE. -+ interface -+ subroutine c_func(b) -+ logical(1), value :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main028.f90 b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main028.f90 -new file mode 100644 -index 0000000..e0269d5 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/fortran_main028.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type with value attribute and the -+! scalar type is char without iso_c_binding -+! -+program main -+ character(1) :: my_x = 'a' -+ interface -+ subroutine c_func(b) -+ character(1), value :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/result.md b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/result.md -new file mode 100644 -index 0000000..5a8fd6c ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/result.md -@@ -0,0 +1,29 @@ -+ | test | gfortran | flang | nvfortran| -+ | 001 | PASS | ERROR | PASS | -+ | 002 | PASS | ERROR | PASS | -+ | 003 | PASS | ERROR | PASS | -+ | 004 | PASS | ERROR | PASS | -+ | 005 | PASS | ERROR | PASS | -+ | 006 | PASS | ERROR | PASS | -+ | 007 | PASS | ERROR | PASS | -+ | 008 | PASS | ERROR | PASS | -+ | 009 | PASS | ERROR | PASS | -+ | 010 | PASS | ERROR | PASS | -+ | 011 | PASS | ERROR | PASS | -+ | 012 | PASS | ERROR | PASS | -+ | 013 | PASS | ERROR | PASS | -+ | 014 | PASS | ERROR | PASS | -+ | 015 | PASS | ERROR | PASS | -+ | 016 | PASS | ERROR | PASS | -+ | 017 | PASS | ERROR | PASS | -+ | 018 | PASS | ERROR | PASS | -+ | 019 | PASS | ERROR | PASS | -+ | 020 | PASS | ERROR | PASS | -+ | 021 | PASS | PASS | PASS | -+ | 022 | PASS | PASS | PASS | -+ | 023 | PASS | ERROR | ERROR | -+ | 024 | PASS | PASS | PASS | -+ | 025 | PASS | PASS | PASS | -+ | 026 | PASS | PASS | ERROR | -+ | 027 | PASS | ERROR | PASS | -+ | 028 | PASS | ERROR | PASS | -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/run.sh b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/run.sh -new file mode 100644 -index 0000000..dbbd62f ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/003_fortran_call_c_scalar_value/run.sh -@@ -0,0 +1,22 @@ -+for i in {001..028} -+do -+echo "------- test $i ------." -+echo "----- gfortran result:" -+gcc c_func$i.c -c -o c-test.o -+gfortran fortran_main$i.f90 -fno-range-check -c -o fortran-test.o -+gfortran c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+echo "----- flang-new result : " -+clang c_func$i.c -c -o c-test.o -+flang-new fortran_main$i.f90 -c -o fortran-test.o -+flang-new -flang-experimental-exec c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+echo "----- nvfortran result : " -+clang c_func$i.c -c -o c-test.o -+nvfortran fortran_main$i.f90 -c -o fortran-test.o -+nvfortran c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+done -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func001.c b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func001.c -new file mode 100644 -index 0000000..5acb3c0 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func001.c -@@ -0,0 +1,4 @@ -+#include -+void c_func_(int *a) { -+ printf("%d\n", *a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func002.c b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func002.c -new file mode 100644 -index 0000000..a695d21 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func002.c -@@ -0,0 +1,5 @@ -+#include -+#include -+void c_func_(short *a) { -+ printf("%hd\n", *a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func003.c b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func003.c -new file mode 100644 -index 0000000..c3e2b1b ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func003.c -@@ -0,0 +1,5 @@ -+#include -+#include -+void c_func_(long *a) { -+ printf("%ld\n", *a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func004.c b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func004.c -new file mode 100644 -index 0000000..c83f515 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func004.c -@@ -0,0 +1,5 @@ -+#include -+#include -+void c_func_(long long *a) { -+ printf("%lld\n", *a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func005.c b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func005.c -new file mode 100644 -index 0000000..df53145 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func005.c -@@ -0,0 +1,4 @@ -+#include -+void c_func_(signed char *a) { -+ printf("%c\n", *a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func006.c b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func006.c -new file mode 100644 -index 0000000..bf8fe98 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func006.c -@@ -0,0 +1,5 @@ -+#include -+#include -+void c_func_(size_t *a) { -+ printf("%ld\n", *a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func007.c b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func007.c -new file mode 100644 -index 0000000..1ccc2d3 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func007.c -@@ -0,0 +1,5 @@ -+#include -+#include -+void c_func_(int8_t *a) { -+ printf("%hhd\n", *a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func008.c b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func008.c -new file mode 100644 -index 0000000..5b4a477 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func008.c -@@ -0,0 +1,5 @@ -+#include -+#include -+void c_func_(int16_t *a) { -+ printf("%hd\n", *a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func009.c b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func009.c -new file mode 100644 -index 0000000..ef5dbab ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func009.c -@@ -0,0 +1,5 @@ -+#include -+#include -+void c_func_(int32_t *a) { -+ printf("%d\n", *a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func010.c b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func010.c -new file mode 100644 -index 0000000..ff0c5b2 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func010.c -@@ -0,0 +1,5 @@ -+#include -+#include -+void c_func_(int64_t *a) { -+ printf("%ld\n", *a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func011.c b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func011.c -new file mode 100644 -index 0000000..648e234 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func011.c -@@ -0,0 +1,5 @@ -+#include -+#include -+void c_func_(int_least8_t *a) { -+ printf("%hhd\n", *a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func012.c b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func012.c -new file mode 100644 -index 0000000..175d427 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func012.c -@@ -0,0 +1,5 @@ -+#include -+#include -+void c_func_(int_least16_t *a) { -+ printf("%hd\n", *a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func013.c b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func013.c -new file mode 100644 -index 0000000..3e63c13 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func013.c -@@ -0,0 +1,5 @@ -+#include -+#include -+void c_func_(int_least32_t *a) { -+ printf("%d\n", *a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func014.c b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func014.c -new file mode 100644 -index 0000000..ac6a62b ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func014.c -@@ -0,0 +1,5 @@ -+#include -+#include -+void c_func_(int_least64_t *a) { -+ printf("%ld\n", *a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func015.c b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func015.c -new file mode 100644 -index 0000000..85b98cc ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func015.c -@@ -0,0 +1,5 @@ -+#include -+#include -+void c_func_(int_fast8_t *a) { -+ printf("%hhd\n", *a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func016.c b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func016.c -new file mode 100644 -index 0000000..ce358c3 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func016.c -@@ -0,0 +1,5 @@ -+#include -+#include -+void c_func_(int_fast16_t *a) { -+ printf("%ld\n", *a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func017.c b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func017.c -new file mode 100644 -index 0000000..9576185 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func017.c -@@ -0,0 +1,5 @@ -+#include -+#include -+void c_func_(int_fast32_t *a) { -+ printf("%ld\n", *a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func018.c b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func018.c -new file mode 100644 -index 0000000..84469ba ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func018.c -@@ -0,0 +1,5 @@ -+#include -+#include -+void c_func_(int_fast64_t *a) { -+ printf("%ld\n", *a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func019.c b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func019.c -new file mode 100644 -index 0000000..acd8949 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func019.c -@@ -0,0 +1,5 @@ -+#include -+#include -+void c_func_(intmax_t *a) { -+ printf("%ld\n", *a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func020.c b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func020.c -new file mode 100644 -index 0000000..43c01a7 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func020.c -@@ -0,0 +1,5 @@ -+#include -+#include -+void c_func_(intptr_t *a) { -+ printf("%ld\n", *a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func021.c b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func021.c -new file mode 100644 -index 0000000..af99025 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func021.c -@@ -0,0 +1,4 @@ -+#include -+void c_func_(float *a) { -+ printf("%f\n", *a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func022.c b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func022.c -new file mode 100644 -index 0000000..7ae046f ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func022.c -@@ -0,0 +1,4 @@ -+#include -+void c_func_(double *a) { -+ printf("%0.20f\n", *a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func023.c b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func023.c -new file mode 100644 -index 0000000..be8b2b1 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func023.c -@@ -0,0 +1,4 @@ -+#include -+void c_func_(long double *a) { -+ printf("%0.20Lf\n", *a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func024.c b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func024.c -new file mode 100644 -index 0000000..1e65f36 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func024.c -@@ -0,0 +1,5 @@ -+#include -+#include -+void c_func_(float _Complex *t) { -+ printf("%f + %fi\n", creal(*t), cimag(*t)); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func025.c b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func025.c -new file mode 100644 -index 0000000..b3f9944 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func025.c -@@ -0,0 +1,5 @@ -+#include -+#include -+void c_func_(double _Complex *t) { -+ printf("%0.20lf + %0.20lfi\n", creal(*t), cimag(*t)); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func026.c b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func026.c -new file mode 100644 -index 0000000..c049c6f ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func026.c -@@ -0,0 +1,5 @@ -+#include -+#include -+void c_func_(long double _Complex *t) { -+ printf("%0.20f + %0.20fi\n", creal(*t), cimag(*t)); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func027.c b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func027.c -new file mode 100644 -index 0000000..a3a8596 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func027.c -@@ -0,0 +1,4 @@ -+#include -+void c_func_(_Bool *a) { -+ printf("%d\n", *a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func028.c b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func028.c -new file mode 100644 -index 0000000..0abbf89 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/c_func028.c -@@ -0,0 +1,4 @@ -+#include -+void c_func_(char *a) { -+ printf("%c\n", *a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main001.f90 b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main001.f90 -new file mode 100644 -index 0000000..9255a56 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main001.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type and the scalar type is int -+! with bindc -+! -+program main -+ integer(4) :: my_x = 1 -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ integer(4) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main002.f90 b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main002.f90 -new file mode 100644 -index 0000000..a265d80 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main002.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type and the scalar type is short -+! with bindc -+! -+program main -+ integer(2) :: my_x = 1 -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ integer(2) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main003.f90 b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main003.f90 -new file mode 100644 -index 0000000..5ea0bb8 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main003.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type and the scalar type is long -+! with bindc -+! -+program main -+ integer(8) :: my_x = 1 -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ integer(8) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main004.f90 b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main004.f90 -new file mode 100644 -index 0000000..355c37a ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main004.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type and the scalar type is -+! long long with bindc -+! -+program main -+ integer(8) :: my_x = 1 -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ integer(8) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main005.f90 b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main005.f90 -new file mode 100644 -index 0000000..b3f965b ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main005.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type and the scalar type is -+! signed char with bindc -+! -+program main -+ integer(1) :: my_x = 65 -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ integer(1) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main006.f90 b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main006.f90 -new file mode 100644 -index 0000000..0ff532d ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main006.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type and the scalar type is size_t -+! with bindc -+! -+program main -+ integer(8) :: my_x = 1 -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ integer(8) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main007.f90 b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main007.f90 -new file mode 100644 -index 0000000..3fa2acf ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main007.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type and the scalar type is int8_t -+! with bindc -+! -+program main -+ integer(1) :: my_x = 1 -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ integer(1) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main008.f90 b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main008.f90 -new file mode 100644 -index 0000000..28febbd ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main008.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type and the scalar type is -+! int16_t with bindc -+! -+program main -+ integer(2) :: my_x = 1 -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ integer(2) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main009.f90 b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main009.f90 -new file mode 100644 -index 0000000..a25eb5b ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main009.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type and the scalar type is -+! int32_t with bindc -+! -+program main -+ integer(4) :: my_x = 1 -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ integer(4) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main010.f90 b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main010.f90 -new file mode 100644 -index 0000000..89d324d ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main010.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type and the scalar type is -+! int64_t with bindc -+! -+program main -+ integer(8) :: my_x = 1 -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ integer(8) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main011.f90 b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main011.f90 -new file mode 100644 -index 0000000..451ef1e ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main011.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type and the scalar type is -+! int_least8_t with bindc -+! -+program main -+ integer(1) :: my_x = 1 -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ integer(1) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main012.f90 b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main012.f90 -new file mode 100644 -index 0000000..df2f5fd ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main012.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type and the scalar type is -+! int_least16_t with bindc -+! -+program main -+ integer(2) :: my_x = 1 -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ integer(2) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main013.f90 b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main013.f90 -new file mode 100644 -index 0000000..f333dda ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main013.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type and the scalar type is -+! int_least32_t with bindc -+! -+program main -+ integer(4) :: my_x = 1 -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ integer(4) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main014.f90 b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main014.f90 -new file mode 100644 -index 0000000..9af1234 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main014.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type and the scalar type is -+! int_least64_t with bindc -+! -+program main -+ integer(8) :: my_x = 1 -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ integer(8) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main015.f90 b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main015.f90 -new file mode 100644 -index 0000000..84d3954 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main015.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type and the scalar type is -+! int_fast8_t with bindc -+! -+program main -+ integer(1) :: my_x = 1 -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ integer(1) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main016.f90 b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main016.f90 -new file mode 100644 -index 0000000..8d848d3 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main016.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type and the scalar type is -+! int_fast_16_t with bindc -+! -+program main -+ integer(8) :: my_x = 1 -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ integer(8) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main017.f90 b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main017.f90 -new file mode 100644 -index 0000000..b62653c ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main017.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type and the scalar type is -+! int_fast32_t with bindc -+! -+program main -+ integer(8) :: my_x = 1 -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ integer(8) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main018.f90 b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main018.f90 -new file mode 100644 -index 0000000..5343c78 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main018.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type and the scalar type is -+! int_fast64_t with bindc -+! -+program main -+ integer(8) :: my_x = 1 -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ integer(8) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main019.f90 b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main019.f90 -new file mode 100644 -index 0000000..ace3d4e ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main019.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type and the scalar type is -+! intmax_t with bindc -+! -+program main -+ integer(8) :: my_x = 1 -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ integer(8) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main020.f90 b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main020.f90 -new file mode 100644 -index 0000000..9c936f7 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main020.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type and the scalar type is -+! intptr_t with bindc -+! -+program main -+ integer(8) :: my_x = 1 -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ integer(8) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main021.f90 b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main021.f90 -new file mode 100644 -index 0000000..30f8860 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main021.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type and the scalar type is float -+! with bindc -+! -+program main -+ real(4) :: my_x = 3.1415926535 -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ real(4) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main022.f90 b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main022.f90 -new file mode 100644 -index 0000000..bb30edf ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main022.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type and the scalar type is double -+! with bindc -+! -+program main -+ real(8) :: my_x = 3.14159265358979 -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ real(8) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main023.f90 b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main023.f90 -new file mode 100644 -index 0000000..ddc85c4 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main023.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the scalar type and the scalar type is -+! long double with bindc -+! -+program main -+ integer, parameter :: K = selected_real_kind(16) -+ real(K) :: my_x = 3.14159265358979 -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ integer, parameter :: K = selected_real_kind(16) -+ real(K) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main024.f90 b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main024.f90 -new file mode 100644 -index 0000000..298dc40 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main024.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type and the scalar type is -+! float _Complex with bindc -+! -+program main -+ complex(4) :: my_x = (-12345678.7654321, 1) -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ complex(4) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main025.f90 b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main025.f90 -new file mode 100644 -index 0000000..270a89b ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main025.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type and the scalar type is -+! double _Complex with bindc -+! -+program main -+ complex(8) :: my_x = (-3.14159265358979, 1) -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ complex(8) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main026.f90 b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main026.f90 -new file mode 100644 -index 0000000..23755fe ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main026.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the scalar type and the scalar type is -+! long double _Complex with bindc -+! -+program main -+ integer, parameter :: K = selected_real_kind(16) -+ complex(K) :: my_x = (-3.14159265358979, 1) -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ integer, parameter :: K = selected_real_kind(16) -+ complex(K) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main027.f90 b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main027.f90 -new file mode 100644 -index 0000000..207f386 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main027.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type and the scalar type is _Bool -+! with bindc -+! -+program main -+ logical(1) :: my_x = .FALSE. -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ logical(1) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main028.f90 b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main028.f90 -new file mode 100644 -index 0000000..19ab3a6 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/fortran_main028.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type and the scalar type is char -+! with bindc -+! -+program main -+ character(1) :: my_x = 'a' -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ character(1) :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/result.md b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/result.md -new file mode 100644 -index 0000000..f15fe53 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/result.md -@@ -0,0 +1,29 @@ -+ | test | gfortran | flang | nvfortran| -+ | 001 | PASS | PASS | PASS | -+ | 002 | PASS | PASS | PASS | -+ | 003 | PASS | PASS | PASS | -+ | 004 | PASS | PASS | PASS | -+ | 005 | PASS | PASS | PASS | -+ | 006 | PASS | PASS | PASS | -+ | 007 | PASS | PASS | PASS | -+ | 008 | PASS | PASS | PASS | -+ | 009 | PASS | PASS | PASS | -+ | 010 | PASS | PASS | PASS | -+ | 011 | PASS | PASS | PASS | -+ | 012 | PASS | PASS | PASS | -+ | 013 | PASS | PASS | PASS | -+ | 014 | PASS | PASS | PASS | -+ | 015 | PASS | PASS | PASS | -+ | 016 | PASS | PASS | PASS | -+ | 017 | PASS | PASS | PASS | -+ | 018 | PASS | PASS | PASS | -+ | 019 | PASS | PASS | PASS | -+ | 020 | PASS | PASS | PASS | -+ | 021 | PASS | PASS | PASS | -+ | 022 | PASS | PASS | PASS | -+ | 023 | PASS | PASS | ERROR | -+ | 024 | PASS | PASS | PASS | -+ | 025 | PASS | PASS | PASS | -+ | 026 | PASS | PASS | ERROR | -+ | 027 | PASS | PASS | PASS | -+ | 028 | PASS | PASS | PASS | -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/run.sh b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/run.sh -new file mode 100644 -index 0000000..dbbd62f ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/004_fortran_call_c_scalar_bindc/run.sh -@@ -0,0 +1,22 @@ -+for i in {001..028} -+do -+echo "------- test $i ------." -+echo "----- gfortran result:" -+gcc c_func$i.c -c -o c-test.o -+gfortran fortran_main$i.f90 -fno-range-check -c -o fortran-test.o -+gfortran c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+echo "----- flang-new result : " -+clang c_func$i.c -c -o c-test.o -+flang-new fortran_main$i.f90 -c -o fortran-test.o -+flang-new -flang-experimental-exec c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+echo "----- nvfortran result : " -+clang c_func$i.c -c -o c-test.o -+nvfortran fortran_main$i.f90 -c -o fortran-test.o -+nvfortran c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+done -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func001.c b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func001.c -new file mode 100644 -index 0000000..6b34fe7 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func001.c -@@ -0,0 +1,4 @@ -+#include -+void c_func_(int a) { -+ printf("%d\n", a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func002.c b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func002.c -new file mode 100644 -index 0000000..0a82fd6 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func002.c -@@ -0,0 +1,5 @@ -+#include -+#include -+void c_func_(short a) { -+ printf("%hd\n", a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func003.c b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func003.c -new file mode 100644 -index 0000000..e945b70 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func003.c -@@ -0,0 +1,5 @@ -+#include -+#include -+void c_func_(long a) { -+ printf("%ld\n", a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func004.c b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func004.c -new file mode 100644 -index 0000000..6d5f734 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func004.c -@@ -0,0 +1,5 @@ -+#include -+#include -+void c_func_(long long a) { -+ printf("%lld\n", a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func005.c b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func005.c -new file mode 100644 -index 0000000..aa46418 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func005.c -@@ -0,0 +1,4 @@ -+#include -+void c_func_(signed char a) { -+ printf("%c\n", a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func006.c b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func006.c -new file mode 100644 -index 0000000..d78d3d5 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func006.c -@@ -0,0 +1,5 @@ -+#include -+#include -+void c_func_(size_t a) { -+ printf("%ld\n", a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func007.c b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func007.c -new file mode 100644 -index 0000000..2e08462 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func007.c -@@ -0,0 +1,5 @@ -+#include -+#include -+void c_func_(int8_t a) { -+ printf("%hhd\n", a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func008.c b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func008.c -new file mode 100644 -index 0000000..9b10264 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func008.c -@@ -0,0 +1,5 @@ -+#include -+#include -+void c_func_(int16_t a) { -+ printf("%hd\n", a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func009.c b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func009.c -new file mode 100644 -index 0000000..7ed8d51 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func009.c -@@ -0,0 +1,5 @@ -+#include -+#include -+void c_func_(int32_t a) { -+ printf("%d\n", a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func010.c b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func010.c -new file mode 100644 -index 0000000..426f6ae ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func010.c -@@ -0,0 +1,5 @@ -+#include -+#include -+void c_func_(int64_t a) { -+ printf("%ld\n", a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func011.c b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func011.c -new file mode 100644 -index 0000000..660f33e ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func011.c -@@ -0,0 +1,5 @@ -+#include -+#include -+void c_func_(int_least8_t a) { -+ printf("%hhd\n", a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func012.c b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func012.c -new file mode 100644 -index 0000000..abf7d13 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func012.c -@@ -0,0 +1,5 @@ -+#include -+#include -+void c_func_(int_least16_t a) { -+ printf("%hd\n", a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func013.c b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func013.c -new file mode 100644 -index 0000000..638f7d0 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func013.c -@@ -0,0 +1,5 @@ -+#include -+#include -+void c_func_(int_least32_t a) { -+ printf("%d\n", a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func014.c b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func014.c -new file mode 100644 -index 0000000..c0401de ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func014.c -@@ -0,0 +1,5 @@ -+#include -+#include -+void c_func_(int_least64_t a) { -+ printf("%ld\n", a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func015.c b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func015.c -new file mode 100644 -index 0000000..f7b7caa ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func015.c -@@ -0,0 +1,5 @@ -+#include -+#include -+void c_func_(int_fast8_t a) { -+ printf("%hhd\n", a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func016.c b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func016.c -new file mode 100644 -index 0000000..ef70772 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func016.c -@@ -0,0 +1,5 @@ -+#include -+#include -+void c_func_(int_fast16_t a) { -+ printf("%ld\n", a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func017.c b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func017.c -new file mode 100644 -index 0000000..86e6cd6 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func017.c -@@ -0,0 +1,5 @@ -+#include -+#include -+void c_func_(int_fast32_t a) { -+ printf("%ld\n", a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func018.c b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func018.c -new file mode 100644 -index 0000000..c8ae092 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func018.c -@@ -0,0 +1,5 @@ -+#include -+#include -+void c_func_(int_fast64_t a) { -+ printf("%ld\n", a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func019.c b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func019.c -new file mode 100644 -index 0000000..0b0fa15 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func019.c -@@ -0,0 +1,5 @@ -+#include -+#include -+void c_func_(intmax_t a) { -+ printf("%ld\n", a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func020.c b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func020.c -new file mode 100644 -index 0000000..bde599d ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func020.c -@@ -0,0 +1,5 @@ -+#include -+#include -+void c_func_(intptr_t a) { -+ printf("%ld\n", a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func021.c b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func021.c -new file mode 100644 -index 0000000..ae5bf11 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func021.c -@@ -0,0 +1,4 @@ -+#include -+void c_func_(float a) { -+ printf("%f\n", a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func022.c b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func022.c -new file mode 100644 -index 0000000..b3bdc55 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func022.c -@@ -0,0 +1,4 @@ -+#include -+void c_func_(double a) { -+ printf("%0.20lf\n", a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func023.c b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func023.c -new file mode 100644 -index 0000000..af99efc ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func023.c -@@ -0,0 +1,4 @@ -+#include -+void c_func_(long double a) { -+ printf("%0.20Lf\n", a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func024.c b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func024.c -new file mode 100644 -index 0000000..af69eac ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func024.c -@@ -0,0 +1,5 @@ -+#include -+#include -+void c_func_(float _Complex t) { -+ printf("%0.20f + %0.20fi\n", creal(t), cimag(t)); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func025.c b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func025.c -new file mode 100644 -index 0000000..55a85e9 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func025.c -@@ -0,0 +1,5 @@ -+#include -+#include -+void c_func_(double _Complex t) { -+ printf("%0.20lf + %0.20lfi\n", creal(t), cimag(t)); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func026.c b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func026.c -new file mode 100644 -index 0000000..5b7017a ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func026.c -@@ -0,0 +1,5 @@ -+#include -+#include -+void c_func_(long double _Complex t) { -+ printf("%0.20f + %0.20fi\n", creal(t), cimag(t)); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func027.c b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func027.c -new file mode 100644 -index 0000000..ff95fd7 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func027.c -@@ -0,0 +1,4 @@ -+#include -+void c_func_(_Bool a) { -+ printf("%d\n", a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func028.c b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func028.c -new file mode 100644 -index 0000000..b92caf7 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/c_func028.c -@@ -0,0 +1,4 @@ -+#include -+void c_func_(char a) { -+ printf("%c\n", a); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main001.f90 b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main001.f90 -new file mode 100644 -index 0000000..9b2b33f ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main001.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type with value attribute and the -+! scalar type is int with bindc -+! -+program main -+ integer :: my_x = 1 -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ integer, value :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main002.f90 b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main002.f90 -new file mode 100644 -index 0000000..48736e1 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main002.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type with value attribute and the -+! scalar type is short with with bindc -+! -+program main -+ integer(2) :: my_x = 1 -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ integer(2), value :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main003.f90 b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main003.f90 -new file mode 100644 -index 0000000..feca432 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main003.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type with value attribute and the -+! scalar type is long with bindc -+! -+program main -+ integer(8) :: my_x = 1 -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ integer(8), value :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main004.f90 b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main004.f90 -new file mode 100644 -index 0000000..0926bd3 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main004.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type with value attribute and the -+! scalar type is long long with bindc -+! -+program main -+ integer(8) :: my_x = 1 -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ integer(8), value :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main005.f90 b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main005.f90 -new file mode 100644 -index 0000000..8308cf7 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main005.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type with value attribute and the -+! scalar type is signed char with bindc -+! -+program main -+ integer(1) :: my_x = 65 -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ integer(1), value :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main006.f90 b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main006.f90 -new file mode 100644 -index 0000000..ac3bda1 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main006.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type with value attribute and the -+! scalar type is size_t with bindc -+! -+program main -+ integer(8) :: my_x = 3 -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ integer(8), value :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main007.f90 b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main007.f90 -new file mode 100644 -index 0000000..e70a093 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main007.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type with value attribute and the -+! scalar type is int8_t with bindc -+! -+program main -+ integer(1) :: my_x = 1 -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ integer(1), value :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main008.f90 b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main008.f90 -new file mode 100644 -index 0000000..4e9554e ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main008.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type with value attribute and the -+! scalar type is int16_t with bindc -+! -+program main -+ integer(2) :: my_x = 1 -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ integer(2), value :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main009.f90 b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main009.f90 -new file mode 100644 -index 0000000..f1084a6 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main009.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type with value attribute and the -+! scalar type is int32_t with bindc -+! -+program main -+ integer(4) :: my_x = 1 -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ integer(4), value :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main010.f90 b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main010.f90 -new file mode 100644 -index 0000000..8d2ece3 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main010.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type with value attribute and the -+! scalar type is int64_t with bindc -+! -+program main -+ integer(8) :: my_x = 1 -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ integer(8), value :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main011.f90 b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main011.f90 -new file mode 100644 -index 0000000..cd82f35 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main011.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type with value attribute and the -+! scalar type is int_least8_t with bindc -+! -+program main -+ integer(1) :: my_x = 1 -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ integer(1), value :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main012.f90 b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main012.f90 -new file mode 100644 -index 0000000..00da761 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main012.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type with value attribute and the -+! scalar type is int_least16_t with bindc -+! -+program main -+ integer(2) :: my_x = 1 -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ integer(2), value :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main013.f90 b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main013.f90 -new file mode 100644 -index 0000000..28b7535 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main013.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type with value attribute and the -+! scalar type is int_least32_t with bindc -+! -+program main -+ integer(4) :: my_x = 1 -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ integer(4), value :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main014.f90 b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main014.f90 -new file mode 100644 -index 0000000..6336001 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main014.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type with value attribute and the -+! scalar type is int_least64_t with bindc -+! -+program main -+ integer(8) :: my_x = 1 -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ integer(8), value :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main015.f90 b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main015.f90 -new file mode 100644 -index 0000000..bcf23f1 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main015.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type with value attribute and the -+! scalar type is int_fast8_t with bindc -+! -+program main -+ integer(1) :: my_x = 1 -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ integer(1), value :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main016.f90 b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main016.f90 -new file mode 100644 -index 0000000..09b77c7 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main016.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type with value attribute and the -+! scalar type is int_fast16_t with bindc -+! -+program main -+ integer(8) :: my_x = 1 -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ integer(8), value :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main017.f90 b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main017.f90 -new file mode 100644 -index 0000000..26c67eb ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main017.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type with value attribute and the -+! scalar type is int_fast32_t with bindc -+! -+program main -+ integer(8) :: my_x = 1 -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ integer(8), value :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main018.f90 b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main018.f90 -new file mode 100644 -index 0000000..7d94f50 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main018.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type with value attribute and the -+! scalar type is int_fast64_t with bindc -+! -+program main -+ integer(8) :: my_x = 1 -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ integer(8), value :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main019.f90 b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main019.f90 -new file mode 100644 -index 0000000..d77ae94 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main019.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type with value attribute and the -+! scalar type is intmax_t with bindc -+! -+program main -+ integer(8) :: my_x = 3 -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ integer(8), value :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main020.f90 b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main020.f90 -new file mode 100644 -index 0000000..d4b887d ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main020.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type with value attribute and the -+! scalar type is intptr_t with bindc -+! -+program main -+ integer(8) :: my_x = 3 -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ integer(8), value :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main021.f90 b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main021.f90 -new file mode 100644 -index 0000000..7c17ff0 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main021.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type with value attribute and the -+! scalar type is float with bindc -+! -+program main -+ real(4) :: my_x = 12345678.7654321 -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ real(4), value :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main022.f90 b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main022.f90 -new file mode 100644 -index 0000000..713cc1a ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main022.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type with value attribute and the -+! scalar type is double with bindc -+! -+program main -+ real(8) :: my_x = 3.14159265358979 -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ real(8), value :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main023.f90 b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main023.f90 -new file mode 100644 -index 0000000..48633c1 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main023.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the scalar type with value attribute and the -+! scalar type is long double with bindc -+! -+program main -+ integer, parameter :: K = selected_real_kind(16) -+ real(K) :: my_x = 3.14159265358979 -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ integer, parameter :: K = selected_real_kind(16) -+ real(K), value :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main024.f90 b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main024.f90 -new file mode 100644 -index 0000000..545bfed ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main024.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type with value attribute and the -+! scalar type is float _Complex with bindc -+! -+program main -+ complex(4) :: my_x = (-3.14159265358979, 1) -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ complex(4), value :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main025.f90 b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main025.f90 -new file mode 100644 -index 0000000..b32f5af ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main025.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type with value attribute and the -+! scalar type is double _Complex with bindc -+! -+program main -+ complex(8) :: my_x = (-3.14159265358979, 1) -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ complex(8), value :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main026.f90 b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main026.f90 -new file mode 100644 -index 0000000..e04bf6d ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main026.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the scalar type with value attribute and the -+! scalar type is long double _Complex with bindc -+! -+program main -+ integer, parameter :: K = selected_real_kind(16) -+ complex(K) :: my_x = (-3.14159265358979, 1) -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ integer, parameter :: K = selected_real_kind(16) -+ complex(K), value :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main027.f90 b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main027.f90 -new file mode 100644 -index 0000000..300b8fa ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main027.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type with value attribute and the -+! scalar type is _Bool with bindc -+! -+program main -+ logical(1) :: my_x = .FALSE. -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ logical(1), value :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main028.f90 b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main028.f90 -new file mode 100644 -index 0000000..0a53f44 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/fortran_main028.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type with value attribute and the -+! scalar type is char with bindc -+! -+program main -+ character(1) :: my_x = 'a' -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ character(1), value :: b -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/result.md b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/result.md -new file mode 100644 -index 0000000..70d83d4 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/result.md -@@ -0,0 +1,29 @@ -+ | test | gfortran | flang | nvfortran| -+ | 001 | PASS | PASS | PASS | -+ | 002 | PASS | PASS | PASS | -+ | 003 | PASS | PASS | PASS | -+ | 004 | PASS | PASS | PASS | -+ | 005 | PASS | PASS | PASS | -+ | 006 | PASS | PASS | PASS | -+ | 007 | PASS | PASS | PASS | -+ | 008 | PASS | PASS | PASS | -+ | 009 | PASS | PASS | PASS | -+ | 010 | PASS | PASS | PASS | -+ | 011 | PASS | PASS | PASS | -+ | 012 | PASS | PASS | PASS | -+ | 013 | PASS | PASS | PASS | -+ | 014 | PASS | PASS | PASS | -+ | 015 | PASS | PASS | PASS | -+ | 016 | PASS | PASS | PASS | -+ | 017 | PASS | PASS | PASS | -+ | 018 | PASS | PASS | PASS | -+ | 019 | PASS | PASS | PASS | -+ | 020 | PASS | PASS | PASS | -+ | 021 | PASS | PASS | PASS | -+ | 022 | PASS | PASS | PASS | -+ | 023 | PASS | PASS | ERROR | -+ | 024 | PASS | PASS | PASS | -+ | 025 | PASS | PASS | PASS | -+ | 026 | PASS | ERROR | ERROR | -+ | 027 | PASS | PASS | PASS | -+ | 028 | PASS | ERROR | PASS | -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/run.sh b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/run.sh -new file mode 100644 -index 0000000..dbbd62f ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/005_fortran_call_c_scalar_bindc_value/run.sh -@@ -0,0 +1,22 @@ -+for i in {001..028} -+do -+echo "------- test $i ------." -+echo "----- gfortran result:" -+gcc c_func$i.c -c -o c-test.o -+gfortran fortran_main$i.f90 -fno-range-check -c -o fortran-test.o -+gfortran c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+echo "----- flang-new result : " -+clang c_func$i.c -c -o c-test.o -+flang-new fortran_main$i.f90 -c -o fortran-test.o -+flang-new -flang-experimental-exec c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+echo "----- nvfortran result : " -+clang c_func$i.c -c -o c-test.o -+nvfortran fortran_main$i.f90 -c -o fortran-test.o -+nvfortran c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+done -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/006_fortran_call_c_pointer/c_func001.c b/test/interoperability_with_c_fortran_call_c_scalar/006_fortran_call_c_pointer/c_func001.c -new file mode 100644 -index 0000000..f8cbea0 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/006_fortran_call_c_pointer/c_func001.c -@@ -0,0 +1,7 @@ -+#include -+#include -+void c_func_(int *s) -+{ -+ *s = 2; -+ printf("the num is:%d\n", *s); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/006_fortran_call_c_pointer/c_func002.c b/test/interoperability_with_c_fortran_call_c_scalar/006_fortran_call_c_pointer/c_func002.c -new file mode 100644 -index 0000000..f8cbea0 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/006_fortran_call_c_pointer/c_func002.c -@@ -0,0 +1,7 @@ -+#include -+#include -+void c_func_(int *s) -+{ -+ *s = 2; -+ printf("the num is:%d\n", *s); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/006_fortran_call_c_pointer/c_func003.c b/test/interoperability_with_c_fortran_call_c_scalar/006_fortran_call_c_pointer/c_func003.c -new file mode 100644 -index 0000000..1964fe8 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/006_fortran_call_c_pointer/c_func003.c -@@ -0,0 +1,8 @@ -+#include -+#include -+void c_func_(int *s) -+{ -+ for(int i = 0;i < sizeof(s); i++) { -+ s[i] = i; -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/006_fortran_call_c_pointer/c_func004.c b/test/interoperability_with_c_fortran_call_c_scalar/006_fortran_call_c_pointer/c_func004.c -new file mode 100644 -index 0000000..4822ea9 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/006_fortran_call_c_pointer/c_func004.c -@@ -0,0 +1,8 @@ -+#include -+#include -+void c_func_(int *s) -+{ -+ for(int i = 0;i < sizeof(s); i++) { -+ s[i] = 0; -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/006_fortran_call_c_pointer/fortran_main001.f90 b/test/interoperability_with_c_fortran_call_c_scalar/006_fortran_call_c_pointer/fortran_main001.f90 -new file mode 100644 -index 0000000..87908b1 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/006_fortran_call_c_pointer/fortran_main001.f90 -@@ -0,0 +1,17 @@ -+! Test fortran call c for the pointer type and allocate a free space -+! for the pointer -+! -+program main -+ integer, pointer :: my_x -+ interface -+ subroutine c_func(b) -+ integer :: b -+ end -+ end interface -+ allocate(my_x) -+ my_x = 1 -+ print *, my_x -+ call c_func(my_x) -+ print *, my_x -+ deallocate(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/006_fortran_call_c_pointer/fortran_main002.f90 b/test/interoperability_with_c_fortran_call_c_scalar/006_fortran_call_c_pointer/fortran_main002.f90 -new file mode 100644 -index 0000000..78f8a20 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/006_fortran_call_c_pointer/fortran_main002.f90 -@@ -0,0 +1,18 @@ -+! Test fortran call c for the pointer type and let the pointer point to -+! a target variable -+! -+program main -+ integer, pointer :: my_x -+ integer, target :: x = 3 -+ interface -+ subroutine c_func(b) -+ integer :: b -+ end -+ end interface -+ allocate(my_x) -+ my_x => x -+ print *, my_x -+ call c_func(my_x) -+ print *, my_x -+ print *, x -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/006_fortran_call_c_pointer/fortran_main003.f90 b/test/interoperability_with_c_fortran_call_c_scalar/006_fortran_call_c_pointer/fortran_main003.f90 -new file mode 100644 -index 0000000..99c2ca4 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/006_fortran_call_c_pointer/fortran_main003.f90 -@@ -0,0 +1,20 @@ -+! Test fortran call c for the pointer type and let the pointer point to -+! a target variable array -+! -+program main -+ integer, pointer :: my_x(:) -+ integer, target :: x(10) -+ interface -+ subroutine c_func(b) -+ integer, dimension(*) :: b -+ end -+ end interface -+ do i =1, 10 -+ x(i) = i -+ end do -+ my_x => x(5: 10) -+ print *, my_x -+ call c_func(my_x) -+ print *, my_x -+ print *, x -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/006_fortran_call_c_pointer/fortran_main004.f90 b/test/interoperability_with_c_fortran_call_c_scalar/006_fortran_call_c_pointer/fortran_main004.f90 -new file mode 100644 -index 0000000..149c338 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/006_fortran_call_c_pointer/fortran_main004.f90 -@@ -0,0 +1,23 @@ -+! Test fortran call c for the pointer type and let the pointer point to -+! a target two-dimensional array -+! -+program main -+ integer, pointer :: my_x(:, :) -+ integer, target :: x(4, 4) -+ interface -+ subroutine c_func(b) -+ integer, dimension(*) :: b -+ end -+ end interface -+ do i =1, 4 -+ do j = 1, 4 -+ x(i, j) = i + j -+ end do -+ end do -+ my_x => x(1: 2, 2: 3) -+ print *, x -+ print *, my_x -+ call c_func(my_x) -+ print *, my_x -+ print *, x -+end -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/006_fortran_call_c_pointer/result.md b/test/interoperability_with_c_fortran_call_c_scalar/006_fortran_call_c_pointer/result.md -new file mode 100644 -index 0000000..cdbdc8c ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/006_fortran_call_c_pointer/result.md -@@ -0,0 +1,5 @@ -+ | test | gfortran | flang | nvfortran| -+ | 001 | PASS | PASS | PASS | -+ | 002 | PASS | PASS | PASS | -+ | 003 | PASS | PASS | PASS | -+ | 004 | PASS | ERROR | PASS | -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/006_fortran_call_c_pointer/run.sh b/test/interoperability_with_c_fortran_call_c_scalar/006_fortran_call_c_pointer/run.sh -new file mode 100644 -index 0000000..45c6bb0 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/006_fortran_call_c_pointer/run.sh -@@ -0,0 +1,22 @@ -+for i in {001..004} -+do -+echo "------- test $i ------." -+echo "----- gfortran result:" -+gcc c_func$i.c -c -o c-test.o -+gfortran fortran_main$i.f90 -fno-range-check -c -o fortran-test.o -+gfortran c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+echo "----- flang-new result : " -+clang c_func$i.c -c -o c-test.o -+flang-new fortran_main$i.f90 -c -o fortran-test.o -+flang-new -flang-experimental-exec c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+echo "----- nvfortran result : " -+clang c_func$i.c -c -o c-test.o -+nvfortran fortran_main$i.f90 -c -o fortran-test.o -+nvfortran c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+done -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/007_fortran_call_c_procedure_pointer/c_func001.c b/test/interoperability_with_c_fortran_call_c_scalar/007_fortran_call_c_procedure_pointer/c_func001.c -new file mode 100644 -index 0000000..2ce3091 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/007_fortran_call_c_procedure_pointer/c_func001.c -@@ -0,0 +1,5 @@ -+void func_(void (*foo)(int *)) { -+ int *x, y = 1; -+ x = &y; -+ foo(x); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/007_fortran_call_c_procedure_pointer/c_func002.c b/test/interoperability_with_c_fortran_call_c_scalar/007_fortran_call_c_procedure_pointer/c_func002.c -new file mode 100644 -index 0000000..130b5fa ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/007_fortran_call_c_procedure_pointer/c_func002.c -@@ -0,0 +1,5 @@ -+void func_(void (**foo)(int *)) { -+ int *x, y = 1; -+ x = &y; -+ (*foo)(x); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/007_fortran_call_c_procedure_pointer/c_func003.c b/test/interoperability_with_c_fortran_call_c_scalar/007_fortran_call_c_procedure_pointer/c_func003.c -new file mode 100644 -index 0000000..cf688f2 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/007_fortran_call_c_procedure_pointer/c_func003.c -@@ -0,0 +1,7 @@ -+#include -+void func_(int (**foo)(int *)) { -+ int *x, y = 1; -+ x = &y; -+ int w = (*foo)(x); -+ printf("%d\n", w); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/007_fortran_call_c_procedure_pointer/c_func004.c b/test/interoperability_with_c_fortran_call_c_scalar/007_fortran_call_c_procedure_pointer/c_func004.c -new file mode 100644 -index 0000000..1540ee1 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/007_fortran_call_c_procedure_pointer/c_func004.c -@@ -0,0 +1,7 @@ -+#include -+void func_(int (*foo)(int *)) { -+ int *x, y = 1; -+ x = &y; -+ int w = foo(x); -+ printf("%d\n", w); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/007_fortran_call_c_procedure_pointer/c_func005.c b/test/interoperability_with_c_fortran_call_c_scalar/007_fortran_call_c_procedure_pointer/c_func005.c -new file mode 100644 -index 0000000..04172df ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/007_fortran_call_c_procedure_pointer/c_func005.c -@@ -0,0 +1,6 @@ -+void func_(void (**foo)(int *), void (**foo2)(int *)) { -+ int *x, y = 1; -+ x = &y; -+ (*foo)(x); -+ (*foo2)(x); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/007_fortran_call_c_procedure_pointer/c_func006.c b/test/interoperability_with_c_fortran_call_c_scalar/007_fortran_call_c_procedure_pointer/c_func006.c -new file mode 100644 -index 0000000..a0c6df1 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/007_fortran_call_c_procedure_pointer/c_func006.c -@@ -0,0 +1,7 @@ -+#include -+void func_(void (**foo)(float *)) { -+ printf("ref\n"); -+ float *x, y = 1.1; -+ x = &y; -+ (*foo)(x); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/007_fortran_call_c_procedure_pointer/c_func007.c b/test/interoperability_with_c_fortran_call_c_scalar/007_fortran_call_c_procedure_pointer/c_func007.c -new file mode 100644 -index 0000000..7c11812 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/007_fortran_call_c_procedure_pointer/c_func007.c -@@ -0,0 +1,4 @@ -+#include -+void func_(int *x) { -+ printf("%d\n", *x); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/007_fortran_call_c_procedure_pointer/c_func008.c b/test/interoperability_with_c_fortran_call_c_scalar/007_fortran_call_c_procedure_pointer/c_func008.c -new file mode 100644 -index 0000000..787c4be ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/007_fortran_call_c_procedure_pointer/c_func008.c -@@ -0,0 +1,4 @@ -+#include -+int func_(int *x) { -+ return *x + 1; -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/007_fortran_call_c_procedure_pointer/c_func009.c b/test/interoperability_with_c_fortran_call_c_scalar/007_fortran_call_c_procedure_pointer/c_func009.c -new file mode 100644 -index 0000000..a821381 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/007_fortran_call_c_procedure_pointer/c_func009.c -@@ -0,0 +1,11 @@ -+#include -+void print_x(); -+void (**func_(void (**)()))(); -+void print_x() { -+ printf("ook\n"); -+} -+void (**func_(void (**fx)()))() { -+ printf("ok\n"); -+ fx[0] = print_x; -+ return fx; -+}; -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/007_fortran_call_c_procedure_pointer/fortran_main001.f90 b/test/interoperability_with_c_fortran_call_c_scalar/007_fortran_call_c_procedure_pointer/fortran_main001.f90 -new file mode 100644 -index 0000000..9e2bc92 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/007_fortran_call_c_procedure_pointer/fortran_main001.f90 -@@ -0,0 +1,17 @@ -+! test fortran call c for procedure about callback subroutine -+! -+program main -+ procedure(), pointer :: pp -+ interface -+ subroutine func(p) -+ procedure() :: p -+ end -+ end interface -+ pp=>print_x -+ call func(pp) -+contains -+ subroutine print_x(x) -+ integer :: x -+ print *, x -+ end -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/007_fortran_call_c_procedure_pointer/fortran_main002.f90 b/test/interoperability_with_c_fortran_call_c_scalar/007_fortran_call_c_procedure_pointer/fortran_main002.f90 -new file mode 100644 -index 0000000..25fe4ec ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/007_fortran_call_c_procedure_pointer/fortran_main002.f90 -@@ -0,0 +1,17 @@ -+! test fortran call c for procedure pointer about callback subroutine -+! -+program main -+ interface -+ subroutine func(p) -+ procedure(), pointer :: p -+ end -+ end interface -+ procedure(), pointer :: pp -+ pp=>print_x -+ call func(pp) -+contains -+ subroutine print_x(x) -+ integer :: x -+ print *, x -+ end -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/007_fortran_call_c_procedure_pointer/fortran_main003.f90 b/test/interoperability_with_c_fortran_call_c_scalar/007_fortran_call_c_procedure_pointer/fortran_main003.f90 -new file mode 100644 -index 0000000..4905453 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/007_fortran_call_c_procedure_pointer/fortran_main003.f90 -@@ -0,0 +1,18 @@ -+! test fortran call c for procedure pointer about callback function -+! -+program main -+ interface -+ subroutine func(p) -+ procedure(), pointer :: p -+ end -+ end interface -+ procedure(), pointer :: pp -+ pp=>return_x -+ call func(pp) -+contains -+ function return_x(x) -+ integer :: x -+ integer :: return_x -+ return_x = x -+ end -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/007_fortran_call_c_procedure_pointer/fortran_main004.f90 b/test/interoperability_with_c_fortran_call_c_scalar/007_fortran_call_c_procedure_pointer/fortran_main004.f90 -new file mode 100644 -index 0000000..e29fcff ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/007_fortran_call_c_procedure_pointer/fortran_main004.f90 -@@ -0,0 +1,18 @@ -+! test fortran call c for procedure about callback function -+! -+program main -+ interface -+ subroutine func(p) -+ procedure() :: p -+ end -+ end interface -+ procedure(), pointer :: pp -+ pp=>return_x -+ call func(pp) -+contains -+ function return_x(x) -+ integer :: x -+ integer :: return_x -+ return_x = x -+ end -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/007_fortran_call_c_procedure_pointer/fortran_main005.f90 b/test/interoperability_with_c_fortran_call_c_scalar/007_fortran_call_c_procedure_pointer/fortran_main005.f90 -new file mode 100644 -index 0000000..38b4596 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/007_fortran_call_c_procedure_pointer/fortran_main005.f90 -@@ -0,0 +1,24 @@ -+! test fortran call c for procedure pointers about callback subroutine -+! -+program main -+ interface -+ subroutine func(p, p2) -+ procedure(), pointer :: p -+ procedure(), pointer :: p2 -+ end -+ end interface -+ procedure(), pointer :: pp, pp2 -+ pp=>print_x -+ pp2=>print_negx -+ call func(pp, pp2) -+contains -+ subroutine print_x(x) -+ integer :: x -+ print *, x -+ end -+ subroutine print_negx(x) -+ integer :: x -+ x = -1 * x -+ print *, x -+ end -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/007_fortran_call_c_procedure_pointer/fortran_main006.f90 b/test/interoperability_with_c_fortran_call_c_scalar/007_fortran_call_c_procedure_pointer/fortran_main006.f90 -new file mode 100644 -index 0000000..600e9b7 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/007_fortran_call_c_procedure_pointer/fortran_main006.f90 -@@ -0,0 +1,19 @@ -+! test fortran call c for procedure pointer about callback lib function -+! -+program main -+ procedure(), pointer :: pp -+ interface -+ subroutine func(p) -+ procedure(), pointer :: p -+ end -+ end interface -+ pp=>print_cosx -+ call func(pp) -+ !pp=>cos -+ !call pp(1.1) -+contains -+ subroutine print_cosx(x) -+ real(4) :: x -+ print *, cos(x) -+ end -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/007_fortran_call_c_procedure_pointer/fortran_main007.f90 b/test/interoperability_with_c_fortran_call_c_scalar/007_fortran_call_c_procedure_pointer/fortran_main007.f90 -new file mode 100644 -index 0000000..abadafd ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/007_fortran_call_c_procedure_pointer/fortran_main007.f90 -@@ -0,0 +1,14 @@ -+! test fortran call c for procedure pointer that points to C subroutine -+! -+program main -+ interface -+ subroutine func(x) bind(C) -+ integer :: x -+ end -+ end interface -+ procedure(func), bind(C, name = "func_") :: proc -+ procedure(func), pointer :: pp -+ integer :: x = 5 -+ pp=>proc -+ call pp(x) -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/007_fortran_call_c_procedure_pointer/fortran_main008.f90 b/test/interoperability_with_c_fortran_call_c_scalar/007_fortran_call_c_procedure_pointer/fortran_main008.f90 -new file mode 100644 -index 0000000..2fe0611 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/007_fortran_call_c_procedure_pointer/fortran_main008.f90 -@@ -0,0 +1,16 @@ -+! test fortran call c for procedure pointer that points to C function -+! -+program main -+ interface -+ function func(x) bind(C) -+ integer :: x -+ integer :: func -+ end -+ end interface -+ procedure(func), bind(C, name = "func_") :: proc -+ procedure(func), pointer :: pp -+ integer :: x = 5, y -+ pp=>proc -+ y = pp(x) -+ print *, y -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/007_fortran_call_c_procedure_pointer/fortran_main009.f90 b/test/interoperability_with_c_fortran_call_c_scalar/007_fortran_call_c_procedure_pointer/fortran_main009.f90 -new file mode 100644 -index 0000000..2f4dc48 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/007_fortran_call_c_procedure_pointer/fortran_main009.f90 -@@ -0,0 +1,16 @@ -+! test fortran call c for return procedure pointer by function -+! -+program main -+ interface -+ subroutine f() bind(C) -+ end -+ function func(x) bind(C, name = "func_") result(res) -+ procedure(f), pointer :: x -+ procedure(f), pointer :: res -+ end -+ end interface -+ procedure(f), pointer :: pp => null() -+ procedure(f), pointer :: x => null() -+ pp => func(x) -+ call pp() -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/007_fortran_call_c_procedure_pointer/result.md b/test/interoperability_with_c_fortran_call_c_scalar/007_fortran_call_c_procedure_pointer/result.md -new file mode 100644 -index 0000000..679af9b ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/007_fortran_call_c_procedure_pointer/result.md -@@ -0,0 +1,11 @@ -+ | test | gfortran | flang | nvfortran| -+ | 001 | PASS | ERROR | PASS | -+ | 002 | PASS | ERROR | PASS | -+ | 003 | PASS | ERROR | ERROR | -+ | 004 | PASS | ERROR | ERROR | -+ | 005 | PASS | ERROR | PASS | -+ | 006 | PASS | ERROR | PASS | -+ | 007 | PASS | ERROR | PASS | -+ | 008 | PASS | ERROR | PASS | -+ | 009 | PASS | ERROR | PASS | -+ | 010 | ERROR | ERROR | PASS | -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_scalar/007_fortran_call_c_procedure_pointer/run.sh b/test/interoperability_with_c_fortran_call_c_scalar/007_fortran_call_c_procedure_pointer/run.sh -new file mode 100644 -index 0000000..2b09ed3 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_scalar/007_fortran_call_c_procedure_pointer/run.sh -@@ -0,0 +1,22 @@ -+for i in {001..009} -+do -+echo "------- test $i ------." -+echo "----- gfortran result:" -+gcc c_func$i.c -c -o c-test.o -+gfortran fortran_main$i.f90 -fno-range-check -c -o fortran-test.o -+gfortran c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+echo "----- flang-new result : " -+clang c_func$i.c -c -o c-test.o -+flang-new fortran_main$i.f90 -c -o fortran-test.o -+flang-new -flang-experimental-exec c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+echo "----- nvfortran result : " -+clang c_func$i.c -c -o c-test.o -+nvfortran fortran_main$i.f90 -c -o fortran-test.o -+nvfortran c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+done -\ No newline at end of file --- -2.25.1 - diff --git a/4-add-test-cases-for-openmp-optimization.patch b/4-add-test-cases-for-openmp-optimization.patch deleted file mode 100644 index 0b0c064da5604e7ed90003c5bf2285c22252e54a..0000000000000000000000000000000000000000 --- a/4-add-test-cases-for-openmp-optimization.patch +++ /dev/null @@ -1,2068 +0,0 @@ -From 1c04d8e4b34e8a9c8415cca22ef6c710662c13a3 Mon Sep 17 00:00:00 2001 -From: xieyihui -Date: Fri, 13 Jan 2023 21:12:04 +0800 -Subject: [PATCH] Add test cases for OpenMP optimizations - -diff --git a/test/openmp_optimization/fortran_func001.f90 b/test/openmp_optimization/fortran_func001.f90 -new file mode 100644 -index 0000000..239b5aa ---- /dev/null -+++ b/test/openmp_optimization/fortran_func001.f90 -@@ -0,0 +1,13 @@ -+subroutine f(a, b) -+ integer :: a(100), b(100) -+ !$omp parallel do -+ do i = 1, 100 -+ a(i) = i -+ end do -+ !$omp end parallel do -+ !$omp parallel do -+ do i = 1, 100 -+ b(i) = i -+ end do -+ !$omp end parallel do -+end -\ No newline at end of file -diff --git a/test/openmp_optimization/fortran_func002.f90 b/test/openmp_optimization/fortran_func002.f90 -new file mode 100644 -index 0000000..dbd669d ---- /dev/null -+++ b/test/openmp_optimization/fortran_func002.f90 -@@ -0,0 +1,10 @@ -+subroutine f(a) -+ integer :: a(100) -+ !$omp parallel -+ !$omp do -+ do i = 1, 100 -+ a(i) = i -+ end do -+ !$omp end do -+ !$omp end parallel -+end -\ No newline at end of file -diff --git a/test/openmp_optimization/fortran_func004.f90 b/test/openmp_optimization/fortran_func004.f90 -new file mode 100644 -index 0000000..1e3c0e6 ---- /dev/null -+++ b/test/openmp_optimization/fortran_func004.f90 -@@ -0,0 +1,15 @@ -+subroutine f(a, b, c, d) -+ integer :: a(100), b(100), c(100), d(100) -+ !$omp parallel -+ !$omp do -+ do i = 1, 100 -+ a(i) = d(i) -+ end do -+ !$omp end do -+ !$omp do -+ do i = 1, 100 -+ b(i) = c(i) -+ end do -+ !$omp end do -+ !$omp end parallel -+end -\ No newline at end of file -diff --git a/test/openmp_optimization/fortran_func005.f90 b/test/openmp_optimization/fortran_func005.f90 -new file mode 100644 -index 0000000..81fc5d8 ---- /dev/null -+++ b/test/openmp_optimization/fortran_func005.f90 -@@ -0,0 +1,15 @@ -+subroutine f(a, b) -+ integer :: a(100), b(100) -+ !$omp parallel -+ !$omp do -+ do i = 1, 99, 2 -+ a(i) = b(i) -+ end do -+ !$omp end do -+ !$omp do -+ do i = 2, 100, 2 -+ a(i) = b(i) -+ end do -+ !$omp end do -+ !$omp end parallel -+end -\ No newline at end of file -diff --git a/test/openmp_optimization/fortran_func007.f90 b/test/openmp_optimization/fortran_func007.f90 -new file mode 100644 -index 0000000..c7eda6f ---- /dev/null -+++ b/test/openmp_optimization/fortran_func007.f90 -@@ -0,0 +1,9 @@ -+subroutine add1(s) -+ use omp_lib -+ real :: s(1000) -+ !$omp do -+ do i = 1, 1000 -+ s(i) = i -+ end do -+ !$omp end do -+end subroutine add1 -\ No newline at end of file -diff --git a/test/openmp_optimization/fortran_func008.f90 b/test/openmp_optimization/fortran_func008.f90 -new file mode 100644 -index 0000000..0121681 ---- /dev/null -+++ b/test/openmp_optimization/fortran_func008.f90 -@@ -0,0 +1,10 @@ -+subroutine add1(s, n) -+ use omp_lib -+ real :: s(100000) -+ integer :: n -+ !$omp parallel do -+ do i = 1, n -+ s(i) = i -+ end do -+ !$omp end parallel do -+end subroutine add1 -\ No newline at end of file -diff --git a/test/openmp_optimization/fortran_func009.f90 b/test/openmp_optimization/fortran_func009.f90 -new file mode 100644 -index 0000000..69e63f0 ---- /dev/null -+++ b/test/openmp_optimization/fortran_func009.f90 -@@ -0,0 +1,15 @@ -+subroutine f(a, n) -+ integer :: a(100) -+ integer :: n -+ !$omp parallel do -+ do i = 1, 100 -+ a(i) = i + 1 -+ end do -+ !$omp end parallel do -+ !$omp parallel do -+ do i = 1, 100 -+ a(i) = i + a(i) -+ end do -+ !$omp end parallel do -+ n = n + 1 -+end -\ No newline at end of file -diff --git a/test/openmp_optimization/fortran_func010.f90 b/test/openmp_optimization/fortran_func010.f90 -new file mode 100644 -index 0000000..20de122 ---- /dev/null -+++ b/test/openmp_optimization/fortran_func010.f90 -@@ -0,0 +1,6 @@ -+subroutine f(a, b, c, d) -+ integer :: a(10000000), b(10000000), c(10000000), d(10000000) -+ do i = 2, 10000000 -+ a(i) = a(i - 1) + b(i) * c(i) / d(i) * b(i) -+ end do -+end -\ No newline at end of file -diff --git a/test/openmp_optimization/fortran_func011.f90 b/test/openmp_optimization/fortran_func011.f90 -new file mode 100644 -index 0000000..2481284 ---- /dev/null -+++ b/test/openmp_optimization/fortran_func011.f90 -@@ -0,0 +1,8 @@ -+subroutine f(a) -+ integer :: a(10000) -+ !$omp parallel do schedule (static, 1) -+ do i = 1, 10000 -+ a(i) = a(i) + 1 -+ end do -+ !$omp end parallel do -+end -\ No newline at end of file -diff --git a/test/openmp_optimization/fortran_func012.f90 b/test/openmp_optimization/fortran_func012.f90 -new file mode 100644 -index 0000000..991e5f0 ---- /dev/null -+++ b/test/openmp_optimization/fortran_func012.f90 -@@ -0,0 +1,15 @@ -+subroutine f(a, b) -+ integer :: a(1000), b(1000) -+ !$omp parallel -+ !$omp do private(a) -+ do i = 1, 1000 -+ temp = a(i) -+ end do -+ !$omp end do -+ !$omp do private(a) -+ do i = 1, 1000 -+ temp = b(i) -+ end do -+ !$omp end do -+ !$omp end parallel -+end -\ No newline at end of file -diff --git a/test/openmp_optimization/fortran_func013.f90 b/test/openmp_optimization/fortran_func013.f90 -new file mode 100644 -index 0000000..7dd2e50 ---- /dev/null -+++ b/test/openmp_optimization/fortran_func013.f90 -@@ -0,0 +1,9 @@ -+subroutine add1(s) -+ use omp_lib -+ real :: s(10000) -+ !$omp parallel do -+ do i = 1, 10000 -+ s(i) = i + 1 -+ end do -+ !$omp end parallel do -+end subroutine add1 -\ No newline at end of file -diff --git a/test/openmp_optimization/fortran_func014.f90 b/test/openmp_optimization/fortran_func014.f90 -new file mode 100644 -index 0000000..cd1eed7 ---- /dev/null -+++ b/test/openmp_optimization/fortran_func014.f90 -@@ -0,0 +1,7 @@ -+subroutine f() -+ !$omp parallel -+ !$omp end parallel -+ !$omp parallel -+ call foo() -+ !$omp end parallel -+end -\ No newline at end of file -diff --git a/test/openmp_optimization/fortran_func015.f90 b/test/openmp_optimization/fortran_func015.f90 -new file mode 100644 -index 0000000..3283902 ---- /dev/null -+++ b/test/openmp_optimization/fortran_func015.f90 -@@ -0,0 +1,7 @@ -+subroutine f(a, b, c) -+ integer :: a(1000000), b(1000000), c(1000000) -+ do i = 1, 1000000 -+ x = (b(i) + c(i)) / 2 -+ a(i) = a(i + 1) + x -+ end do -+end -\ No newline at end of file -diff --git a/test/openmp_optimization/fortran_func016.f90 b/test/openmp_optimization/fortran_func016.f90 -new file mode 100644 -index 0000000..a826cc5 ---- /dev/null -+++ b/test/openmp_optimization/fortran_func016.f90 -@@ -0,0 +1,7 @@ -+subroutine f(a, b, c) -+ integer :: a(1000000), b(1000000), c(1000000) -+ do i = 1, 1000000 -+ b(i) = b(i) + a(i - 1) -+ a(i) = a(i) + c(i) -+ end do -+end -\ No newline at end of file -diff --git a/test/openmp_optimization/fortran_func017.f90 b/test/openmp_optimization/fortran_func017.f90 -new file mode 100644 -index 0000000..fd8b6e6 ---- /dev/null -+++ b/test/openmp_optimization/fortran_func017.f90 -@@ -0,0 +1,17 @@ -+subroutine f(x, y) -+ integer, pointer :: x(:) -+ integer, pointer :: y -+ integer :: n = 512 -+ integer :: l -+ integer :: k -+ integer :: m -+ l = x(1) -+ a = n + l -+ !$omp parallel do firstprivate(x, y, n, l, a) -+ do i = 1, n -+ k = y -+ m = n * k -+ x(i) = m + a * l * i -+ end do -+ !$omp end parallel do -+end -\ No newline at end of file -diff --git a/test/openmp_optimization/fortran_func018.f90 b/test/openmp_optimization/fortran_func018.f90 -new file mode 100644 -index 0000000..00ece0b ---- /dev/null -+++ b/test/openmp_optimization/fortran_func018.f90 -@@ -0,0 +1,13 @@ -+subroutine f(a, t) -+ integer :: a(100000), t -+ logical :: b = .FALSE. -+ !$omp parallel shared(a, b) -+ !$omp do -+ do i = 1, 100000 -+ if (a(i) == t) then -+ b = .TRUE. -+ end if -+ end do -+ !$omp end do -+ !$omp end parallel -+end -\ No newline at end of file -diff --git a/test/openmp_optimization/fortran_func019.f90 b/test/openmp_optimization/fortran_func019.f90 -new file mode 100644 -index 0000000..c893706 ---- /dev/null -+++ b/test/openmp_optimization/fortran_func019.f90 -@@ -0,0 +1,14 @@ -+subroutine f(a, b) -+ integer :: a(10000), b(10000) -+ integer :: max = -1 -+ !$omp parallel do shared(a, b, max) -+ do i =1, 10000 -+ b(i) = 0.5 * a(i) -+ !$omp critical -+ if (b(i) > max) then -+ max = b(i) -+ end if -+ !$omp end critical -+ end do -+ !$omp end parallel do -+end -\ No newline at end of file -diff --git a/test/openmp_optimization/fortran_func020.f90 b/test/openmp_optimization/fortran_func020.f90 -new file mode 100644 -index 0000000..dec0737 ---- /dev/null -+++ b/test/openmp_optimization/fortran_func020.f90 -@@ -0,0 +1,11 @@ -+subroutine f(a, b) -+ use omp_lib -+ integer :: a(32), b(32), tid -+ !$omp parallel private(tid) shared(a, b) -+ tid = omp_get_thread_num() -+ do i = 1, 100 -+ call work(a, b) -+ end do -+ !$omp end parallel -+end -+ -diff --git a/test/openmp_optimization/fortran_main001.f90 b/test/openmp_optimization/fortran_main001.f90 -new file mode 100644 -index 0000000..7dfe448 ---- /dev/null -+++ b/test/openmp_optimization/fortran_main001.f90 -@@ -0,0 +1,19 @@ -+! Test optimizaton for fortran use openmp about parallel region merge -+! -+program main -+ use omp_lib -+ real(kind = 8) :: starttime, endtime, time -+ integer :: a(100) -+ integer :: b(100) -+ starttime = omp_get_wtime() -+ do n = 1, 100000 -+ call f(a, b) -+ end do -+ endtime = omp_get_wtime() -+ time = endtime - starttime -+print *, time -+end program main -+ -+! Reference -+! Müller, Matthias S.. "Some Simple OpenMP Optimization Techniques." -+! WOMPAT (2001). -\ No newline at end of file -diff --git a/test/openmp_optimization/fortran_main002.f90 b/test/openmp_optimization/fortran_main002.f90 -new file mode 100644 -index 0000000..9059ded ---- /dev/null -+++ b/test/openmp_optimization/fortran_main002.f90 -@@ -0,0 +1,19 @@ -+! Test optimizaton for fortran use openmp about implicit nowait at end -+! of parallel region -+! -+program main -+ use omp_lib -+ real(kind = 8) :: starttime, endtime, time -+ integer :: a(100) -+ starttime = omp_get_wtime() -+ do n = 1, 100000 -+ call f(a) -+ end do -+ endtime = omp_get_wtime() -+ time = endtime - starttime -+ print *, time -+end program main -+ -+! Reference -+! Müller, Matthias S.. "Some Simple OpenMP Optimization Techniques." -+! WOMPAT (2001). -\ No newline at end of file -diff --git a/test/openmp_optimization/fortran_main003.f90 b/test/openmp_optimization/fortran_main003.f90 -new file mode 100644 -index 0000000..687127f ---- /dev/null -+++ b/test/openmp_optimization/fortran_main003.f90 -@@ -0,0 +1,31 @@ -+! Test help optimize code with the OpenMP directive. OpenMP directives -+! may help the compiler to generate better code because he knows that -+! certain preconditions are fulfilled. Compiler cannot assume that the -+! different iterations of the loop are independent. But there is omp -+! parallel do. The loop also can be optimized by vectorization -+! -+program main -+ use omp_lib -+ real(kind = 8) :: starttime, endtime, time -+ integer :: a(100) -+ integer :: b(100) -+ integer :: index(100) -+ do i = 1, 100 -+ index(i) = i -+ end do -+ starttime = omp_get_wtime() -+ do n = 1, 100000 -+ !$omp parallel do -+ do i = 1, 100 -+ a(index(i)) = a(index(i)) + b(i) -+ end do -+ !$omp end parallel do -+ end do -+ endtime = omp_get_wtime() -+ time = endtime - starttime -+ print *, time -+end program main -+ -+! Reference -+! Müller, Matthias S.. "Some Simple OpenMP Optimization Techniques." -+! WOMPAT (2001). -\ No newline at end of file -diff --git a/test/openmp_optimization/fortran_main004.f90 b/test/openmp_optimization/fortran_main004.f90 -new file mode 100644 -index 0000000..679c7e3 ---- /dev/null -+++ b/test/openmp_optimization/fortran_main004.f90 -@@ -0,0 +1,22 @@ -+! Test optimizaton for fortran use openmp about remove the redundant -+! barrier -+! -+program main -+ use omp_lib -+ real(kind = 8) :: starttime, endtime, time -+ integer :: a(100), b(100), c(100), d(100) -+ starttime = omp_get_wtime() -+ do n = 1, 100000 -+ call f(a, b, c, d) -+ end do -+ endtime = omp_get_wtime() -+ time = endtime - starttime -+ print *, time -+end program main -+ -+! Reference -+! H. Ma, R. Zhao, X. Gao and Y. Zhang, "Barrier Optimization for -+! OpenMP Program," 2009 10th ACIS International Conference on Software -+! Engineering, Artificial Intelligences, Networking and -+! Parallel/Distributed Computing, 2009, pp. 495-500, doi: -+! 10.1109/SNPD.2009.16. -\ No newline at end of file -diff --git a/test/openmp_optimization/fortran_main005.f90 b/test/openmp_optimization/fortran_main005.f90 -new file mode 100644 -index 0000000..af058f6 ---- /dev/null -+++ b/test/openmp_optimization/fortran_main005.f90 -@@ -0,0 +1,22 @@ -+! Test optimizaton for fortran use openmp about remove the redundant -+! barrier -+! -+program main -+ use omp_lib -+ real(kind = 8) :: starttime, endtime, time -+ integer :: a(100), b(100) -+ starttime = omp_get_wtime() -+ do n = 1, 100000 -+ call f(a, b) -+ end do -+ endtime = omp_get_wtime() -+ time = endtime - starttime -+ print *, time -+end program main -+ -+! Reference -+! H. Ma, R. Zhao, X. Gao and Y. Zhang, "Barrier Optimization for -+! OpenMP Program," 2009 10th ACIS International Conference on Software -+! Engineering, Artificial Intelligences, Networking and -+! Parallel/Distributed Computing, 2009, pp. 495-500, doi: -+! 10.1109/SNPD.2009.16. -\ No newline at end of file -diff --git a/test/openmp_optimization/fortran_main006.f90 b/test/openmp_optimization/fortran_main006.f90 -new file mode 100644 -index 0000000..653a0c9 ---- /dev/null -+++ b/test/openmp_optimization/fortran_main006.f90 -@@ -0,0 +1,26 @@ -+! Test optimizaton for fortran use openmp about implement of DOACROSS -+! parallelism -+! -+program main -+ use omp_lib -+ real(kind = 8) :: starttime, endtime, time -+ integer :: a(100, 100) -+ starttime = omp_get_wtime() -+ do n = 1, 50000 -+ do i = 2, 100 -+ do j = 2, 100 -+ a(i, j) = a(i - 1, j) + a(i, j-1) -+ end do -+ end do -+ end do -+ endtime = omp_get_wtime() -+ time = endtime - starttime -+ print *, time -+end program main -+ -+! Reference -+! H. Ma, R. Zhao, X. Gao and Y. Zhang, "Barrier Optimization for -+! OpenMP Program," 2009 10th ACIS International Conference on Software -+! Engineering, Artificial Intelligences, Networking and -+! Parallel/Distributed Computing, 2009, pp. 495-500, doi: -+! 10.1109/SNPD.2009.16. -\ No newline at end of file -diff --git a/test/openmp_optimization/fortran_main007.f90 b/test/openmp_optimization/fortran_main007.f90 -new file mode 100644 -index 0000000..fdcf30d ---- /dev/null -+++ b/test/openmp_optimization/fortran_main007.f90 -@@ -0,0 +1,18 @@ -+! Test optimizaton for fortran use openmp about orphaned directives -+! -+program main -+ use omp_lib -+ real(kind = 8) :: starttime, endtime, time -+ real :: a(1000) -+ starttime = omp_get_wtime() -+ do n = 1, 500000 -+ call add1(a) -+ end do -+ endtime = omp_get_wtime() -+ time = endtime - starttime -+ print *, time -+end program main -+ -+! Reference -+! Müller, Matthias S.. "Some Simple OpenMP Optimization Techniques." -+! WOMPAT (2001). -\ No newline at end of file -diff --git a/test/openmp_optimization/fortran_main008.f90 b/test/openmp_optimization/fortran_main008.f90 -new file mode 100644 -index 0000000..5502775 ---- /dev/null -+++ b/test/openmp_optimization/fortran_main008.f90 -@@ -0,0 +1,20 @@ -+! Test optimizaton for fortran use openmp about alternative code. The -+! goal is to have the performance of the serial code if it is faster -+! than the parallel -+! -+program main -+ use omp_lib -+ real(kind = 8) :: starttime, endtime, time -+ real :: a(100000) -+ starttime = omp_get_wtime() -+ do i = 1, 10 -+ call add1(a, 8000) -+ end do -+ endtime = omp_get_wtime() -+ time = endtime - starttime -+ print *, time -+end program main -+ -+! Reference -+! Müller, Matthias S.. "Some Simple OpenMP Optimization Techniques." -+! WOMPAT (2001). -\ No newline at end of file -diff --git a/test/openmp_optimization/fortran_main009.f90 b/test/openmp_optimization/fortran_main009.f90 -new file mode 100644 -index 0000000..985e748 ---- /dev/null -+++ b/test/openmp_optimization/fortran_main009.f90 -@@ -0,0 +1,22 @@ -+! Test optimizaton for fortran use openmp about parallel region expand -+! -+program main -+ use omp_lib -+ real(kind = 8) :: starttime, endtime, time -+ integer :: a(100) -+ integer :: n = 0 -+ starttime = omp_get_wtime() -+ do while (n <= 100000) -+ call f(a, n) -+ end do -+ endtime = omp_get_wtime() -+ time = endtime - starttime -+ print *, time -+end program main -+ -+! Reference -+! Doerfert, J., Finkel, H. (2018). Compiler Optimizations for OpenMP. -+! In: de Supinski, B., Valero-Lara, P., Martorell, X., Mateo Bellido S. -+! , Labarta, J. (eds) Evolving OpenMP for Evolving Architectures. -+! IWOMP 2018. Lecture Notes in Computer Science(), vol 11128. Springer, -+! Cham. https://doi.org/10.1007/978-3-319-98521-3_8 -\ No newline at end of file -diff --git a/test/openmp_optimization/fortran_main010.f90 b/test/openmp_optimization/fortran_main010.f90 -new file mode 100644 -index 0000000..7bcc705 ---- /dev/null -+++ b/test/openmp_optimization/fortran_main010.f90 -@@ -0,0 +1,23 @@ -+! Test optimizaton for fortran use openmp about partial parallel -+! -+program main -+ use omp_lib -+ real(kind = 8) :: starttime, endtime, time -+ integer :: a(10000000), b(10000000), c(10000000), d(10000000) -+ do i = 1, 10000000 -+ a(i) = i -+ b(i) = i -+ c(i) = i -+ d(i) = i -+ end do -+ starttime = omp_get_wtime() -+ do i = 1, 100 -+ call f(a, b, c, d) -+ end do -+ endtime = omp_get_wtime() -+ time = endtime - starttime -+ print *, time -+end program main -+ -+! Reference -+! https://www.intel.com/content/www/us/en/developer/articles/tool/oneapi-standalone-components.html#dpcpp-cpp -\ No newline at end of file -diff --git a/test/openmp_optimization/fortran_main011.f90 b/test/openmp_optimization/fortran_main011.f90 -new file mode 100644 -index 0000000..b2cfa65 ---- /dev/null -+++ b/test/openmp_optimization/fortran_main011.f90 -@@ -0,0 +1,21 @@ -+! Test optimizaton for fortran use openmp about avoid false sharing -+! -+program main -+ use omp_lib -+ real(kind = 8) :: starttime, endtime, time -+ integer :: a(10000) -+ integer :: temp -+ do i = 1, 10000 -+ a(i) = i -+ end do -+ starttime = omp_get_wtime() -+ do n = 1, 50000 -+ call f(a) -+ end do -+ endtime = omp_get_wtime() -+ time = endtime - starttime -+ print *, time -+end program main -+ -+! Reference -+! http://akira.ruc.dk/~keld/teaching/IPDC_f10/Slides/pdf4x/4_Performance.4x.pdf -\ No newline at end of file -diff --git a/test/openmp_optimization/fortran_main012.f90 b/test/openmp_optimization/fortran_main012.f90 -new file mode 100644 -index 0000000..0d4841a ---- /dev/null -+++ b/test/openmp_optimization/fortran_main012.f90 -@@ -0,0 +1,18 @@ -+! Test optimizaton for fortran use openmp about variable attributes -+! -+program main -+ use omp_lib -+ real(kind = 8) :: starttime, endtime, time -+ integer :: a(1000), b(1000) -+ integer :: temp -+ starttime = omp_get_wtime() -+ do n = 1, 5000 -+ call f(a, b) -+ end do -+ endtime = omp_get_wtime() -+ time = endtime - starttime -+ print *, time -+end program main -+ -+! Reference -+! 游佐勇. OpenMP并行编程模型与性能优化方法的研究及应用[D].成都理工大学,2011. -\ No newline at end of file -diff --git a/test/openmp_optimization/fortran_main013.f90 b/test/openmp_optimization/fortran_main013.f90 -new file mode 100644 -index 0000000..22ec5dd ---- /dev/null -+++ b/test/openmp_optimization/fortran_main013.f90 -@@ -0,0 +1,18 @@ -+! Test optimizaton for fortran use openmp about parallel region -+! reconstruction -+! -+program main -+ use omp_lib -+ real(kind = 8) :: starttime, endtime, time -+ real :: a(10000) -+ starttime = omp_get_wtime() -+ do n = 1, 50000 -+ call add1(a) -+ end do -+ endtime = omp_get_wtime() -+ time = endtime - starttime -+ print *, time -+end program main -+ -+! Reference -+! 刘京,郑启龙,李彭勇,郭连伟.面向Open64的OpenMP程序优化[J].计算机系统应用,2016,25(01):154-159. -\ No newline at end of file -diff --git a/test/openmp_optimization/fortran_main014.f90 b/test/openmp_optimization/fortran_main014.f90 -new file mode 100644 -index 0000000..06bcea5 ---- /dev/null -+++ b/test/openmp_optimization/fortran_main014.f90 -@@ -0,0 +1,20 @@ -+! Test optimizaton for fortran use openmp about parallel removing -+! parallel region with no side-effects -+! -+subroutine foo() -+ integer :: x = 1 -+end subroutine foo -+program main -+ use omp_lib -+ real(kind = 8) :: starttime, endtime, time -+ starttime = omp_get_wtime() -+ do n = 1, 100000 -+ call f() -+ end do -+ endtime = omp_get_wtime() -+ time = endtime - starttime -+print *, time -+end program main -+ -+! Reference -+! https://openmp.llvm.org/remarks/OptimizationRemarks.html -\ No newline at end of file -diff --git a/test/openmp_optimization/fortran_main015.f90 b/test/openmp_optimization/fortran_main015.f90 -new file mode 100644 -index 0000000..f1c593c ---- /dev/null -+++ b/test/openmp_optimization/fortran_main015.f90 -@@ -0,0 +1,25 @@ -+! Test optimizaton for fortran use openmp about remove dependencies -+! -+program main -+ use omp_lib -+ real(kind = 8) :: starttime, endtime, time -+ integer :: a(1000000) -+ integer :: b(1000000) -+ integer :: c(1000000) -+ integer :: x -+ do i = 1, 1000000 -+ a(i) = i -+ b(i) = i + 1 -+ c(i) = i + 2 -+ end do -+ starttime = omp_get_wtime() -+ do w = 1, 100 -+ call f(a, b, c) -+ end do -+ endtime = omp_get_wtime() -+ time = endtime - starttime -+ print *, time -+end program main -+ -+! Reference -+! http://akira.ruc.dk/~keld/teaching/IPDC_f10/Slides/pdf4x/4_Performance.4x.pdf -\ No newline at end of file -diff --git a/test/openmp_optimization/fortran_main016.f90 b/test/openmp_optimization/fortran_main016.f90 -new file mode 100644 -index 0000000..e33bfcb ---- /dev/null -+++ b/test/openmp_optimization/fortran_main016.f90 -@@ -0,0 +1,24 @@ -+! Test optimizaton for fortran use openmp about remove dependencies -+! -+program main -+ use omp_lib -+ real(kind = 8) :: starttime, endtime, time -+ integer :: a(1000000) -+ integer :: b(1000000) -+ integer :: c(1000000) -+ do i = 1, 1000000 -+ a(i) = i -+ b(i) = i + 1 -+ c(i) = i + 2 -+ end do -+ starttime = omp_get_wtime() -+ do w = 1, 1000 -+ call f(a, b, c) -+ end do -+ endtime = omp_get_wtime() -+ time = endtime - starttime -+ print *, time -+end program main -+ -+! Reference -+! http://akira.ruc.dk/~keld/teaching/IPDC_f10/Slides/pdf4x/4_Performance.4x.pdf -\ No newline at end of file -diff --git a/test/openmp_optimization/fortran_main017.f90 b/test/openmp_optimization/fortran_main017.f90 -new file mode 100644 -index 0000000..6cd5232 ---- /dev/null -+++ b/test/openmp_optimization/fortran_main017.f90 -@@ -0,0 +1,35 @@ -+! Test optimizaton for fortran use openmp about communication -+! -+program main -+ use omp_lib -+ interface -+ subroutine f(x, y) -+ integer, pointer :: x(:) -+ integer, pointer :: y -+ end subroutine -+ end interface -+ real(kind = 8) :: starttime, endtime, time -+ integer, target :: a(512) -+ integer, target :: b = 1 -+ integer, pointer :: ap(:) -+ integer, pointer :: bp -+ do i = 1, 512 -+ a(i) = i -+ end do -+ ap => a -+ bp => b -+ starttime = omp_get_wtime() -+ do i = 1, 1000 -+ call f(ap, bp) -+ end do -+ endtime = omp_get_wtime() -+ time = endtime - starttime -+ print *, time -+end program main -+ -+! Reference -+! Doerfert, J., Finkel, H. (2018). Compiler Optimizations for OpenMP. -+! In: de Supinski, B., Valero-Lara, P., Martorell, X., Mateo Bellido S. -+! , Labarta, J. (eds) Evolving OpenMP for Evolving Architectures. -+! IWOMP 2018. Lecture Notes in Computer Science(), vol 11128. Springer, -+! Cham. https://doi.org/10.1007/978-3-319-98521-3_8 -\ No newline at end of file -diff --git a/test/openmp_optimization/fortran_main018.f90 b/test/openmp_optimization/fortran_main018.f90 -new file mode 100644 -index 0000000..97c8bb2 ---- /dev/null -+++ b/test/openmp_optimization/fortran_main018.f90 -@@ -0,0 +1,21 @@ -+! Test optimizaton for fortran use openmp about use cancel construction -+! -+program main -+ use omp_lib -+ real(kind = 8) :: starttime, endtime, time -+ integer :: a(100000) -+ integer :: t = 50000 -+ do i = 1, 100000 -+ a(i) = i -+ end do -+ starttime = omp_get_wtime() -+ do i = 1, 100000 -+ call f(a, t) -+ end do -+ endtime = omp_get_wtime() -+ time = endtime - starttime -+ print *, time -+end -+ -+! Reference -+! https://www.cines.fr/wp-content/uploads/2014/10/lesson3_slides.pdf -\ No newline at end of file -diff --git a/test/openmp_optimization/fortran_main019.f90 b/test/openmp_optimization/fortran_main019.f90 -new file mode 100644 -index 0000000..ec85db7 ---- /dev/null -+++ b/test/openmp_optimization/fortran_main019.f90 -@@ -0,0 +1,21 @@ -+! Test optimizaton for fortran use openmp about Reduce threads -+! synchronisations about critical -+! -+program main -+ use omp_lib -+ real(kind = 8) :: starttime, endtime, time -+ integer :: a(10000), b(10000) -+ do i = 1, 10000 -+ a(i) = i -+ end do -+ starttime = omp_get_wtime() -+ do n = 1, 200 -+ call f(a, b) -+ end do -+ endtime = omp_get_wtime() -+ time = endtime - starttime -+ print *, time -+end program main -+ -+! Reference -+! https://www.cines.fr/wp-content/uploads/2014/10/lesson3_slides.pdf -\ No newline at end of file -diff --git a/test/openmp_optimization/fortran_main020.f90 b/test/openmp_optimization/fortran_main020.f90 -new file mode 100644 -index 0000000..7c5c7a9 ---- /dev/null -+++ b/test/openmp_optimization/fortran_main020.f90 -@@ -0,0 +1,24 @@ -+! Test optimizaton for fortran use openmp about Change the way -+! variables are passed -+! -+program main -+ use omp_lib -+ real(kind = 8) :: starttime, endtime, time -+ integer :: a(32), b(32) -+ starttime = omp_get_wtime() -+ do i = 1, 1000 -+ call f(a, b) -+ end do -+ endtime = omp_get_wtime() -+ time = endtime - starttime -+ print *, time -+end -+subroutine work(a, b) -+ integer :: a(32), b(32) -+ do i = 1, 32 -+ a(i) = a(i) + 1 -+ b(i) = b(i) + 1 -+ end do -+end -+! Reference -+! 孙志刚. 基于键涨落模型数值模拟的并行优化[D].山东大学,2013. -\ No newline at end of file -diff --git a/test/openmp_optimization/fortran_optimized_func001.f90 b/test/openmp_optimization/fortran_optimized_func001.f90 -new file mode 100644 -index 0000000..b2f0bc3 ---- /dev/null -+++ b/test/openmp_optimization/fortran_optimized_func001.f90 -@@ -0,0 +1,9 @@ -+subroutine f(a, b) -+ integer :: a(100), b(100) -+ !$omp parallel do -+ do i = 1, 100 -+ a(i) = i -+ b(i) = i -+ end do -+ !$omp end parallel do -+end -\ No newline at end of file -diff --git a/test/openmp_optimization/fortran_optimized_func002.f90 b/test/openmp_optimization/fortran_optimized_func002.f90 -new file mode 100644 -index 0000000..55a8af2 ---- /dev/null -+++ b/test/openmp_optimization/fortran_optimized_func002.f90 -@@ -0,0 +1,10 @@ -+subroutine f(a) -+ integer :: a(100) -+ !$omp parallel -+ !$omp do -+ do i = 1, 100 -+ a(i) = i -+ end do -+ !$omp end do nowait -+ !$omp end parallel -+end -\ No newline at end of file -diff --git a/test/openmp_optimization/fortran_optimized_func004.f90 b/test/openmp_optimization/fortran_optimized_func004.f90 -new file mode 100644 -index 0000000..d98e388 ---- /dev/null -+++ b/test/openmp_optimization/fortran_optimized_func004.f90 -@@ -0,0 +1,15 @@ -+subroutine f(a, b, c, d) -+ integer :: a(100), b(100), c(100), d(100) -+ !$omp parallel -+ !$omp do -+ do i = 1, 100 -+ a(i) = d(i) -+ end do -+ !$omp end do nowait -+ !$omp do -+ do i = 1, 100 -+ b(i) = c(i) -+ end do -+ !$omp end do nowait -+ !$omp end parallel -+end -\ No newline at end of file -diff --git a/test/openmp_optimization/fortran_optimized_func005.f90 b/test/openmp_optimization/fortran_optimized_func005.f90 -new file mode 100644 -index 0000000..69e4b7b ---- /dev/null -+++ b/test/openmp_optimization/fortran_optimized_func005.f90 -@@ -0,0 +1,15 @@ -+subroutine f(a, b) -+ integer :: a(100), b(100) -+ !$omp parallel -+ !$omp do -+ do i = 1, 99, 2 -+ a(i) = b(i) -+ end do -+ !$omp end do nowait -+ !$omp do -+ do i = 2, 100, 2 -+ a(i) = b(i) -+ end do -+ !$omp end do nowait -+ !$omp end parallel -+end -\ No newline at end of file -diff --git a/test/openmp_optimization/fortran_optimized_func007.f90 b/test/openmp_optimization/fortran_optimized_func007.f90 -new file mode 100644 -index 0000000..0d6eac3 ---- /dev/null -+++ b/test/openmp_optimization/fortran_optimized_func007.f90 -@@ -0,0 +1,15 @@ -+subroutine add1(s) -+ use omp_lib -+ real :: s(1000) -+ if(omp_in_parallel()) then -+ !$omp do -+ do i = 1, 1000 -+ s(i) = i -+ end do -+ !$omp end do -+ else -+ do i = 1, 1000 -+ s(i) = i -+ end do -+ end if -+end subroutine add1 -\ No newline at end of file -diff --git a/test/openmp_optimization/fortran_optimized_func008.f90 b/test/openmp_optimization/fortran_optimized_func008.f90 -new file mode 100644 -index 0000000..e11d2d6 ---- /dev/null -+++ b/test/openmp_optimization/fortran_optimized_func008.f90 -@@ -0,0 +1,16 @@ -+subroutine add1(s, n) -+ use omp_lib -+ real :: s(100000) -+ integer :: n -+ if(n > 10000) then -+ !$omp parallel do -+ do i = 1, n -+ s(i) = i -+ end do -+ !$omp end parallel do -+ else -+ do i = 1, n -+ s(i) = i -+ end do -+ end if -+end subroutine add1 -\ No newline at end of file -diff --git a/test/openmp_optimization/fortran_optimized_func009.f90 b/test/openmp_optimization/fortran_optimized_func009.f90 -new file mode 100644 -index 0000000..6850535 ---- /dev/null -+++ b/test/openmp_optimization/fortran_optimized_func009.f90 -@@ -0,0 +1,18 @@ -+subroutine f(a, n) -+ integer :: a(100) -+ integer :: n -+ !$omp do -+ do i = 1, 100 -+ a(i) = i + 1 -+ end do -+ !$omp end do -+ !$omp do -+ do i = 1, 100 -+ a(i) = i + a(i) -+ end do -+ !$omp end do -+ !$omp master -+ n = n + 1 -+ !$omp end master -+ !$omp barrier -+end -\ No newline at end of file -diff --git a/test/openmp_optimization/fortran_optimized_func010.f90 b/test/openmp_optimization/fortran_optimized_func010.f90 -new file mode 100644 -index 0000000..d9061f0 ---- /dev/null -+++ b/test/openmp_optimization/fortran_optimized_func010.f90 -@@ -0,0 +1,11 @@ -+subroutine f(a, b, c, d, e) -+ integer :: a(10000000), b(10000000), c(10000000), d(10000000), e(10000000) -+ !$omp parallel do -+ do i = 2, 10000000 -+ d(i) = b(i) * c(i) / e(i) * b(i) -+ end do -+ !$omp end parallel do -+ do i = 2, 10000000 -+ a(i) = a(i - 1) + d(i) -+ end do -+end -\ No newline at end of file -diff --git a/test/openmp_optimization/fortran_optimized_func011.f90 b/test/openmp_optimization/fortran_optimized_func011.f90 -new file mode 100644 -index 0000000..5ad2b2e ---- /dev/null -+++ b/test/openmp_optimization/fortran_optimized_func011.f90 -@@ -0,0 +1,8 @@ -+subroutine f(a) -+ integer :: a(10000) -+ !$omp parallel do schedule (static, 1) -+ do i = 1, 10000 -+ a(i) = a(i * 16) + 1 -+ end do -+ !$omp end parallel do -+end -\ No newline at end of file -diff --git a/test/openmp_optimization/fortran_optimized_func012.f90 b/test/openmp_optimization/fortran_optimized_func012.f90 -new file mode 100644 -index 0000000..abcb3c5 ---- /dev/null -+++ b/test/openmp_optimization/fortran_optimized_func012.f90 -@@ -0,0 +1,15 @@ -+subroutine f(a, b) -+ integer :: a(1000), b(1000) -+ !$omp parallel private(a) -+ !$omp do -+ do i = 1, 1000 -+ temp = a(i) -+ end do -+ !$omp end do -+ !$omp do -+ do i = 1, 1000 -+ temp = b(i) -+ end do -+ !$omp end do -+!$omp end parallel -+end -\ No newline at end of file -diff --git a/test/openmp_optimization/fortran_optimized_func013.f90 b/test/openmp_optimization/fortran_optimized_func013.f90 -new file mode 100644 -index 0000000..088475c ---- /dev/null -+++ b/test/openmp_optimization/fortran_optimized_func013.f90 -@@ -0,0 +1,9 @@ -+subroutine add1(s) -+ use omp_lib -+ real :: s(10000) -+ !$omp do -+ do i = 1, 10000 -+ s(i) = i + 1 -+ end do -+ !$omp end do -+end subroutine add1 -\ No newline at end of file -diff --git a/test/openmp_optimization/fortran_optimized_func014.f90 b/test/openmp_optimization/fortran_optimized_func014.f90 -new file mode 100644 -index 0000000..48248cb ---- /dev/null -+++ b/test/openmp_optimization/fortran_optimized_func014.f90 -@@ -0,0 +1,2 @@ -+subroutine f() -+end -\ No newline at end of file -diff --git a/test/openmp_optimization/fortran_optimized_func015.f90 b/test/openmp_optimization/fortran_optimized_func015.f90 -new file mode 100644 -index 0000000..10da81b ---- /dev/null -+++ b/test/openmp_optimization/fortran_optimized_func015.f90 -@@ -0,0 +1,14 @@ -+subroutine f(a, b, c, a_copy) -+ integer :: a(1000000), b(1000000), c(1000000), a_copy(1000000) -+ !$omp parallel do shared(a_copy) -+ do i = 1, 1000000 -+ a_copy(i) = a(i + 1) -+ end do -+ !$omp end parallel do -+ !$omp parallel do shared(a) -+ do i = 1, 1000000 -+ x = (b(i) + c(i)) / 2 -+ a(i) = a_copy(i) + x -+ end do -+ !$omp end parallel do -+end -\ No newline at end of file -diff --git a/test/openmp_optimization/fortran_optimized_func016.f90 b/test/openmp_optimization/fortran_optimized_func016.f90 -new file mode 100644 -index 0000000..3defc51 ---- /dev/null -+++ b/test/openmp_optimization/fortran_optimized_func016.f90 -@@ -0,0 +1,11 @@ -+subroutine f(a, b, c) -+ integer :: a(1000000), b(1000000), c(1000000) -+ b(1) = b(1) - a(0) -+ !$omp parallel do shared(a, b, c) -+ do i = 2, 1000000 -+ b(i) = b(i) + a(i - 1) -+ a(i) = a(i) + c(i) -+ end do -+ !$omp end parallel do -+ a(1000000 - 1) = a(1000000 - 1) + c(1000000 - 1) -+end -\ No newline at end of file -diff --git a/test/openmp_optimization/fortran_optimized_func017.f90 b/test/openmp_optimization/fortran_optimized_func017.f90 -new file mode 100644 -index 0000000..ccc88eb ---- /dev/null -+++ b/test/openmp_optimization/fortran_optimized_func017.f90 -@@ -0,0 +1,17 @@ -+subroutine f(x, y) -+ integer, pointer :: x(:) -+ integer, pointer :: y -+ integer :: l -+ integer :: k -+ integer :: m -+ integer :: a -+ l = x(1) -+ k = y -+ m = 512 * k -+ a = 512 + l -+ !$omp parallel do firstprivate(x, m, l, a) -+ do i = 1, 512 -+ x(i) = m + a * l * i -+ end do -+ !$omp end parallel do -+end -\ No newline at end of file -diff --git a/test/openmp_optimization/fortran_optimized_func018.f90 b/test/openmp_optimization/fortran_optimized_func018.f90 -new file mode 100644 -index 0000000..d7dd87a ---- /dev/null -+++ b/test/openmp_optimization/fortran_optimized_func018.f90 -@@ -0,0 +1,14 @@ -+subroutine f(a, t) -+ integer :: a(100000), t -+ logical :: b = .FALSE. -+ !$omp parallel shared(a, b) -+ !$omp do -+ do i = 1, 100000 -+ if (a(i) == t) then -+ b = .TRUE. -+ !$omp cancel do -+ end if -+ end do -+ !$omp end do -+ !$omp end parallel -+end -\ No newline at end of file -diff --git a/test/openmp_optimization/fortran_optimized_func019.f90 b/test/openmp_optimization/fortran_optimized_func019.f90 -new file mode 100644 -index 0000000..a7d30da ---- /dev/null -+++ b/test/openmp_optimization/fortran_optimized_func019.f90 -@@ -0,0 +1,16 @@ -+subroutine f(a, b) -+ integer :: a(10000), b(10000) -+ integer :: max = -1 -+ !$omp parallel do shared(a, b, max) -+ do i =1, 10000 -+ b(i) = 0.5 * a(i) -+ if(b(i) > max) then -+ !$omp critical -+ if (b(i) > max) then -+ max = b(i) -+ end if -+ !$omp end critical -+ end if -+ end do -+ !$omp end parallel do -+end -\ No newline at end of file -diff --git a/test/openmp_optimization/fortran_optimized_func020.f90 b/test/openmp_optimization/fortran_optimized_func020.f90 -new file mode 100644 -index 0000000..b5101cd ---- /dev/null -+++ b/test/openmp_optimization/fortran_optimized_func020.f90 -@@ -0,0 +1,15 @@ -+subroutine f(a, b) -+ use omp_lib -+ integer :: a(32), b(32), tid, ia(32), ib(32) -+ !$omp parallel private(tid, ia, ib) shared(a, b) -+ tid = omp_get_thread_num() -+ ia = a -+ ib = b -+ do i = 1, 100 -+ call work(ia, ib) -+ end do -+ a = ia -+ b = ib -+ !$omp end parallel -+end -+ -diff --git a/test/openmp_optimization/optimized_main001.f90 b/test/openmp_optimization/optimized_main001.f90 -new file mode 100644 -index 0000000..4a7f4dc ---- /dev/null -+++ b/test/openmp_optimization/optimized_main001.f90 -@@ -0,0 +1,19 @@ -+! Test optimizaton for fortran use openmp about parallel region merge -+! -+program main -+ use omp_lib -+ real(kind = 8) :: starttime, endtime, time -+ integer :: a(100) -+ integer :: b(100) -+ starttime = omp_get_wtime() -+ do n = 1, 100000 -+ call f(a, b) -+ end do -+ endtime = omp_get_wtime() -+ time = endtime - starttime -+ print *, time -+end program main -+ -+! Reference -+! Müller, Matthias S.. "Some Simple OpenMP Optimization Techniques." -+! WOMPAT (2001). -\ No newline at end of file -diff --git a/test/openmp_optimization/optimized_main002.f90 b/test/openmp_optimization/optimized_main002.f90 -new file mode 100644 -index 0000000..ec4c7fd ---- /dev/null -+++ b/test/openmp_optimization/optimized_main002.f90 -@@ -0,0 +1,19 @@ -+! Test optimizaton for fortran use openmp about implicit nowait at end -+! of parallel region -+! -+program main -+ use omp_lib -+ real(kind = 8) :: starttime, endtime, time -+ integer :: a(100) -+ starttime = omp_get_wtime() -+ do n = 1, 100000 -+ call f(a) -+ end do -+ endtime = omp_get_wtime() -+ time = endtime - starttime -+ print *, time -+end program main -+ -+! Reference -+! Müller, Matthias S.. "Some Simple OpenMP Optimization Techniques." -+! WOMPAT (2001). -diff --git a/test/openmp_optimization/optimized_main004.f90 b/test/openmp_optimization/optimized_main004.f90 -new file mode 100644 -index 0000000..679c7e3 ---- /dev/null -+++ b/test/openmp_optimization/optimized_main004.f90 -@@ -0,0 +1,22 @@ -+! Test optimizaton for fortran use openmp about remove the redundant -+! barrier -+! -+program main -+ use omp_lib -+ real(kind = 8) :: starttime, endtime, time -+ integer :: a(100), b(100), c(100), d(100) -+ starttime = omp_get_wtime() -+ do n = 1, 100000 -+ call f(a, b, c, d) -+ end do -+ endtime = omp_get_wtime() -+ time = endtime - starttime -+ print *, time -+end program main -+ -+! Reference -+! H. Ma, R. Zhao, X. Gao and Y. Zhang, "Barrier Optimization for -+! OpenMP Program," 2009 10th ACIS International Conference on Software -+! Engineering, Artificial Intelligences, Networking and -+! Parallel/Distributed Computing, 2009, pp. 495-500, doi: -+! 10.1109/SNPD.2009.16. -\ No newline at end of file -diff --git a/test/openmp_optimization/optimized_main005.f90 b/test/openmp_optimization/optimized_main005.f90 -new file mode 100644 -index 0000000..af058f6 ---- /dev/null -+++ b/test/openmp_optimization/optimized_main005.f90 -@@ -0,0 +1,22 @@ -+! Test optimizaton for fortran use openmp about remove the redundant -+! barrier -+! -+program main -+ use omp_lib -+ real(kind = 8) :: starttime, endtime, time -+ integer :: a(100), b(100) -+ starttime = omp_get_wtime() -+ do n = 1, 100000 -+ call f(a, b) -+ end do -+ endtime = omp_get_wtime() -+ time = endtime - starttime -+ print *, time -+end program main -+ -+! Reference -+! H. Ma, R. Zhao, X. Gao and Y. Zhang, "Barrier Optimization for -+! OpenMP Program," 2009 10th ACIS International Conference on Software -+! Engineering, Artificial Intelligences, Networking and -+! Parallel/Distributed Computing, 2009, pp. 495-500, doi: -+! 10.1109/SNPD.2009.16. -\ No newline at end of file -diff --git a/test/openmp_optimization/optimized_main007.f90 b/test/openmp_optimization/optimized_main007.f90 -new file mode 100644 -index 0000000..fdcf30d ---- /dev/null -+++ b/test/openmp_optimization/optimized_main007.f90 -@@ -0,0 +1,18 @@ -+! Test optimizaton for fortran use openmp about orphaned directives -+! -+program main -+ use omp_lib -+ real(kind = 8) :: starttime, endtime, time -+ real :: a(1000) -+ starttime = omp_get_wtime() -+ do n = 1, 500000 -+ call add1(a) -+ end do -+ endtime = omp_get_wtime() -+ time = endtime - starttime -+ print *, time -+end program main -+ -+! Reference -+! Müller, Matthias S.. "Some Simple OpenMP Optimization Techniques." -+! WOMPAT (2001). -\ No newline at end of file -diff --git a/test/openmp_optimization/optimized_main008.f90 b/test/openmp_optimization/optimized_main008.f90 -new file mode 100644 -index 0000000..5502775 ---- /dev/null -+++ b/test/openmp_optimization/optimized_main008.f90 -@@ -0,0 +1,20 @@ -+! Test optimizaton for fortran use openmp about alternative code. The -+! goal is to have the performance of the serial code if it is faster -+! than the parallel -+! -+program main -+ use omp_lib -+ real(kind = 8) :: starttime, endtime, time -+ real :: a(100000) -+ starttime = omp_get_wtime() -+ do i = 1, 10 -+ call add1(a, 8000) -+ end do -+ endtime = omp_get_wtime() -+ time = endtime - starttime -+ print *, time -+end program main -+ -+! Reference -+! Müller, Matthias S.. "Some Simple OpenMP Optimization Techniques." -+! WOMPAT (2001). -\ No newline at end of file -diff --git a/test/openmp_optimization/optimized_main009.f90 b/test/openmp_optimization/optimized_main009.f90 -new file mode 100644 -index 0000000..1b67d12 ---- /dev/null -+++ b/test/openmp_optimization/optimized_main009.f90 -@@ -0,0 +1,24 @@ -+! Test optimizaton for fortran use openmp about partial simd -+! -+program main -+ use omp_lib -+ real(kind = 8) :: starttime, endtime, time -+ integer :: a(100) -+ integer :: n = 0 -+ starttime = omp_get_wtime() -+ !$omp parallel shared(n, a) -+ do while (n <= 100000) -+ call f(a, n) -+ end do -+ !$omp end parallel -+ endtime = omp_get_wtime() -+ time = endtime - starttime -+ print *, time -+end program main -+ -+! Reference -+! Doerfert, J., Finkel, H. (2018). Compiler Optimizations for OpenMP. -+! In: de Supinski, B., Valero-Lara, P., Martorell, X., Mateo Bellido S. -+! , Labarta, J. (eds) Evolving OpenMP for Evolving Architectures. -+! IWOMP 2018. Lecture Notes in Computer Science(), vol 11128. Springer, -+! Cham. https://doi.org/10.1007/978-3-319-98521-3_8 -\ No newline at end of file -diff --git a/test/openmp_optimization/optimized_main010.f90 b/test/openmp_optimization/optimized_main010.f90 -new file mode 100644 -index 0000000..59d1578 ---- /dev/null -+++ b/test/openmp_optimization/optimized_main010.f90 -@@ -0,0 +1,23 @@ -+! Test optimizaton for fortran use openmp about partial parallel -+! -+program main -+ use omp_lib -+ real(kind = 8) :: starttime, endtime, time -+ integer :: a(10000000), b(10000000), c(10000000), d(10000000), e(10000000) -+ do i = 1, 10000000 -+ a(i) = i -+ b(i) = i -+ c(i) = i -+ e(i) = i -+ end do -+ starttime = omp_get_wtime() -+ do i = 1, 100 -+ call f(a, b, c, d, e) -+ end do -+ endtime = omp_get_wtime() -+ time = endtime - starttime -+print *, time -+end program main -+ -+! Reference -+! https://www.intel.com/content/www/us/en/developer/articles/tool/oneapi-standalone-components.html#dpcpp-cpp -\ No newline at end of file -diff --git a/test/openmp_optimization/optimized_main011.f90 b/test/openmp_optimization/optimized_main011.f90 -new file mode 100644 -index 0000000..c4b595b ---- /dev/null -+++ b/test/openmp_optimization/optimized_main011.f90 -@@ -0,0 +1,21 @@ -+! Test optimizaton for fortran use openmp about avoid false sharing -+! -+program main -+ use omp_lib -+ real(kind = 8) :: starttime, endtime, time -+ integer :: a(10000 * 16) -+ integer :: temp -+ do i = 1, 10000 -+ a(i * 16) = i -+ end do -+ starttime = omp_get_wtime() -+ do n = 1, 50000 -+ call f(a) -+ end do -+ endtime = omp_get_wtime() -+ time = endtime - starttime -+print *, time -+end program main -+ -+! Reference -+! http://akira.ruc.dk/~keld/teaching/IPDC_f10/Slides/pdf4x/4_Performance.4x.pdf -\ No newline at end of file -diff --git a/test/openmp_optimization/optimized_main012.f90 b/test/openmp_optimization/optimized_main012.f90 -new file mode 100644 -index 0000000..0d4841a ---- /dev/null -+++ b/test/openmp_optimization/optimized_main012.f90 -@@ -0,0 +1,18 @@ -+! Test optimizaton for fortran use openmp about variable attributes -+! -+program main -+ use omp_lib -+ real(kind = 8) :: starttime, endtime, time -+ integer :: a(1000), b(1000) -+ integer :: temp -+ starttime = omp_get_wtime() -+ do n = 1, 5000 -+ call f(a, b) -+ end do -+ endtime = omp_get_wtime() -+ time = endtime - starttime -+ print *, time -+end program main -+ -+! Reference -+! 游佐勇. OpenMP并行编程模型与性能优化方法的研究及应用[D].成都理工大学,2011. -\ No newline at end of file -diff --git a/test/openmp_optimization/optimized_main013.f90 b/test/openmp_optimization/optimized_main013.f90 -new file mode 100644 -index 0000000..2f972d2 ---- /dev/null -+++ b/test/openmp_optimization/optimized_main013.f90 -@@ -0,0 +1,20 @@ -+! Test optimizaton for fortran use openmp about parallel region -+! reconstruction -+! -+program main -+ use omp_lib -+ real(kind = 8) :: starttime, endtime, time -+ real :: a(10000) -+ starttime = omp_get_wtime() -+ do n = 1, 50000 -+ !$omp parallel -+ call add1(a) -+ !$omp end parallel -+ end do -+ endtime = omp_get_wtime() -+ time = endtime - starttime -+ print *, time -+end program main -+ -+! Reference -+! 刘京,郑启龙,李彭勇,郭连伟.面向Open64的OpenMP程序优化[J].计算机系统应用,2016,25(01):154-159. -\ No newline at end of file -diff --git a/test/openmp_optimization/optimized_main014.f90 b/test/openmp_optimization/optimized_main014.f90 -new file mode 100644 -index 0000000..06bcea5 ---- /dev/null -+++ b/test/openmp_optimization/optimized_main014.f90 -@@ -0,0 +1,20 @@ -+! Test optimizaton for fortran use openmp about parallel removing -+! parallel region with no side-effects -+! -+subroutine foo() -+ integer :: x = 1 -+end subroutine foo -+program main -+ use omp_lib -+ real(kind = 8) :: starttime, endtime, time -+ starttime = omp_get_wtime() -+ do n = 1, 100000 -+ call f() -+ end do -+ endtime = omp_get_wtime() -+ time = endtime - starttime -+print *, time -+end program main -+ -+! Reference -+! https://openmp.llvm.org/remarks/OptimizationRemarks.html -\ No newline at end of file -diff --git a/test/openmp_optimization/optimized_main015.f90 b/test/openmp_optimization/optimized_main015.f90 -new file mode 100644 -index 0000000..d5c335a ---- /dev/null -+++ b/test/openmp_optimization/optimized_main015.f90 -@@ -0,0 +1,25 @@ -+! Test optimizaton for fortran use openmp about remove dependencies -+! -+program main -+ use omp_lib -+ real(kind = 8) :: starttime, endtime, time -+ integer :: a(1000000), a_copy(1000000) -+ integer :: b(1000000) -+ integer :: c(1000000) -+ integer :: x -+ do i = 1, 1000000 -+ a(i) = i -+ b(i) = i + 1 -+ c(i) = i + 2 -+ end do -+ starttime = omp_get_wtime() -+ do w = 1, 100 -+ call f(a, b, c, a_copy) -+ end do -+ endtime = omp_get_wtime() -+ time = endtime - starttime -+print *, time -+end program main -+ -+! Reference -+! http://akira.ruc.dk/~keld/teaching/IPDC_f10/Slides/pdf4x/4_Performance.4x.pdf -\ No newline at end of file -diff --git a/test/openmp_optimization/optimized_main016.f90 b/test/openmp_optimization/optimized_main016.f90 -new file mode 100644 -index 0000000..e7be707 ---- /dev/null -+++ b/test/openmp_optimization/optimized_main016.f90 -@@ -0,0 +1,24 @@ -+! Test optimizaton for fortran use openmp about remove dependencies -+! -+program main -+ use omp_lib -+ real(kind = 8) :: starttime, endtime, time -+ integer :: a(1000000) -+ integer :: b(1000000) -+ integer :: c(1000000) -+ do i = 1, 1000000 -+ a(i) = i -+ b(i) = i + 1 -+ c(i) = i + 2 -+ end do -+ starttime = omp_get_wtime() -+ do w = 1, 1000 -+ call f(a, b, c) -+ end do -+ endtime = omp_get_wtime() -+ time = endtime - starttime -+print *, time -+end program main -+ -+! Reference -+! http://akira.ruc.dk/~keld/teaching/IPDC_f10/Slides/pdf4x/4_Performance.4x.pdf -\ No newline at end of file -diff --git a/test/openmp_optimization/optimized_main017.f90 b/test/openmp_optimization/optimized_main017.f90 -new file mode 100644 -index 0000000..344e9c1 ---- /dev/null -+++ b/test/openmp_optimization/optimized_main017.f90 -@@ -0,0 +1,35 @@ -+! Test optimizaton for fortran use openmp about communication -+! -+program main -+ use omp_lib -+ interface -+ subroutine f(x, y) -+ integer, pointer :: x(:) -+ integer, pointer :: y -+ end subroutine -+ end interface -+ real(kind = 8) :: starttime, endtime, time -+ integer, target :: a(512) -+ integer, target :: b = 1 -+ integer, pointer :: ap(:) -+ integer, pointer :: bp -+ do i = 1, 512 -+ a(i) = i -+ end do -+ ap => a -+ bp => b -+ starttime = omp_get_wtime() -+ do i = 1, 1000 -+ call f(ap, bp) -+ end do -+ endtime = omp_get_wtime() -+ time = endtime - starttime -+print *, time -+end program main -+ -+! Reference -+! Doerfert, J., Finkel, H. (2018). Compiler Optimizations for OpenMP. -+! In: de Supinski, B., Valero-Lara, P., Martorell, X., Mateo Bellido S. -+! , Labarta, J. (eds) Evolving OpenMP for Evolving Architectures. -+! IWOMP 2018. Lecture Notes in Computer Science(), vol 11128. Springer, -+! Cham. https://doi.org/10.1007/978-3-319-98521-3_8 -\ No newline at end of file -diff --git a/test/openmp_optimization/optimized_main018.f90 b/test/openmp_optimization/optimized_main018.f90 -new file mode 100644 -index 0000000..97c8bb2 ---- /dev/null -+++ b/test/openmp_optimization/optimized_main018.f90 -@@ -0,0 +1,21 @@ -+! Test optimizaton for fortran use openmp about use cancel construction -+! -+program main -+ use omp_lib -+ real(kind = 8) :: starttime, endtime, time -+ integer :: a(100000) -+ integer :: t = 50000 -+ do i = 1, 100000 -+ a(i) = i -+ end do -+ starttime = omp_get_wtime() -+ do i = 1, 100000 -+ call f(a, t) -+ end do -+ endtime = omp_get_wtime() -+ time = endtime - starttime -+ print *, time -+end -+ -+! Reference -+! https://www.cines.fr/wp-content/uploads/2014/10/lesson3_slides.pdf -\ No newline at end of file -diff --git a/test/openmp_optimization/optimized_main019.f90 b/test/openmp_optimization/optimized_main019.f90 -new file mode 100644 -index 0000000..ec85db7 ---- /dev/null -+++ b/test/openmp_optimization/optimized_main019.f90 -@@ -0,0 +1,21 @@ -+! Test optimizaton for fortran use openmp about Reduce threads -+! synchronisations about critical -+! -+program main -+ use omp_lib -+ real(kind = 8) :: starttime, endtime, time -+ integer :: a(10000), b(10000) -+ do i = 1, 10000 -+ a(i) = i -+ end do -+ starttime = omp_get_wtime() -+ do n = 1, 200 -+ call f(a, b) -+ end do -+ endtime = omp_get_wtime() -+ time = endtime - starttime -+ print *, time -+end program main -+ -+! Reference -+! https://www.cines.fr/wp-content/uploads/2014/10/lesson3_slides.pdf -\ No newline at end of file -diff --git a/test/openmp_optimization/optimized_main020.f90 b/test/openmp_optimization/optimized_main020.f90 -new file mode 100644 -index 0000000..7c5c7a9 ---- /dev/null -+++ b/test/openmp_optimization/optimized_main020.f90 -@@ -0,0 +1,24 @@ -+! Test optimizaton for fortran use openmp about Change the way -+! variables are passed -+! -+program main -+ use omp_lib -+ real(kind = 8) :: starttime, endtime, time -+ integer :: a(32), b(32) -+ starttime = omp_get_wtime() -+ do i = 1, 1000 -+ call f(a, b) -+ end do -+ endtime = omp_get_wtime() -+ time = endtime - starttime -+ print *, time -+end -+subroutine work(a, b) -+ integer :: a(32), b(32) -+ do i = 1, 32 -+ a(i) = a(i) + 1 -+ b(i) = b(i) + 1 -+ end do -+end -+! Reference -+! 孙志刚. 基于键涨落模型数值模拟的并行优化[D].山东大学,2013. -\ No newline at end of file -diff --git a/test/openmp_optimization/readme.md b/test/openmp_optimization/readme.md -new file mode 100644 -index 0000000..d1131ce ---- /dev/null -+++ b/test/openmp_optimization/readme.md -@@ -0,0 +1,83 @@ -+These files are designed to test how OpenMP programs can be optimized. -+This folder has two types of test file, one is unoptimized, the other -+one is optimized. -+ -+Testing Environment: 2-way 32-core Intel(R) Xeon(R) Silver 4215R CPU @ -+3.20GHz, 512GB RAM, X86 -+OMP_NUM_THREADS=8 -+ -+test every case 20 times with flang-new -O3 -+ unoptimized optimized -+test001: 1.437 0.690 -+test002: 0.611 0.430 -+test003: Unable to optimize with hand-written code -+test004: 0.961 0.574 -+test005: 0.983 0.582 -+test006: Unable to optimize with hand-written code -+test007: 3.255 0.303 -+test008: 0.00555 0.000025 -+test009: 1.480 0.818 -+test010: 2.222 1.398 -+test011: 3.271 2.957 -+test012: 0.0697 0.0686 -+test013: 0.388 0.393 -+test014: 0.287 0.000411 -+test015: 0.127 0.249 -+test016: 0.759 0.0160 -+test017: ERROR -+test018: ERROR -+test019: 1.044 0.0272 -+test020: 1.316 0.343 -+ -+test every case 20 times with flang -O3 -+ unoptimized optimized -+test001: 0.986 0.464 -+test002: 0.614 0.440 -+test003: Unable to optimize with hand-written code -+test004: 0.969 0.568 -+test005: 0.977 0.575 -+test006: Unable to optimize with hand-written code -+test007: 2.485 0.054 -+test008: 0.00490 0.00154 -+test009: 1.003 0.775 -+test010: 2.216 1.334 -+test011: 3.842 2.610 -+test012: 0.0684 0.0672 -+test013: 0.231 0.318 -+test014: 0.639 0.000251 -+test015: 0.0578 0.0575 -+test016: 0.749 0.217 -+test017: 0.0355 0.0323 -+test018: 0.609 1.3886 -+test019: 1.028 0.0262 -+test020: 0.290 0.0164 -+ -+Reference -+[1] Müller, Matthias S.. "Some Simple OpenMP Optimization Techniques." -+WOMPAT (2001). -+ -+[2] Doerfert, J., Finkel, H. (2018). Compiler Optimizations for OpenMP. -+In: de Supinski, B., Valero-Lara, P., Martorell, X., Mateo Bellido S., -+Labarta, J. (eds) Evolving OpenMP for Evolving Architectures.IWOMP 2018 -+. Lecture Notes in Computer Science(), vol 11128. Springer,Cham. -+https://doi.org/10.1007/978-3-319-98521-3_8 -+ -+[3] H. Ma, R. Zhao, X. Gao and Y. Zhang, "Barrier Optimization for -+OpenMP Program," 2009 10th ACIS International Conference on Software -+Engineering, Artificial Intelligences, Networking and -+Parallel/Distributed Computing, 2009, pp. 495-500, doi: -+10.1109/SNPD.2009.16. -+ -+[4] 刘京,郑启龙,李彭勇,郭连伟.面向Open64的OpenMP程序优化[J].计算机系统应用,2016,25(01):154-159. -+ -+[5] 游佐勇. OpenMP并行编程模型与性能优化方法的研究及应用[D].成都理工大学,2011. -+ -+[6] http://akira.ruc.dk/~keld/teaching/IPDC_f10/Slides/pdf4x/4_Performance.4x.pdf -+ -+[7] https://openmp.llvm.org/remarks/OptimizationRemarks.html -+ -+[8] https://www.intel.com/content/www/us/en/developer/articles/tool/oneapi-standalone-components.html#dpcpp-cpp -+ -+[9] https://www.cines.fr/wp-content/uploads/2014/10/lesson3_slides.pdf -+ -+[10] 孙志刚. 基于键涨落模型数值模拟的并行优化[D].山东大学,2013. -\ No newline at end of file -diff --git a/test/openmp_optimization/run_flang-new.sh b/test/openmp_optimization/run_flang-new.sh -new file mode 100644 -index 0000000..23de4fe ---- /dev/null -+++ b/test/openmp_optimization/run_flang-new.sh -@@ -0,0 +1,68 @@ -+for i in {001..002} -+do -+echo "------- test $i ------." -+flang-new fortran_main$i.f90 -c -o fortran-test.o -fopenmp -O3 -+flang-new fortran_func$i.f90 -c -o fortran-test2.o -fopenmp -O3 -+flang-new fortran-test2.o fortran-test.o -fopenmp -O3 -+export OMP_NUM_THREADS=8 -+./a.out -+rm *.o -+rm a.out -+done -+ -+for i in {004..005} -+do -+echo "------- test $i ------." -+flang-new fortran_main$i.f90 -c -o fortran-test.o -fopenmp -O3 -+flang-new fortran_func$i.f90 -c -o fortran-test2.o -fopenmp -O3 -+flang-new fortran-test2.o fortran-test.o -fopenmp -O3 -+export OMP_NUM_THREADS=8 -+./a.out -+rm *.o -+rm a.out -+done -+ -+for i in {007..020} -+do -+echo "------- test $i ------." -+flang-new fortran_main$i.f90 -c -o fortran-test.o -fopenmp -O3 -+flang-new fortran_func$i.f90 -c -o fortran-test2.o -fopenmp -O3 -+flang-new fortran-test2.o fortran-test.o -fopenmp -O3 -+export OMP_NUM_THREADS=8 -+./a.out -+rm *.o -+rm a.out -+done -+for i in {001..002} -+do -+echo "------- test $i ------." -+flang-new optimized_main$i.f90 -c -o fortran-test.o -fopenmp -O3 -+flang-new fortran_optimized_func$i.f90 -c -o fortran-test2.o -fopenmp -O3 -+flang-new fortran-test2.o fortran-test.o -fopenmp -O3 -+export OMP_NUM_THREADS=8 -+./a.out -+rm *.o -+rm a.out -+done -+for i in {004..005} -+do -+echo "------- test $i ------." -+flang-new optimized_main$i.f90 -c -o fortran-test.o -fopenmp -O3 -+flang-new fortran_optimized_func$i.f90 -c -o fortran-test2.o -fopenmp -O3 -+flang-new fortran-test2.o fortran-test.o -fopenmp -O3 -+export OMP_NUM_THREADS=8 -+./a.out -+rm *.o -+rm a.out -+done -+for i in {007..020} -+do -+echo "------- test $i ------." -+flang-new optimized_main$i.f90 -c -o fortran-test.o -fopenmp -O3 -+flang-new fortran_optimized_func$i.f90 -c -o fortran-test2.o -fopenmp -O3 -+flang-new fortran-test2.o fortran-test.o -fopenmp -O3 -+export OMP_NUM_THREADS=8 -+./a.out -+rm *.o -+rm a.out -+done -\ No newline at end of file -diff --git a/test/openmp_optimization/run_flang.sh b/test/openmp_optimization/run_flang.sh -new file mode 100644 -index 0000000..095efad ---- /dev/null -+++ b/test/openmp_optimization/run_flang.sh -@@ -0,0 +1,68 @@ -+for i in {001..002} -+do -+echo "------- test $i ------." -+flang fortran_main$i.f90 -c -o fortran-test.o -fopenmp -O3 -Rpass=openmp-opt -+flang fortran_func$i.f90 -c -o fortran-test2.o -fopenmp -O3 -Rpass=openmp-opt -+flang fortran-test2.o fortran-test.o -fopenmp -O3 -Rpass=openmp-opt -+export OMP_NUM_THREADS=8 -+./a.out -+rm *.o -+rm a.out -+done -+ -+for i in {004..005} -+do -+echo "------- test $i ------." -+flang fortran_main$i.f90 -c -o fortran-test.o -fopenmp -O3 -Rpass=openmp-opt -+flang fortran_func$i.f90 -c -o fortran-test2.o -fopenmp -O3 -Rpass=openmp-opt -+flang fortran-test2.o fortran-test.o -fopenmp -O3 -Rpass=openmp-opt -+export OMP_NUM_THREADS=8 -+./a.out -+rm *.o -+rm a.out -+done -+ -+for i in {007..020} -+do -+echo "------- test $i ------." -+flang fortran_main$i.f90 -c -o fortran-test.o -fopenmp -O3 -Rpass=openmp-opt -+flang fortran_func$i.f90 -c -o fortran-test2.o -fopenmp -O3 -Rpass=openmp-opt -+flang fortran-test2.o fortran-test.o -fopenmp -O3 -Rpass=openmp-opt -+export OMP_NUM_THREADS=8 -+./a.out -+rm *.o -+rm a.out -+done -+for i in {001..002} -+do -+echo "------- test $i ------." -+flang optimized_main$i.f90 -c -o fortran-test.o -fopenmp -O3 -Rpass=openmp-opt -+flang fortran_optimized_func$i.f90 -c -o fortran-test2.o -fopenmp -O3 -Rpass=openmp-opt -+flang fortran-test2.o fortran-test.o -fopenmp -O3 -Rpass=openmp-opt -+export OMP_NUM_THREADS=8 -+./a.out -+rm *.o -+rm a.out -+done -+for i in {004..005} -+do -+echo "------- test $i ------." -+flang optimized_main$i.f90 -c -o fortran-test.o -fopenmp -O3 -Rpass=openmp-opt -+flang fortran_optimized_func$i.f90 -c -o fortran-test2.o -fopenmp -O3 -Rpass=openmp-opt -+flang fortran-test2.o fortran-test.o -fopenmp -O3 -Rpass=openmp-opt -+export OMP_NUM_THREADS=8 -+./a.out -+rm *.o -+rm a.out -+done -+for i in {007..020} -+do -+echo "------- test $i ------." -+flang optimized_main$i.f90 -c -o fortran-test.o -fopenmp -O3 -Rpass=openmp-opt -+flang fortran_optimized_func$i.f90 -c -o fortran-test2.o -fopenmp -O3 -Rpass=openmp-opt -+flang fortran-test2.o fortran-test.o -fopenmp -O3 -Rpass=openmp-opt -+export OMP_NUM_THREADS=8 -+./a.out -+rm *.o -+rm a.out -+done -\ No newline at end of file -diff --git a/test/openmp_optimization/t.sh b/test/openmp_optimization/t.sh -new file mode 100644 -index 0000000..985983f ---- /dev/null -+++ b/test/openmp_optimization/t.sh -@@ -0,0 +1,23 @@ -+for i in {021..021} -+do -+echo "------- test $i ------." -+flang fortran_main$i.f90 -c -o fortran-test.o -fopenmp -O3 -Rpass=openmp-opt -+flang fortran_func$i.f90 -c -o fortran-test2.o -fopenmp -O3 -Rpass=openmp-opt -+flang fortran-test2.o fortran-test.o -fopenmp -O3 -Rpass=openmp-opt -+export OMP_NUM_THREADS=8 -+./a.out -+rm *.o -+rm a.out -+done -+ -+for i in {021..021} -+do -+echo "------- test $i ------." -+flang optimized_main$i.f90 -c -o fortran-test.o -fopenmp -O3 -Rpass=openmp-opt -+flang fortran_optimized_func$i.f90 -c -o fortran-test2.o -fopenmp -O3 -Rpass=openmp-opt -+flang fortran-test2.o fortran-test.o -fopenmp -O3 -Rpass=openmp-opt -+export OMP_NUM_THREADS=8 -+./a.out -+rm *.o -+rm a.out -+done --- -2.25.1 - diff --git a/5-test-interoperability-with-c-c-call-fortran-scalar.patch b/5-test-interoperability-with-c-c-call-fortran-scalar.patch deleted file mode 100644 index 914b24a1a0499fcdf730ff65cfac23d92f6309fd..0000000000000000000000000000000000000000 --- a/5-test-interoperability-with-c-c-call-fortran-scalar.patch +++ /dev/null @@ -1,4814 +0,0 @@ -From dd8de0230f8f43745f341068ace91d276b31c759 Mon Sep 17 00:00:00 2001 -From: xieyihui -Date: Fri, 18 Nov 2022 13:02:04 +0800 -Subject: [PATCH] Add new test cases about scalar for interoperability with C - about C call fortran - -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main001.c b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main001.c -new file mode 100644 -index 0000000..4b940d6 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main001.c -@@ -0,0 +1,9 @@ -+// Test c call fortran for scalar type and the scalar type is int -+// -+#include -+extern void f_func_(int *i); -+int main() { -+ int i = 0; -+ f_func_(&i); -+ printf("%d\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main002.c b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main002.c -new file mode 100644 -index 0000000..d2bf109 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main002.c -@@ -0,0 +1,9 @@ -+// Test c call fortran for scalar type and the scalar type is short -+// -+#include -+extern void f_func_(short *i); -+int main() { -+ short i = 0; -+ f_func_(&i); -+ printf("%hd\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main003.c b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main003.c -new file mode 100644 -index 0000000..921d6e7 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main003.c -@@ -0,0 +1,9 @@ -+// Test c call fortran for scalar type and the scalar type is long -+// -+#include -+extern void f_func_(long *i); -+int main() { -+ long i = 0; -+ f_func_(&i); -+ printf("%ld\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main004.c b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main004.c -new file mode 100644 -index 0000000..20e2d27 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main004.c -@@ -0,0 +1,9 @@ -+// Test c call fortran for scalar type and the scalar type is long long -+// -+#include -+extern void f_func_(long long *i); -+int main() { -+ long long i = 0; -+ f_func_(&i); -+ printf("%Ld\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main005.c b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main005.c -new file mode 100644 -index 0000000..9f396bd ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main005.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for scalar type and the scalar type is signed -+// char -+// -+#include -+extern void f_func_(signed char *i); -+int main() { -+ signed char i = 0; -+ f_func_(&i); -+ printf("%c\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main006.c b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main006.c -new file mode 100644 -index 0000000..f5f6b65 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main006.c -@@ -0,0 +1,9 @@ -+// Test c call fortran for scalar type and the scalar type is size_t -+// -+#include -+extern void f_func_(size_t *i); -+int main() { -+ size_t i = 0; -+ f_func_(&i); -+ printf("%ld\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main007.c b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main007.c -new file mode 100644 -index 0000000..a526d24 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main007.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for scalar type and the scalar type is int8_t -+// -+#include -+#include -+extern void f_func_(int8_t *i); -+int main() { -+ int8_t i = 0; -+ f_func_(&i); -+ printf("%hhd\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main008.c b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main008.c -new file mode 100644 -index 0000000..89b28a5 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main008.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for scalar type and the scalar type is int16_t -+// -+#include -+#include -+extern void f_func_(int16_t *i); -+int main() { -+ int16_t i = 0; -+ f_func_(&i); -+ printf("%hd\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main009.c b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main009.c -new file mode 100644 -index 0000000..a883214 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main009.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for scalar type and the scalar type is int32_t -+// -+#include -+#include -+extern void f_func_(int32_t *i); -+int main() { -+ int32_t i = 0; -+ f_func_(&i); -+ printf("%d\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main010.c b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main010.c -new file mode 100644 -index 0000000..f1360d8 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main010.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for scalar type and the scalar type is int64_t -+// -+#include -+#include -+extern void f_func_(int64_t *i); -+int main() { -+ int64_t i = 0; -+ f_func_(&i); -+ printf("%ld\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main011.c b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main011.c -new file mode 100644 -index 0000000..014c867 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main011.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for scalar type and the scalar type is -+// int_least8_t -+// -+#include -+#include -+extern void f_func_(int_least8_t *i); -+int main() { -+ int_least8_t i = 0; -+ f_func_(&i); -+ printf("%hhd\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main012.c b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main012.c -new file mode 100644 -index 0000000..7b059ae ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main012.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for scalar type and the scalar type is -+// int_least16_t -+// -+#include -+#include -+extern void f_func_(int_least16_t *i); -+int main() { -+ int_least16_t i = 0; -+ f_func_(&i); -+ printf("%hd\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main013.c b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main013.c -new file mode 100644 -index 0000000..7d75b28 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main013.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for scalar type and the scalar type is -+// int_least32_t -+// -+#include -+#include -+extern void f_func_(int_least32_t *i); -+int main() { -+ int_least32_t i = 0; -+ f_func_(&i); -+ printf("%d\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main014.c b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main014.c -new file mode 100644 -index 0000000..90dc33a ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main014.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for scalar type and the scalar type is -+// int_least64_t -+// -+#include -+#include -+extern void f_func_(int_least64_t *i); -+int main() { -+ int_least64_t i = 0; -+ f_func_(&i); -+ printf("%ld\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main015.c b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main015.c -new file mode 100644 -index 0000000..556f989 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main015.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for scalar type and the scalar type is -+// int_fast8_t -+// -+#include -+#include -+extern void f_func_(int_fast8_t *i); -+int main() { -+ int_fast8_t i = 0; -+ f_func_(&i); -+ printf("%hhd\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main016.c b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main016.c -new file mode 100644 -index 0000000..05400b2 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main016.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for scalar type and the scalar type is -+// int_fast16_t -+// -+#include -+#include -+extern void f_func_(int_fast16_t *i); -+int main() { -+ int_fast16_t i = 0; -+ f_func_(&i); -+ printf("%ld\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main017.c b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main017.c -new file mode 100644 -index 0000000..774ceb4 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main017.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for scalar type and the scalar type is -+// int_fast32_t -+// -+#include -+#include -+extern void f_func_(int_fast32_t *i); -+int main() { -+ int_fast32_t i = 0; -+ f_func_(&i); -+ printf("%ld\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main018.c b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main018.c -new file mode 100644 -index 0000000..3ec2748 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main018.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for scalar type and the scalar type is -+// int_fast64_t -+// -+#include -+#include -+extern void f_func_(int_fast64_t *i); -+int main() { -+ int_fast64_t i = 0; -+ f_func_(&i); -+ printf("%ld\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main019.c b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main019.c -new file mode 100644 -index 0000000..5b8b2ef ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main019.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for scalar type and the scalar type is intmax_t -+// -+#include -+#include -+extern void f_func_(intmax_t *i); -+int main() { -+ intmax_t i = 0; -+ f_func_(&i); -+ printf("%ld\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main020.c b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main020.c -new file mode 100644 -index 0000000..ab30f63 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main020.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for scalar type and the scalar type is intptr_t -+// -+#include -+#include -+extern void f_func_(intptr_t *i); -+int main() { -+ intptr_t i = 0; -+ f_func_(&i); -+ printf("%ld\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main021.c b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main021.c -new file mode 100644 -index 0000000..ccb4136 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main021.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for scalar type and the scalar type is float -+// -+#include -+#include -+extern void f_func_(float *i); -+int main() { -+ float i = 0; -+ f_func_(&i); -+ printf("%0.20f\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main022.c b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main022.c -new file mode 100644 -index 0000000..19df789 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main022.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for scalar type and the scalar type is double -+// -+#include -+#include -+extern void f_func_(double *i); -+int main() { -+ double i = 0; -+ f_func_(&i); -+ printf("%0.20lf\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main023.c b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main023.c -new file mode 100644 -index 0000000..819e350 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main023.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for scalar type and the scalar type is long -+// double -+// -+#include -+#include -+extern void f_func_(long double *i); -+int main() { -+ long double i = 0; -+ f_func_(&i); -+ printf("%0.20Lf\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main024.c b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main024.c -new file mode 100644 -index 0000000..4acf839 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main024.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for scalar type and the scalar type is float -+// _Complex -+// -+#include -+#include -+extern void f_func_(float _Complex *i); -+int main() { -+ float _Complex i; -+ f_func_(&i); -+ printf("%0.20f + %0.20fi\n", creal(i), cimag(i)); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main025.c b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main025.c -new file mode 100644 -index 0000000..c1803eb ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main025.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for scalar type and the scalar type is double -+// _Complex -+// -+#include -+#include -+extern void f_func_(double _Complex *i); -+int main() { -+ double _Complex i; -+ f_func_(&i); -+ printf("%0.20lf + %0.20lfi\n", creal(i), cimag(i)); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main026.c b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main026.c -new file mode 100644 -index 0000000..7b5e50e ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main026.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for scalar type and the scalar type is double -+// _Complex -+// -+#include -+#include -+extern void f_func_(long double _Complex *i); -+int main() { -+ long double _Complex i; -+ f_func_(&i); -+ printf("%0.20lf + %0.20lfi\n", creal(i), cimag(i)); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main027.c b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main027.c -new file mode 100644 -index 0000000..199691d ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main027.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for scalar type and the scalar type is _Bool -+// -+#include -+#include -+extern void f_func_(_Bool *i); -+int main() { -+ _Bool i = 0; -+ f_func_(&i); -+ printf("%d\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main028.c b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main028.c -new file mode 100644 -index 0000000..3b2376d ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/c_main028.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for scalar type and the scalar type is char -+// -+#include -+#include -+extern void f_func_(char *i); -+int main() { -+ char i; -+ f_func_(&i); -+ printf("%c\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func001.f90 b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func001.f90 -new file mode 100644 -index 0000000..95e75fa ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func001.f90 -@@ -0,0 +1,4 @@ -+subroutine f_func(i) -+ integer :: i -+ i = 2147483647 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func002.f90 b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func002.f90 -new file mode 100644 -index 0000000..74c32fa ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func002.f90 -@@ -0,0 +1,4 @@ -+subroutine f_func(i) -+ integer(2) :: i -+ i = 32767 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func003.f90 b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func003.f90 -new file mode 100644 -index 0000000..cc3e99a ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func003.f90 -@@ -0,0 +1,4 @@ -+subroutine f_func(i) -+ integer(8) :: i -+ i = 9223372036854775807 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func004.f90 b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func004.f90 -new file mode 100644 -index 0000000..cc3e99a ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func004.f90 -@@ -0,0 +1,4 @@ -+subroutine f_func(i) -+ integer(8) :: i -+ i = 9223372036854775807 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func005.f90 b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func005.f90 -new file mode 100644 -index 0000000..9fa97ed ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func005.f90 -@@ -0,0 +1,4 @@ -+subroutine f_func(i) -+ integer(1) :: i -+ i = 97 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func006.f90 b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func006.f90 -new file mode 100644 -index 0000000..cc3e99a ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func006.f90 -@@ -0,0 +1,4 @@ -+subroutine f_func(i) -+ integer(8) :: i -+ i = 9223372036854775807 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func007.f90 b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func007.f90 -new file mode 100644 -index 0000000..c854566 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func007.f90 -@@ -0,0 +1,4 @@ -+subroutine f_func(i) -+ integer(1) :: i -+ i = 127 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func008.f90 b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func008.f90 -new file mode 100644 -index 0000000..74c32fa ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func008.f90 -@@ -0,0 +1,4 @@ -+subroutine f_func(i) -+ integer(2) :: i -+ i = 32767 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func009.f90 b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func009.f90 -new file mode 100644 -index 0000000..87e7774 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func009.f90 -@@ -0,0 +1,4 @@ -+subroutine f_func(i) -+ integer(4) :: i -+ i = 2147483647 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func010.f90 b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func010.f90 -new file mode 100644 -index 0000000..cc3e99a ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func010.f90 -@@ -0,0 +1,4 @@ -+subroutine f_func(i) -+ integer(8) :: i -+ i = 9223372036854775807 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func011.f90 b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func011.f90 -new file mode 100644 -index 0000000..c854566 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func011.f90 -@@ -0,0 +1,4 @@ -+subroutine f_func(i) -+ integer(1) :: i -+ i = 127 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func012.f90 b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func012.f90 -new file mode 100644 -index 0000000..74c32fa ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func012.f90 -@@ -0,0 +1,4 @@ -+subroutine f_func(i) -+ integer(2) :: i -+ i = 32767 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func013.f90 b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func013.f90 -new file mode 100644 -index 0000000..87e7774 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func013.f90 -@@ -0,0 +1,4 @@ -+subroutine f_func(i) -+ integer(4) :: i -+ i = 2147483647 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func014.f90 b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func014.f90 -new file mode 100644 -index 0000000..cc3e99a ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func014.f90 -@@ -0,0 +1,4 @@ -+subroutine f_func(i) -+ integer(8) :: i -+ i = 9223372036854775807 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func015.f90 b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func015.f90 -new file mode 100644 -index 0000000..c854566 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func015.f90 -@@ -0,0 +1,4 @@ -+subroutine f_func(i) -+ integer(1) :: i -+ i = 127 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func016.f90 b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func016.f90 -new file mode 100644 -index 0000000..cc3e99a ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func016.f90 -@@ -0,0 +1,4 @@ -+subroutine f_func(i) -+ integer(8) :: i -+ i = 9223372036854775807 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func017.f90 b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func017.f90 -new file mode 100644 -index 0000000..cc3e99a ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func017.f90 -@@ -0,0 +1,4 @@ -+subroutine f_func(i) -+ integer(8) :: i -+ i = 9223372036854775807 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func018.f90 b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func018.f90 -new file mode 100644 -index 0000000..cc3e99a ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func018.f90 -@@ -0,0 +1,4 @@ -+subroutine f_func(i) -+ integer(8) :: i -+ i = 9223372036854775807 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func019.f90 b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func019.f90 -new file mode 100644 -index 0000000..cc3e99a ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func019.f90 -@@ -0,0 +1,4 @@ -+subroutine f_func(i) -+ integer(8) :: i -+ i = 9223372036854775807 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func020.f90 b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func020.f90 -new file mode 100644 -index 0000000..cc3e99a ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func020.f90 -@@ -0,0 +1,4 @@ -+subroutine f_func(i) -+ integer(8) :: i -+ i = 9223372036854775807 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func021.f90 b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func021.f90 -new file mode 100644 -index 0000000..342040e ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func021.f90 -@@ -0,0 +1,4 @@ -+subroutine f_func(i) -+ real(4) :: i -+ i = 314159265358.979626 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func022.f90 b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func022.f90 -new file mode 100644 -index 0000000..5077d70 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func022.f90 -@@ -0,0 +1,4 @@ -+subroutine f_func(i) -+ real(8) :: i -+ i = 314159265358.979626 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func023.f90 b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func023.f90 -new file mode 100644 -index 0000000..58c7bfd ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func023.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(i) -+ integer, parameter :: K = selected_real_kind(16) -+ real(K) :: i -+ i = 314159265358.979626 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func024.f90 b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func024.f90 -new file mode 100644 -index 0000000..3a14570 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func024.f90 -@@ -0,0 +1,4 @@ -+subroutine f_func(i) -+ complex(4) :: i -+ i = (-12345678.7654321, 1) -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func025.f90 b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func025.f90 -new file mode 100644 -index 0000000..6514dfd ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func025.f90 -@@ -0,0 +1,4 @@ -+subroutine f_func(i) -+ complex(8) :: i -+ i = (-12345678.7654321, 1) -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func026.f90 b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func026.f90 -new file mode 100644 -index 0000000..0acf912 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func026.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(i) -+ integer, parameter :: K = selected_real_kind(16) -+ complex(K) :: i -+ i = (-12345678.7654321, 1) -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func027.f90 b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func027.f90 -new file mode 100644 -index 0000000..f71da8e ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func027.f90 -@@ -0,0 +1,4 @@ -+subroutine f_func(i) -+ logical(1) :: i -+ i = .TRUE. -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func028.f90 b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func028.f90 -new file mode 100644 -index 0000000..14181a4 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/fortran_func028.f90 -@@ -0,0 +1,4 @@ -+subroutine f_func(i) -+ character(1) :: i -+ i = 'a' -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/result.md b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/result.md -new file mode 100644 -index 0000000..347da21 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/result.md -@@ -0,0 +1,29 @@ -+ | test | gfortran | flang | -+ | 001 | PASS | PASS | -+ | 002 | PASS | PASS | -+ | 003 | PASS | PASS | -+ | 004 | PASS | PASS | -+ | 005 | PASS | PASS | -+ | 006 | PASS | PASS | -+ | 007 | PASS | PASS | -+ | 008 | PASS | PASS | -+ | 009 | PASS | PASS | -+ | 010 | PASS | PASS | -+ | 011 | PASS | PASS | -+ | 012 | PASS | PASS | -+ | 013 | PASS | PASS | -+ | 014 | PASS | PASS | -+ | 015 | PASS | PASS | -+ | 016 | PASS | PASS | -+ | 017 | PASS | PASS | -+ | 018 | PASS | PASS | -+ | 019 | PASS | PASS | -+ | 020 | PASS | PASS | -+ | 021 | PASS | PASS | -+ | 022 | PASS | PASS | -+ | 023 | PASS | PASS | -+ | 024 | PASS | PASS | -+ | 025 | PASS | PASS | -+ | 026 | PASS | PASS | -+ | 027 | PASS | PASS | -+ | 028 | PASS | PASS | -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/run.sh b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/run.sh -new file mode 100644 -index 0000000..5b2202e ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/001_c_call_fortran_scalar/run.sh -@@ -0,0 +1,16 @@ -+for i in {001..028} -+do -+echo "------- test $i ------." -+echo "----- gfortran result:" -+gcc c_main$i.c -c -o c-test.o -+gfortran fortran_func$i.f90 -fno-range-check -c -o fortran-test.o -+gfortran fortran-test.o c-test.o -+./a.out -+rm *.o a.out -+echo "----- flang-new result : " -+clang c_main$i.c -c -o c-test.o -+flang-new fortran_func$i.f90 -c -o fortran-test.o -+flang-new -flang-experimental-exec c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+done -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main001.c b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main001.c -new file mode 100644 -index 0000000..2def20c ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main001.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for scalar type and the scalar type is int with -+// bindc -+// -+#include -+extern void f_func_(int *i); -+int main() { -+ int i = 0; -+ f_func_(&i); -+ printf("%d\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main002.c b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main002.c -new file mode 100644 -index 0000000..26bd768 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main002.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for scalar type and the scalar type is short -+// bindc -+// -+#include -+extern void f_func_(short *i); -+int main() { -+ short i = 0; -+ f_func_(&i); -+ printf("%hd\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main003.c b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main003.c -new file mode 100644 -index 0000000..7e95460 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main003.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for scalar type and the scalar type is long with -+// bindc -+// -+#include -+extern void f_func_(long *i); -+int main() { -+ long i = 0; -+ f_func_(&i); -+ printf("%ld\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main004.c b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main004.c -new file mode 100644 -index 0000000..ef0c0fa ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main004.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for scalar type and the scalar type is long long -+// with bindc -+// -+#include -+extern void f_func_(long long *i); -+int main() { -+ long long i = 0; -+ f_func_(&i); -+ printf("%Ld\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main005.c b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main005.c -new file mode 100644 -index 0000000..14ad78c ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main005.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for scalar type and the scalar type is signed -+// char with bindc -+// -+#include -+extern void f_func_(signed char *i); -+int main() { -+ signed char i = 0; -+ f_func_(&i); -+ printf("%c\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main006.c b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main006.c -new file mode 100644 -index 0000000..5202cc2 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main006.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for scalar type and the scalar type is size_t -+// with bindc -+// -+#include -+extern void f_func_(size_t *i); -+int main() { -+ size_t i = 0; -+ f_func_(&i); -+ printf("%ld\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main007.c b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main007.c -new file mode 100644 -index 0000000..52fb2a6 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main007.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for scalar type and the scalar type is int8_t -+// with bindc -+// -+#include -+#include -+extern void f_func_(int8_t *i); -+int main() { -+ int8_t i = 0; -+ f_func_(&i); -+ printf("%hhd\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main008.c b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main008.c -new file mode 100644 -index 0000000..45a3f95 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main008.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for scalar type and the scalar type is int16_t -+// with bindc -+// -+#include -+#include -+extern void f_func_(int16_t *i); -+int main() { -+ int16_t i = 0; -+ f_func_(&i); -+ printf("%hd\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main009.c b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main009.c -new file mode 100644 -index 0000000..3dbd951 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main009.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for scalar type and the scalar type is int32_t -+// with bindc -+// -+#include -+#include -+extern void f_func_(int32_t *i); -+int main() { -+ int32_t i = 0; -+ f_func_(&i); -+ printf("%d\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main010.c b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main010.c -new file mode 100644 -index 0000000..e9e3e2c ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main010.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for scalar type and the scalar type is int64_t -+// with bindc -+// -+#include -+#include -+extern void f_func_(int64_t *i); -+int main() { -+ int64_t i = 0; -+ f_func_(&i); -+ printf("%ld\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main011.c b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main011.c -new file mode 100644 -index 0000000..617fb85 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main011.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for scalar type and the scalar type is -+// int_least8_t with bindc -+// -+#include -+#include -+extern void f_func_(int_least8_t *i); -+int main() { -+ int_least8_t i = 0; -+ f_func_(&i); -+ printf("%hhd\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main012.c b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main012.c -new file mode 100644 -index 0000000..5eac287 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main012.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for scalar type and the scalar type is -+// int_least16_t with bindc -+// -+#include -+#include -+extern void f_func_(int_least16_t *i); -+int main() { -+ int_least16_t i = 0; -+ f_func_(&i); -+ printf("%hd\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main013.c b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main013.c -new file mode 100644 -index 0000000..1e81950 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main013.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for scalar type and the scalar type is -+// int_least32_t with bindc -+// -+#include -+#include -+extern void f_func_(int_least32_t *i); -+int main() { -+ int_least32_t i = 0; -+ f_func_(&i); -+ printf("%d\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main014.c b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main014.c -new file mode 100644 -index 0000000..bb24e29 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main014.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for scalar type and the scalar type is -+// int_least64_t with bindc -+// -+#include -+#include -+extern void f_func_(int_least64_t *i); -+int main() { -+ int_least64_t i = 0; -+ f_func_(&i); -+ printf("%ld\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main015.c b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main015.c -new file mode 100644 -index 0000000..57d4d21 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main015.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for scalar type and the scalar type is -+// int_fast8_t with bindc -+// -+#include -+#include -+extern void f_func_(int_fast8_t *i); -+int main() { -+ int_fast8_t i = 0; -+ f_func_(&i); -+ printf("%hhd\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main016.c b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main016.c -new file mode 100644 -index 0000000..e641f17 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main016.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for scalar type and the scalar type is -+// int_fast16_t with bindc -+// -+#include -+#include -+extern void f_func_(int_fast16_t *i); -+int main() { -+ int_fast16_t i = 0; -+ f_func_(&i); -+ printf("%ld\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main017.c b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main017.c -new file mode 100644 -index 0000000..0634f7a ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main017.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for scalar type and the scalar type is -+// int_fast32_t with bindc -+// -+#include -+#include -+extern void f_func_(int_fast32_t *i); -+int main() { -+ int_fast32_t i = 0; -+ f_func_(&i); -+ printf("%ld\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main018.c b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main018.c -new file mode 100644 -index 0000000..e309b92 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main018.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for scalar type and the scalar type is -+// int_fast64_t with bindc -+// -+#include -+#include -+extern void f_func_(int_fast64_t *i); -+int main() { -+ int_fast64_t i = 0; -+ f_func_(&i); -+ printf("%ld\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main019.c b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main019.c -new file mode 100644 -index 0000000..9fc63af ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main019.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for scalar type and the scalar type is intmax_t -+// with bindc -+// -+#include -+#include -+extern void f_func_(intmax_t *i); -+int main() { -+ intmax_t i = 0; -+ f_func_(&i); -+ printf("%ld\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main020.c b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main020.c -new file mode 100644 -index 0000000..5ea5b4b ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main020.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for scalar type and the scalar type is intptr_t -+// with bindc -+// -+#include -+#include -+extern void f_func_(intptr_t *i); -+int main() { -+ intptr_t i = 0; -+ f_func_(&i); -+ printf("%ld\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main021.c b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main021.c -new file mode 100644 -index 0000000..b32fc2d ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main021.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for scalar type and the scalar type is float -+// with bindc -+// -+#include -+#include -+extern void f_func_(float *i); -+int main() { -+ float i = 0; -+ f_func_(&i); -+ printf("%0.20f\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main022.c b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main022.c -new file mode 100644 -index 0000000..dc6bf18 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main022.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for scalar type and the scalar type is double -+// with bindc -+// -+#include -+#include -+extern void f_func_(double *i); -+int main() { -+ double i = 0; -+ f_func_(&i); -+ printf("%0.20lf\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main023.c b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main023.c -new file mode 100644 -index 0000000..f25288d ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main023.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for scalar type and the scalar type is long -+// double with bindc -+// -+#include -+#include -+extern void f_func_(long double *i); -+int main() { -+ long double i = 0; -+ f_func_(&i); -+ printf("%0.20Lf\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main024.c b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main024.c -new file mode 100644 -index 0000000..99253d2 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main024.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for scalar type and the scalar type is float -+// _Complex with bindc -+// -+#include -+#include -+extern void f_func_(float _Complex *i); -+int main() { -+ float _Complex i; -+ f_func_(&i); -+ printf("%0.20f + %0.20fi\n", creal(i), cimag(i)); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main025.c b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main025.c -new file mode 100644 -index 0000000..622e6f9 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main025.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for scalar type and the scalar type is double -+// _Complex with bindc -+// -+#include -+#include -+extern void f_func_(double _Complex *i); -+int main() { -+ double _Complex i; -+ f_func_(&i); -+ printf("%0.20lf + %0.20lfi\n", creal(i), cimag(i)); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main026.c b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main026.c -new file mode 100644 -index 0000000..5a1852a ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main026.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for scalar type and the scalar type is double -+// _Complex with bindc -+// -+#include -+#include -+extern void f_func_(long double _Complex *i); -+int main() { -+ long double _Complex i; -+ f_func_(&i); -+ printf("%0.20lf + %0.20lfi\n", creal(i), cimag(i)); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main027.c b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main027.c -new file mode 100644 -index 0000000..147f511 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main027.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for scalar type and the scalar type is _Bool -+// with bindc -+// -+#include -+#include -+extern void f_func_(_Bool *i); -+int main() { -+ _Bool i = 0; -+ f_func_(&i); -+ printf("%d\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main028.c b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main028.c -new file mode 100644 -index 0000000..a5978f8 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/c_main028.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for scalar type and the scalar type is char with -+// bindc -+// -+#include -+#include -+extern void f_func_(char *i); -+int main() { -+ char i; -+ f_func_(&i); -+ printf("%c\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func001.f90 b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func001.f90 -new file mode 100644 -index 0000000..ffc08aa ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func001.f90 -@@ -0,0 +1,4 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ integer :: i -+ i = 2147483647 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func002.f90 b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func002.f90 -new file mode 100644 -index 0000000..9ecd88b ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func002.f90 -@@ -0,0 +1,4 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ integer(2) :: i -+ i = 32767 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func003.f90 b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func003.f90 -new file mode 100644 -index 0000000..a1c733a ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func003.f90 -@@ -0,0 +1,4 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ integer(8) :: i -+ i = 9223372036854775807 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func004.f90 b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func004.f90 -new file mode 100644 -index 0000000..a1c733a ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func004.f90 -@@ -0,0 +1,4 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ integer(8) :: i -+ i = 9223372036854775807 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func005.f90 b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func005.f90 -new file mode 100644 -index 0000000..1b5a25f ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func005.f90 -@@ -0,0 +1,4 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ integer(1) :: i -+ i = 97 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func006.f90 b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func006.f90 -new file mode 100644 -index 0000000..a1c733a ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func006.f90 -@@ -0,0 +1,4 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ integer(8) :: i -+ i = 9223372036854775807 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func007.f90 b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func007.f90 -new file mode 100644 -index 0000000..cd8e40f ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func007.f90 -@@ -0,0 +1,4 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ integer(1) :: i -+ i = 127 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func008.f90 b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func008.f90 -new file mode 100644 -index 0000000..9ecd88b ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func008.f90 -@@ -0,0 +1,4 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ integer(2) :: i -+ i = 32767 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func009.f90 b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func009.f90 -new file mode 100644 -index 0000000..6b326f2 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func009.f90 -@@ -0,0 +1,4 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ integer(4) :: i -+ i = 2147483647 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func010.f90 b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func010.f90 -new file mode 100644 -index 0000000..a1c733a ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func010.f90 -@@ -0,0 +1,4 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ integer(8) :: i -+ i = 9223372036854775807 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func011.f90 b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func011.f90 -new file mode 100644 -index 0000000..cd8e40f ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func011.f90 -@@ -0,0 +1,4 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ integer(1) :: i -+ i = 127 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func012.f90 b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func012.f90 -new file mode 100644 -index 0000000..9ecd88b ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func012.f90 -@@ -0,0 +1,4 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ integer(2) :: i -+ i = 32767 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func013.f90 b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func013.f90 -new file mode 100644 -index 0000000..6b326f2 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func013.f90 -@@ -0,0 +1,4 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ integer(4) :: i -+ i = 2147483647 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func014.f90 b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func014.f90 -new file mode 100644 -index 0000000..a1c733a ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func014.f90 -@@ -0,0 +1,4 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ integer(8) :: i -+ i = 9223372036854775807 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func015.f90 b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func015.f90 -new file mode 100644 -index 0000000..cd8e40f ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func015.f90 -@@ -0,0 +1,4 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ integer(1) :: i -+ i = 127 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func016.f90 b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func016.f90 -new file mode 100644 -index 0000000..a1c733a ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func016.f90 -@@ -0,0 +1,4 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ integer(8) :: i -+ i = 9223372036854775807 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func017.f90 b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func017.f90 -new file mode 100644 -index 0000000..a1c733a ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func017.f90 -@@ -0,0 +1,4 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ integer(8) :: i -+ i = 9223372036854775807 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func018.f90 b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func018.f90 -new file mode 100644 -index 0000000..a1c733a ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func018.f90 -@@ -0,0 +1,4 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ integer(8) :: i -+ i = 9223372036854775807 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func019.f90 b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func019.f90 -new file mode 100644 -index 0000000..a1c733a ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func019.f90 -@@ -0,0 +1,4 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ integer(8) :: i -+ i = 9223372036854775807 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func020.f90 b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func020.f90 -new file mode 100644 -index 0000000..a1c733a ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func020.f90 -@@ -0,0 +1,4 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ integer(8) :: i -+ i = 9223372036854775807 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func021.f90 b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func021.f90 -new file mode 100644 -index 0000000..611cdc9 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func021.f90 -@@ -0,0 +1,4 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ real(4) :: i -+ i = 314159265358.979626 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func022.f90 b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func022.f90 -new file mode 100644 -index 0000000..900e195 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func022.f90 -@@ -0,0 +1,4 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ real(8) :: i -+ i = 314159265358.979626 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func023.f90 b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func023.f90 -new file mode 100644 -index 0000000..464d3c1 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func023.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ integer, parameter :: K = selected_real_kind(16) -+ real(K) :: i -+ i = 314159265358.979626 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func024.f90 b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func024.f90 -new file mode 100644 -index 0000000..25c971c ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func024.f90 -@@ -0,0 +1,4 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ complex(4) :: i -+ i = (-12345678.7654321, 1) -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func025.f90 b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func025.f90 -new file mode 100644 -index 0000000..69fddab ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func025.f90 -@@ -0,0 +1,4 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ complex(8) :: i -+ i = (-12345678.7654321, 1) -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func026.f90 b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func026.f90 -new file mode 100644 -index 0000000..2698cb4 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func026.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ integer, parameter :: K = selected_real_kind(16) -+ complex(K) :: i -+ i = (-12345678.7654321, 1) -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func027.f90 b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func027.f90 -new file mode 100644 -index 0000000..2c10c78 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func027.f90 -@@ -0,0 +1,4 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ logical(1) :: i -+ i = .TRUE. -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func028.f90 b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func028.f90 -new file mode 100644 -index 0000000..55d210f ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/fortran_func028.f90 -@@ -0,0 +1,4 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ character(1) :: i -+ i = 'a' -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/result.md b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/result.md -new file mode 100644 -index 0000000..347da21 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/result.md -@@ -0,0 +1,29 @@ -+ | test | gfortran | flang | -+ | 001 | PASS | PASS | -+ | 002 | PASS | PASS | -+ | 003 | PASS | PASS | -+ | 004 | PASS | PASS | -+ | 005 | PASS | PASS | -+ | 006 | PASS | PASS | -+ | 007 | PASS | PASS | -+ | 008 | PASS | PASS | -+ | 009 | PASS | PASS | -+ | 010 | PASS | PASS | -+ | 011 | PASS | PASS | -+ | 012 | PASS | PASS | -+ | 013 | PASS | PASS | -+ | 014 | PASS | PASS | -+ | 015 | PASS | PASS | -+ | 016 | PASS | PASS | -+ | 017 | PASS | PASS | -+ | 018 | PASS | PASS | -+ | 019 | PASS | PASS | -+ | 020 | PASS | PASS | -+ | 021 | PASS | PASS | -+ | 022 | PASS | PASS | -+ | 023 | PASS | PASS | -+ | 024 | PASS | PASS | -+ | 025 | PASS | PASS | -+ | 026 | PASS | PASS | -+ | 027 | PASS | PASS | -+ | 028 | PASS | PASS | -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/run.sh b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/run.sh -new file mode 100644 -index 0000000..5b2202e ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/002_c_call_fortran_scalar_bindc/run.sh -@@ -0,0 +1,16 @@ -+for i in {001..028} -+do -+echo "------- test $i ------." -+echo "----- gfortran result:" -+gcc c_main$i.c -c -o c-test.o -+gfortran fortran_func$i.f90 -fno-range-check -c -o fortran-test.o -+gfortran fortran-test.o c-test.o -+./a.out -+rm *.o a.out -+echo "----- flang-new result : " -+clang c_main$i.c -c -o c-test.o -+flang-new fortran_func$i.f90 -c -o fortran-test.o -+flang-new -flang-experimental-exec c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+done -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main001.c b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main001.c -new file mode 100644 -index 0000000..2dd7dab ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main001.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the scalar type with value attribute and the -+// scalar type is int without bindc -+// -+#include -+extern void f_func_(int i); -+int main() { -+ int res = 12; -+ f_func_(res); -+ printf("%d\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main002.c b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main002.c -new file mode 100644 -index 0000000..23ee8a1 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main002.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the scalar type with value attribute and the -+// scalar type is short without bindc -+// -+#include -+extern void f_func_(short i); -+int main() { -+ short res = 12; -+ f_func_(res); -+ printf("%hd\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main003.c b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main003.c -new file mode 100644 -index 0000000..e116bb8 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main003.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the scalar type with value attribute and the -+// scalar type is long without bindc -+// -+#include -+extern void f_func_(long i); -+int main() { -+ long res = 12; -+ f_func_(res); -+ printf("%ld\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main004.c b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main004.c -new file mode 100644 -index 0000000..82d8e17 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main004.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the scalar type with value attribute and the -+// scalar type is long long without bindc -+// -+#include -+extern void f_func_(long long i); -+int main() { -+ long long res = 12; -+ f_func_(res); -+ printf("%Ld\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main005.c b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main005.c -new file mode 100644 -index 0000000..34da053 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main005.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the scalar type with value attribute and the -+// scalar type is signed char without bindc -+// -+#include -+extern void f_func_(signed char i); -+int main() { -+ signed char res = 12; -+ f_func_(res); -+ printf("%hhd\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main006.c b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main006.c -new file mode 100644 -index 0000000..2f6fa08 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main006.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the scalar type with value attribute and the -+// scalar type is size_t without bindc -+// -+#include -+extern void f_func_(size_t i); -+int main() { -+ size_t res = 12; -+ f_func_(res); -+ printf("%ld\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main007.c b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main007.c -new file mode 100644 -index 0000000..a24750c ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main007.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the scalar type with value attribute and the -+// scalar type is int8_t without bindc -+// -+#include -+#include -+extern void f_func_(int8_t i); -+int main() { -+ int8_t res = 12; -+ f_func_(res); -+ printf("%hhd\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main008.c b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main008.c -new file mode 100644 -index 0000000..94355b6 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main008.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the scalar type with value attribute and the -+// scalar type is int16_t without bindc -+// -+#include -+#include -+extern void f_func_(int16_t i); -+int main() { -+ int16_t res = 12; -+ f_func_(res); -+ printf("%hd\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main009.c b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main009.c -new file mode 100644 -index 0000000..31a1f39 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main009.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the scalar type with value attribute and the -+// scalar type is int32_t without bindc -+// -+#include -+#include -+extern void f_func_(int32_t i); -+int main() { -+ int32_t res = 12; -+ f_func_(res); -+ printf("%d\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main010.c b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main010.c -new file mode 100644 -index 0000000..cbe3787 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main010.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the scalar type with value attribute and the -+// scalar type is int64_t without bindc -+// -+#include -+#include -+extern void f_func_(int64_t i); -+int main() { -+ int64_t res = 12; -+ f_func_(res); -+ printf("%ld\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main011.c b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main011.c -new file mode 100644 -index 0000000..14a671e ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main011.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the scalar type with value attribute and the -+// scalar type is int_least8_t without bindc -+// -+#include -+#include -+extern void f_func_(int_least8_t i); -+int main() { -+ int_least8_t res = 12; -+ f_func_(res); -+ printf("%hhd\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main012.c b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main012.c -new file mode 100644 -index 0000000..3143fbe ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main012.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the scalar type with value attribute and the -+// scalar type is int_least16_t without bindc -+// -+#include -+#include -+extern void f_func_(int_least16_t i); -+int main() { -+ int_least16_t res = 12; -+ f_func_(res); -+ printf("%hd\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main013.c b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main013.c -new file mode 100644 -index 0000000..8fda433 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main013.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the scalar type with value attribute and the -+// scalar type is int_least32_t without bindc -+// -+#include -+#include -+extern void f_func_(int_least32_t i); -+int main() { -+ int_least32_t res = 12; -+ f_func_(res); -+ printf("%d\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main014.c b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main014.c -new file mode 100644 -index 0000000..2149a3e ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main014.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the scalar type with value attribute and the -+// scalar type is int_least64_t without bindc -+// -+#include -+#include -+extern void f_func_(int_least64_t i); -+int main() { -+ int_least64_t res = 12; -+ f_func_(res); -+ printf("%ld\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main015.c b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main015.c -new file mode 100644 -index 0000000..da0e8c4 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main015.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the scalar type with value attribute and the -+// scalar type is int_fast8_t without bindc -+// -+#include -+#include -+extern void f_func_(int_fast8_t i); -+int main() { -+ int_fast8_t res = 12; -+ f_func_(res); -+ printf("%hhd\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main016.c b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main016.c -new file mode 100644 -index 0000000..82d0ab5 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main016.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the scalar type with value attribute and the -+// scalar type is int_fast16_t without bindc -+// -+#include -+#include -+extern void f_func_(int_fast16_t i); -+int main() { -+ int_fast16_t res = 12; -+ f_func_(res); -+ printf("%ld\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main017.c b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main017.c -new file mode 100644 -index 0000000..60e6f02 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main017.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the scalar type with value attribute and the -+// scalar type is int_fast32_t without bindc -+// -+#include -+#include -+extern void f_func_(int_fast32_t i); -+int main() { -+ int_fast32_t res = 12; -+ f_func_(res); -+ printf("%ld\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main018.c b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main018.c -new file mode 100644 -index 0000000..e901780 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main018.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the scalar type with value attribute and the -+// scalar type is int_fast64_t without bindc -+// -+#include -+#include -+extern void f_func_(int_fast64_t i); -+int main() { -+ int_fast64_t res = 12; -+ f_func_(res); -+ printf("%ld\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main019.c b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main019.c -new file mode 100644 -index 0000000..5501578 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main019.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the scalar type with value attribute and the -+// scalar type is intmax_t without bindc -+// -+#include -+#include -+extern void f_func_(intmax_t i); -+int main() { -+ intmax_t res = 12; -+ f_func_(res); -+ printf("%ld\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main020.c b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main020.c -new file mode 100644 -index 0000000..e98973c ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main020.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the scalar type with value attribute and the -+// scalar type is intptr_t without bindc -+// -+#include -+#include -+extern void f_func_(intptr_t i); -+int main() { -+ intptr_t res = 12; -+ f_func_(res); -+ printf("%ld\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main021.c b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main021.c -new file mode 100644 -index 0000000..c664a03 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main021.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the scalar type with value attribute and the -+// scalar type is float without bindc -+// -+#include -+extern void f_func_(float i); -+int main() { -+ float i = 3.14; -+ f_func_(i); -+ printf("%0.20f\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main022.c b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main022.c -new file mode 100644 -index 0000000..47e0d69 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main022.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the scalar type with value attribute and the -+// scalar type is double without bindc -+// -+#include -+extern void f_func_(double i); -+int main() { -+ double i = 3.14; -+ f_func_(i); -+ printf("%0.20lf\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main023.c b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main023.c -new file mode 100644 -index 0000000..0feeed3 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main023.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the scalar type with value attribute and the -+// scalar type is long double without bindc -+// -+#include -+extern void f_func_(long double i); -+int main() { -+ long double i = 3.14; -+ f_func_(i); -+ printf("%0.20Lf\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main024.c b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main024.c -new file mode 100644 -index 0000000..d720a6d ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main024.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the scalar type with value attribute and the -+// scalar type is float _Complex without bindc -+// -+#include -+#include -+extern void f_func_(float _Complex i); -+int main() { -+ float _Complex i = 5.0f + 1.0if; -+ f_func_(i); -+ printf("%0.20f + %0.20fi\n", creal(i), cimag(i)); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main025.c b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main025.c -new file mode 100644 -index 0000000..2cbc3cb ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main025.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the scalar type with value attribute and the -+// scalar type is double _Complex without bindc -+// -+#include -+#include -+extern void f_func_(double _Complex i); -+int main() { -+ double _Complex i = 5.0f + 1.0if; -+ f_func_(i); -+ printf("%0.20f + %0.20fi\n", creal(i), cimag(i)); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main026.c b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main026.c -new file mode 100644 -index 0000000..d221b3f ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main026.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the scalar type with value attribute and the -+// scalar type is long double _Complex without bindc -+// -+#include -+#include -+extern void f_func_(long double _Complex i); -+int main() { -+ long double _Complex i = 5.0f + 1.0if; -+ f_func_(i); -+ printf("%0.20f + %0.20fi\n", creal(i), cimag(i)); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main027.c b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main027.c -new file mode 100644 -index 0000000..54c265f ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main027.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the scalar type with value attribute and the -+// scalar type is _Bool without bindc -+// -+#include -+#include -+extern void f_func_(_Bool i); -+int main() { -+ _Bool i = 0; -+ f_func_(i); -+ printf("%d\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main028.c b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main028.c -new file mode 100644 -index 0000000..2764a44 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/c_main028.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the scalar type with value attribute and the -+// scalar type is char without bindc -+// -+#include -+#include -+extern void f_func_(char i); -+int main() { -+ char i = 'z'; -+ f_func_(i); -+ printf("%c\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func001.f90 b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func001.f90 -new file mode 100644 -index 0000000..9fcc701 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func001.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(b) -+ integer, value :: b -+ b = b + 1 -+ print *, b -+end -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func002.f90 b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func002.f90 -new file mode 100644 -index 0000000..ed202ed ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func002.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(b) -+ integer(2), value :: b -+ b = b + 1 -+ print *, b -+end -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func003.f90 b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func003.f90 -new file mode 100644 -index 0000000..5d65e3e ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func003.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(b) -+ integer(8), value :: b -+ b = b + 1 -+ print *, b -+end -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func004.f90 b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func004.f90 -new file mode 100644 -index 0000000..5d65e3e ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func004.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(b) -+ integer(8), value :: b -+ b = b + 1 -+ print *, b -+end -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func005.f90 b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func005.f90 -new file mode 100644 -index 0000000..3ec34c9 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func005.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(b) -+ integer(1), value :: b -+ b = b + 1 -+ print *, b -+end -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func006.f90 b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func006.f90 -new file mode 100644 -index 0000000..5d65e3e ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func006.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(b) -+ integer(8), value :: b -+ b = b + 1 -+ print *, b -+end -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func007.f90 b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func007.f90 -new file mode 100644 -index 0000000..3ec34c9 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func007.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(b) -+ integer(1), value :: b -+ b = b + 1 -+ print *, b -+end -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func008.f90 b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func008.f90 -new file mode 100644 -index 0000000..ed202ed ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func008.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(b) -+ integer(2), value :: b -+ b = b + 1 -+ print *, b -+end -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func009.f90 b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func009.f90 -new file mode 100644 -index 0000000..ccf4748 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func009.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(b) -+ integer(4), value :: b -+ b = b + 1 -+ print *, b -+end -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func010.f90 b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func010.f90 -new file mode 100644 -index 0000000..5d65e3e ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func010.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(b) -+ integer(8), value :: b -+ b = b + 1 -+ print *, b -+end -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func011.f90 b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func011.f90 -new file mode 100644 -index 0000000..3ec34c9 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func011.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(b) -+ integer(1), value :: b -+ b = b + 1 -+ print *, b -+end -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func012.f90 b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func012.f90 -new file mode 100644 -index 0000000..ed202ed ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func012.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(b) -+ integer(2), value :: b -+ b = b + 1 -+ print *, b -+end -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func013.f90 b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func013.f90 -new file mode 100644 -index 0000000..ccf4748 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func013.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(b) -+ integer(4), value :: b -+ b = b + 1 -+ print *, b -+end -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func014.f90 b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func014.f90 -new file mode 100644 -index 0000000..5d65e3e ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func014.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(b) -+ integer(8), value :: b -+ b = b + 1 -+ print *, b -+end -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func015.f90 b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func015.f90 -new file mode 100644 -index 0000000..3ec34c9 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func015.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(b) -+ integer(1), value :: b -+ b = b + 1 -+ print *, b -+end -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func016.f90 b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func016.f90 -new file mode 100644 -index 0000000..5d65e3e ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func016.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(b) -+ integer(8), value :: b -+ b = b + 1 -+ print *, b -+end -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func017.f90 b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func017.f90 -new file mode 100644 -index 0000000..5d65e3e ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func017.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(b) -+ integer(8), value :: b -+ b = b + 1 -+ print *, b -+end -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func018.f90 b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func018.f90 -new file mode 100644 -index 0000000..5d65e3e ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func018.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(b) -+ integer(8), value :: b -+ b = b + 1 -+ print *, b -+end -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func019.f90 b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func019.f90 -new file mode 100644 -index 0000000..5d65e3e ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func019.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(b) -+ integer(8), value :: b -+ b = b + 1 -+ print *, b -+end -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func020.f90 b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func020.f90 -new file mode 100644 -index 0000000..5d65e3e ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func020.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(b) -+ integer(8), value :: b -+ b = b + 1 -+ print *, b -+end -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func021.f90 b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func021.f90 -new file mode 100644 -index 0000000..2e3b41e ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func021.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(i) -+ real(4), value :: i -+ i = 314159265358.979626 -+ print *, i -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func022.f90 b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func022.f90 -new file mode 100644 -index 0000000..6fadb7b ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func022.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(i) -+ real(8), value :: i -+ i = 314159265358.979626 -+ print *, i -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func023.f90 b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func023.f90 -new file mode 100644 -index 0000000..7b23ee2 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func023.f90 -@@ -0,0 +1,6 @@ -+subroutine f_func(i) -+ integer, parameter :: K = selected_real_kind(16) -+ real(K), value :: i -+ i = 314159265358.979626 -+ print *, i -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func024.f90 b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func024.f90 -new file mode 100644 -index 0000000..ff15413 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func024.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(i) -+ complex(4), value :: i -+ i = (-12345678.7654321, 1) -+ print *, i -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func025.f90 b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func025.f90 -new file mode 100644 -index 0000000..526ad27 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func025.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(i) -+ complex(8), value :: i -+ i = (-12345678.7654321, 1) -+ print *, i -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func026.f90 b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func026.f90 -new file mode 100644 -index 0000000..bb6278f ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func026.f90 -@@ -0,0 +1,6 @@ -+subroutine f_func(i) -+ integer, parameter :: K = selected_real_kind(16) -+ complex(K), value :: i -+ i = (-12345678.7654321, 1) -+ print *, i -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func027.f90 b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func027.f90 -new file mode 100644 -index 0000000..af1f057 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func027.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(i) -+ logical(1), value :: i -+ i = .TRUE. -+ print *, i -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func028.f90 b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func028.f90 -new file mode 100644 -index 0000000..364a371 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/fortran_func028.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(i) -+ character(1), value :: i -+ i = 'a' -+ print *, i -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/result.md b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/result.md -new file mode 100644 -index 0000000..4b52221 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/result.md -@@ -0,0 +1,29 @@ -+ | test | gfortran | flang | -+ | 001 | PASS | ERROR | -+ | 002 | PASS | ERROR | -+ | 003 | PASS | ERROR | -+ | 004 | PASS | ERROR | -+ | 005 | PASS | ERROR | -+ | 006 | PASS | ERROR | -+ | 007 | PASS | ERROR | -+ | 008 | PASS | ERROR | -+ | 009 | PASS | ERROR | -+ | 010 | PASS | ERROR | -+ | 011 | PASS | ERROR | -+ | 012 | PASS | ERROR | -+ | 013 | PASS | ERROR | -+ | 014 | PASS | ERROR | -+ | 015 | PASS | ERROR | -+ | 016 | PASS | ERROR | -+ | 017 | PASS | ERROR | -+ | 018 | PASS | ERROR | -+ | 019 | PASS | ERROR | -+ | 020 | PASS | ERROR | -+ | 021 | PASS | ERROR | -+ | 022 | PASS | ERROR | -+ | 023 | PASS | ERROR | -+ | 024 | PASS | ERROR | -+ | 025 | PASS | ERROR | -+ | 026 | PASS | ERROR | -+ | 027 | PASS | ERROR | -+ | 028 | PASS | ERROR | -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/run.sh b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/run.sh -new file mode 100644 -index 0000000..5b2202e ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/003_c_call_fortran_scalar_value/run.sh -@@ -0,0 +1,16 @@ -+for i in {001..028} -+do -+echo "------- test $i ------." -+echo "----- gfortran result:" -+gcc c_main$i.c -c -o c-test.o -+gfortran fortran_func$i.f90 -fno-range-check -c -o fortran-test.o -+gfortran fortran-test.o c-test.o -+./a.out -+rm *.o a.out -+echo "----- flang-new result : " -+clang c_main$i.c -c -o c-test.o -+flang-new fortran_func$i.f90 -c -o fortran-test.o -+flang-new -flang-experimental-exec c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+done -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main001.c b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main001.c -new file mode 100644 -index 0000000..3366380 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main001.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for scalar type and the scalar type is int using -+// iso_c_binding -+// -+#include -+extern void f_func_(int *i); -+int main() { -+ int i = 0; -+ f_func_(&i); -+ printf("%d\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main002.c b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main002.c -new file mode 100644 -index 0000000..d1c3138 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main002.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for scalar type and the scalar type is short -+// using iso_c_binding -+// -+#include -+extern void f_func_(short *i); -+int main() { -+ short i = 0; -+ f_func_(&i); -+ printf("%hd\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main003.c b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main003.c -new file mode 100644 -index 0000000..d65634c ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main003.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for scalar type and the scalar type is long -+// using iso_c_binding -+// -+#include -+extern void f_func_(long *i); -+int main() { -+ long i = 0; -+ f_func_(&i); -+ printf("%ld\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main004.c b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main004.c -new file mode 100644 -index 0000000..31d4897 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main004.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for scalar type and the scalar type is long long -+// using iso_c_binding -+// -+#include -+extern void f_func_(long long *i); -+int main() { -+ long long i = 0; -+ f_func_(&i); -+ printf("%Ld\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main005.c b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main005.c -new file mode 100644 -index 0000000..b0648c7 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main005.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for scalar type and the scalar type is signed -+// char using iso_c_binding -+// -+#include -+extern void f_func_(signed char *i); -+int main() { -+ signed char i = 0; -+ f_func_(&i); -+ printf("%c\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main006.c b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main006.c -new file mode 100644 -index 0000000..b1b4e73 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main006.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for scalar type and the scalar type is size_t -+// using iso_c_binding -+// -+#include -+extern void f_func_(size_t *i); -+int main() { -+ size_t i = 0; -+ f_func_(&i); -+ printf("%ld\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main007.c b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main007.c -new file mode 100644 -index 0000000..6862145 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main007.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for scalar type and the scalar type is int8_t -+// using iso_c_binding -+// -+#include -+#include -+extern void f_func_(int8_t *i); -+int main() { -+ int8_t i = 0; -+ f_func_(&i); -+ printf("%hhd\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main008.c b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main008.c -new file mode 100644 -index 0000000..1f33ad9 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main008.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for scalar type and the scalar type is int16_t -+// using iso_c_binding -+// -+#include -+#include -+extern void f_func_(int16_t *i); -+int main() { -+ int16_t i = 0; -+ f_func_(&i); -+ printf("%hd\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main009.c b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main009.c -new file mode 100644 -index 0000000..37a1bd9 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main009.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for scalar type and the scalar type is int32_t -+// using iso_c_binding -+// -+#include -+#include -+extern void f_func_(int32_t *i); -+int main() { -+ int32_t i = 0; -+ f_func_(&i); -+ printf("%d\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main010.c b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main010.c -new file mode 100644 -index 0000000..82745a9 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main010.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for scalar type and the scalar type is int64_t -+// using iso_c_binding -+// -+#include -+#include -+extern void f_func_(int64_t *i); -+int main() { -+ int64_t i = 0; -+ f_func_(&i); -+ printf("%ld\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main011.c b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main011.c -new file mode 100644 -index 0000000..5326328 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main011.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for scalar type and the scalar type is -+// int_least8_t using iso_c_binding -+// -+#include -+#include -+extern void f_func_(int_least8_t *i); -+int main() { -+ int_least8_t i = 0; -+ f_func_(&i); -+ printf("%hhd\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main012.c b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main012.c -new file mode 100644 -index 0000000..2c85dd7 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main012.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for scalar type and the scalar type is -+// int_least16_t using iso_c_binding -+// -+#include -+#include -+extern void f_func_(int_least16_t *i); -+int main() { -+ int_least16_t i = 0; -+ f_func_(&i); -+ printf("%hd\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main013.c b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main013.c -new file mode 100644 -index 0000000..c4f54d4 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main013.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for scalar type and the scalar type is -+// int_least32_t using iso_c_binding -+// -+#include -+#include -+extern void f_func_(int_least32_t *i); -+int main() { -+ int_least32_t i = 0; -+ f_func_(&i); -+ printf("%d\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main014.c b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main014.c -new file mode 100644 -index 0000000..8885983 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main014.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for scalar type and the scalar type is -+// int_least64_t using iso_c_binding -+// -+#include -+#include -+extern void f_func_(int_least64_t *i); -+int main() { -+ int_least64_t i = 0; -+ f_func_(&i); -+ printf("%ld\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main015.c b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main015.c -new file mode 100644 -index 0000000..62b01f8 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main015.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for scalar type and the scalar type is -+// int_fast8_t using iso_c_binding -+// -+#include -+#include -+extern void f_func_(int_fast8_t *i); -+int main() { -+ int_fast8_t i = 0; -+ f_func_(&i); -+ printf("%hhd\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main016.c b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main016.c -new file mode 100644 -index 0000000..68ee278 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main016.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for scalar type and the scalar type is -+// int_fast16_t using iso_c_binding -+// -+#include -+#include -+extern void f_func_(int_fast16_t *i); -+int main() { -+ int_fast16_t i = 0; -+ f_func_(&i); -+ printf("%ld\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main017.c b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main017.c -new file mode 100644 -index 0000000..4e9518f ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main017.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for scalar type and the scalar type is -+// int_fast32_t using iso_c_binding -+// -+#include -+#include -+extern void f_func_(int_fast32_t *i); -+int main() { -+ int_fast32_t i = 0; -+ f_func_(&i); -+ printf("%ld\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main018.c b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main018.c -new file mode 100644 -index 0000000..4a0d01a ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main018.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for scalar type and the scalar type is -+// int_fast64_t using iso_c_binding -+// -+#include -+#include -+extern void f_func_(int_fast64_t *i); -+int main() { -+ int_fast64_t i = 0; -+ f_func_(&i); -+ printf("%ld\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main019.c b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main019.c -new file mode 100644 -index 0000000..26c6db9 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main019.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for scalar type and the scalar type is intmax_t -+// using iso_c_binding -+// -+#include -+#include -+extern void f_func_(intmax_t *i); -+int main() { -+ intmax_t i = 0; -+ f_func_(&i); -+ printf("%ld\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main020.c b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main020.c -new file mode 100644 -index 0000000..67f97d8 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main020.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for scalar type and the scalar type is intptr_t -+// using iso_c_binding -+// -+#include -+#include -+extern void f_func_(intptr_t *i); -+int main() { -+ intptr_t i = 0; -+ f_func_(&i); -+ printf("%ld\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main021.c b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main021.c -new file mode 100644 -index 0000000..ae25967 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main021.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for scalar type and the scalar type is float -+// using iso_c_binding -+// -+#include -+#include -+extern void f_func_(float *i); -+int main() { -+ float i = 0; -+ f_func_(&i); -+ printf("%0.20f\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main022.c b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main022.c -new file mode 100644 -index 0000000..6939356 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main022.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for scalar type and the scalar type is double -+// using iso_c_binding -+// -+#include -+#include -+extern void f_func_(double *i); -+int main() { -+ double i = 0; -+ f_func_(&i); -+ printf("%0.20lf\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main023.c b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main023.c -new file mode 100644 -index 0000000..4aedaa7 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main023.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for scalar type and the scalar type is long -+// double using iso_c_binding -+// -+#include -+#include -+extern void f_func_(long double *i); -+int main() { -+ long double i = 0; -+ f_func_(&i); -+ printf("%0.20Lf\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main024.c b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main024.c -new file mode 100644 -index 0000000..cf33e0d ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main024.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for scalar type and the scalar type is float -+// _Complex using iso_c_binding -+// -+#include -+#include -+extern void f_func_(float _Complex *i); -+int main() { -+ float _Complex i; -+ f_func_(&i); -+ printf("%0.20f + %0.20fi\n", creal(i), cimag(i)); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main025.c b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main025.c -new file mode 100644 -index 0000000..ce3a762 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main025.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for scalar type and the scalar type is double -+// _Complex using iso_c_binding -+// -+#include -+#include -+extern void f_func_(double _Complex *i); -+int main() { -+ double _Complex i; -+ f_func_(&i); -+ printf("%0.20lf + %0.20lfi\n", creal(i), cimag(i)); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main026.c b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main026.c -new file mode 100644 -index 0000000..4666cef ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main026.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for scalar type and the scalar type is double -+// _Complex using iso_c_binding -+// -+#include -+#include -+extern void f_func_(long double _Complex *i); -+int main() { -+ long double _Complex i; -+ f_func_(&i); -+ printf("%0.20lf + %0.20lfi\n", creal(i), cimag(i)); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main027.c b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main027.c -new file mode 100644 -index 0000000..9192175 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main027.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for scalar type and the scalar type is _Bool -+// using iso_c_binding -+// -+#include -+#include -+extern void f_func_(_Bool *i); -+int main() { -+ _Bool i = 0; -+ f_func_(&i); -+ printf("%d\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main028.c b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main028.c -new file mode 100644 -index 0000000..4ade3e9 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/c_main028.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for scalar type and the scalar type is char -+// using iso_c_binding -+// -+#include -+#include -+extern void f_func_(char *i); -+int main() { -+ char i; -+ f_func_(&i); -+ printf("%c\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func001.f90 b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func001.f90 -new file mode 100644 -index 0000000..a89bcce ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func001.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(i) -+ use iso_c_binding -+ integer(C_INT) :: i -+ i = 2147483647 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func002.f90 b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func002.f90 -new file mode 100644 -index 0000000..a8c4269 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func002.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(i) -+ use iso_c_binding -+ integer(C_SHORT) :: i -+ i = 32767 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func003.f90 b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func003.f90 -new file mode 100644 -index 0000000..2e0a857 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func003.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(i) -+ use iso_c_binding -+ integer(C_LONG) :: i -+ i = 9223372036854775807 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func004.f90 b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func004.f90 -new file mode 100644 -index 0000000..0499479 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func004.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(i) -+ use iso_c_binding -+ integer(C_LONG_LONG) :: i -+ i = 9223372036854775807 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func005.f90 b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func005.f90 -new file mode 100644 -index 0000000..bd9ca6c ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func005.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(i) -+ use iso_c_binding -+ integer(C_SIGNED_CHAR) :: i -+ i = 97 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func006.f90 b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func006.f90 -new file mode 100644 -index 0000000..bfb200a ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func006.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(i) -+ use iso_c_binding -+ integer(C_SIZE_T) :: i -+ i = 9223372036854775807 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func007.f90 b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func007.f90 -new file mode 100644 -index 0000000..286f948 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func007.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(i) -+ use iso_c_binding -+ integer(C_INT8_T) :: i -+ i = 127 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func008.f90 b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func008.f90 -new file mode 100644 -index 0000000..01fe7ae ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func008.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(i) -+ use iso_c_binding -+ integer(C_INT16_T) :: i -+ i = 32767 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func009.f90 b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func009.f90 -new file mode 100644 -index 0000000..1b0e978 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func009.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(i) -+ use iso_c_binding -+ integer(C_INT32_T) :: i -+ i = 2147483647 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func010.f90 b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func010.f90 -new file mode 100644 -index 0000000..8268291 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func010.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(i) -+ use iso_c_binding -+ integer(C_INT64_T) :: i -+ i = 9223372036854775807 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func011.f90 b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func011.f90 -new file mode 100644 -index 0000000..b4cc050 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func011.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(i) -+ use iso_c_binding -+ integer(C_INT_LEAST8_T) :: i -+ i = 127 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func012.f90 b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func012.f90 -new file mode 100644 -index 0000000..c70c162 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func012.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(i) -+ use iso_c_binding -+ integer(C_INT_LEAST16_T) :: i -+ i = 32767 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func013.f90 b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func013.f90 -new file mode 100644 -index 0000000..b15a907 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func013.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(i) -+ use iso_c_binding -+ integer(C_INT_LEAST32_T) :: i -+ i = 2147483647 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func014.f90 b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func014.f90 -new file mode 100644 -index 0000000..38387e0 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func014.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(i) -+ use iso_c_binding -+ integer(C_INT_LEAST64_T) :: i -+ i = 9223372036854775807 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func015.f90 b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func015.f90 -new file mode 100644 -index 0000000..53aa505 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func015.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(i) -+ use iso_c_binding -+ integer(C_INT_FAST8_T) :: i -+ i = 127 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func016.f90 b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func016.f90 -new file mode 100644 -index 0000000..07004c1 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func016.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(i) -+ use iso_c_binding -+ integer(C_INT_FAST16_T) :: i -+ i = 9223372036854775807 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func017.f90 b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func017.f90 -new file mode 100644 -index 0000000..17f543d ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func017.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(i) -+ use iso_c_binding -+ integer(C_INT_FAST32_T) :: i -+ i = 9223372036854775807 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func018.f90 b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func018.f90 -new file mode 100644 -index 0000000..428ae53 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func018.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(i) -+ use iso_c_binding -+ integer(C_INT_FAST64_T) :: i -+ i = 9223372036854775807 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func019.f90 b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func019.f90 -new file mode 100644 -index 0000000..4229ca5 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func019.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(i) -+ use iso_c_binding -+ integer(C_INTMAX_T) :: i -+ i = 9223372036854775807 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func020.f90 b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func020.f90 -new file mode 100644 -index 0000000..41e71b3 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func020.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(i) -+ use iso_c_binding -+ integer(C_INTPTR_T) :: i -+ i = 9223372036854775807 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func021.f90 b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func021.f90 -new file mode 100644 -index 0000000..5c83130 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func021.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(i) -+ use iso_c_binding -+ real(C_FLOAT) :: i -+ i = 314159265358.979626 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func022.f90 b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func022.f90 -new file mode 100644 -index 0000000..e16e2af ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func022.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(i) -+ use iso_c_binding -+ real(C_DOUBLE) :: i -+ i = 314159265358.979626 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func023.f90 b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func023.f90 -new file mode 100644 -index 0000000..8794877 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func023.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(i) -+ use iso_c_binding -+ real(C_LONG_DOUBLE) :: i -+ i = 314159265358.979626 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func024.f90 b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func024.f90 -new file mode 100644 -index 0000000..bb98e62 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func024.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(i) -+ use iso_c_binding -+ complex(C_FLOAT_COMPLEX) :: i -+ i = (-12345678.7654321, 1) -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func025.f90 b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func025.f90 -new file mode 100644 -index 0000000..378d820 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func025.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(i) -+ use iso_c_binding -+ complex(C_DOUBLE_COMPLEX) :: i -+ i = (-12345678.7654321, 1) -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func026.f90 b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func026.f90 -new file mode 100644 -index 0000000..ee0c90a ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func026.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(i) -+ use iso_c_binding -+ complex(C_LONG_DOUBLE_COMPLEX) :: i -+ i = (-12345678.7654321, 1) -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func027.f90 b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func027.f90 -new file mode 100644 -index 0000000..61299c7 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func027.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(i) -+ use iso_c_binding -+ logical(C_BOOL) :: i -+ i = .TRUE. -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func028.f90 b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func028.f90 -new file mode 100644 -index 0000000..ce5cc88 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/fortran_func028.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(i) -+ use iso_c_binding -+ character(C_CHAR) :: i -+ i = 'a' -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/result.md b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/result.md -new file mode 100644 -index 0000000..89bbd52 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/result.md -@@ -0,0 +1,29 @@ -+ | test | gfortran | flang | -+ | 001 | PASS | PASS | -+ | 002 | PASS | PASS | -+ | 003 | PASS | PASS | -+ | 004 | PASS | PASS | -+ | 005 | PASS | PASS | -+ | 006 | PASS | PASS | -+ | 007 | PASS | PASS | -+ | 008 | PASS | PASS | -+ | 009 | PASS | PASS | -+ | 010 | PASS | PASS | -+ | 011 | PASS | PASS | -+ | 012 | PASS | PASS | -+ | 013 | PASS | PASS | -+ | 014 | PASS | PASS | -+ | 015 | PASS | PASS | -+ | 016 | PASS | ERROR | -+ | 017 | PASS | ERROR | -+ | 018 | PASS | PASS | -+ | 019 | PASS | PASS | -+ | 020 | PASS | PASS | -+ | 021 | PASS | PASS | -+ | 022 | PASS | PASS | -+ | 023 | PASS | ERROR | -+ | 024 | PASS | PASS | -+ | 025 | PASS | PASS | -+ | 026 | PASS | ERROR | -+ | 027 | PASS | PASS | -+ | 028 | PASS | PASS | -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/run.sh b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/run.sh -new file mode 100644 -index 0000000..5b2202e ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/004_c_call_fortran_scalar_iso_c_binding/run.sh -@@ -0,0 +1,16 @@ -+for i in {001..028} -+do -+echo "------- test $i ------." -+echo "----- gfortran result:" -+gcc c_main$i.c -c -o c-test.o -+gfortran fortran_func$i.f90 -fno-range-check -c -o fortran-test.o -+gfortran fortran-test.o c-test.o -+./a.out -+rm *.o a.out -+echo "----- flang-new result : " -+clang c_main$i.c -c -o c-test.o -+flang-new fortran_func$i.f90 -c -o fortran-test.o -+flang-new -flang-experimental-exec c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+done -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main001.c b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main001.c -new file mode 100644 -index 0000000..93e2e96 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main001.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the scalar type with value attribute and the -+// scalar type is int with bindc -+// -+#include -+extern void f_func_(int i); -+int main() { -+ int res = 12; -+ f_func_(res); -+ printf("%d\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main002.c b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main002.c -new file mode 100644 -index 0000000..e6c7ffc ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main002.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the scalar type with value attribute and the -+// scalar type is short with bindc -+// -+#include -+extern void f_func_(short i); -+int main() { -+ short res = 12; -+ f_func_(res); -+ printf("%hd\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main003.c b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main003.c -new file mode 100644 -index 0000000..0c15160 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main003.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the scalar type with value attribute and the -+// scalar type is long with bindc -+// -+#include -+extern void f_func_(long i); -+int main() { -+ long res = 12; -+ f_func_(res); -+ printf("%ld\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main004.c b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main004.c -new file mode 100644 -index 0000000..c8a4326 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main004.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the scalar type with value attribute and the -+// scalar type is long long with bindc -+// -+#include -+extern void f_func_(long long i); -+int main() { -+ long long res = 12; -+ f_func_(res); -+ printf("%Ld\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main005.c b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main005.c -new file mode 100644 -index 0000000..dbfeab0 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main005.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the scalar type with value attribute and the -+// scalar type is signed char with bindc -+// -+#include -+extern void f_func_(signed char i); -+int main() { -+ signed char res = 12; -+ f_func_(res); -+ printf("%hhd\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main006.c b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main006.c -new file mode 100644 -index 0000000..bd4992d ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main006.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the scalar type with value attribute and the -+// scalar type is size_t with bindc -+// -+#include -+extern void f_func_(size_t i); -+int main() { -+ size_t res = 12; -+ f_func_(res); -+ printf("%ld\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main007.c b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main007.c -new file mode 100644 -index 0000000..a4de5e1 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main007.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the scalar type with value attribute and the -+// scalar type is int8_t with bindc -+// -+#include -+#include -+extern void f_func_(int8_t i); -+int main() { -+ int8_t res = 12; -+ f_func_(res); -+ printf("%hhd\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main008.c b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main008.c -new file mode 100644 -index 0000000..51b166b ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main008.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the scalar type with value attribute and the -+// scalar type is int16_t with bindc -+// -+#include -+#include -+extern void f_func_(int16_t i); -+int main() { -+ int16_t res = 12; -+ f_func_(res); -+ printf("%hd\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main009.c b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main009.c -new file mode 100644 -index 0000000..982a2a0 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main009.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the scalar type with value attribute and the -+// scalar type is int32_t with bindc -+// -+#include -+#include -+extern void f_func_(int32_t i); -+int main() { -+ int32_t res = 12; -+ f_func_(res); -+ printf("%d\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main010.c b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main010.c -new file mode 100644 -index 0000000..ff12da7 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main010.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the scalar type with value attribute and the -+// scalar type is int64_t with bindc -+// -+#include -+#include -+extern void f_func_(int64_t i); -+int main() { -+ int64_t res = 12; -+ f_func_(res); -+ printf("%ld\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main011.c b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main011.c -new file mode 100644 -index 0000000..ff2cdfd ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main011.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the scalar type with value attribute and the -+// scalar type is int_least8_t with bindc -+// -+#include -+#include -+extern void f_func_(int_least8_t i); -+int main() { -+ int_least8_t res = 12; -+ f_func_(res); -+ printf("%hhd\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main012.c b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main012.c -new file mode 100644 -index 0000000..8a23a89 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main012.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the scalar type with value attribute and the -+// scalar type is int_least16_t with bindc -+// -+#include -+#include -+extern void f_func_(int_least16_t i); -+int main() { -+ int_least16_t res = 12; -+ f_func_(res); -+ printf("%hd\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main013.c b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main013.c -new file mode 100644 -index 0000000..6257c07 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main013.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the scalar type with value attribute and the -+// scalar type is int_least32_t with bindc -+// -+#include -+#include -+extern void f_func_(int_least32_t i); -+int main() { -+ int_least32_t res = 12; -+ f_func_(res); -+ printf("%d\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main014.c b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main014.c -new file mode 100644 -index 0000000..21b8378 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main014.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the scalar type with value attribute and the -+// scalar type is int_least64_t with bindc -+// -+#include -+#include -+extern void f_func_(int_least64_t i); -+int main() { -+ int_least64_t res = 12; -+ f_func_(res); -+ printf("%ld\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main015.c b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main015.c -new file mode 100644 -index 0000000..822f85a ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main015.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the scalar type with value attribute and the -+// scalar type is int_fast8_t with bindc -+// -+#include -+#include -+extern void f_func_(int_fast8_t i); -+int main() { -+ int_fast8_t res = 12; -+ f_func_(res); -+ printf("%hhd\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main016.c b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main016.c -new file mode 100644 -index 0000000..492be5b ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main016.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the scalar type with value attribute and the -+// scalar type is int_fast16_t with bindc -+// -+#include -+#include -+extern void f_func_(int_fast16_t i); -+int main() { -+ int_fast16_t res = 12; -+ f_func_(res); -+ printf("%ld\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main017.c b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main017.c -new file mode 100644 -index 0000000..c49574a ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main017.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the scalar type with value attribute and the -+// scalar type is int_fast32_t with bindc -+// -+#include -+#include -+extern void f_func_(int_fast32_t i); -+int main() { -+ int_fast32_t res = 12; -+ f_func_(res); -+ printf("%ld\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main018.c b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main018.c -new file mode 100644 -index 0000000..cad9eef ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main018.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the scalar type with value attribute and the -+// scalar type is int_fast64_t with bindc -+// -+#include -+#include -+extern void f_func_(int_fast64_t i); -+int main() { -+ int_fast64_t res = 12; -+ f_func_(res); -+ printf("%ld\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main019.c b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main019.c -new file mode 100644 -index 0000000..2c69046 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main019.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the scalar type with value attribute and the -+// scalar type is intmax_t with bindc -+// -+#include -+#include -+extern void f_func_(intmax_t i); -+int main() { -+ intmax_t res = 12; -+ f_func_(res); -+ printf("%ld\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main020.c b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main020.c -new file mode 100644 -index 0000000..fd25b96 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main020.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the scalar type with value attribute and the -+// scalar type is intptr_t with bindc -+// -+#include -+#include -+extern void f_func_(intptr_t i); -+int main() { -+ intptr_t res = 12; -+ f_func_(res); -+ printf("%ld\n", res); -+} -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main021.c b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main021.c -new file mode 100644 -index 0000000..27131ff ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main021.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the scalar type with value attribute and the -+// scalar type is float with bindc -+// -+#include -+extern void f_func_(float i); -+int main() { -+ float i = 3.14; -+ f_func_(i); -+ printf("%0.20f\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main022.c b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main022.c -new file mode 100644 -index 0000000..926e1cd ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main022.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the scalar type with value attribute and the -+// scalar type is double with bindc -+// -+#include -+extern void f_func_(double i); -+int main() { -+ double i = 3.14; -+ f_func_(i); -+ printf("%0.20lf\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main023.c b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main023.c -new file mode 100644 -index 0000000..5cd25a0 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main023.c -@@ -0,0 +1,10 @@ -+// Test c call fortran for the scalar type with value attribute and the -+// scalar type is long double with bindc -+// -+#include -+extern void f_func_(long double i); -+int main() { -+ long double i = 3.14; -+ f_func_(i); -+ printf("%0.20Lf\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main024.c b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main024.c -new file mode 100644 -index 0000000..4488766 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main024.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the scalar type with value attribute and the -+// scalar type is float _Complex with bindc -+// -+#include -+#include -+extern void f_func_(float _Complex i); -+int main() { -+ float _Complex i = 5.0f + 1.0if; -+ f_func_(i); -+ printf("%0.20f + %0.20fi\n", creal(i), cimag(i)); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main025.c b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main025.c -new file mode 100644 -index 0000000..a612e9f ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main025.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the scalar type with value attribute and the -+// scalar type is double _Complex with bindc -+// -+#include -+#include -+extern void f_func_(double _Complex i); -+int main() { -+ double _Complex i = 5.0f + 1.0if; -+ f_func_(i); -+ printf("%0.20f + %0.20fi\n", creal(i), cimag(i)); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main026.c b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main026.c -new file mode 100644 -index 0000000..e237729 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main026.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the scalar type with value attribute and the -+// scalar type is long double _Complex with bindc -+// -+#include -+#include -+extern void f_func_(long double _Complex i); -+int main() { -+ long double _Complex i = 5.0f + 1.0if; -+ f_func_(i); -+ printf("%0.20f + %0.20fi\n", creal(i), cimag(i)); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main027.c b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main027.c -new file mode 100644 -index 0000000..463cb21 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main027.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the scalar type with value attribute and the -+// scalar type is _Bool with bindc -+// -+#include -+#include -+extern void f_func_(_Bool i); -+int main() { -+ _Bool i = 0; -+ f_func_(i); -+ printf("%d\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main028.c b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main028.c -new file mode 100644 -index 0000000..4152530 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/c_main028.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the scalar type with value attribute and the -+// scalar type is char with bindc -+// -+#include -+#include -+extern void f_func_(char i); -+int main() { -+ char i = 'z'; -+ f_func_(i); -+ printf("%c\n", i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func001.f90 b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func001.f90 -new file mode 100644 -index 0000000..de93201 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func001.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(b) bind(c, name = "f_func_") -+ integer, value :: b -+ b = b + 1 -+ print *, b -+end -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func002.f90 b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func002.f90 -new file mode 100644 -index 0000000..912b855 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func002.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(b) bind(c, name = "f_func_") -+ integer(2), value :: b -+ b = b + 1 -+ print *, b -+end -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func003.f90 b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func003.f90 -new file mode 100644 -index 0000000..e3bdc20 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func003.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(b) bind(c, name = "f_func_") -+ integer(8), value :: b -+ b = b + 1 -+ print *, b -+end -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func004.f90 b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func004.f90 -new file mode 100644 -index 0000000..e3bdc20 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func004.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(b) bind(c, name = "f_func_") -+ integer(8), value :: b -+ b = b + 1 -+ print *, b -+end -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func005.f90 b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func005.f90 -new file mode 100644 -index 0000000..b4d2fe2 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func005.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(b) bind(c, name = "f_func_") -+ integer(1), value :: b -+ b = b + 1 -+ print *, b -+end -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func006.f90 b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func006.f90 -new file mode 100644 -index 0000000..e3bdc20 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func006.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(b) bind(c, name = "f_func_") -+ integer(8), value :: b -+ b = b + 1 -+ print *, b -+end -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func007.f90 b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func007.f90 -new file mode 100644 -index 0000000..b4d2fe2 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func007.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(b) bind(c, name = "f_func_") -+ integer(1), value :: b -+ b = b + 1 -+ print *, b -+end -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func008.f90 b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func008.f90 -new file mode 100644 -index 0000000..912b855 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func008.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(b) bind(c, name = "f_func_") -+ integer(2), value :: b -+ b = b + 1 -+ print *, b -+end -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func009.f90 b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func009.f90 -new file mode 100644 -index 0000000..35f23ce ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func009.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(b) bind(c, name = "f_func_") -+ integer(4), value :: b -+ b = b + 1 -+ print *, b -+end -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func010.f90 b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func010.f90 -new file mode 100644 -index 0000000..e3bdc20 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func010.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(b) bind(c, name = "f_func_") -+ integer(8), value :: b -+ b = b + 1 -+ print *, b -+end -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func011.f90 b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func011.f90 -new file mode 100644 -index 0000000..b4d2fe2 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func011.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(b) bind(c, name = "f_func_") -+ integer(1), value :: b -+ b = b + 1 -+ print *, b -+end -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func012.f90 b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func012.f90 -new file mode 100644 -index 0000000..912b855 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func012.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(b) bind(c, name = "f_func_") -+ integer(2), value :: b -+ b = b + 1 -+ print *, b -+end -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func013.f90 b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func013.f90 -new file mode 100644 -index 0000000..35f23ce ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func013.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(b) bind(c, name = "f_func_") -+ integer(4), value :: b -+ b = b + 1 -+ print *, b -+end -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func014.f90 b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func014.f90 -new file mode 100644 -index 0000000..e3bdc20 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func014.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(b) bind(c, name = "f_func_") -+ integer(8), value :: b -+ b = b + 1 -+ print *, b -+end -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func015.f90 b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func015.f90 -new file mode 100644 -index 0000000..b4d2fe2 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func015.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(b) bind(c, name = "f_func_") -+ integer(1), value :: b -+ b = b + 1 -+ print *, b -+end -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func016.f90 b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func016.f90 -new file mode 100644 -index 0000000..e3bdc20 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func016.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(b) bind(c, name = "f_func_") -+ integer(8), value :: b -+ b = b + 1 -+ print *, b -+end -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func017.f90 b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func017.f90 -new file mode 100644 -index 0000000..e3bdc20 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func017.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(b) bind(c, name = "f_func_") -+ integer(8), value :: b -+ b = b + 1 -+ print *, b -+end -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func018.f90 b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func018.f90 -new file mode 100644 -index 0000000..e3bdc20 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func018.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(b) bind(c, name = "f_func_") -+ integer(8), value :: b -+ b = b + 1 -+ print *, b -+end -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func019.f90 b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func019.f90 -new file mode 100644 -index 0000000..e3bdc20 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func019.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(b) bind(c, name = "f_func_") -+ integer(8), value :: b -+ b = b + 1 -+ print *, b -+end -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func020.f90 b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func020.f90 -new file mode 100644 -index 0000000..e3bdc20 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func020.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(b) bind(c, name = "f_func_") -+ integer(8), value :: b -+ b = b + 1 -+ print *, b -+end -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func021.f90 b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func021.f90 -new file mode 100644 -index 0000000..671133b ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func021.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ real(4), value :: i -+ i = 314159265358.979626 -+ print *, i -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func022.f90 b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func022.f90 -new file mode 100644 -index 0000000..b14b9b9 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func022.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ real(8), value :: i -+ i = 314159265358.979626 -+ print *, i -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func023.f90 b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func023.f90 -new file mode 100644 -index 0000000..afc5e87 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func023.f90 -@@ -0,0 +1,6 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ integer, parameter :: K = selected_real_kind(16) -+ real(K), value :: i -+ i = 314159265358.979626 -+ print *, i -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func024.f90 b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func024.f90 -new file mode 100644 -index 0000000..a043f8e ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func024.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ complex(4), value :: i -+ i = (-12345678.7654321, 1) -+ print *, i -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func025.f90 b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func025.f90 -new file mode 100644 -index 0000000..cc4e165 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func025.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ complex(8), value :: i -+ i = (-12345678.7654321, 1) -+ print *, i -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func026.f90 b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func026.f90 -new file mode 100644 -index 0000000..a256773 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func026.f90 -@@ -0,0 +1,6 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ integer, parameter :: K = selected_real_kind(16) -+ complex(K), value :: i -+ i = (-12345678.7654321, 1) -+ print *, i -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func027.f90 b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func027.f90 -new file mode 100644 -index 0000000..3a01854 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func027.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ logical(1), value :: i -+ i = .TRUE. -+ print *, i -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func028.f90 b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func028.f90 -new file mode 100644 -index 0000000..7881678 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/fortran_func028.f90 -@@ -0,0 +1,5 @@ -+subroutine f_func(i) bind(c, name = "f_func_") -+ character(1), value :: i -+ i = 'a' -+ print *, i -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/result.md b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/result.md -new file mode 100644 -index 0000000..4b52221 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/result.md -@@ -0,0 +1,29 @@ -+ | test | gfortran | flang | -+ | 001 | PASS | ERROR | -+ | 002 | PASS | ERROR | -+ | 003 | PASS | ERROR | -+ | 004 | PASS | ERROR | -+ | 005 | PASS | ERROR | -+ | 006 | PASS | ERROR | -+ | 007 | PASS | ERROR | -+ | 008 | PASS | ERROR | -+ | 009 | PASS | ERROR | -+ | 010 | PASS | ERROR | -+ | 011 | PASS | ERROR | -+ | 012 | PASS | ERROR | -+ | 013 | PASS | ERROR | -+ | 014 | PASS | ERROR | -+ | 015 | PASS | ERROR | -+ | 016 | PASS | ERROR | -+ | 017 | PASS | ERROR | -+ | 018 | PASS | ERROR | -+ | 019 | PASS | ERROR | -+ | 020 | PASS | ERROR | -+ | 021 | PASS | ERROR | -+ | 022 | PASS | ERROR | -+ | 023 | PASS | ERROR | -+ | 024 | PASS | ERROR | -+ | 025 | PASS | ERROR | -+ | 026 | PASS | ERROR | -+ | 027 | PASS | ERROR | -+ | 028 | PASS | ERROR | -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/run.sh b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/run.sh -new file mode 100644 -index 0000000..5b2202e ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/005_c_call_fortran_scalar_bindc_value/run.sh -@@ -0,0 +1,16 @@ -+for i in {001..028} -+do -+echo "------- test $i ------." -+echo "----- gfortran result:" -+gcc c_main$i.c -c -o c-test.o -+gfortran fortran_func$i.f90 -fno-range-check -c -o fortran-test.o -+gfortran fortran-test.o c-test.o -+./a.out -+rm *.o a.out -+echo "----- flang-new result : " -+clang c_main$i.c -c -o c-test.o -+flang-new fortran_func$i.f90 -c -o fortran-test.o -+flang-new -flang-experimental-exec c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+done -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/006_c_call_fortran_pointer/c_main001.c b/test/interoperability_with_c_c_call_fortran_scalar/006_c_call_fortran_pointer/c_main001.c -new file mode 100644 -index 0000000..d1592b4 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/006_c_call_fortran_pointer/c_main001.c -@@ -0,0 +1,11 @@ -+// Test c call fortran for the pointer type and allocate a free space -+// for the pointer -+// -+#include -+#include -+extern void f_func_(int *i); -+int main() { -+ int *i = (int*) malloc(sizeof(int)); -+ f_func_(i); -+ printf("%d\n", *i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/006_c_call_fortran_pointer/c_main002.c b/test/interoperability_with_c_c_call_fortran_scalar/006_c_call_fortran_pointer/c_main002.c -new file mode 100644 -index 0000000..5dc36ae ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/006_c_call_fortran_pointer/c_main002.c -@@ -0,0 +1,15 @@ -+// Test c call fortan for the pointer type and let the pointer point to -+// a variable array -+// -+#include -+#include -+extern void f_func_(int *i); -+int main() { -+ int x[5] = {5, 4, 3, 2, 1}; -+ int *i = x; -+ f_func_(i); -+ for(int w = 0; w < 5; w++) { -+ printf("%d\n", i[w]); -+ printf("%d\n", x[w]); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/006_c_call_fortran_pointer/c_main003.c b/test/interoperability_with_c_c_call_fortran_scalar/006_c_call_fortran_pointer/c_main003.c -new file mode 100644 -index 0000000..85d12b7 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/006_c_call_fortran_pointer/c_main003.c -@@ -0,0 +1,13 @@ -+// Test c call fortan for the pointer type and let the pointer point to -+// a variable -+// -+#include -+#include -+extern void f_func_(int *i); -+int main() { -+ int x = 5; -+ int *i = &x; -+ f_func_(i); -+ printf("%d\n", *i); -+ printf("%d\n", x); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/006_c_call_fortran_pointer/c_main004.c b/test/interoperability_with_c_c_call_fortran_scalar/006_c_call_fortran_pointer/c_main004.c -new file mode 100644 -index 0000000..c4326b9 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/006_c_call_fortran_pointer/c_main004.c -@@ -0,0 +1,20 @@ -+// Test c call fortran for the pointer type and let the pointer point -+// to a variable two-dimensinal array -+// -+#include -+#include -+extern void f_func_(int [][3]); -+int main() { -+ int x[3][3]; -+ for(int n = 0; n < 3; n++) { -+ for(int w = 0; w < 3; w++) { -+ x[n][w] = 1; -+ } -+ } -+ f_func_(x); -+ for(int n = 0; n < 3; n++) { -+ for(int w = 0; w < 3; w++) { -+ printf("%d\n", x[n][w]); -+ } -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/006_c_call_fortran_pointer/fortran_func001.f90 b/test/interoperability_with_c_c_call_fortran_scalar/006_c_call_fortran_pointer/fortran_func001.f90 -new file mode 100644 -index 0000000..f107dca ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/006_c_call_fortran_pointer/fortran_func001.f90 -@@ -0,0 +1,4 @@ -+subroutine f_func(i) -+ integer :: i -+ i = 1 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/006_c_call_fortran_pointer/fortran_func002.f90 b/test/interoperability_with_c_c_call_fortran_scalar/006_c_call_fortran_pointer/fortran_func002.f90 -new file mode 100644 -index 0000000..a2fa9d6 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/006_c_call_fortran_pointer/fortran_func002.f90 -@@ -0,0 +1,6 @@ -+subroutine f_func(i) -+ integer, dimension(*) :: i -+ do n = 1, 5 -+ i(n) = n -+ end do -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/006_c_call_fortran_pointer/fortran_func003.f90 b/test/interoperability_with_c_c_call_fortran_scalar/006_c_call_fortran_pointer/fortran_func003.f90 -new file mode 100644 -index 0000000..f107dca ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/006_c_call_fortran_pointer/fortran_func003.f90 -@@ -0,0 +1,4 @@ -+subroutine f_func(i) -+ integer :: i -+ i = 1 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/006_c_call_fortran_pointer/fortran_func004.f90 b/test/interoperability_with_c_c_call_fortran_scalar/006_c_call_fortran_pointer/fortran_func004.f90 -new file mode 100644 -index 0000000..0d721cb ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/006_c_call_fortran_pointer/fortran_func004.f90 -@@ -0,0 +1,8 @@ -+subroutine f_func(i) -+ integer :: i(3, 3) -+ do n = 1, 3 -+ do j = 1, 3 -+ i(n, j) = n + j -+ end do -+ end do -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/006_c_call_fortran_pointer/result.md b/test/interoperability_with_c_c_call_fortran_scalar/006_c_call_fortran_pointer/result.md -new file mode 100644 -index 0000000..ed1f4be ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/006_c_call_fortran_pointer/result.md -@@ -0,0 +1,5 @@ -+ | test | gfortran | flang | -+ | 001 | PASS | PASS | -+ | 002 | PASS | PASS | -+ | 003 | PASS | PASS | -+ | 004 | PASS | PASS | -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/006_c_call_fortran_pointer/run.sh b/test/interoperability_with_c_c_call_fortran_scalar/006_c_call_fortran_pointer/run.sh -new file mode 100644 -index 0000000..fd0df6a ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/006_c_call_fortran_pointer/run.sh -@@ -0,0 +1,16 @@ -+for i in {001..004} -+do -+echo "------- test $i ------." -+echo "----- gfortran result:" -+gcc c_main$i.c -c -o c-test.o -+gfortran fortran_func$i.f90 -fno-range-check -c -o fortran-test.o -+gfortran fortran-test.o c-test.o -+./a.out -+rm *.o a.out -+echo "----- flang-new result : " -+clang c_main$i.c -c -o c-test.o -+flang-new fortran_func$i.f90 -c -o fortran-test.o -+flang-new -flang-experimental-exec c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+done -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/007_c_call_fortran_procedure_pointer/c_main001.c b/test/interoperability_with_c_c_call_fortran_scalar/007_c_call_fortran_procedure_pointer/c_main001.c -new file mode 100644 -index 0000000..2bc9194 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/007_c_call_fortran_procedure_pointer/c_main001.c -@@ -0,0 +1,13 @@ -+// test c call fortran for procedure about callback -+// -+#include -+extern void f_func_(void (*foo)(int *)); -+void print(int *x) { -+ printf("%d\n", *x); -+} -+int main() { -+ int i = 0; -+ void (*foo)(int *); -+ foo = print; -+ f_func_(foo); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/007_c_call_fortran_procedure_pointer/c_main002.c b/test/interoperability_with_c_c_call_fortran_scalar/007_c_call_fortran_procedure_pointer/c_main002.c -new file mode 100644 -index 0000000..701f6af ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/007_c_call_fortran_procedure_pointer/c_main002.c -@@ -0,0 +1,13 @@ -+// test c call fortran for procedure about callback -+// -+#include -+extern void f_func_(void (**foo)(int *)); -+void print(int *x) { -+ printf("%d\n", *x); -+} -+int main() { -+ int i = 0; -+ void (*foo[1])(int *); -+ foo[0] = print; -+ f_func_(foo); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/007_c_call_fortran_procedure_pointer/c_main003.c b/test/interoperability_with_c_c_call_fortran_scalar/007_c_call_fortran_procedure_pointer/c_main003.c -new file mode 100644 -index 0000000..7991526 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/007_c_call_fortran_procedure_pointer/c_main003.c -@@ -0,0 +1,13 @@ -+// test c call fortran for procedure about callback -+// -+#include -+extern void f_func_(int (*foo)(int *)); -+int ret(int *x) { -+ return *x + 1; -+} -+int main() { -+ int i = 0; -+ int (*foo)(int *); -+ foo = ret; -+ f_func_(foo); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/007_c_call_fortran_procedure_pointer/c_main004.c b/test/interoperability_with_c_c_call_fortran_scalar/007_c_call_fortran_procedure_pointer/c_main004.c -new file mode 100644 -index 0000000..2e93c83 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/007_c_call_fortran_procedure_pointer/c_main004.c -@@ -0,0 +1,13 @@ -+// test c call fortran for procedure about callback -+// -+#include -+extern void f_func_(int (**foo)(int *)); -+int ret(int *x) { -+ return *x + 1; -+} -+int main() { -+ int i = 0; -+ int (*foo[1])(int *); -+ foo[0] = ret; -+ f_func_(foo); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/007_c_call_fortran_procedure_pointer/c_main005.c b/test/interoperability_with_c_c_call_fortran_scalar/007_c_call_fortran_procedure_pointer/c_main005.c -new file mode 100644 -index 0000000..6f7e931 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/007_c_call_fortran_procedure_pointer/c_main005.c -@@ -0,0 +1,12 @@ -+// test c call fortran for procedure pointer that points to fortran -+// subroutine -+// -+#include -+extern void f_func_(int *); -+int main() { -+ int *i , y = 2; -+ i = &y; -+ void (*foo[1])(int *); -+ foo[0] = f_func_; -+ (*foo)(i); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/007_c_call_fortran_procedure_pointer/c_main006.c b/test/interoperability_with_c_c_call_fortran_scalar/007_c_call_fortran_procedure_pointer/c_main006.c -new file mode 100644 -index 0000000..1b51e46 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/007_c_call_fortran_procedure_pointer/c_main006.c -@@ -0,0 +1,13 @@ -+// test c call fortran for procedure pointer that points to fortran -+// subroutine -+// -+#include -+extern int f_func_(int *); -+int main() { -+ int *i , y = 2; -+ i = &y; -+ int (*foo[1])(int *); -+ foo[0] = f_func_; -+ int x = (*foo)(i); -+ printf("%d\n", x); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/007_c_call_fortran_procedure_pointer/c_main007.c b/test/interoperability_with_c_c_call_fortran_scalar/007_c_call_fortran_procedure_pointer/c_main007.c -new file mode 100644 -index 0000000..389ed1a ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/007_c_call_fortran_procedure_pointer/c_main007.c -@@ -0,0 +1,18 @@ -+// test c call fortran for procedures about callback -+// -+#include -+extern void f_func_(void (**foo)(int *), void (**foo2)(int *)); -+void print(int *x) { -+ printf("%d\n", *x); -+} -+void printn(int *x) { -+ printf("%d\n", *x * -1); -+} -+int main() { -+ int i = 0; -+ void (*foo[1])(int *); -+ void (*foo2[1])(int *); -+ foo[0] = print; -+ foo2[0] = printn; -+ f_func_(foo, foo2); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/007_c_call_fortran_procedure_pointer/c_main008.c b/test/interoperability_with_c_c_call_fortran_scalar/007_c_call_fortran_procedure_pointer/c_main008.c -new file mode 100644 -index 0000000..6ce0048 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/007_c_call_fortran_procedure_pointer/c_main008.c -@@ -0,0 +1,10 @@ -+// test c call fortran for return procedure pointer -+// -+ -+extern void (**func_(void (**fx)()))(); -+int main() { -+ void (**fx)(void); -+ void (**res)(void); -+ res = func_(fx); -+ (*res)(); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/007_c_call_fortran_procedure_pointer/fortran_func001.f90 b/test/interoperability_with_c_c_call_fortran_scalar/007_c_call_fortran_procedure_pointer/fortran_func001.f90 -new file mode 100644 -index 0000000..ffd7ff0 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/007_c_call_fortran_procedure_pointer/fortran_func001.f90 -@@ -0,0 +1,4 @@ -+subroutine f_func(p) -+ procedure() :: p -+ call p(1) -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/007_c_call_fortran_procedure_pointer/fortran_func002.f90 b/test/interoperability_with_c_c_call_fortran_scalar/007_c_call_fortran_procedure_pointer/fortran_func002.f90 -new file mode 100644 -index 0000000..b87a30f ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/007_c_call_fortran_procedure_pointer/fortran_func002.f90 -@@ -0,0 +1,4 @@ -+subroutine f_func(p) -+ procedure(), pointer :: p -+ call p(1) -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/007_c_call_fortran_procedure_pointer/fortran_func003.f90 b/test/interoperability_with_c_c_call_fortran_scalar/007_c_call_fortran_procedure_pointer/fortran_func003.f90 -new file mode 100644 -index 0000000..3b8f913 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/007_c_call_fortran_procedure_pointer/fortran_func003.f90 -@@ -0,0 +1,12 @@ -+subroutine f_func(p) -+ interface -+ function f(x) -+ integer :: x -+ integer :: f -+ end -+ end interface -+ procedure(f) :: p -+ integer :: w = 1 -+ w = p(1) -+ print * , w -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/007_c_call_fortran_procedure_pointer/fortran_func004.f90 b/test/interoperability_with_c_c_call_fortran_scalar/007_c_call_fortran_procedure_pointer/fortran_func004.f90 -new file mode 100644 -index 0000000..c77662a ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/007_c_call_fortran_procedure_pointer/fortran_func004.f90 -@@ -0,0 +1,12 @@ -+subroutine f_func(p) -+ interface -+ function f(x) -+ integer :: x -+ integer :: f -+ end -+ end interface -+ procedure(f), pointer :: p -+ integer :: w = 1 -+ w = p(1) -+ print * , w -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/007_c_call_fortran_procedure_pointer/fortran_func005.f90 b/test/interoperability_with_c_c_call_fortran_scalar/007_c_call_fortran_procedure_pointer/fortran_func005.f90 -new file mode 100644 -index 0000000..8bb7a41 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/007_c_call_fortran_procedure_pointer/fortran_func005.f90 -@@ -0,0 +1,4 @@ -+subroutine f_func(i) -+ integer :: i -+ print *, i -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/007_c_call_fortran_procedure_pointer/fortran_func006.f90 b/test/interoperability_with_c_c_call_fortran_scalar/007_c_call_fortran_procedure_pointer/fortran_func006.f90 -new file mode 100644 -index 0000000..02861a1 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/007_c_call_fortran_procedure_pointer/fortran_func006.f90 -@@ -0,0 +1,5 @@ -+function f_func(i) -+ integer :: i -+ integer :: f_func -+ f_func = i + 1 -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/007_c_call_fortran_procedure_pointer/fortran_func007.f90 b/test/interoperability_with_c_c_call_fortran_scalar/007_c_call_fortran_procedure_pointer/fortran_func007.f90 -new file mode 100644 -index 0000000..3cff57c ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/007_c_call_fortran_procedure_pointer/fortran_func007.f90 -@@ -0,0 +1,7 @@ -+subroutine f_func(p, q) -+ procedure(), pointer :: p -+ procedure(), pointer :: q -+ call q(1) -+ call p(1) -+ -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/007_c_call_fortran_procedure_pointer/fortran_func008.f90 b/test/interoperability_with_c_c_call_fortran_scalar/007_c_call_fortran_procedure_pointer/fortran_func008.f90 -new file mode 100644 -index 0000000..212458d ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/007_c_call_fortran_procedure_pointer/fortran_func008.f90 -@@ -0,0 +1,14 @@ -+function func(x) -+ interface -+ subroutine common -+ end -+ end interface -+ procedure(common), pointer :: x -+ procedure(common), pointer :: func -+ print *, 'ok' -+ x => printx -+ contains -+ subroutine printx() -+ print *, 'ook' -+ end -+end -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/007_c_call_fortran_procedure_pointer/result.md b/test/interoperability_with_c_c_call_fortran_scalar/007_c_call_fortran_procedure_pointer/result.md -new file mode 100644 -index 0000000..7b04196 ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/007_c_call_fortran_procedure_pointer/result.md -@@ -0,0 +1,9 @@ -+ | test | gfortran | flang | -+ | 001 | PASS | PASS | -+ | 002 | PASS | ERROR | -+ | 003 | PASS | PASS | -+ | 004 | PASS | ERROR | -+ | 005 | PASS | PASS | -+ | 006 | PASS | PASS | -+ | 007 | PASS | ERROR | -+ | 008 | PASS | ERROR | -\ No newline at end of file -diff --git a/test/interoperability_with_c_c_call_fortran_scalar/007_c_call_fortran_procedure_pointer/run.sh b/test/interoperability_with_c_c_call_fortran_scalar/007_c_call_fortran_procedure_pointer/run.sh -new file mode 100644 -index 0000000..01f477d ---- /dev/null -+++ b/test/interoperability_with_c_c_call_fortran_scalar/007_c_call_fortran_procedure_pointer/run.sh -@@ -0,0 +1,16 @@ -+for i in {001..009} -+do -+echo "------- test $i ------." -+echo "----- gfortran result:" -+gcc c_main$i.c -c -o c-test.o -+gfortran fortran_func$i.f90 -fno-range-check -c -o fortran-test.o -+gfortran fortran-test.o c-test.o -+./a.out -+rm *.o a.out -+echo "----- flang-new result : " -+clang c_main$i.c -c -o c-test.o -+flang-new fortran_func$i.f90 -c -o fortran-test.o -+flang-new -flang-experimental-exec c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+done -\ No newline at end of file --- -2.25.1 - diff --git a/6-Add-test-cases-for-types.patch b/6-Add-test-cases-for-types.patch deleted file mode 100644 index 9e424fc5d5dd72d7515a5077b05bc2545c938cc9..0000000000000000000000000000000000000000 --- a/6-Add-test-cases-for-types.patch +++ /dev/null @@ -1,873 +0,0 @@ -commit 8dca32950ac1c1a677bcff46e67f01efa11fa123 -Author: MinchaoLiang -Date: Thu Oct 27 21:21:54 2022 +0800 - - Add test cases for types - -diff --git a/test/Semantics/0701_C729.f90 b/test/Semantics/0701_C729.f90 -new file mode 100644 -index 0000000..3e1f54c ---- /dev/null -+++ b/test/Semantics/0701_C729.f90 -@@ -0,0 +1,11 @@ -+! Test C729: A derived type type-name shall not be DOUBLEPRECISION or the same -+! as the name of any intrinsic type defined in this document. -+ -+program main -+ implicit none -+ !ERROR: A derived type name cannot be the name of an intrinsic type -+ type :: DOUBLEPRECISION -+ integer :: test -+ end type DOUBLEPRECISION -+ !ERROR: A derived type name cannot be the name of an intrinsic type -+end -\ No newline at end of file -diff --git a/test/Semantics/0702_C730_abstract.f90 b/test/Semantics/0702_C730_abstract.f90 -new file mode 100644 -index 0000000..3d124bc ---- /dev/null -+++ b/test/Semantics/0702_C730_abstract.f90 -@@ -0,0 +1,11 @@ -+! Test C730: The same type-attr-spec shall not appear more -+! than once in a given derived-type-stmt. -+ -+program main -+ implicit none -+ !WARNING: Attribute 'ABSTRACT' cannot be used more than once -+ type,abstract,abstract:: person -+ character(len=20) :: name -+ integer :: age -+ end type person -+end -\ No newline at end of file -diff --git a/test/Semantics/0703_C730_public.f90 b/test/Semantics/0703_C730_public.f90 -new file mode 100644 -index 0000000..00f982e ---- /dev/null -+++ b/test/Semantics/0703_C730_public.f90 -@@ -0,0 +1,12 @@ -+! Test C730: The same type-attr-spec shall not appear more -+! than once in a given derived-type-stmt. -+ -+program main -+ implicit none -+ !ERROR: PUBLIC attribute may only appear in the specification part of a module -+ !WARNING: Attribute 'PUBLIC' cannot be used more than once -+ type,public,public :: person -+ character(len=20) :: name -+ integer :: age -+ end type person -+end -\ No newline at end of file -diff --git a/test/Semantics/0704_C730_private.f90 b/test/Semantics/0704_C730_private.f90 -new file mode 100644 -index 0000000..70d72da ---- /dev/null -+++ b/test/Semantics/0704_C730_private.f90 -@@ -0,0 +1,12 @@ -+! Test C730: The same type-attr-spec shall not appear more -+! than once in a given derived-type-stmt. -+ -+program main -+ implicit none -+ !ERROR: PRIVATE attribute may only appear in the specification part of a module -+ !WARNING: Attribute 'PRIVATE' cannot be used more than once -+ type,private,private :: person -+ character(len=20) :: name -+ integer :: age -+ end type person -+end -\ No newline at end of file -diff --git a/test/Semantics/0705_C730_bind.f90 b/test/Semantics/0705_C730_bind.f90 -new file mode 100644 -index 0000000..baede1a ---- /dev/null -+++ b/test/Semantics/0705_C730_bind.f90 -@@ -0,0 +1,11 @@ -+! Test C730: The same type-attr-spec shall not appear more -+! than once in a given derived-type-stmt. -+ -+program main -+ implicit none -+ !WARNING: Attribute 'BIND(C)' cannot be used more than once -+ type,bind(C),bind(C) :: person -+ character(len=20) :: name -+ integer :: age -+ end type person -+end -\ No newline at end of file -diff --git a/test/Semantics/0706_C730_extends.f90 b/test/Semantics/0706_C730_extends.f90 -new file mode 100644 -index 0000000..af70d7d ---- /dev/null -+++ b/test/Semantics/0706_C730_extends.f90 -@@ -0,0 +1,14 @@ -+! Test C730: The same type-attr-spec shall not appear more -+! than once in a given derived-type-stmt. -+ -+program main -+ implicit none -+ type :: person -+ character :: name -+ integer :: age -+ end type person -+ !ERROR: Attribute 'EXTENDS' cannot be used more than once -+ type,extends(person),extends(person) :: woman -+ integer :: salary -+ end type woman -+end -\ No newline at end of file -diff --git a/test/Semantics/0707_C731.f90 b/test/Semantics/0707_C731.f90 -new file mode 100644 -index 0000000..5e68829 ---- /dev/null -+++ b/test/Semantics/0707_C731.f90 -@@ -0,0 +1,10 @@ -+! Test C731: The same type-param-name shall not appear -+! more than once in a given derived-type-stmt -+ -+program main -+ !ERROR: Duplicate type parameter name: 'dim' -+ type t(dim,dim) -+ integer, kind :: dim -+ real :: c(dim) -+ end type -+end -\ No newline at end of file -diff --git a/test/Semantics/0708_C732.f90 b/test/Semantics/0708_C732.f90 -new file mode 100644 -index 0000000..de325b4 ---- /dev/null -+++ b/test/Semantics/0708_C732.f90 -@@ -0,0 +1,10 @@ -+! Test C732: A parent-type-name shall be the name of a previously defined extensible type -+ -+program main -+ implicit none -+ !ERROR: Derived type 'man' not found -+ type,extends(man) :: person -+ character :: name -+ integer :: age -+ end type person -+end -\ No newline at end of file -diff --git a/test/Semantics/0709_C733_contains.f90 b/test/Semantics/0709_C733_contains.f90 -new file mode 100644 -index 0000000..e27750d ---- /dev/null -+++ b/test/Semantics/0709_C733_contains.f90 -@@ -0,0 +1,17 @@ -+! Test C733: If the type definition contains or inherits a deferred -+! type-bound procedure, ABSTRACT shall appear -+ -+program main -+ implicit none -+ type :: t -+ contains -+ !ERROR: Procedure bound to non-ABSTRACT derived type 'abstract_t' may not be DEFERRED -+ procedure(s), pass, deferred :: foo -+ end type -+ abstract interface -+ subroutine s(this) -+ import :: t -+ class(t),intent(in)::this -+ end subroutine s -+ end interface -+end -\ No newline at end of file -diff --git a/test/Semantics/0710_C733_inherits.f90 b/test/Semantics/0710_C733_inherits.f90 -new file mode 100644 -index 0000000..e471aa8 ---- /dev/null -+++ b/test/Semantics/0710_C733_inherits.f90 -@@ -0,0 +1,19 @@ -+! Test C733: If the type definition contains or inherits a deferred -+! type-bound procedure, ABSTRACT shall appear -+program main -+ implicit none -+ type,abstract :: t -+ contains -+ procedure(s), pass, deferred :: f -+ end type -+ ! ERROR: Non-ABSTRACT extension of ABSTRACT derived type 't' lacks a binding for DEFERRED procedure 'f' -+ type,extends(t) :: as -+ real :: x -+ end type -+ abstract interface -+ subroutine s(this) -+ import :: t -+ class(t),intent(in)::this -+ end subroutine s -+ end interface -+end -\ No newline at end of file -diff --git a/test/Semantics/0711_C734_abstract.f90 b/test/Semantics/0711_C734_abstract.f90 -new file mode 100644 -index 0000000..f1334ba ---- /dev/null -+++ b/test/Semantics/0711_C734_abstract.f90 -@@ -0,0 +1,11 @@ -+! Test C734: If ABSTRACT appears, the type shall be extensible -+ -+program main -+ implicit none -+ ! ERROR: An ABSTRACT derived type must be extensible -+ type,abstract :: t -+ sequence -+ integer :: i -+ real :: r -+ end type -+end -\ No newline at end of file -diff --git a/test/Semantics/0712_C734_parent.f90 b/test/Semantics/0712_C734_parent.f90 -new file mode 100644 -index 0000000..b7f5783 ---- /dev/null -+++ b/test/Semantics/0712_C734_parent.f90 -@@ -0,0 +1,14 @@ -+! Test C734: If ABSTRACT appears, the type shall be extensible. -+ -+program main -+ implicit none -+ type:: t -+ sequence -+ integer :: i -+ real :: r -+ end type -+ ! ERROR: The parent type is not extensible -+ type,extends(t)::test -+ real :: v -+ end type -+end -\ No newline at end of file -diff --git a/test/Semantics/0713_C735.f90 b/test/Semantics/0713_C735.f90 -new file mode 100644 -index 0000000..c99cf66 ---- /dev/null -+++ b/test/Semantics/0713_C735.f90 -@@ -0,0 +1,14 @@ -+! Test C735: If EXTENDS appears, SEQUENCE shall not appear. -+ -+program main -+ implicit none -+ type:: t -+ integer :: i -+ real :: r -+ end type -+ ! ERROR: A sequence type may not have the EXTENDS attribute -+ type,extends(t)::test -+ sequence -+ real :: va -+ end type -+end -\ No newline at end of file -diff --git a/test/Semantics/0714_C738_private.f90 b/test/Semantics/0714_C738_private.f90 -new file mode 100644 -index 0000000..837393a ---- /dev/null -+++ b/test/Semantics/0714_C738_private.f90 -@@ -0,0 +1,17 @@ -+! Test C738: The same private-or-sequence shall not -+! appear more than once in a given derived-type-def. -+ -+module types -+ implicit none -+ type :: t -+ ! WARNING: PRIVATE may not appear more than once in derived type components -+ private -+ private -+ integer :: i -+ real :: r -+ end type -+end module types -+program main -+use types -+implicit none -+end -\ No newline at end of file -diff --git a/test/Semantics/0715_C738_sequence.f90 b/test/Semantics/0715_C738_sequence.f90 -new file mode 100644 -index 0000000..d5a50bc ---- /dev/null -+++ b/test/Semantics/0715_C738_sequence.f90 -@@ -0,0 +1,17 @@ -+! Test C738: The same private-or-sequence shall not -+! appear more than once in a given derived-type-def. -+ -+module types -+ implicit none -+ type :: t -+ ! WARNING: SEQUENCE may not appear more than once in derived type components -+ sequence -+ sequence -+ integer :: i -+ real :: r -+ end type -+end module types -+program main -+use types -+implicit none -+end -\ No newline at end of file -diff --git a/test/Semantics/0716_C739.f90 b/test/Semantics/0716_C739.f90 -new file mode 100644 -index 0000000..5ee1bcf ---- /dev/null -+++ b/test/Semantics/0716_C739.f90 -@@ -0,0 +1,12 @@ -+! Test C739: If END TYPE is followed by a type-name, the type-name shall be -+! the same as that in the corresponding derived-type-stmt. -+ -+program main -+ implicit none -+ ! ERROR: derived type definition name mismatch -+ type :: t -+ sequence -+ integer :: i -+ real :: r -+ end type a -+end -\ No newline at end of file -diff --git a/test/Semantics/0717_C740_one.f90 b/test/Semantics/0717_C740_one.f90 -new file mode 100644 -index 0000000..fd24386 ---- /dev/null -+++ b/test/Semantics/0717_C740_one.f90 -@@ -0,0 +1,11 @@ -+! Test C740: If SEQUENCE appears, the type shall have at least one component, each data component -+! shall be declared to be of an intrinsic type or of a sequence type, the derived type shall not have -+! any type parameter, and a type-bound-procedure-part shall not appear. -+ -+program main -+ implicit none -+ ! ERROR: A sequence type must have at least one component -+ type :: t -+ sequence -+ end type -+end -\ No newline at end of file -diff --git a/test/Semantics/0718_C740_sequence.f90 b/test/Semantics/0718_C740_sequence.f90 -new file mode 100644 -index 0000000..eecf5ce ---- /dev/null -+++ b/test/Semantics/0718_C740_sequence.f90 -@@ -0,0 +1,22 @@ -+! Test C740: If SEQUENCE appears, the type shall have at least one component, each data component -+! shall be declared to be of an intrinsic type or of a sequence type, the derived type shall not have -+! any type parameter, and a type-bound-procedure-part shall not appear. -+ -+program main -+ implicit none -+ type,abstract :: t -+ sequence -+ real :: r -+ ! ERROR: A sequence type may not have a CONTAINS statement -+ contains -+ ! ERROR: Passed-object dummy argument 'this' of procedure 'f' may not be polymorphic because 't' is not extensible -+ procedure(s), PASS, deferred :: f -+ end type -+ abstract interface -+ subroutine s(this) -+ import :: t -+ ! ERROR: Non-extensible derived type 't' may not be used with CLASS keyword -+ class(t),intent(in)::this -+ end subroutine s -+ end interface -+end -\ No newline at end of file -diff --git a/test/Semantics/0719_C741.f90 b/test/Semantics/0719_C741.f90 -new file mode 100644 -index 0000000..f4cb2c4 ---- /dev/null -+++ b/test/Semantics/0719_C741.f90 -@@ -0,0 +1,11 @@ -+! Test C741: A type-param-name in a type-param-def-stmt in a derived-type-def shall be one -+! of the type-param-names in the derived-type-stmt of that derived-type-def. -+ -+program main -+implicit none -+ ! ERROR: No definition found for type parameter 'a' -+ type matrix(k,d,a) -+ integer,kind:: k -+ integer,len:: d -+ end type -+end -\ No newline at end of file -diff --git a/test/Semantics/0720_C742_noDef.f90 b/test/Semantics/0720_C742_noDef.f90 -new file mode 100644 -index 0000000..6ed282d ---- /dev/null -+++ b/test/Semantics/0720_C742_noDef.f90 -@@ -0,0 +1,10 @@ -+! Test C742: Each type-param-name in the derived-type-stmt in a derived-type-def shall -+! appear exactly once as a type-param-name in a type-param-def-stmt in that derived-type-def. -+ -+program main -+ implicit none -+ ! ERROR: No definition found for type parameter 'd' -+ type matrix(k,d) -+ integer,kind:: k -+ end type -+end -\ No newline at end of file -diff --git a/test/Semantics/0721_C742_defTwice.f90 b/test/Semantics/0721_C742_defTwice.f90 -new file mode 100644 -index 0000000..5a587bc ---- /dev/null -+++ b/test/Semantics/0721_C742_defTwice.f90 -@@ -0,0 +1,12 @@ -+! Test C742: Each type-param-name in the derived-type-stmt in a derived-type-def shall -+! appear exactly once as a type-param-name in a type-param-def-stmt in that derived-type-def. -+ -+program main -+ implicit none -+ ! ERROR: Type parameter, component, or procedure binding 'k' already defined in this type -+ type matrix(k,d) -+ integer,kind :: k -+ integer,len :: d -+ integer,len :: k -+ end type -+end -\ No newline at end of file -diff --git a/test/Semantics/0722_C743_public.f90 b/test/Semantics/0722_C743_public.f90 -new file mode 100644 -index 0000000..f0b05c9 ---- /dev/null -+++ b/test/Semantics/0722_C743_public.f90 -@@ -0,0 +1,16 @@ -+! Test C743: No component-attr-spec shall appear more -+! than once in a given component-def-stmt. -+ -+module types -+ implicit none -+ type :: t -+ ! WARNING: Attribute 'PUBLIC' cannot be used more than once -+ private -+ integer,public,public :: i -+ REAL :: r -+ end type -+end module types -+program main -+ use types -+ implicit none -+end -\ No newline at end of file -diff --git a/test/Semantics/0723_C743_private.f90 b/test/Semantics/0723_C743_private.f90 -new file mode 100644 -index 0000000..b0be948 ---- /dev/null -+++ b/test/Semantics/0723_C743_private.f90 -@@ -0,0 +1,15 @@ -+! Test C743: No component-attr-spec shall appear more -+! than once in a given component-def-stmt. -+ -+module types -+ implicit none -+ type :: t -+ ! WARNING: Attribute 'PRIVATE' cannot be used more than once -+ integer,private,private :: i -+ REAL :: r -+ end type -+end module types -+program main -+ use types -+ implicit none -+end -\ No newline at end of file -diff --git a/test/Semantics/0724_C743_allocatable.f90 b/test/Semantics/0724_C743_allocatable.f90 -new file mode 100644 -index 0000000..ac3d9b7 ---- /dev/null -+++ b/test/Semantics/0724_C743_allocatable.f90 -@@ -0,0 +1,15 @@ -+! Test C743: No component-attr-spec shall appear more -+! than once in a given component-def-stmt. -+ -+module types -+ implicit none -+ type :: t -+ ! WARNING: Attribute 'ALLOCATABLE' cannot be used more than once -+ integer,allocatable,allocatable :: i -+ real :: r -+ end type -+end module types -+program main -+ use types -+ implicit none -+end -\ No newline at end of file -diff --git a/test/Semantics/0725_C743_codimension.f90 b/test/Semantics/0725_C743_codimension.f90 -new file mode 100644 -index 0000000..5239acd ---- /dev/null -+++ b/test/Semantics/0725_C743_codimension.f90 -@@ -0,0 +1,14 @@ -+! Test C743: No component-attr-spec shall appear more -+! than once in a given component-def-stmt. -+ -+module types -+ implicit none -+ type :: t -+ ! ERROR: Attribute 'CODIMENSION' cannot be used more than once -+ real,allocatable,codimension [:,:,:],codimension [:,:,:] :: g(:,:,:) -+ end type -+end module types -+program main -+ use types -+ implicit none -+end -\ No newline at end of file -diff --git a/test/Semantics/0726_C743_contiguous.f90 b/test/Semantics/0726_C743_contiguous.f90 -new file mode 100644 -index 0000000..ba88828 ---- /dev/null -+++ b/test/Semantics/0726_C743_contiguous.f90 -@@ -0,0 +1,14 @@ -+! Test C743: No component-attr-spec shall appear more -+! than once in a given component-def-stmt. -+ -+module types -+ implicit none -+ type :: t -+ ! WARNING: Attribute 'CONTIGUOUS' cannot be used more than once -+ real,pointer,contiguous,contiguous :: g(:) -+ end type -+end module types -+program main -+ use types -+ implicit none -+end -\ No newline at end of file -diff --git a/test/Semantics/0727_C743_pointer.f90 b/test/Semantics/0727_C743_pointer.f90 -new file mode 100644 -index 0000000..49e01ab ---- /dev/null -+++ b/test/Semantics/0727_C743_pointer.f90 -@@ -0,0 +1,14 @@ -+! Test C743: No component-attr-spec shall appear more -+! than once in a given component-def-stmt. -+ -+module types -+ implicit none -+ type :: t -+ ! WARNING: Attribute 'POINTER' cannot be used more than once -+ real,pointer,contiguous,pointer :: g(:) -+ end type -+end module types -+program main -+ use types -+ implicit none -+end -\ No newline at end of file -diff --git a/test/Semantics/0728_C743_dimension.f90 b/test/Semantics/0728_C743_dimension.f90 -new file mode 100644 -index 0000000..303ae2b ---- /dev/null -+++ b/test/Semantics/0728_C743_dimension.f90 -@@ -0,0 +1,14 @@ -+! Test C743: No component-attr-spec shall appear more -+! than once in a given component-def-stmt. -+ -+module types -+ implicit none -+ type :: t -+ ! ERROR: Attribute 'DIMENSION' cannot be used more than once -+ real,dimension(2,2),dimension(2,2) :: g -+ end type -+end module types -+program main -+ use types -+ implicit none -+end -\ No newline at end of file -diff --git a/test/Semantics/0729_C744.f90 b/test/Semantics/0729_C744.f90 -new file mode 100644 -index 0000000..884df94 ---- /dev/null -+++ b/test/Semantics/0729_C744.f90 -@@ -0,0 +1,15 @@ -+! Test C744: If neither the POINTER nor the ALLOCATABLE attribute is -+! specified, the declaration-type-spec in the component-def-stmt shall -+! specify an intrinsic type or a previously defined derived type. -+ -+module types -+ implicit none -+ type :: t -+ ! ERROR: CLASS entity 'g' must be a dummy argument or have ALLOCATABLE or POINTER attribute -+ class(*) :: g -+ end type -+end module types -+program main -+ use types -+ implicit none -+end -\ No newline at end of file -diff --git a/test/Semantics/0730_C745_array.f90 b/test/Semantics/0730_C745_array.f90 -new file mode 100644 -index 0000000..dda723d ---- /dev/null -+++ b/test/Semantics/0730_C745_array.f90 -@@ -0,0 +1,14 @@ -+! Test C745: If the POINTER or ALLOCATABLE attribute is specified, -+! each component-array-spec shall be a deferred-shape-spec-list. -+ -+module types -+ implicit none -+ type :: t -+ ! ERROR: Array pointer component 'g' must have deferred shape -+ real,pointer :: g(5) -+ end type -+end module types -+program main -+ use types -+ implicit none -+end -\ No newline at end of file -diff --git a/test/Semantics/0731_C745_allocatable.f90 b/test/Semantics/0731_C745_allocatable.f90 -new file mode 100644 -index 0000000..b5f4257 ---- /dev/null -+++ b/test/Semantics/0731_C745_allocatable.f90 -@@ -0,0 +1,14 @@ -+! Test C745: If the POINTER or ALLOCATABLE attribute is specified, -+! each component-array-spec shall be a deferred-shape-spec-list. -+ -+module types -+ implicit none -+ type :: t -+ ! ERROR: Allocatable array component 'g' must have deferred shape -+ real,allocatable :: g(5) -+ end type -+end module types -+program main -+ use types -+ implicit none -+end -\ No newline at end of file -diff --git a/test/Semantics/0732_C746_explicit.f90 b/test/Semantics/0732_C746_explicit.f90 -new file mode 100644 -index 0000000..a837325 ---- /dev/null -+++ b/test/Semantics/0732_C746_explicit.f90 -@@ -0,0 +1,14 @@ -+! Test C746: If a coarray-spec appears, it shall be a deferred-coshape-spec-list \ -+! and the component shall have the ALLOCATABLE attribute. -+ -+module types -+ implicit none -+ type :: t -+ ! ERROR: 'g' is an ALLOCATABLE coarray and must have a deferred coshape -+ real,allocatable :: g[5:*] -+ end type -+end module types -+program main -+ use types -+ implicit none -+end -\ No newline at end of file -diff --git a/test/Semantics/0733_C746_noAlloc.f90 b/test/Semantics/0733_C746_noAlloc.f90 -new file mode 100644 -index 0000000..7f47456 ---- /dev/null -+++ b/test/Semantics/0733_C746_noAlloc.f90 -@@ -0,0 +1,14 @@ -+! Test C746: If a coarray-spec appears, it shall be a deferred-coshape-spec-list \ -+! and the component shall have the ALLOCATABLE attribute. -+ -+module types -+ implicit none -+ type :: t -+ ! ERROR: Component 'g' is a coarray and must have the ALLOCATABLE attribute and have a deferred coshape -+ real :: g[5:*] -+ end type -+end module types -+program main -+ use types -+ implicit none -+end -\ No newline at end of file -diff --git a/test/Semantics/0735_C747_ptr.f90 b/test/Semantics/0735_C747_ptr.f90 -new file mode 100644 -index 0000000..341c64a ---- /dev/null -+++ b/test/Semantics/0735_C747_ptr.f90 -@@ -0,0 +1,16 @@ -+! Test C747: If a coarray-spec appears, the component shall not be of -+! type C_PTR or C_FUNPTR from the intrinsic module ISO_C_BINDING (18.2), -+! or of type TEAM_TYPE from the intrinsic module ISO_FORTRAN_ENV (16.10.2). -+ -+module types -+ use, intrinsic :: iso_c_binding -+ ! ERROR: A derived type with the BIND attribute cannot have a pointer or allocatable component -+ type, bind(c) :: t -+ ! ERROR: Coarray 's' may not have type TEAM_TYPE, C_PTR, or C_FUNPTR -+ type(c_ptr),allocatable :: s[:] -+ end type -+end module types -+program main -+ use types -+ implicit none -+end -\ No newline at end of file -diff --git a/test/Semantics/0736_C747_funptr.f90 b/test/Semantics/0736_C747_funptr.f90 -new file mode 100644 -index 0000000..51d4d25 ---- /dev/null -+++ b/test/Semantics/0736_C747_funptr.f90 -@@ -0,0 +1,16 @@ -+! Test C747: If a coarray-spec appears, the component shall not be of -+! type C_PTR or C_FUNPTR from the intrinsic module ISO_C_BINDING (18.2), -+! or of type TEAM_TYPE from the intrinsic module ISO_FORTRAN_ENV (16.10.2). -+ -+module types -+ use, intrinsic :: iso_c_binding -+ ! ERROR: A derived type with the BIND attribute cannot have a pointer or allocatable component -+ type, bind(c) :: t -+ ! ERROR: Coarray 's' may not have type TEAM_TYPE, C_PTR, or C_FUNPTR -+ type(c_funptr),allocatable :: s[:] -+ end type -+end module types -+program main -+ use types -+ implicit none -+end -\ No newline at end of file -diff --git a/test/Semantics/0737_C747_team.f90 b/test/Semantics/0737_C747_team.f90 -new file mode 100644 -index 0000000..124ddf2 ---- /dev/null -+++ b/test/Semantics/0737_C747_team.f90 -@@ -0,0 +1,16 @@ -+! Test C747: If a coarray-spec appears, the component shall not be of -+! type C_PTR or C_FUNPTR from the intrinsic module ISO_C_BINDING (18.2), -+! or of type TEAM_TYPE from the intrinsic module ISO_FORTRAN_ENV (16.10.2). -+ -+module types -+ use, intrinsic :: iso_fortran_env -+ ! ERROR: Component 's' is a coarray and must have the ALLOCATABLE attribute -+ type :: t -+ ! ERROR: Coarray 's' may not have type TEAM_TYPE, C_PTR, or C_FUNPTR -+ type(team_type):: s[:] -+ end type -+end module types -+program main -+ use types -+ implicit none -+end -\ No newline at end of file -diff --git a/test/Semantics/0738_C749.f90 b/test/Semantics/0738_C749.f90 -new file mode 100644 -index 0000000..203abf7 ---- /dev/null -+++ b/test/Semantics/0738_C749.f90 -@@ -0,0 +1,14 @@ -+! Test C749: If neither the POINTER nor the ALLOCATABLE attribute is specified, -+! each component-array-spec shall be an explicit-shape-spec-list. -+ -+module types -+ implicit none -+ type :: t -+ ! ERROR: Component array 's' without ALLOCATABLE or POINTER attribute must have explicit shape -+ real :: s(:) -+ end type -+end module types -+program main -+ use types -+ implicit none -+end -\ No newline at end of file -diff --git a/test/Semantics/0739_C750.f90 b/test/Semantics/0739_C750.f90 -new file mode 100644 -index 0000000..7eb4a19 ---- /dev/null -+++ b/test/Semantics/0739_C750.f90 -@@ -0,0 +1,21 @@ -+! Test C750: Each bound in the explicit-shape-spec shall be a specification expression in which there are no ref- -+! erences to specification functions or the intrinsic functions ALLOCATED, ASSOCIATED, EXTENDS_- -+! TYPE_OF, PRESENT, or SAME_TYPE_AS, every specification inquiry reference is a constant ex- -+! pression, and the value does not depend on the value of a variable. -+ -+module types -+ type t1 -+ real c -+ end type -+ type, extends(t1) :: t2 -+ end type -+ class(t1),pointer :: p,q -+ type :: mt -+ ! ERROR: Invalid specification expression: reference to impure function 'c_sizeof' -+ real :: s(int(c_sizeof(same_type_of(p,q))),8) -+ end type -+end module -+program main -+ use types -+ implicit none -+end -\ No newline at end of file -diff --git a/test/Semantics/0740_C751.f90 b/test/Semantics/0740_C751.f90 -new file mode 100644 -index 0000000..92afdbc ---- /dev/null -+++ b/test/Semantics/0740_C751.f90 -@@ -0,0 +1,13 @@ -+! Test C751: A component shall not have both the ALLOCATABLE and POINTER attributes. -+ -+module types -+ type :: mt -+ ! ERROR: 's' may not have both the POINTER and ALLOCATABLE attributes -+ ! ERROR: 's' may not have the POINTER attribute because it is a coarray -+ real,allocatable,pointer :: s[:] -+ end type -+end module -+program main -+ use types -+ implicit none -+end -\ No newline at end of file -diff --git a/test/Semantics/result.md b/test/Semantics/result-07.md -new file mode 100644 -index 0000000..33775be ---- /dev/null -+++ b/test/Semantics/result.md -@@ -0,0 +1,41 @@ -+| Constraint | flang-new | gfortran | ifort | -+| :--------------: | :-------: | :------: | :---: | -+| C729 | ERROR | ERROR | ERROR | -+| C730 abstract | WARNING | ERROR | ERROR | -+| C730 public | WARNING | ERROR | ERROR | -+| C730 private | WARNING | ERROR | ERROR | -+| C730 bind | WARNING | ERROR | ERROR | -+| C730 extends | ERROR | ERROR | ERROR | -+| C731 | ERROR | ERROR | OK | -+| C732 | ERROR | ERROR | ERROR | -+| C733 contains | ERROR | ERROR | ERROR | -+| C733 inherits | ERROR | ERROR | ERROR | -+| C734 abstract | ERROR | ERROR | ERROR | -+| C734 parent | ERROR | ERROR | ERROR | -+| C735 | ERROR | ERROR | ERROR | -+| C738 private | WARNING | ERROR | ERROR | -+| C738 sequence | WARNING | ERROR | ERROR | -+| C739 | ERROR | ERROR | ERROR | -+| C740 one | ERROR | OK | OK | -+| C740 sequence | ERROR | ERROR | ERROR | -+| C741 | ERROR | ERROR | ERROR | -+| C742 noDef | ERROR | ERROR | ERROR | -+| C742 defTwice | ERROR | ERROR | ERROR | -+| C743 public | WARNING | ERROR | ERROR | -+| C743 private | WARNING | ERROR | ERROR | -+| C743 allocatable | WARNING | ERROR | ERROR | -+| C743 codimension | ERROR | ERROR | ERROR | -+| C743 contiguous | WARNING | ERROR | ERROR | -+| C743 pointer | WARNING | ERROR | ERROR | -+| C743 dimension | WARNING | ERROR | ERROR | -+| C744 | ERROR | ERROR | ERROR | -+| C745 array | ERROR | ERROR | ERROR | -+| C745 allocatable | ERROR | ERROR | ERROR | -+| C746 explicit | ERROR | ERROR | ERROR | -+| C746 noAlloc | ERROR | ERROR | ERROR | -+| C747 ptr | ERROR | ERROR | ERROR | -+| C747 funptr | ERROR | ERROR | ERROR | -+| C747 team | ERROR | ERROR | ERROR | -+| C749 | ERROR | ERROR | ERROR | -+| C750 | ERROR | ERROR | ERROR | -+| C751 | ERROR | ERROR | ERROR | diff --git a/7-add-test-cases-for-attribute-declarations-and-specifications.patch b/7-add-test-cases-for-attribute-declarations-and-specifications.patch deleted file mode 100644 index ee85d5245359fa66c894a0c7049fdbd22d452e98..0000000000000000000000000000000000000000 --- a/7-add-test-cases-for-attribute-declarations-and-specifications.patch +++ /dev/null @@ -1,681 +0,0 @@ -commit 3760ea44978bcd3113d7e0395f949aeffe16ce5d -Author: wzw -Date: Thu Oct 27 21:50:17 2022 +0800 - - [flang] Add test cases for attribute declarations and specifications - - Add test cases for attribute declarations and specifications - -diff --git a/test/Semantics/0801_C801_allocatable.f90 b/test/Semantics/0801_C801_allocatable.f90 -new file mode 100644 -index 0000000..1ba4de9 ---- /dev/null -+++ b/test/Semantics/0801_C801_allocatable.f90 -@@ -0,0 +1,9 @@ -+! RUN: %python %S/test_errors.py %s %flang_fc1 -+! Test C801: The same attr-spec shall not appear more than once in a given -+! type-declaration-stmt. -+ -+program main -+ implicit none -+ ! WARNING: Attribute 'ALLOCATABLE' cannot be used more than once -+ real, allocatable, allocatable :: darray(:) -+end program main -diff --git a/test/Semantics/0802_C801_contiguous.f90 b/test/Semantics/0802_C801_contiguous.f90 -new file mode 100644 -index 0000000..935d513 ---- /dev/null -+++ b/test/Semantics/0802_C801_contiguous.f90 -@@ -0,0 +1,8 @@ -+! RUN: %python %S/test_errors.py %s %flang_fc1 -+! Test C801: The same attr-spec shall not appear more than once in a given -+! type-declaration-stmt. -+ -+program main -+ ! WARNING: Attribute 'CONTIGUOUS' cannot be used more than once -+ integer, contiguous, contiguous, pointer :: a(:) -+end program main -diff --git a/test/Semantics/0803_C801_dimension.f90 b/test/Semantics/0803_C801_dimension.f90 -new file mode 100644 -index 0000000..dff6365 ---- /dev/null -+++ b/test/Semantics/0803_C801_dimension.f90 -@@ -0,0 +1,8 @@ -+! RUN: %python %S/test_errors.py %s %flang_fc1 -+! Test C801: The same attr-spec shall not appear more than once in a given -+! type-declaration-stmt. -+ -+SUBROUTINE SUB(I,M) -+ ! ERROR: Attribute 'DIMENSION' cannot be used more than once -+ INTEGER, ALLOCATABLE, DIMENSION(:,:), DIMENSION(:,:) :: A -+END SUBROUTINE -diff --git a/test/Semantics/0804_C801_external.f90 b/test/Semantics/0804_C801_external.f90 -new file mode 100644 -index 0000000..50d8b83 ---- /dev/null -+++ b/test/Semantics/0804_C801_external.f90 -@@ -0,0 +1,8 @@ -+! RUN: %python %S/test_errors.py %s %flang_fc1 -+! Test C801: The same attr-spec shall not appear more than once in a given -+! type-declaration-stmt. -+ -+subroutine test() -+ ! WARNING: Attribute 'EXTERNAL' cannot be used more than once -+ real, external, external :: func -+end subroutine -diff --git a/test/Semantics/0805_C801_intent.f90 b/test/Semantics/0805_C801_intent.f90 -new file mode 100644 -index 0000000..b8ebb8c ---- /dev/null -+++ b/test/Semantics/0805_C801_intent.f90 -@@ -0,0 +1,8 @@ -+! RUN: %python %S/test_errors.py %s %flang_fc1 -+! Test C801: The same attr-spec shall not appear more than once in a given -+! type-declaration-stmt. -+ -+subroutine test(a) -+ ! WARNING: Attribute 'INTENT(IN)' cannot be used more than once -+ real, intent(in), intent(in) :: a -+end subroutine -diff --git a/test/Semantics/0806_C801_intrinsic.f90 b/test/Semantics/0806_C801_intrinsic.f90 -new file mode 100644 -index 0000000..da84f4a ---- /dev/null -+++ b/test/Semantics/0806_C801_intrinsic.f90 -@@ -0,0 +1,8 @@ -+! RUN: %python %S/test_errors.py %s %flang_fc1 -+! Test C801: The same attr-spec shall not appear more than once in a given -+! type-declaration-stmt. -+ -+subroutine test() -+ ! WARNING: Attribute 'INTRINSIC' cannot be used more than once -+ real, intrinsic, intrinsic :: sin -+end subroutine -diff --git a/test/Semantics/0807_C801_optional.f90 b/test/Semantics/0807_C801_optional.f90 -new file mode 100644 -index 0000000..8f80c36 ---- /dev/null -+++ b/test/Semantics/0807_C801_optional.f90 -@@ -0,0 +1,8 @@ -+! RUN: %python %S/test_errors.py %s %flang_fc1 -+! Test C801: The same attr-spec shall not appear more than once in a given -+! type-declaration-stmt. -+ -+subroutine test(a) -+ ! WARNING: Attribute 'OPTIONAL' cannot be used more than once -+ real, optional, optional ::a -+end subroutine -diff --git a/test/Semantics/0808_C801_parameter.f90 b/test/Semantics/0808_C801_parameter.f90 -new file mode 100644 -index 0000000..90493af ---- /dev/null -+++ b/test/Semantics/0808_C801_parameter.f90 -@@ -0,0 +1,8 @@ -+! RUN: %python %S/test_errors.py %s %flang_fc1 -+! Test C801: The same attr-spec shall not appear more than once in a given -+! type-declaration-stmt. -+ -+subroutine test() -+ ! WARNING: Attribute 'PARAMETER' cannot be used more than once -+ real, parameter, parameter :: two = 2.0 -+end subroutine -diff --git a/test/Semantics/0809_C801_pointer.f90 b/test/Semantics/0809_C801_pointer.f90 -new file mode 100644 -index 0000000..d9223fa ---- /dev/null -+++ b/test/Semantics/0809_C801_pointer.f90 -@@ -0,0 +1,8 @@ -+! RUN: %python %S/test_errors.py %s %flang_fc1 -+! Test C801: The same attr-spec shall not appear more than once in a given -+! type-declaration-stmt. -+ -+subroutine test() -+ ! WARNING: Attribute 'POINTER' cannot be used more than once -+ integer, pointer, pointer :: ptr -+end subroutine -diff --git a/test/Semantics/0810_C801_protected.f90 b/test/Semantics/0810_C801_protected.f90 -new file mode 100644 -index 0000000..f4a607f ---- /dev/null -+++ b/test/Semantics/0810_C801_protected.f90 -@@ -0,0 +1,8 @@ -+! RUN: %python %S/test_errors.py %s %flang_fc1 -+! Test C801: The same attr-spec shall not appear more than once in a given -+! type-declaration-stmt. -+ -+subroutine test() -+ ! WARNING: Attribute 'PROTECTED' cannot be used more than once -+ integer, protected, protected :: val -+end subroutine -diff --git a/test/Semantics/0811_C801_save.f90 b/test/Semantics/0811_C801_save.f90 -new file mode 100644 -index 0000000..9d28281 ---- /dev/null -+++ b/test/Semantics/0811_C801_save.f90 -@@ -0,0 +1,8 @@ -+! RUN: %python %S/test_errors.py %s %flang_fc1 -+! Test C801: The same attr-spec shall not appear more than once in a given -+! type-declaration-stmt. -+ -+subroutine test() -+ ! WARNING: Attribute 'SAVE' cannot be used more than once -+ integer, save, save :: a -+end subroutine -diff --git a/test/Semantics/0812_C801_target.f90 b/test/Semantics/0812_C801_target.f90 -new file mode 100644 -index 0000000..2be98d6 ---- /dev/null -+++ b/test/Semantics/0812_C801_target.f90 -@@ -0,0 +1,8 @@ -+! RUN: %python %S/test_errors.py %s %flang_fc1 -+! Test C801: The same attr-spec shall not appear more than once in a given -+! type-declaration-stmt. -+ -+subroutine test() -+ ! WARNING: Attribute 'TARGET' cannot be used more than once -+ real, target, target :: a -+end subroutine -diff --git a/test/Semantics/0813_C801_value.f90 b/test/Semantics/0813_C801_value.f90 -new file mode 100644 -index 0000000..8f92f23 ---- /dev/null -+++ b/test/Semantics/0813_C801_value.f90 -@@ -0,0 +1,8 @@ -+! RUN: %python %S/test_errors.py %s %flang_fc1 -+! Test C801: The same attr-spec shall not appear more than once in a given -+! type-declaration-stmt. -+ -+subroutine test(x) -+ ! WARNING: Attribute 'VALUE' cannot be used more than once -+ integer, value, value :: x -+end subroutine -diff --git a/test/Semantics/0814_C801_volatile.f90 b/test/Semantics/0814_C801_volatile.f90 -new file mode 100644 -index 0000000..9de25a4 ---- /dev/null -+++ b/test/Semantics/0814_C801_volatile.f90 -@@ -0,0 +1,8 @@ -+! RUN: %python %S/test_errors.py %s %flang_fc1 -+! Test C801: The same attr-spec shall not appear more than once in a given -+! type-declaration-stmt. -+ -+subroutine test() -+ ! WARNING: Attribute 'VOLATILE' cannot be used more than once -+ real, volatile, volatile :: a -+end subroutine -diff --git a/test/Semantics/0815_C802.f90 b/test/Semantics/0815_C802.f90 -new file mode 100644 -index 0000000..97508e8 ---- /dev/null -+++ b/test/Semantics/0815_C802.f90 -@@ -0,0 +1,11 @@ -+! RUN: %python %S/test_errors.py %s %flang_fc1 -+! Test C802: If a language-binding-spec with a NAME= specifier appears, the -+! entity-decl-list shall consist of a single entity-decl. -+ -+module m -+ type, bind(c) :: a -+ integer(4) :: j = -1 -+ end type a -+ ! ERROR: Two entities have the same BIND(C) name 'test' -+ type(a), bind(c, name="test") :: t1, t2 -+end -diff --git a/test/Semantics/0816_C803.f90 b/test/Semantics/0816_C803.f90 -new file mode 100644 -index 0000000..f92f57d ---- /dev/null -+++ b/test/Semantics/0816_C803.f90 -@@ -0,0 +1,15 @@ -+! RUN: %python %S/test_errors.py %s %flang_fc1 -+! Test C803: If a language-binding-spec is specified, the entity-decl-list -+! shall not contain any procedure names. -+ -+module m -+ integer, bind(c) :: test -+ contains -+ ! FATAL INTERNAL ERROR: bind name not allowed on this kind of symbol at -+ ! ./install-llvm-flang-f18/llvm-project/flang/lib/Semantics/symbol.cpp(326) -+ !PLEASE submit a bug report to -+ ! https://github.com/llvm/llvm-project/issues/ and include the crash backtrace. -+ ! Stack dump: -+ subroutine test -+ end -+end -diff --git a/test/Semantics/0817_C804.f90 b/test/Semantics/0817_C804.f90 -new file mode 100644 -index 0000000..0741c03 ---- /dev/null -+++ b/test/Semantics/0817_C804.f90 -@@ -0,0 +1,10 @@ -+! RUN: %python %S/test_errors.py %s %flang_fc1 -+! Test C804: If the entity is not of type character, * char-length shall not -+! appear. -+ -+program m -+ character :: c * 15 -+ ! ERROR: A length specifier cannot be used to declare the non-character entity 'd' -+ integer :: d * 15 -+ c = "abc" -+end -diff --git a/test/Semantics/0818_C805.f90 b/test/Semantics/0818_C805.f90 -new file mode 100644 -index 0000000..c106689 ---- /dev/null -+++ b/test/Semantics/0818_C805.f90 -@@ -0,0 +1,15 @@ -+! RUN: %python %S/test_errors.py %s %flang_fc1 -+! Test C805: A type-param-value in a char-length in an entity-decl shall be a -+! colon, asterisk, or specification expression. -+ -+program main -+ character :: a -+ character(len = 10) :: b -+ call test(b) -+contains -+ subroutine test(x) -+ character(len=*) :: x -+ ! ERROR: Must have INTEGER type, but is CHARACTER(KIND=1,LEN=3_8) -+ character('abc') :: y -+ end -+end program -diff --git a/test/Semantics/0819_C806.f90 b/test/Semantics/0819_C806.f90 -new file mode 100644 -index 0000000..81d537d ---- /dev/null -+++ b/test/Semantics/0819_C806.f90 -@@ -0,0 +1,8 @@ -+! RUN: %python %S/test_errors.py %s %flang_fc1 -+! Test C806: If initialization appears, a double-colon separator shall appear -+! before the entity-decl-list. -+ -+subroutine test() -+ ! ERROR: expected '::' -+ character(len=15) x = "aaaaa" -+end subroutine -diff --git a/test/Semantics/0820_C807.f90 b/test/Semantics/0820_C807.f90 -new file mode 100644 -index 0000000..4dedf0a ---- /dev/null -+++ b/test/Semantics/0820_C807.f90 -@@ -0,0 +1,8 @@ -+! RUN: %python %S/test_errors.py %s %flang_fc1 -+! Test C807: If the PARAMETER keyword appears, initialization shall appear in -+! each entity-decl. -+ -+subroutine test() -+ ! ERROR: Missing initialization for parameter 'y' -+ character(len=15), parameter :: x="aaaaa", y -+end subroutine -diff --git a/test/Semantics/0821_C808.f90 b/test/Semantics/0821_C808.f90 -new file mode 100644 -index 0000000..2ed4362 ---- /dev/null -+++ b/test/Semantics/0821_C808.f90 -@@ -0,0 +1,10 @@ -+! RUN: %python %S/test_errors.py %s %flang_fc1 -+! Test C808: An initialization shall not appear if object-name is a dummy -+! argument, a function result, an object in a named common block unless the type -+! declaration is in a block data program unit, an object in blank common, an -+! allocatable variable, or an automatic data object. -+ -+subroutine test(x) -+ ! ERROR: A dummy argument must not be initialized -+ integer(4) :: x = 10 -+end subroutine -diff --git a/test/Semantics/0822_C811.f90 b/test/Semantics/0822_C811.f90 -new file mode 100644 -index 0000000..6f530a8 ---- /dev/null -+++ b/test/Semantics/0822_C811.f90 -@@ -0,0 +1,10 @@ -+! RUN: %python %S/test_errors.py %s %flang_fc1 -+! Test C811: If => appears in initialization, the entity shall have the POINTER -+! attribute. If = appears in initialization, the entity shall not have the -+! POINTER attribute. -+ -+subroutine test() -+ integer, target :: t = 12 -+ ! ERROR: 'p' is a pointer but is not initialized like one -+ integer, pointer :: p = t -+end subroutine -diff --git a/test/Semantics/0823_C812.f90 b/test/Semantics/0823_C812.f90 -new file mode 100644 -index 0000000..fb6e17e ---- /dev/null -+++ b/test/Semantics/0823_C812.f90 -@@ -0,0 +1,9 @@ -+! RUN: %python %S/test_errors.py %s %flang_fc1 -+! Test C812: If initial-data-target appears, object-name shall be -+! data-pointer-initialization compatible with it (7.5.4.6) -+ -+subroutine test() -+ integer, target :: t = 12 -+ ! ERROR: Target type INTEGER(4) is not compatible with pointer type REAL(4) -+ real, pointer :: p => t -+end subroutine -diff --git a/test/Semantics/0824_C814.f90 b/test/Semantics/0824_C814.f90 -new file mode 100644 -index 0000000..ff0a810 ---- /dev/null -+++ b/test/Semantics/0824_C814.f90 -@@ -0,0 +1,10 @@ -+! RUN: %python %S/test_errors.py %s %flang_fc1 -+! Test C814: An automatic data object shall not have the SAVE attribute. -+ -+subroutine test(x, n, m) -+ ! ERROR: SAVE attribute may not be applied to dummy argument 'x' -+ integer, save :: x -+ integer, intent(in) :: n, m -+ ! ERROR: SAVE attribute may not be applied to automatic data object 'temp' -+ real, dimension(n,m), save :: temp -+end subroutine -diff --git a/test/Semantics/0825_C817.f90 b/test/Semantics/0825_C817.f90 -new file mode 100644 -index 0000000..ac6233c ---- /dev/null -+++ b/test/Semantics/0825_C817.f90 -@@ -0,0 +1,15 @@ -+! RUN: %python %S/test_errors.py %s %flang_fc1 -+! Test C817: An access-spec shall appear only in the specification-part of a -+! module. -+ -+module m -+private -+end -+program main -+! ERROR: PUBLIC statement may only appear in the specification part of a module -+public -+end -+subroutine s -+! ERROR: PRIVATE statement may only appear in the specification part of a module -+private -+end -diff --git a/test/Semantics/0826_C818.f90 b/test/Semantics/0826_C818.f90 -new file mode 100644 -index 0000000..fca8f08 ---- /dev/null -+++ b/test/Semantics/0826_C818.f90 -@@ -0,0 +1,26 @@ -+! RUN: %python %S/test_errors.py %s %flang_fc1 -+! Test C818: An entity with the BIND attribute shall be a common block, -+! variable, type, or! procedure. -+ -+subroutine test_sub() bind(c, name="test_sub") -+end subroutine -+ -+module test_variable -+ integer, bind(c, name="test_int") :: test_int -+end module test_variable -+ -+module test_type -+ type, bind(c) :: a -+ integer(4) :: j = -1 -+ end type a -+ type(a), bind(c, name="test") :: t -+end module test_type -+ -+program main -+ use, intrinsic :: iso_c_binding -+ integer(kind = c_int) :: a -+ real(kind = c_float) :: b -+ common /c/ a, b -+ save :: /c/ -+ bind(c, name="c") :: /c/ -+end program main -diff --git a/test/Semantics/0827_C819.f90 b/test/Semantics/0827_C819.f90 -new file mode 100644 -index 0000000..ffcd47c ---- /dev/null -+++ b/test/Semantics/0827_C819.f90 -@@ -0,0 +1,9 @@ -+! RUN: %python %S/test_errors.py %s %flang_fc1 -+! Test C819: A variable with the BIND attribute shall be declared in the -+! specification part of a module. -+ -+subroutine test() -+ ! ERROR: A variable with BIND(C) attribute may only appear in the specification part of a module -+ integer :: x -+ bind(c, name="x") :: x -+end subroutine -diff --git a/test/Semantics/0828_C822.f90 b/test/Semantics/0828_C822.f90 -new file mode 100644 -index 0000000..98ad273 ---- /dev/null -+++ b/test/Semantics/0828_C822.f90 -@@ -0,0 +1,12 @@ -+! RUN: %python %S/test_errors.py %s %flang_fc1 -+! Test C822: The sum of the rank and corank of an entity shall not exceed -+! fifteen. -+ -+subroutine test() -+ ! ERROR: 'a' has rank 16, which is greater than the maximum supported rank 15 -+ integer, dimension(2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2) :: a -+end subroutine -+ -+program main -+ call test() -+end program main -diff --git a/test/Semantics/0829_C830.f90 b/test/Semantics/0829_C830.f90 -new file mode 100644 -index 0000000..7ec3643 ---- /dev/null -+++ b/test/Semantics/0829_C830.f90 -@@ -0,0 +1,11 @@ -+! RUN: %python %S/test_errors.py %s %flang_fc1 -+! Test C830: An entity with the CONTIGUOUS attribute shall be an array pointer, -+! an assumed-shape array, or an assumed-rank dummy data object. -+ -+subroutine test(assumed_shape, assumed_rank) -+ integer, contiguous, pointer :: a(:) -+ integer, intent(in), contiguous, dimension(:) :: assumed_shape -+ integer, contiguous :: assumed_rank(..) -+ ! Do not raised any error. -+ integer, contiguous :: err_test -+end subroutine -diff --git a/test/Semantics/0830_C831.f90 b/test/Semantics/0830_C831.f90 -new file mode 100644 -index 0000000..da127bf ---- /dev/null -+++ b/test/Semantics/0830_C831.f90 -@@ -0,0 +1,15 @@ -+! RUN: %python %S/test_errors.py %s %flang_fc1 -+! Test C831: An explicit-shape-spec whose bounds are not constant expressions -+! shall appear only in a subprogram, derived type definition, BLOCK construct, -+! or interface body. -+ -+subroutine test(n) -+ integer :: n -+ integer, dimension(n, 10) :: a -+end subroutine -+ -+program main -+ integer :: i = 2 -+ ! ERROR: Invalid specification expression: reference to local entity 'i' -+ integer, dimension(i, 10) :: a -+end program main -diff --git a/test/Semantics/0831_C832.f90 b/test/Semantics/0831_C832.f90 -new file mode 100644 -index 0000000..99e20c0 ---- /dev/null -+++ b/test/Semantics/0831_C832.f90 -@@ -0,0 +1,13 @@ -+! RUN: %python %S/test_errors.py %s %flang_fc1 -+! Test C832: An array with the POINTER or ALLOCATABLE attribute shall have an array-spec that is a deferred-shape-spec-list. -+ -+subroutine test() -+ integer :: i = 2 -+ real, pointer, dimension(:) :: a -+ ! ERROR: Array pointer 'b' must have deferred shape or assumed rank -+ real, pointer, dimension(0 : 2) :: b -+ -+ real, allocatable :: c(:) -+ ! ERROR: Allocatable array 'd' must have deferred shape or assumed rank -+ real, allocatable :: d(0 : 2) -+end subroutine -diff --git a/test/Semantics/0832_C833.f90 b/test/Semantics/0832_C833.f90 -new file mode 100644 -index 0000000..5f49388 ---- /dev/null -+++ b/test/Semantics/0832_C833.f90 -@@ -0,0 +1,14 @@ -+! RUN: %python %S/test_errors.py %s %flang_fc1 -+! Test C833: An object whose array bounds are specified by an assumed-size-spec -+! shall be a dummy data object. -+ -+subroutine test(n) -+ integer :: n -+ integer :: m = 2 -+ -+ ! ERROR: Assumed-size array 'a' must be a dummy argument -+ integer, dimension(n, *) :: a -+ ! ERROR: Assumed-size array 'b' must be a dummy argument -+ ! ERROR: Invalid specification expression: reference to local entity 'm' -+ integer, dimension(m, *):: b -+end subroutine -diff --git a/test/Semantics/0833_C835.f90 b/test/Semantics/0833_C835.f90 -new file mode 100644 -index 0000000..26210bf ---- /dev/null -+++ b/test/Semantics/0833_C835.f90 -@@ -0,0 +1,11 @@ -+! RUN: %python %S/test_errors.py %s %flang_fc1 -+! Test C835: An object whose array bounds are specified by an -+! implied-shape-or-assumed-size-spec shall be a dummy data object or a named -+! constant. -+ -+subroutine test(a) -+ integer, dimension(*) :: a -+ integer, parameter :: b(*) = [1, 2, 3] -+ ! ERROR: Implied-shape array 'c' must be a named constant or a dummy argument -+ integer, dimension(*) :: c -+end subroutine -diff --git a/test/Semantics/0834_C836.f90 b/test/Semantics/0834_C836.f90 -new file mode 100644 -index 0000000..f0741d5 ---- /dev/null -+++ b/test/Semantics/0834_C836.f90 -@@ -0,0 +1,8 @@ -+! RUN: %python %S/test_errors.py %s %flang_fc1 -+! Test C836: An implied-shape array shall be a named constant. -+ -+subroutine test() -+ integer, parameter :: a(*) = [1,2,3] -+ ! ERROR: Missing initialization for parameter 'b' -+ integer, parameter :: b(*) -+end subroutine -diff --git a/test/Semantics/0835_C837.f90 b/test/Semantics/0835_C837.f90 -new file mode 100644 -index 0000000..dedf556 ---- /dev/null -+++ b/test/Semantics/0835_C837.f90 -@@ -0,0 +1,10 @@ -+! RUN: %python %S/test_errors.py %s %flang_fc1 -+! Test C837: An assumed-rank entity shall be a dummy data object that does not -+! have the CODIMENSION or VALUE attribute. -+ -+subroutine test(a) -+ integer, value :: a(..) -+ ! ERROR: Assumed-rank array 'b' must be a dummy argument -+ ! ERROR: VALUE attribute may apply only to a dummy argument -+ integer, value :: b(..) -+end subroutine -diff --git a/test/Semantics/0836_C840.f90 b/test/Semantics/0836_C840.f90 -new file mode 100644 -index 0000000..c7a2694 ---- /dev/null -+++ b/test/Semantics/0836_C840.f90 -@@ -0,0 +1,9 @@ -+! RUN: %python %S/test_errors.py %s %flang_fc1 -+! Test C840: An entity shall not have both the EXTERNAL attribute and the -+! INTRINSIC attribute. -+ -+program main -+ ! Do not raised any error! -+ real, external, intrinsic :: sin -+ real, external, intrinsic :: func -+end program main -diff --git a/test/Semantics/0837_C841.f90 b/test/Semantics/0837_C841.f90 -new file mode 100644 -index 0000000..b196541 ---- /dev/null -+++ b/test/Semantics/0837_C841.f90 -@@ -0,0 +1,9 @@ -+! RUN: %python %S/test_errors.py %s %flang_fc1 -+! Test C841: In an external subprogram, the EXTERNAL attribute shall not be -+! specified for a procedure defined by the subprogram. -+ -+subroutine test() -+ real :: func -+ ! ERROR: EXTERNAL attribute not allowed on 'test' -+ external test -+end subroutine -diff --git a/test/Semantics/0838_C842.f90 b/test/Semantics/0838_C842.f90 -new file mode 100644 -index 0000000..4948636 ---- /dev/null -+++ b/test/Semantics/0838_C842.f90 -@@ -0,0 +1,18 @@ -+! RUN: %python %S/test_errors.py %s %flang_fc1 -+! Test C842: In an interface body, the EXTERNAL attribute shall not be specified -+! for the procedure declared by the interface body. -+ -+module m -+ interface -+ real function func(x) -+ real, intent(in) :: x -+ real, external :: y -+ end function func -+ end interface -+ ! ERROR: EXTERNAL attribute not allowed on 'func' -+ external func -+end module -+ -+program main -+ use m -+end program main -diff --git a/test/Semantics/result-08.md b/test/Semantics/result-08.md -new file mode 100644 -index 0000000..8c81e9a ---- /dev/null -+++ b/test/Semantics/result-08.md -@@ -0,0 +1,40 @@ -+| Constraint | flang-new | gfortran | ifort | -+| :--------------- | :----- | :---- | :---- | -+| C801 allocatable | WARN | ERROR | ERROR | -+| C801 contiguous | WARN | ERROR | ERROR | -+| C801 dimension | ERROR | ERROR | ERROR | -+| C801 external | WARN | ERROR | ERROR | -+| C801 intent | WARN | ERROR | ERROR | -+| C801 intrinsic | WARN | ERROR | ERROR | -+| C801 optional | WARN | ERROR | ERROR | -+| C801 parameter | WARN | ERROR | ERROR | -+| C801 pointer | WARN | ERROR | ERROR | -+| C801 protected | WARN | ERROR | ERROR | -+| C801 save | WARN | ERROR | ERROR | -+| C801 target | WARN | ERROR | ERROR | -+| C801 value | WARN | ERROR | ERROR | -+| C801 volatile | WARN | ERROR | ERROR | -+| C802 | ERROR | ERROR | ERROR | -+| C803 | ICE | ERROR | ERROR | -+| C804 | ERROR | ERROR | ERROR | -+| C805 | ERROR | ERROR | ERROR in ‘program main'
OK in 'subroutine' | -+| C806 | ERROR | ERROR | ERROR | -+| C807 | ERROR | ERROR | ERROR | -+| C808 | ERROR | ERROR | ERROR | -+| C811 | ERROR | ERROR | ERROR | -+| C812 | ERROR | ERROR | ERROR | -+| C814 | ERROR | ERROR | ERROR | -+| C817 | ERROR | ERROR | ERROR | -+| C818 | OK | OK | OK | -+| C819 | ERROR | ERROR | ERROR | -+| C822 | ERROR | ERROR | OK | -+| C830 | OK | ERROR | ERROR | -+| C831 | ERROR | ERROR | ERROR | -+| C832 | ERROR | ERROR | ERROR | -+| C833 | ERROR | ERROR | ERROR | -+| C835 | ERROR | ERROR | ERROR | -+| C836 | ERROR | ERROR | ERROR | -+| C837 | ERROR | ERROR | ERROR | -+| C840 | OK | ERROR | ERROR | -+| C841 | ERROR | ERROR | ERROR | -+| C842 | ERROR | ERROR | ERROR | diff --git a/8-test-interoperability-with-c-fortran-call-c-array.patch b/8-test-interoperability-with-c-fortran-call-c-array.patch deleted file mode 100644 index 2e97306b0cbdeb388ce9d52b91506b1a865c236b..0000000000000000000000000000000000000000 --- a/8-test-interoperability-with-c-fortran-call-c-array.patch +++ /dev/null @@ -1,3066 +0,0 @@ -From ebc7950f1d916776bf8e785083df58caad184187 Mon Sep 17 00:00:00 2001 -From: xieyihui -Date: Fri, 18 Nov 2022 12:39:03 +0800 -Subject: [PATCH] Add new test cases about array for interoperability with C - about fortran call C - -diff --git a/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func001.c b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func001.c -new file mode 100644 -index 0000000..c7cf73f ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func001.c -@@ -0,0 +1,5 @@ -+#include -+void c_func_(int *a) { -+ printf("%d\n", a[0]); -+ printf("%d\n", a[1]); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func002.c b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func002.c -new file mode 100644 -index 0000000..010cdf7 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func002.c -@@ -0,0 +1,6 @@ -+#include -+#include -+void c_func_(short *a) { -+ printf("%hd\n", a[0]); -+ printf("%hd\n", a[1]); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func003.c b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func003.c -new file mode 100644 -index 0000000..5e69081 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func003.c -@@ -0,0 +1,6 @@ -+#include -+#include -+void c_func_(long *a) { -+ printf("%ld\n", a[0]); -+ printf("%ld\n", a[1]); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func004.c b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func004.c -new file mode 100644 -index 0000000..3f74c8e ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func004.c -@@ -0,0 +1,6 @@ -+#include -+#include -+void c_func_(long long *a) { -+ printf("%lld\n", a[0]); -+ printf("%lld\n", a[1]); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func005.c b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func005.c -new file mode 100644 -index 0000000..77794d4 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func005.c -@@ -0,0 +1,5 @@ -+#include -+void c_func_(signed char *a) { -+ printf("%c\n", a[0]); -+ printf("%c\n", a[1]); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func006.c b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func006.c -new file mode 100644 -index 0000000..27c475f ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func006.c -@@ -0,0 +1,6 @@ -+#include -+#include -+void c_func_(size_t *a) { -+ printf("%ld\n", a[0]); -+ printf("%ld\n", a[1]); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func007.c b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func007.c -new file mode 100644 -index 0000000..f7c4384 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func007.c -@@ -0,0 +1,6 @@ -+#include -+#include -+void c_func_(int8_t *a) { -+ printf("%hhd\n", a[0]); -+ printf("%hhd\n", a[1]); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func008.c b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func008.c -new file mode 100644 -index 0000000..e29971f ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func008.c -@@ -0,0 +1,6 @@ -+#include -+#include -+void c_func_(int16_t *a) { -+ printf("%hd\n", a[0]); -+ printf("%hd\n", a[1]); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func009.c b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func009.c -new file mode 100644 -index 0000000..3b84c1a ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func009.c -@@ -0,0 +1,6 @@ -+#include -+#include -+void c_func_(int32_t *a) { -+ printf("%d\n", a[0]); -+ printf("%d\n", a[1]); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func010.c b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func010.c -new file mode 100644 -index 0000000..11ca3e1 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func010.c -@@ -0,0 +1,6 @@ -+#include -+#include -+void c_func_(int64_t *a) { -+ printf("%ld\n", a[0]); -+ printf("%ld\n", a[1]); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func011.c b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func011.c -new file mode 100644 -index 0000000..f830d74 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func011.c -@@ -0,0 +1,6 @@ -+#include -+#include -+void c_func_(int_least8_t *a) { -+ printf("%hhd\n", a[0]); -+ printf("%hhd\n", a[1]); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func012.c b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func012.c -new file mode 100644 -index 0000000..6ffd7e3 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func012.c -@@ -0,0 +1,6 @@ -+#include -+#include -+void c_func_(int_least16_t *a) { -+ printf("%hd\n", a[0]); -+ printf("%hd\n", a[1]); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func013.c b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func013.c -new file mode 100644 -index 0000000..4b367cb ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func013.c -@@ -0,0 +1,6 @@ -+#include -+#include -+void c_func_(int_least32_t *a) { -+ printf("%d\n", a[0]); -+ printf("%d\n", a[1]); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func014.c b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func014.c -new file mode 100644 -index 0000000..6b2d5b3 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func014.c -@@ -0,0 +1,6 @@ -+#include -+#include -+void c_func_(int_least64_t *a) { -+ printf("%ld\n", a[0]); -+ printf("%ld\n", a[1]); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func015.c b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func015.c -new file mode 100644 -index 0000000..81d223a ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func015.c -@@ -0,0 +1,6 @@ -+#include -+#include -+void c_func_(int_fast8_t *a) { -+ printf("%hhd\n", a[0]); -+ printf("%hhd\n", a[1]); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func016.c b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func016.c -new file mode 100644 -index 0000000..297be3a ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func016.c -@@ -0,0 +1,6 @@ -+#include -+#include -+void c_func_(int_fast16_t *a) { -+ printf("%ld\n", a[0]); -+ printf("%ld\n", a[1]); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func017.c b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func017.c -new file mode 100644 -index 0000000..8eb5818 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func017.c -@@ -0,0 +1,6 @@ -+#include -+#include -+void c_func_(int_fast32_t *a) { -+ printf("%ld\n", a[0]); -+ printf("%ld\n", a[1]); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func018.c b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func018.c -new file mode 100644 -index 0000000..030b1f7 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func018.c -@@ -0,0 +1,6 @@ -+#include -+#include -+void c_func_(int_fast64_t *a) { -+ printf("%ld\n", a[0]); -+ printf("%ld\n", a[1]); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func019.c b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func019.c -new file mode 100644 -index 0000000..babfc75 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func019.c -@@ -0,0 +1,6 @@ -+#include -+#include -+void c_func_(intmax_t *a) { -+ printf("%ld\n", a[0]); -+ printf("%ld\n", a[1]); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func020.c b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func020.c -new file mode 100644 -index 0000000..26c7726 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func020.c -@@ -0,0 +1,6 @@ -+#include -+#include -+void c_func_(intptr_t *a) { -+ printf("%ld\n", a[0]); -+ printf("%ld\n", a[1]); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func021.c b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func021.c -new file mode 100644 -index 0000000..a73f11b ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func021.c -@@ -0,0 +1,5 @@ -+#include -+void c_func_(float *a) { -+ printf("%f\n", a[0]); -+ printf("%f\n", a[1]); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func022.c b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func022.c -new file mode 100644 -index 0000000..688f3c0 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func022.c -@@ -0,0 +1,5 @@ -+#include -+void c_func_(double *a) { -+ printf("%20lf\n", a[0]); -+ printf("%20lf\n", a[1]); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func023.c b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func023.c -new file mode 100644 -index 0000000..af86ba3 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func023.c -@@ -0,0 +1,5 @@ -+#include -+void c_func_(long double *a) { -+ printf("%20Lf\n", a[0]); -+ printf("%20Lf\n", a[1]); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func024.c b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func024.c -new file mode 100644 -index 0000000..1d34f02 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func024.c -@@ -0,0 +1,6 @@ -+#include -+#include -+void c_func_(float _Complex *t) { -+ printf("%0.20f + %0.20fi\n", creal(t[0]), cimag(t[0])); -+ printf("%0.20f + %0.20fi\n", creal(t[1]), cimag(t[1])); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func025.c b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func025.c -new file mode 100644 -index 0000000..12b9abb ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func025.c -@@ -0,0 +1,6 @@ -+#include -+#include -+void c_func_(double _Complex *t) { -+ printf("%20lf + %20lfi\n", creal(t[0]), cimag(t[0])); -+ printf("%20lf + %20lfi\n", creal(t[1]), cimag(t[1])); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func026.c b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func026.c -new file mode 100644 -index 0000000..78011d4 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func026.c -@@ -0,0 +1,6 @@ -+#include -+#include -+void c_func_(long double _Complex *t) { -+ printf("%20f + %20fi\n", creal(t[0]), cimag(t[0])); -+ printf("%20f + %20fi\n", creal(t[1]), cimag(t[1])); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func027.c b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func027.c -new file mode 100644 -index 0000000..91a49b5 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func027.c -@@ -0,0 +1,5 @@ -+#include -+void c_func_(_Bool *a) { -+ printf("%d\n", a[0]); -+ printf("%d\n", a[1]); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func028.c b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func028.c -new file mode 100644 -index 0000000..9335307 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/c_func028.c -@@ -0,0 +1,5 @@ -+#include -+void c_func_(char *a) { -+ printf("%c\n", a[0]); -+ printf("%c\n", a[1]); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main001.f90 b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main001.f90 -new file mode 100644 -index 0000000..6e1f16f ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main001.f90 -@@ -0,0 +1,11 @@ -+! Test fortran call c for the array type and the array type is int -+! -+program main -+ integer :: my_x(2) = 1 -+ interface -+ subroutine c_func(b) -+ integer :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main002.f90 b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main002.f90 -new file mode 100644 -index 0000000..50f36f6 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main002.f90 -@@ -0,0 +1,11 @@ -+! Test fortran call c for the array type and the array type is short -+! -+program main -+ integer(2) :: my_x(2) = 1 -+ interface -+ subroutine c_func(b) -+ integer(2) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main003.f90 b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main003.f90 -new file mode 100644 -index 0000000..5109bc3 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main003.f90 -@@ -0,0 +1,11 @@ -+! Test fortran call c for the array type and the array type is long -+! -+program main -+ integer(8) :: my_x(2) = 1 -+ interface -+ subroutine c_func(b) -+ integer(8) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main004.f90 b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main004.f90 -new file mode 100644 -index 0000000..a4e1bc6 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main004.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the array type and the array type is -+! long long -+! -+program main -+ integer(8) :: my_x(2) = 1 -+ interface -+ subroutine c_func(b) -+ integer(8) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main005.f90 b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main005.f90 -new file mode 100644 -index 0000000..6f52cca ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main005.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the array type and the array type is -+! signed char -+! -+program main -+ integer(1) :: my_x(2) = 65 -+ interface -+ subroutine c_func(b) -+ integer(1) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main006.f90 b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main006.f90 -new file mode 100644 -index 0000000..3505849 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main006.f90 -@@ -0,0 +1,11 @@ -+! Test fortran call c for the array type and the array type is size_t -+! -+program main -+ integer(8) :: my_x(2) = 3 -+ interface -+ subroutine c_func(b) -+ integer(8) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main007.f90 b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main007.f90 -new file mode 100644 -index 0000000..3ce82ad ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main007.f90 -@@ -0,0 +1,11 @@ -+! Test fortran call c for the array type and the array type is int8_t -+! -+program main -+ integer(1) :: my_x(2) = 1 -+ interface -+ subroutine c_func(b) -+ integer(1) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main008.f90 b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main008.f90 -new file mode 100644 -index 0000000..12a52ee ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main008.f90 -@@ -0,0 +1,11 @@ -+! Test fortran call c for the array type and the array type is int16_t -+! -+program main -+ integer(2) :: my_x(2) = 1 -+ interface -+ subroutine c_func(b) -+ integer(2) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main009.f90 b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main009.f90 -new file mode 100644 -index 0000000..139d7f9 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main009.f90 -@@ -0,0 +1,11 @@ -+! Test fortran call c for the array type and the array type is int32_t -+! -+program main -+ integer(4) :: my_x(2) = 1 -+ interface -+ subroutine c_func(b) -+ integer(4) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main010.f90 b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main010.f90 -new file mode 100644 -index 0000000..81859b7 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main010.f90 -@@ -0,0 +1,11 @@ -+! Test fortran call c for the array type and the array type is int64_t -+! -+program main -+ integer(8) :: my_x(2) = 1 -+ interface -+ subroutine c_func(b) -+ integer(8) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main011.f90 b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main011.f90 -new file mode 100644 -index 0000000..cee5bab ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main011.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type and the scalar type is -+! int_least8_t -+! -+program main -+ integer(1) :: my_x(2) = 1 -+ interface -+ subroutine c_func(b) -+ integer(1) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main012.f90 b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main012.f90 -new file mode 100644 -index 0000000..fd005f2 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main012.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type and the scalar type is -+! int_least16_t -+! -+program main -+ integer(2) :: my_x(2) = 1 -+ interface -+ subroutine c_func(b) -+ integer(2) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main013.f90 b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main013.f90 -new file mode 100644 -index 0000000..1fe884b ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main013.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type and the scalar type is -+! int_least32_t -+! -+program main -+ integer(4) :: my_x(2) = 1 -+ interface -+ subroutine c_func(b) -+ integer(4) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main014.f90 b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main014.f90 -new file mode 100644 -index 0000000..ada1c56 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main014.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type and the scalar type is -+! int_least64_t -+! -+program main -+ integer(8) :: my_x(2) = 1 -+ interface -+ subroutine c_func(b) -+ integer(8) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main015.f90 b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main015.f90 -new file mode 100644 -index 0000000..a025c8a ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main015.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type and the scalar type is -+! int_fast8_t -+! -+program main -+ integer(1) :: my_x(2) = 1 -+ interface -+ subroutine c_func(b) -+ integer(1) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main016.f90 b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main016.f90 -new file mode 100644 -index 0000000..d6d3f63 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main016.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type and the scalar type is -+! int_fast16_t -+! -+program main -+ integer(8) :: my_x(2) = 1 -+ interface -+ subroutine c_func(b) -+ integer(8) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main017.f90 b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main017.f90 -new file mode 100644 -index 0000000..851d06d ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main017.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type and the scalar type is -+! int_fast32_t -+! -+program main -+ integer(8) :: my_x(2) = 1 -+ interface -+ subroutine c_func(b) -+ integer(8) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main018.f90 b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main018.f90 -new file mode 100644 -index 0000000..9b62610 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main018.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type and the scalar type is -+! int_fast64_t -+! -+program main -+ integer(8) :: my_x(2) = 1 -+ interface -+ subroutine c_func(b) -+ integer(8) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main019.f90 b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main019.f90 -new file mode 100644 -index 0000000..41f77aa ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main019.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type and the scalar type is -+! intmax_t -+! -+program main -+ integer(8) :: my_x(2) = 1 -+ interface -+ subroutine c_func(b) -+ integer(8) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main020.f90 b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main020.f90 -new file mode 100644 -index 0000000..3a48805 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main020.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type and the scalar type is -+! intptr_t -+! -+program main -+ integer(8) :: my_x(2) = 1 -+ interface -+ subroutine c_func(b) -+ integer(8) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main021.f90 b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main021.f90 -new file mode 100644 -index 0000000..86a9cf5 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main021.f90 -@@ -0,0 +1,11 @@ -+! Test fortran call c for the array type and the array type is float -+! -+program main -+ real(4) :: my_x(2) = 12345678.7654321 -+ interface -+ subroutine c_func(b) -+ real(4) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main022.f90 b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main022.f90 -new file mode 100644 -index 0000000..ad70ca5 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main022.f90 -@@ -0,0 +1,11 @@ -+! Test fortran call c for the array type and the array type is double -+! -+program main -+ real(8) :: my_x(2) = 12345678.7654321 -+ interface -+ subroutine c_func(b) -+ real(8) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main023.f90 b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main023.f90 -new file mode 100644 -index 0000000..e44608b ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main023.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the array type and the array type is -+! long double -+! -+program main -+ integer, parameter :: K = selected_real_kind(16) -+ real(K) :: my_x(2) = 12345678.7654321 -+ interface -+ subroutine c_func(b) -+ integer, parameter :: K = selected_real_kind(16) -+ real(K) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main024.f90 b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main024.f90 -new file mode 100644 -index 0000000..19df422 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main024.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the array type and the array type is -+! float _Complex -+! -+program main -+ complex(4) :: my_x(2) = (-3.14159265358979, 1) -+ interface -+ subroutine c_func(b) -+ complex(4) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main025.f90 b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main025.f90 -new file mode 100644 -index 0000000..b335a51 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main025.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the array type and the array type is -+! double _Complex -+! -+program main -+ complex(8) :: my_x(2) = (-3.14159265358979, 1) -+ interface -+ subroutine c_func(b) -+ complex(8) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main026.f90 b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main026.f90 -new file mode 100644 -index 0000000..7482ce8 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main026.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the array type and the array type is -+! long double _Complex -+! -+program main -+ integer, parameter :: K = selected_real_kind(16) -+ complex(K) :: my_x(2) = (-3.14159265358979, 1) -+ interface -+ subroutine c_func(b) -+ integer, parameter :: K = selected_real_kind(16) -+ complex(K) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main027.f90 b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main027.f90 -new file mode 100644 -index 0000000..d3249d1 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main027.f90 -@@ -0,0 +1,11 @@ -+! Test fortran call c for the array type and the array type is _Bool -+! -+program main -+ logical(1) :: my_x(2) = .TRUE. -+ interface -+ subroutine c_func(b) -+ logical(1) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main028.f90 b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main028.f90 -new file mode 100644 -index 0000000..a854e09 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/fortran_main028.f90 -@@ -0,0 +1,11 @@ -+! Test fortran call c for the array type and the array type is char -+! -+program main -+ character(1) :: my_x(2) = 'a' -+ interface -+ subroutine c_func(b) -+ character(1) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/result.md b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/result.md -new file mode 100644 -index 0000000..f15fe53 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/result.md -@@ -0,0 +1,29 @@ -+ | test | gfortran | flang | nvfortran| -+ | 001 | PASS | PASS | PASS | -+ | 002 | PASS | PASS | PASS | -+ | 003 | PASS | PASS | PASS | -+ | 004 | PASS | PASS | PASS | -+ | 005 | PASS | PASS | PASS | -+ | 006 | PASS | PASS | PASS | -+ | 007 | PASS | PASS | PASS | -+ | 008 | PASS | PASS | PASS | -+ | 009 | PASS | PASS | PASS | -+ | 010 | PASS | PASS | PASS | -+ | 011 | PASS | PASS | PASS | -+ | 012 | PASS | PASS | PASS | -+ | 013 | PASS | PASS | PASS | -+ | 014 | PASS | PASS | PASS | -+ | 015 | PASS | PASS | PASS | -+ | 016 | PASS | PASS | PASS | -+ | 017 | PASS | PASS | PASS | -+ | 018 | PASS | PASS | PASS | -+ | 019 | PASS | PASS | PASS | -+ | 020 | PASS | PASS | PASS | -+ | 021 | PASS | PASS | PASS | -+ | 022 | PASS | PASS | PASS | -+ | 023 | PASS | PASS | ERROR | -+ | 024 | PASS | PASS | PASS | -+ | 025 | PASS | PASS | PASS | -+ | 026 | PASS | PASS | ERROR | -+ | 027 | PASS | PASS | PASS | -+ | 028 | PASS | PASS | PASS | -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/run.sh b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/run.sh -new file mode 100644 -index 0000000..dbbd62f ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/001_fortran_call_c_array/run.sh -@@ -0,0 +1,22 @@ -+for i in {001..028} -+do -+echo "------- test $i ------." -+echo "----- gfortran result:" -+gcc c_func$i.c -c -o c-test.o -+gfortran fortran_main$i.f90 -fno-range-check -c -o fortran-test.o -+gfortran c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+echo "----- flang-new result : " -+clang c_func$i.c -c -o c-test.o -+flang-new fortran_main$i.f90 -c -o fortran-test.o -+flang-new -flang-experimental-exec c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+echo "----- nvfortran result : " -+clang c_func$i.c -c -o c-test.o -+nvfortran fortran_main$i.f90 -c -o fortran-test.o -+nvfortran c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+done -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func001.c b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func001.c -new file mode 100644 -index 0000000..c7cf73f ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func001.c -@@ -0,0 +1,5 @@ -+#include -+void c_func_(int *a) { -+ printf("%d\n", a[0]); -+ printf("%d\n", a[1]); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func002.c b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func002.c -new file mode 100644 -index 0000000..010cdf7 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func002.c -@@ -0,0 +1,6 @@ -+#include -+#include -+void c_func_(short *a) { -+ printf("%hd\n", a[0]); -+ printf("%hd\n", a[1]); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func003.c b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func003.c -new file mode 100644 -index 0000000..5e69081 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func003.c -@@ -0,0 +1,6 @@ -+#include -+#include -+void c_func_(long *a) { -+ printf("%ld\n", a[0]); -+ printf("%ld\n", a[1]); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func004.c b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func004.c -new file mode 100644 -index 0000000..3f74c8e ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func004.c -@@ -0,0 +1,6 @@ -+#include -+#include -+void c_func_(long long *a) { -+ printf("%lld\n", a[0]); -+ printf("%lld\n", a[1]); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func005.c b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func005.c -new file mode 100644 -index 0000000..77794d4 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func005.c -@@ -0,0 +1,5 @@ -+#include -+void c_func_(signed char *a) { -+ printf("%c\n", a[0]); -+ printf("%c\n", a[1]); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func006.c b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func006.c -new file mode 100644 -index 0000000..27c475f ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func006.c -@@ -0,0 +1,6 @@ -+#include -+#include -+void c_func_(size_t *a) { -+ printf("%ld\n", a[0]); -+ printf("%ld\n", a[1]); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func007.c b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func007.c -new file mode 100644 -index 0000000..f7c4384 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func007.c -@@ -0,0 +1,6 @@ -+#include -+#include -+void c_func_(int8_t *a) { -+ printf("%hhd\n", a[0]); -+ printf("%hhd\n", a[1]); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func008.c b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func008.c -new file mode 100644 -index 0000000..e29971f ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func008.c -@@ -0,0 +1,6 @@ -+#include -+#include -+void c_func_(int16_t *a) { -+ printf("%hd\n", a[0]); -+ printf("%hd\n", a[1]); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func009.c b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func009.c -new file mode 100644 -index 0000000..3b84c1a ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func009.c -@@ -0,0 +1,6 @@ -+#include -+#include -+void c_func_(int32_t *a) { -+ printf("%d\n", a[0]); -+ printf("%d\n", a[1]); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func010.c b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func010.c -new file mode 100644 -index 0000000..11ca3e1 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func010.c -@@ -0,0 +1,6 @@ -+#include -+#include -+void c_func_(int64_t *a) { -+ printf("%ld\n", a[0]); -+ printf("%ld\n", a[1]); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func011.c b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func011.c -new file mode 100644 -index 0000000..f830d74 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func011.c -@@ -0,0 +1,6 @@ -+#include -+#include -+void c_func_(int_least8_t *a) { -+ printf("%hhd\n", a[0]); -+ printf("%hhd\n", a[1]); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func012.c b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func012.c -new file mode 100644 -index 0000000..6ffd7e3 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func012.c -@@ -0,0 +1,6 @@ -+#include -+#include -+void c_func_(int_least16_t *a) { -+ printf("%hd\n", a[0]); -+ printf("%hd\n", a[1]); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func013.c b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func013.c -new file mode 100644 -index 0000000..4b367cb ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func013.c -@@ -0,0 +1,6 @@ -+#include -+#include -+void c_func_(int_least32_t *a) { -+ printf("%d\n", a[0]); -+ printf("%d\n", a[1]); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func014.c b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func014.c -new file mode 100644 -index 0000000..6b2d5b3 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func014.c -@@ -0,0 +1,6 @@ -+#include -+#include -+void c_func_(int_least64_t *a) { -+ printf("%ld\n", a[0]); -+ printf("%ld\n", a[1]); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func015.c b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func015.c -new file mode 100644 -index 0000000..81d223a ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func015.c -@@ -0,0 +1,6 @@ -+#include -+#include -+void c_func_(int_fast8_t *a) { -+ printf("%hhd\n", a[0]); -+ printf("%hhd\n", a[1]); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func016.c b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func016.c -new file mode 100644 -index 0000000..297be3a ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func016.c -@@ -0,0 +1,6 @@ -+#include -+#include -+void c_func_(int_fast16_t *a) { -+ printf("%ld\n", a[0]); -+ printf("%ld\n", a[1]); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func017.c b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func017.c -new file mode 100644 -index 0000000..8eb5818 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func017.c -@@ -0,0 +1,6 @@ -+#include -+#include -+void c_func_(int_fast32_t *a) { -+ printf("%ld\n", a[0]); -+ printf("%ld\n", a[1]); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func018.c b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func018.c -new file mode 100644 -index 0000000..030b1f7 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func018.c -@@ -0,0 +1,6 @@ -+#include -+#include -+void c_func_(int_fast64_t *a) { -+ printf("%ld\n", a[0]); -+ printf("%ld\n", a[1]); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func019.c b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func019.c -new file mode 100644 -index 0000000..babfc75 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func019.c -@@ -0,0 +1,6 @@ -+#include -+#include -+void c_func_(intmax_t *a) { -+ printf("%ld\n", a[0]); -+ printf("%ld\n", a[1]); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func020.c b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func020.c -new file mode 100644 -index 0000000..26c7726 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func020.c -@@ -0,0 +1,6 @@ -+#include -+#include -+void c_func_(intptr_t *a) { -+ printf("%ld\n", a[0]); -+ printf("%ld\n", a[1]); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func021.c b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func021.c -new file mode 100644 -index 0000000..a73f11b ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func021.c -@@ -0,0 +1,5 @@ -+#include -+void c_func_(float *a) { -+ printf("%f\n", a[0]); -+ printf("%f\n", a[1]); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func022.c b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func022.c -new file mode 100644 -index 0000000..b600f94 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func022.c -@@ -0,0 +1,5 @@ -+#include -+void c_func_(double *a) { -+ printf("%0.20lf\n", a[0]); -+ printf("%0.20lf\n", a[1]); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func023.c b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func023.c -new file mode 100644 -index 0000000..b34c388 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func023.c -@@ -0,0 +1,5 @@ -+#include -+void c_func_(long double *a) { -+ printf("%.20Lf\n", a[0]); -+ printf("%.20Lf\n", a[1]); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func024.c b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func024.c -new file mode 100644 -index 0000000..1d34f02 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func024.c -@@ -0,0 +1,6 @@ -+#include -+#include -+void c_func_(float _Complex *t) { -+ printf("%0.20f + %0.20fi\n", creal(t[0]), cimag(t[0])); -+ printf("%0.20f + %0.20fi\n", creal(t[1]), cimag(t[1])); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func025.c b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func025.c -new file mode 100644 -index 0000000..582096e ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func025.c -@@ -0,0 +1,6 @@ -+#include -+#include -+void c_func_(double _Complex *t) { -+ printf("%0.20lf + %0.20lfi\n", creal(t[0]), cimag(t[0])); -+ printf("%0.20lf + %0.20lfi\n", creal(t[1]), cimag(t[1])); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func026.c b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func026.c -new file mode 100644 -index 0000000..b665220 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func026.c -@@ -0,0 +1,6 @@ -+#include -+#include -+void c_func_(long double _Complex *t) { -+ printf("%0.20f + %0.20fi\n", creal(t[0]), cimag(t[0])); -+ printf("%0.20f + %0.20fi\n", creal(t[1]), cimag(t[1])); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func027.c b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func027.c -new file mode 100644 -index 0000000..91a49b5 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func027.c -@@ -0,0 +1,5 @@ -+#include -+void c_func_(_Bool *a) { -+ printf("%d\n", a[0]); -+ printf("%d\n", a[1]); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func028.c b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func028.c -new file mode 100644 -index 0000000..9335307 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/c_func028.c -@@ -0,0 +1,5 @@ -+#include -+void c_func_(char *a) { -+ printf("%c\n", a[0]); -+ printf("%c\n", a[1]); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main001.f90 b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main001.f90 -new file mode 100644 -index 0000000..c1c866f ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main001.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the scalar type and the scalar type is int -+! with iso_c_binding -+! -+program main -+ use iso_c_binding -+ integer(C_INT) :: my_x(2) = 1 -+ interface -+ subroutine c_func(b) -+ use iso_c_binding -+ integer(C_INT) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main002.f90 b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main002.f90 -new file mode 100644 -index 0000000..cb9976e ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main002.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the scalar type and the scalar type is short -+! with iso_c_binding -+! -+program main -+ use iso_c_binding -+ integer(C_SHORT) :: my_x(2) = 1 -+ interface -+ subroutine c_func(b) -+ use iso_c_binding -+ integer(C_SHORT) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main003.f90 b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main003.f90 -new file mode 100644 -index 0000000..fd935af ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main003.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the scalar type and the scalar type is long -+! with iso_c_binding -+! -+program main -+ use iso_c_binding -+ integer(C_LONG) :: my_x(2) = 1 -+ interface -+ subroutine c_func(b) -+ use iso_c_binding -+ integer(C_LONG) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main004.f90 b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main004.f90 -new file mode 100644 -index 0000000..fd72ea7 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main004.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the scalar type and the scalar type is -+! long long with iso_c_binding -+! -+program main -+ use iso_c_binding -+ integer(C_LONG_LONG) :: my_x(2) = 1 -+ interface -+ subroutine c_func(b) -+ use iso_c_binding -+ integer(C_LONG_LONG) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main005.f90 b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main005.f90 -new file mode 100644 -index 0000000..f6e923d ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main005.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the scalar type and the scalar type is -+! signed char with iso_c_binding -+! -+program main -+ use iso_c_binding -+ integer(C_SIGNED_CHAR) :: my_x(2) = 65 -+ interface -+ subroutine c_func(b) -+ use iso_c_binding -+ integer(C_SIGNED_CHAR) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main006.f90 b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main006.f90 -new file mode 100644 -index 0000000..421534d ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main006.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the scalar type and the scalar type is size_t -+! with iso_c_binding -+! -+program main -+ use iso_c_binding -+ integer(C_SIZE_T) :: my_x(2) = 3 -+ interface -+ subroutine c_func(b) -+ use iso_c_binding -+ integer(C_SIZE_T) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main007.f90 b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main007.f90 -new file mode 100644 -index 0000000..d7b5b93 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main007.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the scalar type and the scalar type is int8_t -+! with iso_c_binding -+! -+program main -+ use iso_c_binding -+ integer(C_INT8_T) :: my_x(2) = 1 -+ interface -+ subroutine c_func(b) -+ use iso_c_binding -+ integer(C_INT8_T) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main008.f90 b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main008.f90 -new file mode 100644 -index 0000000..d7f7492 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main008.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the scalar type and the scalar type is -+! int16_t with iso_c_binding -+! -+program main -+ use iso_c_binding -+ integer(C_INT16_T) :: my_x(2) = 1 -+ interface -+ subroutine c_func(b) -+ use iso_c_binding -+ integer(C_INT16_T) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main009.f90 b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main009.f90 -new file mode 100644 -index 0000000..35233f5 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main009.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the scalar type and the scalar type is -+! int32_t with iso_c_binding -+! -+program main -+ use iso_c_binding -+ integer(C_INT32_T) :: my_x(2) = 1 -+ interface -+ subroutine c_func(b) -+ use iso_c_binding -+ integer(C_INT32_T) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main010.f90 b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main010.f90 -new file mode 100644 -index 0000000..f0c5cb2 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main010.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the scalar type and the scalar type is -+! int64_t with iso_c_binding -+! -+program main -+ use iso_c_binding -+ integer(C_INT64_T) :: my_x(2) = 1 -+ interface -+ subroutine c_func(b) -+ use iso_c_binding -+ integer(C_INT64_T) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main011.f90 b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main011.f90 -new file mode 100644 -index 0000000..9b6e534 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main011.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the scalar type and the scalar type is -+! int_least_8_t with iso_c_binding -+! -+program main -+ use iso_c_binding -+ integer(C_INT_LEAST8_T) :: my_x(2) = 1 -+ interface -+ subroutine c_func(b) -+ use iso_c_binding -+ integer(C_INT_LEAST8_T) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main012.f90 b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main012.f90 -new file mode 100644 -index 0000000..d0b4d29 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main012.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the scalar type and the scalar type is -+! int_least16_t with iso_c_binding -+! -+program main -+ use iso_c_binding -+ integer(C_INT_LEAST16_T) :: my_x(2) = 1 -+ interface -+ subroutine c_func(b) -+ use iso_c_binding -+ integer(C_INT_LEAST16_T) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main013.f90 b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main013.f90 -new file mode 100644 -index 0000000..74e2a82 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main013.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the scalar type and the scalar type is -+! int_least32_t with iso_c_binding -+! -+program main -+ use iso_c_binding -+ integer(C_INT_LEAST32_T) :: my_x(2) = 1 -+ interface -+ subroutine c_func(b) -+ use iso_c_binding -+ integer(C_INT_LEAST32_T) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main014.f90 b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main014.f90 -new file mode 100644 -index 0000000..09830a3 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main014.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the scalar type and the scalar type is -+! int_least64_t with iso_c_binding -+! -+program main -+ use iso_c_binding -+ integer(C_INT_LEAST64_T) :: my_x(2) = 1 -+ interface -+ subroutine c_func(b) -+ use iso_c_binding -+ integer(C_INT_LEAST64_T) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main015.f90 b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main015.f90 -new file mode 100644 -index 0000000..0663936 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main015.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the scalar type and the scalar type is -+! int_fast8_t with iso_c_binding -+! -+program main -+ use iso_c_binding -+ integer(C_INT_FAST8_T) :: my_x(2) = 1 -+ interface -+ subroutine c_func(b) -+ use iso_c_binding -+ integer(C_INT_FAST8_T) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main016.f90 b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main016.f90 -new file mode 100644 -index 0000000..3ed798b ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main016.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the scalar type and the scalar type is -+! int_fast16_t with iso_c_binding -+! -+program main -+ use iso_c_binding -+ integer(C_INT_FAST16_T) :: my_x(2) = 1 -+ interface -+ subroutine c_func(b) -+ use iso_c_binding -+ integer(C_INT_FAST16_T) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main017.f90 b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main017.f90 -new file mode 100644 -index 0000000..ad04f7a ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main017.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the scalar type and the scalar type is -+! int_fast32_t with iso_c_binding -+! -+program main -+ use iso_c_binding -+ integer(C_INT_FAST32_T) :: my_x(2) = 1 -+ interface -+ subroutine c_func(b) -+ use iso_c_binding -+ integer(C_INT_FAST32_T) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main018.f90 b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main018.f90 -new file mode 100644 -index 0000000..21bccab ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main018.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the scalar type and the scalar type is -+! int_fast64_t with iso_c_binding -+! -+program main -+ use iso_c_binding -+ integer(C_INT_FAST64_T) :: my_x(2) = 1 -+ interface -+ subroutine c_func(b) -+ use iso_c_binding -+ integer(C_INT_FAST64_T) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main019.f90 b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main019.f90 -new file mode 100644 -index 0000000..0ec82b6 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main019.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the scalar type and the scalar type is -+! intmax_t with iso_c_binding -+! -+program main -+ use iso_c_binding -+ integer(C_INTMAX_T) :: my_x(2) = 1 -+ interface -+ subroutine c_func(b) -+ use iso_c_binding -+ integer(C_INTMAX_T) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main020.f90 b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main020.f90 -new file mode 100644 -index 0000000..dabd45d ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main020.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the scalar type and the scalar type is -+! intptr_t with iso_c_binding -+! -+program main -+ use iso_c_binding -+ integer(C_INTPTR_T) :: my_x(2) = 1 -+ interface -+ subroutine c_func(b) -+ use iso_c_binding -+ integer(C_INTPTR_T) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main021.f90 b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main021.f90 -new file mode 100644 -index 0000000..e0b4407 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main021.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the scalar type and the scalar type is float -+! with iso_c_binding -+! -+program main -+ use iso_c_binding -+ real(C_FLOAT) :: my_x(2) = 12345678.7654321 -+ interface -+ subroutine c_func(b) -+ use iso_c_binding -+ real(C_FLOAT) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main022.f90 b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main022.f90 -new file mode 100644 -index 0000000..453383e ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main022.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the scalar type and the scalar type is double -+! with iso_c_binding -+! -+program main -+ use iso_c_binding -+ real(C_DOUBLE) :: my_x(2) = 3.14159265358979 -+ interface -+ subroutine c_func(b) -+ use iso_c_binding -+ real(C_DOUBLE) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main023.f90 b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main023.f90 -new file mode 100644 -index 0000000..527cb8a ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main023.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the scalar type and the scalar type is -+! long double with iso_c_binding -+! -+program main -+ use iso_c_binding -+ real(C_LONG_DOUBLE) :: my_x(2) = 3.14159265358979 -+ interface -+ subroutine c_func(b) -+ use iso_c_binding -+ real(C_LONG_DOUBLE) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main024.f90 b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main024.f90 -new file mode 100644 -index 0000000..a1d726f ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main024.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the scalar type and the scalar type is -+! float _Complex with iso_c_binding -+! -+program main -+ use iso_c_binding -+ complex(C_FLOAT_COMPLEX) :: my_x(2) = (-12345678.7654321, 1) -+ interface -+ subroutine c_func(b) -+ use iso_c_binding -+ complex(C_FLOAT_COMPLEX) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main025.f90 b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main025.f90 -new file mode 100644 -index 0000000..d8e8d58 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main025.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the scalar type and the scalar type is -+! double _Complex with iso_c_binding -+! -+program main -+ use iso_c_binding -+ complex(C_DOUBLE_COMPLEX) :: my_x(2) = (-3.14159265358979, 1) -+ interface -+ subroutine c_func(b) -+ use iso_c_binding -+ complex(C_DOUBLE_COMPLEX) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main026.f90 b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main026.f90 -new file mode 100644 -index 0000000..b90c2ce ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main026.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the scalar type and the scalar type is -+! long double _Complex with iso_c_binding -+! -+program main -+ use iso_c_binding -+ complex(C_LONG_DOUBLE_COMPLEX) :: my_x(2) = (-3.14159265358979, 1) -+ interface -+ subroutine c_func(b) -+ use iso_c_binding -+ complex(C_LONG_DOUBLE_COMPLEX) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main027.f90 b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main027.f90 -new file mode 100644 -index 0000000..ad4ac52 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main027.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the scalar type and the scalar type is _Bool -+! with iso_c_binding -+! -+program main -+ use iso_c_binding -+ logical(C_BOOL) :: my_x(2) = .FALSE. -+ interface -+ subroutine c_func(b) -+ use iso_c_binding -+ logical(C_BOOL) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main028.f90 b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main028.f90 -new file mode 100644 -index 0000000..d7a220b ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/fortran_main028.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the scalar type and the scalar type is char -+! with iso_c_binding -+! -+program main -+ use iso_c_binding -+ character(C_CHAR) :: my_x(2) = 'a' -+ interface -+ subroutine c_func(b) -+ use iso_c_binding -+ character(C_CHAR) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/result.md b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/result.md -new file mode 100644 -index 0000000..0499a78 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/result.md -@@ -0,0 +1,29 @@ -+ | test | gfortran | flang | nvfortran| -+ | 001 | PASS | PASS | PASS | -+ | 002 | PASS | PASS | PASS | -+ | 003 | PASS | PASS | PASS | -+ | 004 | PASS | PASS | PASS | -+ | 005 | PASS | PASS | PASS | -+ | 006 | PASS | PASS | PASS | -+ | 007 | PASS | PASS | PASS | -+ | 008 | PASS | PASS | PASS | -+ | 009 | PASS | PASS | PASS | -+ | 010 | PASS | PASS | PASS | -+ | 011 | PASS | PASS | PASS | -+ | 012 | PASS | PASS | PASS | -+ | 013 | PASS | PASS | PASS | -+ | 014 | PASS | PASS | PASS | -+ | 015 | PASS | PASS | PASS | -+ | 016 | PASS | ERROR | PASS | -+ | 017 | PASS | ERROR | PASS | -+ | 018 | PASS | PASS | PASS | -+ | 019 | PASS | ERROR | PASS | -+ | 020 | PASS | PASS | PASS | -+ | 021 | PASS | PASS | PASS | -+ | 022 | PASS | PASS | PASS | -+ | 023 | PASS | ERROR | ERROR | -+ | 024 | PASS | PASS | PASS | -+ | 025 | PASS | PASS | PASS | -+ | 026 | PASS | ERROR | ERROR | -+ | 027 | PASS | PASS | PASS | -+ | 028 | PASS | PASS | PASS | -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/run.sh b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/run.sh -new file mode 100644 -index 0000000..dbbd62f ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/002_fortran_call_c_array_iso_c_binding/run.sh -@@ -0,0 +1,22 @@ -+for i in {001..028} -+do -+echo "------- test $i ------." -+echo "----- gfortran result:" -+gcc c_func$i.c -c -o c-test.o -+gfortran fortran_main$i.f90 -fno-range-check -c -o fortran-test.o -+gfortran c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+echo "----- flang-new result : " -+clang c_func$i.c -c -o c-test.o -+flang-new fortran_main$i.f90 -c -o fortran-test.o -+flang-new -flang-experimental-exec c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+echo "----- nvfortran result : " -+clang c_func$i.c -c -o c-test.o -+nvfortran fortran_main$i.f90 -c -o fortran-test.o -+nvfortran c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+done -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func001.c b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func001.c -new file mode 100644 -index 0000000..c7cf73f ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func001.c -@@ -0,0 +1,5 @@ -+#include -+void c_func_(int *a) { -+ printf("%d\n", a[0]); -+ printf("%d\n", a[1]); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func002.c b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func002.c -new file mode 100644 -index 0000000..010cdf7 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func002.c -@@ -0,0 +1,6 @@ -+#include -+#include -+void c_func_(short *a) { -+ printf("%hd\n", a[0]); -+ printf("%hd\n", a[1]); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func003.c b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func003.c -new file mode 100644 -index 0000000..5e69081 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func003.c -@@ -0,0 +1,6 @@ -+#include -+#include -+void c_func_(long *a) { -+ printf("%ld\n", a[0]); -+ printf("%ld\n", a[1]); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func004.c b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func004.c -new file mode 100644 -index 0000000..3f74c8e ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func004.c -@@ -0,0 +1,6 @@ -+#include -+#include -+void c_func_(long long *a) { -+ printf("%lld\n", a[0]); -+ printf("%lld\n", a[1]); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func005.c b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func005.c -new file mode 100644 -index 0000000..77794d4 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func005.c -@@ -0,0 +1,5 @@ -+#include -+void c_func_(signed char *a) { -+ printf("%c\n", a[0]); -+ printf("%c\n", a[1]); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func006.c b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func006.c -new file mode 100644 -index 0000000..27c475f ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func006.c -@@ -0,0 +1,6 @@ -+#include -+#include -+void c_func_(size_t *a) { -+ printf("%ld\n", a[0]); -+ printf("%ld\n", a[1]); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func007.c b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func007.c -new file mode 100644 -index 0000000..f7c4384 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func007.c -@@ -0,0 +1,6 @@ -+#include -+#include -+void c_func_(int8_t *a) { -+ printf("%hhd\n", a[0]); -+ printf("%hhd\n", a[1]); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func008.c b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func008.c -new file mode 100644 -index 0000000..e29971f ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func008.c -@@ -0,0 +1,6 @@ -+#include -+#include -+void c_func_(int16_t *a) { -+ printf("%hd\n", a[0]); -+ printf("%hd\n", a[1]); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func009.c b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func009.c -new file mode 100644 -index 0000000..3b84c1a ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func009.c -@@ -0,0 +1,6 @@ -+#include -+#include -+void c_func_(int32_t *a) { -+ printf("%d\n", a[0]); -+ printf("%d\n", a[1]); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func010.c b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func010.c -new file mode 100644 -index 0000000..11ca3e1 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func010.c -@@ -0,0 +1,6 @@ -+#include -+#include -+void c_func_(int64_t *a) { -+ printf("%ld\n", a[0]); -+ printf("%ld\n", a[1]); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func011.c b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func011.c -new file mode 100644 -index 0000000..f830d74 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func011.c -@@ -0,0 +1,6 @@ -+#include -+#include -+void c_func_(int_least8_t *a) { -+ printf("%hhd\n", a[0]); -+ printf("%hhd\n", a[1]); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func012.c b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func012.c -new file mode 100644 -index 0000000..6ffd7e3 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func012.c -@@ -0,0 +1,6 @@ -+#include -+#include -+void c_func_(int_least16_t *a) { -+ printf("%hd\n", a[0]); -+ printf("%hd\n", a[1]); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func013.c b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func013.c -new file mode 100644 -index 0000000..4b367cb ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func013.c -@@ -0,0 +1,6 @@ -+#include -+#include -+void c_func_(int_least32_t *a) { -+ printf("%d\n", a[0]); -+ printf("%d\n", a[1]); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func014.c b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func014.c -new file mode 100644 -index 0000000..6b2d5b3 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func014.c -@@ -0,0 +1,6 @@ -+#include -+#include -+void c_func_(int_least64_t *a) { -+ printf("%ld\n", a[0]); -+ printf("%ld\n", a[1]); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func015.c b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func015.c -new file mode 100644 -index 0000000..81d223a ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func015.c -@@ -0,0 +1,6 @@ -+#include -+#include -+void c_func_(int_fast8_t *a) { -+ printf("%hhd\n", a[0]); -+ printf("%hhd\n", a[1]); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func016.c b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func016.c -new file mode 100644 -index 0000000..297be3a ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func016.c -@@ -0,0 +1,6 @@ -+#include -+#include -+void c_func_(int_fast16_t *a) { -+ printf("%ld\n", a[0]); -+ printf("%ld\n", a[1]); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func017.c b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func017.c -new file mode 100644 -index 0000000..8eb5818 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func017.c -@@ -0,0 +1,6 @@ -+#include -+#include -+void c_func_(int_fast32_t *a) { -+ printf("%ld\n", a[0]); -+ printf("%ld\n", a[1]); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func018.c b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func018.c -new file mode 100644 -index 0000000..030b1f7 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func018.c -@@ -0,0 +1,6 @@ -+#include -+#include -+void c_func_(int_fast64_t *a) { -+ printf("%ld\n", a[0]); -+ printf("%ld\n", a[1]); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func019.c b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func019.c -new file mode 100644 -index 0000000..babfc75 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func019.c -@@ -0,0 +1,6 @@ -+#include -+#include -+void c_func_(intmax_t *a) { -+ printf("%ld\n", a[0]); -+ printf("%ld\n", a[1]); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func020.c b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func020.c -new file mode 100644 -index 0000000..26c7726 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func020.c -@@ -0,0 +1,6 @@ -+#include -+#include -+void c_func_(intptr_t *a) { -+ printf("%ld\n", a[0]); -+ printf("%ld\n", a[1]); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func021.c b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func021.c -new file mode 100644 -index 0000000..a73f11b ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func021.c -@@ -0,0 +1,5 @@ -+#include -+void c_func_(float *a) { -+ printf("%f\n", a[0]); -+ printf("%f\n", a[1]); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func022.c b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func022.c -new file mode 100644 -index 0000000..688f3c0 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func022.c -@@ -0,0 +1,5 @@ -+#include -+void c_func_(double *a) { -+ printf("%20lf\n", a[0]); -+ printf("%20lf\n", a[1]); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func023.c b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func023.c -new file mode 100644 -index 0000000..af86ba3 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func023.c -@@ -0,0 +1,5 @@ -+#include -+void c_func_(long double *a) { -+ printf("%20Lf\n", a[0]); -+ printf("%20Lf\n", a[1]); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func024.c b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func024.c -new file mode 100644 -index 0000000..1d34f02 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func024.c -@@ -0,0 +1,6 @@ -+#include -+#include -+void c_func_(float _Complex *t) { -+ printf("%0.20f + %0.20fi\n", creal(t[0]), cimag(t[0])); -+ printf("%0.20f + %0.20fi\n", creal(t[1]), cimag(t[1])); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func025.c b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func025.c -new file mode 100644 -index 0000000..12b9abb ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func025.c -@@ -0,0 +1,6 @@ -+#include -+#include -+void c_func_(double _Complex *t) { -+ printf("%20lf + %20lfi\n", creal(t[0]), cimag(t[0])); -+ printf("%20lf + %20lfi\n", creal(t[1]), cimag(t[1])); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func026.c b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func026.c -new file mode 100644 -index 0000000..78011d4 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func026.c -@@ -0,0 +1,6 @@ -+#include -+#include -+void c_func_(long double _Complex *t) { -+ printf("%20f + %20fi\n", creal(t[0]), cimag(t[0])); -+ printf("%20f + %20fi\n", creal(t[1]), cimag(t[1])); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func027.c b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func027.c -new file mode 100644 -index 0000000..91a49b5 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func027.c -@@ -0,0 +1,5 @@ -+#include -+void c_func_(_Bool *a) { -+ printf("%d\n", a[0]); -+ printf("%d\n", a[1]); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func028.c b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func028.c -new file mode 100644 -index 0000000..9335307 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/c_func028.c -@@ -0,0 +1,5 @@ -+#include -+void c_func_(char *a) { -+ printf("%c\n", a[0]); -+ printf("%c\n", a[1]); -+} -diff --git a/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main001.f90 b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main001.f90 -new file mode 100644 -index 0000000..de41e30 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main001.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the array type and the array type is int with -+! bindc -+! -+program main -+ integer :: my_x(2) = 1 -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ integer :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main002.f90 b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main002.f90 -new file mode 100644 -index 0000000..5cbfa78 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main002.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the array type and the array type is short -+! with bindc -+! -+program main -+ integer(2) :: my_x(2) = 1 -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ integer(2) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main003.f90 b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main003.f90 -new file mode 100644 -index 0000000..d7c5825 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main003.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the array type and the array type is long -+! with bindc -+! -+program main -+ integer(8) :: my_x(2) = 1 -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ integer(8) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main004.f90 b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main004.f90 -new file mode 100644 -index 0000000..6f54746 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main004.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the array type and the array type is -+! long long with bindc -+! -+program main -+ integer(8) :: my_x(2) = 1 -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ integer(8) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main005.f90 b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main005.f90 -new file mode 100644 -index 0000000..14607e5 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main005.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the array type and the array type is -+! signed char with bindc -+! -+program main -+ integer(1) :: my_x(2) = 65 -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ integer(1) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main006.f90 b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main006.f90 -new file mode 100644 -index 0000000..56d0f08 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main006.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the array type and the array type is size_t -+! with bindc -+! -+program main -+ integer(8) :: my_x(2) = 3 -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ integer(8) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main007.f90 b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main007.f90 -new file mode 100644 -index 0000000..73dd12f ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main007.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the array type and the array type is int8_t -+! with bindc -+! -+program main -+ integer(1) :: my_x(2) = 1 -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ integer(1) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main008.f90 b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main008.f90 -new file mode 100644 -index 0000000..c496284 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main008.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the array type and the array type is int16_t -+! with bindc -+! -+program main -+ integer(2) :: my_x(2) = 1 -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ integer(2) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main009.f90 b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main009.f90 -new file mode 100644 -index 0000000..aad0c4a ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main009.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the array type and the array type is int32_t -+! with bindc -+! -+program main -+ integer(4) :: my_x(2) = 1 -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ integer(4) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main010.f90 b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main010.f90 -new file mode 100644 -index 0000000..495b43a ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main010.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the array type and the array type is int64_t -+! with bindc -+! -+program main -+ integer(8) :: my_x(2) = 1 -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ integer(8) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main011.f90 b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main011.f90 -new file mode 100644 -index 0000000..dcde21c ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main011.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type and the scalar type is -+! int_least8_t with bindc -+! -+program main -+ integer(1) :: my_x(2) = 1 -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ integer(1) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main012.f90 b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main012.f90 -new file mode 100644 -index 0000000..6399871 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main012.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type and the scalar type is -+! int_least16_t with bindc -+! -+program main -+ integer(2) :: my_x(2) = 1 -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ integer(2) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main013.f90 b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main013.f90 -new file mode 100644 -index 0000000..b49842e ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main013.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type and the scalar type is -+! int_least32_t with bindc -+! -+program main -+ integer(4) :: my_x(2) = 1 -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ integer(4) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main014.f90 b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main014.f90 -new file mode 100644 -index 0000000..66fe325 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main014.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type and the scalar type is -+! int_least64_t with bindc -+! -+program main -+ integer(8) :: my_x(2) = 1 -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ integer(8) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main015.f90 b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main015.f90 -new file mode 100644 -index 0000000..bfcf6a3 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main015.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type and the scalar type is -+! int_fast8_t with bindc -+! -+program main -+ integer(1) :: my_x(2) = 1 -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ integer(1) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main016.f90 b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main016.f90 -new file mode 100644 -index 0000000..f9eef1c ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main016.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type and the scalar type is -+! int_fast16_t with bindc -+! -+program main -+ integer(8) :: my_x(2) = 1 -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ integer(8) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main017.f90 b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main017.f90 -new file mode 100644 -index 0000000..8f293c1 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main017.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type and the scalar type is -+! int_fast32_t with bindc -+! -+program main -+ integer(8) :: my_x(2) = 1 -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ integer(8) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main018.f90 b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main018.f90 -new file mode 100644 -index 0000000..8f01271 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main018.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type and the scalar type is -+! int_fast64_t with bindc -+! -+program main -+ integer(8) :: my_x(2) = 1 -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ integer(8) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main019.f90 b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main019.f90 -new file mode 100644 -index 0000000..1102216 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main019.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type and the scalar type is -+! intmax_t with bindc -+! -+program main -+ integer(8) :: my_x(2) = 1 -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ integer(8) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main020.f90 b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main020.f90 -new file mode 100644 -index 0000000..8976d63 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main020.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the scalar type and the scalar type is -+! intptr_t with bindc -+! -+program main -+ integer(8) :: my_x(2) = 1 -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ integer(8) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main021.f90 b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main021.f90 -new file mode 100644 -index 0000000..ae733f9 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main021.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the array type and the array type is float -+! with bindc -+! -+program main -+ real(4) :: my_x(2) = 12345678.7654321 -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ real(4) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main022.f90 b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main022.f90 -new file mode 100644 -index 0000000..319d83a ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main022.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the array type and the array type is double -+! with bindc -+! -+program main -+ real(8) :: my_x(2) = 12345678.7654321 -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ real(8) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main023.f90 b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main023.f90 -new file mode 100644 -index 0000000..9aad10e ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main023.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the array type and the array type is -+! long double with bindc -+! -+program main -+ integer, parameter :: K = selected_real_kind(16) -+ real(K) :: my_x(2) = 12345678.7654321 -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ integer, parameter :: K = selected_real_kind(16) -+ real(K) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main024.f90 b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main024.f90 -new file mode 100644 -index 0000000..47bdc29 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main024.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the array type and the array type is -+! float _Complex with bindc -+! -+program main -+ complex(4) :: my_x(2) = (-3.14159265358979, 1) -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ complex(4) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main025.f90 b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main025.f90 -new file mode 100644 -index 0000000..9390897 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main025.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the array type and the array type is -+! double _Complex with bindc -+! -+program main -+ complex(8) :: my_x(2) = (-3.14159265358979, 1) -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ complex(8) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main026.f90 b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main026.f90 -new file mode 100644 -index 0000000..e07c0ae ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main026.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the array type and the array type is -+! long double _Complex with bindc -+! -+program main -+ integer, parameter :: K = selected_real_kind(16) -+ complex(K) :: my_x(2) = (-3.14159265358979, 1) -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ integer, parameter :: K = selected_real_kind(16) -+ complex(K) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main027.f90 b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main027.f90 -new file mode 100644 -index 0000000..7a89da0 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main027.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the array type and the array type is _Bool -+! with bindc -+! -+program main -+ logical(1) :: my_x(2) = .TRUE. -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ logical(1) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main028.f90 b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main028.f90 -new file mode 100644 -index 0000000..b4fd1ba ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/fortran_main028.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the array type and the array type is char -+! with bindc -+! -+program main -+ character(1) :: my_x(2) = 'a' -+ interface -+ subroutine c_func(b) bind(c, name = "c_func_") -+ character(1) :: b(2) -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/result.md b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/result.md -new file mode 100644 -index 0000000..f15fe53 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/result.md -@@ -0,0 +1,29 @@ -+ | test | gfortran | flang | nvfortran| -+ | 001 | PASS | PASS | PASS | -+ | 002 | PASS | PASS | PASS | -+ | 003 | PASS | PASS | PASS | -+ | 004 | PASS | PASS | PASS | -+ | 005 | PASS | PASS | PASS | -+ | 006 | PASS | PASS | PASS | -+ | 007 | PASS | PASS | PASS | -+ | 008 | PASS | PASS | PASS | -+ | 009 | PASS | PASS | PASS | -+ | 010 | PASS | PASS | PASS | -+ | 011 | PASS | PASS | PASS | -+ | 012 | PASS | PASS | PASS | -+ | 013 | PASS | PASS | PASS | -+ | 014 | PASS | PASS | PASS | -+ | 015 | PASS | PASS | PASS | -+ | 016 | PASS | PASS | PASS | -+ | 017 | PASS | PASS | PASS | -+ | 018 | PASS | PASS | PASS | -+ | 019 | PASS | PASS | PASS | -+ | 020 | PASS | PASS | PASS | -+ | 021 | PASS | PASS | PASS | -+ | 022 | PASS | PASS | PASS | -+ | 023 | PASS | PASS | ERROR | -+ | 024 | PASS | PASS | PASS | -+ | 025 | PASS | PASS | PASS | -+ | 026 | PASS | PASS | ERROR | -+ | 027 | PASS | PASS | PASS | -+ | 028 | PASS | PASS | PASS | -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/run.sh b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/run.sh -new file mode 100644 -index 0000000..dbbd62f ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/003_fortran_call_c_array_bindc/run.sh -@@ -0,0 +1,22 @@ -+for i in {001..028} -+do -+echo "------- test $i ------." -+echo "----- gfortran result:" -+gcc c_func$i.c -c -o c-test.o -+gfortran fortran_main$i.f90 -fno-range-check -c -o fortran-test.o -+gfortran c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+echo "----- flang-new result : " -+clang c_func$i.c -c -o c-test.o -+flang-new fortran_main$i.f90 -c -o fortran-test.o -+flang-new -flang-experimental-exec c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+echo "----- nvfortran result : " -+clang c_func$i.c -c -o c-test.o -+nvfortran fortran_main$i.f90 -c -o fortran-test.o -+nvfortran c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+done -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_array/004_fortran_call_c_allocatable/c_func001.c b/test/interoperability_with_c_fortran_call_c_array/004_fortran_call_c_allocatable/c_func001.c -new file mode 100644 -index 0000000..6c2e3c9 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/004_fortran_call_c_allocatable/c_func001.c -@@ -0,0 +1,11 @@ -+#include -+#include -+#include -+void c_func_(int *s) -+{ -+ s = (int*) malloc(5 * sizeof(int)); -+ for(int i = 0; i < 5; i++) { -+ s[i] = i; -+ printf("the num is:%d\n", s[i]); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_array/004_fortran_call_c_allocatable/c_func002.c b/test/interoperability_with_c_fortran_call_c_array/004_fortran_call_c_allocatable/c_func002.c -new file mode 100644 -index 0000000..366ed68 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/004_fortran_call_c_allocatable/c_func002.c -@@ -0,0 +1,10 @@ -+#include -+#include -+#include -+void c_func_(int *s) -+{ -+ for(int i = 0; i < 5; i++) { -+ s[i] = i; -+ printf("the num is:%d\n", s[i]); -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_array/004_fortran_call_c_allocatable/fortran_main001.f90 b/test/interoperability_with_c_fortran_call_c_array/004_fortran_call_c_allocatable/fortran_main001.f90 -new file mode 100644 -index 0000000..0832e9c ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/004_fortran_call_c_allocatable/fortran_main001.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the allocatable type and the allocatable type -+! is unallocated -+! -+program main -+ integer, allocatable:: my_x(:) -+ interface -+ subroutine c_func(b) -+ integer, allocatable :: b(:) -+ end -+ end interface -+ print *, my_x -+ call c_func(my_x) -+ print *, my_x -+end -diff --git a/test/interoperability_with_c_fortran_call_c_array/004_fortran_call_c_allocatable/fortran_main002.f90 b/test/interoperability_with_c_fortran_call_c_array/004_fortran_call_c_allocatable/fortran_main002.f90 -new file mode 100644 -index 0000000..89e27a6 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/004_fortran_call_c_allocatable/fortran_main002.f90 -@@ -0,0 +1,19 @@ -+! Test fortran call c for the allocatable type and the allocatable type -+! is allocated -+! -+program main -+ integer, allocatable:: my_x(:) -+ interface -+ subroutine c_func(b) -+ integer, dimension(*) :: b -+ end -+ end interface -+ allocate(my_x(5)) -+ do i = 1, 5 -+ my_x(i) = 5 + i -+ end do -+ print *, my_x -+ call c_func(my_x) -+ print *, my_x -+ deallocate(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_array/004_fortran_call_c_allocatable/result.md b/test/interoperability_with_c_fortran_call_c_array/004_fortran_call_c_allocatable/result.md -new file mode 100644 -index 0000000..555c792 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/004_fortran_call_c_allocatable/result.md -@@ -0,0 +1,3 @@ -+ | test | gfortran | flang | nvfortran| -+ | 001 | PASS | PASS | PASS | -+ | 002 | PASS | PASS | PASS | -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_array/004_fortran_call_c_allocatable/run.sh b/test/interoperability_with_c_fortran_call_c_array/004_fortran_call_c_allocatable/run.sh -new file mode 100644 -index 0000000..8b4b5b9 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/004_fortran_call_c_allocatable/run.sh -@@ -0,0 +1,22 @@ -+for i in {001..002} -+do -+echo "------- test $i ------." -+echo "----- gfortran result:" -+gcc c_func$i.c -c -o c-test.o -+gfortran fortran_main$i.f90 -fno-range-check -c -o fortran-test.o -+gfortran c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+echo "----- flang-new result : " -+clang c_func$i.c -c -o c-test.o -+flang-new fortran_main$i.f90 -c -o fortran-test.o -+flang-new -flang-experimental-exec c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+echo "----- nvfortran result : " -+clang c_func$i.c -c -o c-test.o -+nvfortran fortran_main$i.f90 -c -o fortran-test.o -+nvfortran c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+done -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_array/005_fortran_call_c_string/c_func001.c b/test/interoperability_with_c_fortran_call_c_array/005_fortran_call_c_string/c_func001.c -new file mode 100644 -index 0000000..8df9e4b ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/005_fortran_call_c_string/c_func001.c -@@ -0,0 +1,8 @@ -+#include -+#include -+void c_func_(char *s) -+{ -+ char str1[4]; -+ strcpy(str1, s); -+ printf("the string is:%s\n", str1); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_array/005_fortran_call_c_string/c_func002.c b/test/interoperability_with_c_fortran_call_c_array/005_fortran_call_c_string/c_func002.c -new file mode 100644 -index 0000000..22ed279 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/005_fortran_call_c_string/c_func002.c -@@ -0,0 +1,11 @@ -+#include -+#include -+#include -+void c_func_(char *s) -+{ -+ char *str1; -+ str1 = (char*) malloc(4 * sizeof(char)); -+ strcpy(str1, s); -+ printf("the string is:%s\n", str1); -+ free(str1); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_array/005_fortran_call_c_string/c_func003.c b/test/interoperability_with_c_fortran_call_c_array/005_fortran_call_c_string/c_func003.c -new file mode 100644 -index 0000000..6d6d589 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/005_fortran_call_c_string/c_func003.c -@@ -0,0 +1,16 @@ -+#include -+#include -+#include -+void c_func_(char *s) -+{ -+ char **str1; -+ str1 = (char **) malloc(4 * sizeof(char *)); -+ for(int i = 0; i < 4; i++) { -+ str1[i] = (char * )malloc(4 * sizeof(char)); -+ for(int j = 0; j < 4; j++) { -+ str1[i][j] = s[i * 4 + j]; -+ } -+ printf("the string%d is:%s\n", i+1, str1[i]); -+ } -+ free(str1); -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_array/005_fortran_call_c_string/c_func004.c b/test/interoperability_with_c_fortran_call_c_array/005_fortran_call_c_string/c_func004.c -new file mode 100644 -index 0000000..6d7781a ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/005_fortran_call_c_string/c_func004.c -@@ -0,0 +1,11 @@ -+#include -+#include -+#include -+void c_func_(char *in, char *out) -+{ -+ int i = 0; -+ while(in[i] != '\0') { -+ out[i] = in[i]; -+ i++; -+ } -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_array/005_fortran_call_c_string/fortran_main001.f90 b/test/interoperability_with_c_fortran_call_c_array/005_fortran_call_c_string/fortran_main001.f90 -new file mode 100644 -index 0000000..aa23d5d ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/005_fortran_call_c_string/fortran_main001.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the char array and use character array to -+! store data in C files -+! -+program main -+ character :: my_x(4) = 'abcd' -+ interface -+ subroutine c_func(b) -+ character :: b(4) -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_array/005_fortran_call_c_string/fortran_main002.f90 b/test/interoperability_with_c_fortran_call_c_array/005_fortran_call_c_string/fortran_main002.f90 -new file mode 100644 -index 0000000..e9f831e ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/005_fortran_call_c_string/fortran_main002.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the char array and use character pointer to -+! store data in C files -+! -+program main -+ character :: my_x(4) = 'abcd' -+ interface -+ subroutine c_func(b) -+ character :: b(4) -+ end -+ end interface -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_array/005_fortran_call_c_string/fortran_main003.f90 b/test/interoperability_with_c_fortran_call_c_array/005_fortran_call_c_string/fortran_main003.f90 -new file mode 100644 -index 0000000..105de51 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/005_fortran_call_c_string/fortran_main003.f90 -@@ -0,0 +1,16 @@ -+! Test fortran call c for the char two-dimensional array -+! -+program main -+ character, dimension(4, 4) :: my_x -+ interface -+ subroutine c_func(b) -+ character, dimension(4, 4) :: b -+ end -+ end interface -+ do i = 1, 4 -+ do j = 1, 4 -+ my_x(i, j) = ACHAR(64 + i + j) -+ end do -+ end do -+ call c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_array/005_fortran_call_c_string/fortran_main004.f90 b/test/interoperability_with_c_fortran_call_c_array/005_fortran_call_c_string/fortran_main004.f90 -new file mode 100644 -index 0000000..46b8a73 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/005_fortran_call_c_string/fortran_main004.f90 -@@ -0,0 +1,13 @@ -+! Test fortran call c for the char dynamic arrays -+! -+program main -+ character(len = 9) :: my_x = 'abcddbcaw' -+ interface -+ subroutine c_func(a, b) -+ character, dimension(*) :: a, b -+ end -+ end interface -+ character, dimension(9) :: res -+ call c_func(my_x, res) -+ print *, res -+end -diff --git a/test/interoperability_with_c_fortran_call_c_array/005_fortran_call_c_string/result.md b/test/interoperability_with_c_fortran_call_c_array/005_fortran_call_c_string/result.md -new file mode 100644 -index 0000000..206c907 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/005_fortran_call_c_string/result.md -@@ -0,0 +1,5 @@ -+ | test | gfortran | flang | nvfortran| -+ | 001 | PASS | PASS | PASS | -+ | 002 | PASS | PASS | PASS | -+ | 003 | PASS | PASS | PASS | -+ | 004 | PASS | PASS | PASS | -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_array/005_fortran_call_c_string/run.sh b/test/interoperability_with_c_fortran_call_c_array/005_fortran_call_c_string/run.sh -new file mode 100644 -index 0000000..45c6bb0 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_array/005_fortran_call_c_string/run.sh -@@ -0,0 +1,22 @@ -+for i in {001..004} -+do -+echo "------- test $i ------." -+echo "----- gfortran result:" -+gcc c_func$i.c -c -o c-test.o -+gfortran fortran_main$i.f90 -fno-range-check -c -o fortran-test.o -+gfortran c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+echo "----- flang-new result : " -+clang c_func$i.c -c -o c-test.o -+flang-new fortran_main$i.f90 -c -o fortran-test.o -+flang-new -flang-experimental-exec c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+echo "----- nvfortran result : " -+clang c_func$i.c -c -o c-test.o -+nvfortran fortran_main$i.f90 -c -o fortran-test.o -+nvfortran c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+done -\ No newline at end of file --- -2.25.1 - diff --git a/9-test-interoperability-with-c-fortran-call-c-function.patch b/9-test-interoperability-with-c-fortran-call-c-function.patch deleted file mode 100644 index 4239fd50ae7e93d5ce5a3caeb1b7597b1c93b5ac..0000000000000000000000000000000000000000 --- a/9-test-interoperability-with-c-fortran-call-c-function.patch +++ /dev/null @@ -1,7770 +0,0 @@ -From 67de0ab8c92f170c4e758430393c1bd2ccf29c5f Mon Sep 17 00:00:00 2001 -From: xieyihui -Date: Fri, 18 Nov 2022 12:41:41 +0800 -Subject: [PATCH] Add new test cases about function for interoperability with C - about fortran call C - -diff --git a/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func001.c b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func001.c -new file mode 100644 -index 0000000..89defd9 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func001.c -@@ -0,0 +1,5 @@ -+#include -+int* c_func_(int *a) { -+ printf("%5d\n", *a); -+ return a; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func002.c b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func002.c -new file mode 100644 -index 0000000..6c172b6 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func002.c -@@ -0,0 +1,5 @@ -+#include -+short* c_func_(short *a) { -+ printf("%5d\n", *a); -+ return a; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func003.c b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func003.c -new file mode 100644 -index 0000000..b1b4838 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func003.c -@@ -0,0 +1,5 @@ -+#include -+long* c_func_(long *a) { -+ printf("%5ld\n", *a); -+ return a; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func004.c b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func004.c -new file mode 100644 -index 0000000..90896f0 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func004.c -@@ -0,0 +1,5 @@ -+#include -+long long* c_func_(long long *a) { -+ printf("%lld\n", *a); -+ return a; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func005.c b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func005.c -new file mode 100644 -index 0000000..91e7d0d ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func005.c -@@ -0,0 +1,5 @@ -+#include -+signed char* c_func_(signed char *a) { -+ printf("%5c\n", *a); -+ return a; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func006.c b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func006.c -new file mode 100644 -index 0000000..13ec31a ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func006.c -@@ -0,0 +1,6 @@ -+#include -+#include -+size_t* c_func_(size_t *a) { -+ printf("%5ld\n", *a); -+ return a; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func007.c b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func007.c -new file mode 100644 -index 0000000..e883fd3 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func007.c -@@ -0,0 +1,6 @@ -+#include -+#include -+int8_t* c_func_(int8_t *a) { -+ printf("%5hhd\n", *a); -+ return a; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func008.c b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func008.c -new file mode 100644 -index 0000000..a8a3209 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func008.c -@@ -0,0 +1,6 @@ -+#include -+#include -+int16_t* c_func_(int16_t *a) { -+ printf("%5hd\n", *a); -+ return a; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func009.c b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func009.c -new file mode 100644 -index 0000000..9ad7e76 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func009.c -@@ -0,0 +1,6 @@ -+#include -+#include -+int32_t* c_func_(int32_t *a) { -+ printf("%5d\n", *a); -+ return a; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func010.c b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func010.c -new file mode 100644 -index 0000000..6bff1b5 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func010.c -@@ -0,0 +1,6 @@ -+#include -+#include -+int64_t* c_func_(int64_t *a) { -+ printf("%5ld\n", *a); -+ return a; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func011.c b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func011.c -new file mode 100644 -index 0000000..4a5970a ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func011.c -@@ -0,0 +1,6 @@ -+#include -+#include -+int_least8_t* c_func_(int_least8_t *a) { -+ printf("%5hhd\n", *a); -+ return a; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func012.c b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func012.c -new file mode 100644 -index 0000000..72ac1a4 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func012.c -@@ -0,0 +1,6 @@ -+#include -+#include -+int_least16_t* c_func_(int_least16_t *a) { -+ printf("%5hd\n", *a); -+ return a; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func013.c b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func013.c -new file mode 100644 -index 0000000..771e48b ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func013.c -@@ -0,0 +1,6 @@ -+#include -+#include -+int_least32_t* c_func_(int_least32_t *a) { -+ printf("%d\n", *a); -+ return a; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func014.c b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func014.c -new file mode 100644 -index 0000000..c782984 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func014.c -@@ -0,0 +1,6 @@ -+#include -+#include -+int_least64_t* c_func_(int_least64_t *a) { -+ printf("%5ld\n", *a); -+ return a; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func015.c b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func015.c -new file mode 100644 -index 0000000..96452b1 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func015.c -@@ -0,0 +1,6 @@ -+#include -+#include -+int_fast8_t* c_func_(int_fast8_t *a) { -+ printf("%5hhd\n", *a); -+ return a; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func016.c b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func016.c -new file mode 100644 -index 0000000..27bac38 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func016.c -@@ -0,0 +1,6 @@ -+#include -+#include -+int_fast16_t* c_func_(int_fast16_t *a) { -+ printf("%5ld\n", *a); -+ return a; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func017.c b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func017.c -new file mode 100644 -index 0000000..f4e0e76 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func017.c -@@ -0,0 +1,6 @@ -+#include -+#include -+int_fast32_t* c_func_(int_fast32_t *a) { -+ printf("%ld\n", *a); -+ return a; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func018.c b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func018.c -new file mode 100644 -index 0000000..ee80d9a ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func018.c -@@ -0,0 +1,6 @@ -+#include -+#include -+int_fast64_t* c_func_(int_fast64_t *a) { -+ printf("%5ld\n", *a); -+ return a; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func019.c b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func019.c -new file mode 100644 -index 0000000..a6205df ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func019.c -@@ -0,0 +1,6 @@ -+#include -+#include -+intmax_t* c_func_(intmax_t *a) { -+ printf("%5ld\n", *a); -+ return a; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func020.c b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func020.c -new file mode 100644 -index 0000000..3fc6c40 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func020.c -@@ -0,0 +1,6 @@ -+#include -+#include -+intptr_t* c_func_(intptr_t *a) { -+ printf("%5ld\n", *a); -+ return a; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func021.c b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func021.c -new file mode 100644 -index 0000000..4584a17 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func021.c -@@ -0,0 +1,5 @@ -+#include -+float* c_func_(float *a) { -+ printf("%0.20f\n", *a); -+ return a; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func022.c b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func022.c -new file mode 100644 -index 0000000..6c20627 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func022.c -@@ -0,0 +1,5 @@ -+#include -+double* c_func_(double *a) { -+ printf("%0.20lf\n", *a); -+ return a; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func023.c b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func023.c -new file mode 100644 -index 0000000..4067c00 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func023.c -@@ -0,0 +1,5 @@ -+#include -+long double* c_func_(long double *a) { -+ printf("%0.20Lf\n", *a); -+ return a; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func024.c b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func024.c -new file mode 100644 -index 0000000..8d5cbd6 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func024.c -@@ -0,0 +1,6 @@ -+#include -+#include -+float _Complex* c_func_(float _Complex *t) { -+ printf("%0.20f + %0.20fi\n", creal(*t), cimag(*t)); -+ return t; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func025.c b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func025.c -new file mode 100644 -index 0000000..2cc6c66 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func025.c -@@ -0,0 +1,6 @@ -+#include -+#include -+double _Complex* c_func_(double _Complex *t) { -+ printf("%0.20lf + %0.20lfi\n", creal(*t), cimag(*t)); -+ return t; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func026.c b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func026.c -new file mode 100644 -index 0000000..4cd06f9 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func026.c -@@ -0,0 +1,6 @@ -+#include -+#include -+long double _Complex* c_func_(long double _Complex *t) { -+ printf("%0.20f + %0.20fi\n", creal(*t), cimag(*t)); -+ return t; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func027.c b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func027.c -new file mode 100644 -index 0000000..d576c9e ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func027.c -@@ -0,0 +1,5 @@ -+#include -+_Bool* c_func_(_Bool *a) { -+ printf("%5d\n", *a); -+ return a; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func028.c b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func028.c -new file mode 100644 -index 0000000..6024629 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/c_func028.c -@@ -0,0 +1,5 @@ -+#include -+char* c_func_(char *t) { -+ printf("%c\n", *t); -+ return t; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main001.f90 b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main001.f90 -new file mode 100644 -index 0000000..0162f22 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main001.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the return type is ptr of type int -+! -+program main -+ integer :: my_x = 1 -+ interface -+ function c_func(b) result(res) -+ integer :: b -+ integer, pointer :: res -+ end -+ end interface -+ print '(I5)', c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main002.f90 b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main002.f90 -new file mode 100644 -index 0000000..9398800 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main002.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the return type is ptr of type short -+! -+program main -+ integer(2) :: my_x = 1 -+ interface -+ function c_func(b) result(res) -+ integer(2) :: b -+ integer(2), pointer :: res -+ end -+ end interface -+ print '(I5)', c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main003.f90 b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main003.f90 -new file mode 100644 -index 0000000..8905eab ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main003.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the return type is ptr of type long -+! -+program main -+ integer(8) :: my_x = 1 -+ interface -+ function c_func(b) result(res) -+ integer(8) :: b -+ integer(8), pointer :: res -+ end -+ end interface -+ print '(I5)', c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main004.f90 b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main004.f90 -new file mode 100644 -index 0000000..6ce9768 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main004.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the return type is ptr of type long long -+! -+program main -+ integer(8) :: my_x = 1 -+ interface -+ function c_func(b) result(res) -+ integer(8) :: b -+ integer(8), pointer :: res -+ end -+ end interface -+ print '(I5)', c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main005.f90 b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main005.f90 -new file mode 100644 -index 0000000..9445938 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main005.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the return type is ptr of type signed char -+! -+program main -+ integer(1) :: my_x = 65 -+ interface -+ function c_func(b) result(res) -+ integer(1) :: b -+ integer(1), pointer :: res -+ end -+ end interface -+ print '(I5)', c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main006.f90 b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main006.f90 -new file mode 100644 -index 0000000..7ead44f ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main006.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the return type is ptr of type size_t -+! -+program main -+ integer(8) :: my_x = 1 -+ interface -+ function c_func(b) result(res) -+ integer(8) :: b -+ integer(8), pointer :: res -+ end -+ end interface -+ print '(I5)', c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main007.f90 b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main007.f90 -new file mode 100644 -index 0000000..4a80499 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main007.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the return type is ptr of type int8_t -+! -+program main -+ integer(1) :: my_x = 1 -+ interface -+ function c_func(b) result(res) -+ integer(1) :: b -+ integer(1), pointer :: res -+ end -+ end interface -+ print '(I5)', c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main008.f90 b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main008.f90 -new file mode 100644 -index 0000000..d85e1bb ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main008.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the return type is ptr of type int16_t -+! -+program main -+ integer(2) :: my_x = 1 -+ interface -+ function c_func(b) result(res) -+ integer(2) :: b -+ integer(2), pointer :: res -+ end -+ end interface -+ print '(I5)', c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main009.f90 b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main009.f90 -new file mode 100644 -index 0000000..a613e46 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main009.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the return type is ptr of type int32_t -+! -+program main -+ integer(4) :: my_x = 1 -+ interface -+ function c_func(b) result(res) -+ integer(4) :: b -+ integer(4), pointer :: res -+ end -+ end interface -+ print '(I5)', c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main010.f90 b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main010.f90 -new file mode 100644 -index 0000000..c300630 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main010.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the return type is ptr of type int64_t -+! -+program main -+ integer(8) :: my_x = 1 -+ interface -+ function c_func(b) result(res) -+ integer(8) :: b -+ integer(8), pointer :: res -+ end -+ end interface -+ print '(I5)', c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main011.f90 b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main011.f90 -new file mode 100644 -index 0000000..c5b3ec4 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main011.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the return type is ptr of type int_least8_t -+! -+program main -+ integer(1) :: my_x = 1 -+ interface -+ function c_func(b) result(res) -+ integer(1) :: b -+ integer(1), pointer :: res -+ end -+ end interface -+ print '(I5)', c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main012.f90 b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main012.f90 -new file mode 100644 -index 0000000..50d736a ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main012.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the return type is ptr of type int_least16_t -+! -+program main -+ integer(2) :: my_x = 1 -+ interface -+ function c_func(b) result(res) -+ integer(2) :: b -+ integer(2), pointer :: res -+ end -+ end interface -+ print '(I5)', c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main013.f90 b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main013.f90 -new file mode 100644 -index 0000000..f1ed742 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main013.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the return type is ptr of type int_least32_t -+! -+program main -+ integer(4) :: my_x = 1 -+ interface -+ function c_func(b) result(res) -+ integer(4) :: b -+ integer(4), pointer :: res -+ end -+ end interface -+ print '(I5)', c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main014.f90 b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main014.f90 -new file mode 100644 -index 0000000..d508d97 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main014.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the return type is ptr of type int_least64_t -+! -+program main -+ integer(8) :: my_x = 1 -+ interface -+ function c_func(b) result(res) -+ integer(8) :: b -+ integer(8), pointer :: res -+ end -+ end interface -+ print '(I5)', c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main015.f90 b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main015.f90 -new file mode 100644 -index 0000000..626f02a ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main015.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the return type is ptr of type int_fast8_t -+! -+program main -+ integer(1) :: my_x = 1 -+ interface -+ function c_func(b) result(res) -+ integer(1) :: b -+ integer(1), pointer :: res -+ end -+ end interface -+ print '(I5)', c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main016.f90 b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main016.f90 -new file mode 100644 -index 0000000..2a41aa9 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main016.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the return type is ptr of type int_fast16_t -+! -+program main -+ integer(8) :: my_x = 1 -+ interface -+ function c_func(b) result(res) -+ integer(8) :: b -+ integer(8), pointer :: res -+ end -+ end interface -+ print '(I5)', c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main017.f90 b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main017.f90 -new file mode 100644 -index 0000000..1f4ae6a ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main017.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the return type is ptr of type int_fast32_t -+! -+program main -+ integer(8) :: my_x = 1 -+ interface -+ function c_func(b) result(res) -+ integer(8) :: b -+ integer(8), pointer :: res -+ end -+ end interface -+ print '(I5)', c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main018.f90 b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main018.f90 -new file mode 100644 -index 0000000..9c99b13 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main018.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the return type is ptr of type int_fast64_t -+! -+program main -+ integer(8) :: my_x = 1 -+ interface -+ function c_func(b) result(res) -+ integer(8) :: b -+ integer(8), pointer :: res -+ end -+ end interface -+ print '(I5)', c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main019.f90 b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main019.f90 -new file mode 100644 -index 0000000..4bdcd0c ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main019.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the return type is ptr of type intmax_t -+! -+program main -+ integer(8) :: my_x = 1 -+ interface -+ function c_func(b) result(res) -+ integer(8) :: b -+ integer(8), pointer :: res -+ end -+ end interface -+ print *, c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main020.f90 b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main020.f90 -new file mode 100644 -index 0000000..80b302e ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main020.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the return type is ptr of type intptr_t -+! -+program main -+ integer(8) :: my_x = 1 -+ interface -+ function c_func(b) result(res) -+ integer(8) :: b -+ integer(8), pointer :: res -+ end -+ end interface -+ print '(I5)', c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main021.f90 b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main021.f90 -new file mode 100644 -index 0000000..3760036 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main021.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the return type is ptr of type float -+! -+program main -+ real(4) :: my_x = 1.0 -+ interface -+ function c_func(b) result(res) -+ real(4) :: b -+ real(4), pointer :: res -+ end -+ end interface -+ print '(F20.10)', c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main022.f90 b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main022.f90 -new file mode 100644 -index 0000000..491887f ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main022.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the return type is ptr of type double -+! -+program main -+ real(8) :: my_x = 3.1415926535 -+ interface -+ function c_func(b) result(res) -+ real(8) :: b -+ real(8), pointer :: res -+ end -+ end interface -+ print '(F20.10)', c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main023.f90 b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main023.f90 -new file mode 100644 -index 0000000..a8861c9 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main023.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the return type is ptr of type long double -+! -+program main -+ integer, parameter :: K = selected_real_kind(16) -+ real(K) :: my_x = 3.1415926535 -+ interface -+ function c_func(b) result(res) -+ integer, parameter :: K = selected_real_kind(16) -+ real(K) :: b -+ real(K), pointer :: res -+ end -+ end interface -+ print '(F20.10)', c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main024.f90 b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main024.f90 -new file mode 100644 -index 0000000..2a49f2a ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main024.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the return type is ptr of type float _Complex -+! -+program main -+ complex(4) :: my_x = (3.1415926535, 1) -+ interface -+ function c_func(b) result(res) -+ complex(4) :: b -+ complex(4), pointer :: res -+ end -+ end interface -+ print '(F20.10)', c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main025.f90 b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main025.f90 -new file mode 100644 -index 0000000..e329c2a ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main025.f90 -@@ -0,0 +1,13 @@ -+! Test fortran call c for the return type is ptr of type double -+! _Complex -+! -+program main -+ complex(8) :: my_x = (3.1415926535, 1) -+ interface -+ function c_func(b) result(res) -+ complex(8) :: b -+ complex(8), pointer :: res -+ end -+ end interface -+ print '(F20.10)', c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main026.f90 b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main026.f90 -new file mode 100644 -index 0000000..6b2b0a2 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main026.f90 -@@ -0,0 +1,15 @@ -+! Test fortran call c for the return type is ptr of type long double -+! _Complex -+! -+program main -+ integer, parameter :: K = selected_real_kind(16) -+ complex(K) :: my_x = (3.1415926535, 1) -+ interface -+ function c_func(b) result(res) -+ integer, parameter :: K = selected_real_kind(16) -+ complex(K) :: b -+ complex(K), pointer :: res -+ end -+ end interface -+ print '(F20.10)', c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main027.f90 b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main027.f90 -new file mode 100644 -index 0000000..28efc8d ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main027.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the return type is ptr of type _Bool -+! -+program main -+ logical(1) :: my_x = .FALSE. -+ interface -+ function c_func(b) result(res) -+ logical(1) :: b -+ logical(1), pointer :: res -+ end -+ end interface -+ print *, c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main028.f90 b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main028.f90 -new file mode 100644 -index 0000000..37a0198 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/fortran_main028.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the return type is ptr of type char -+! -+program main -+ character(1) :: my_x = 'a' -+ interface -+ function c_func(b) result(res) -+ character(1) :: b -+ character(1), pointer :: res -+ end -+ end interface -+ print *, c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/result.md b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/result.md -new file mode 100644 -index 0000000..8facd6e ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/result.md -@@ -0,0 +1,29 @@ -+ | test | gfortran | flang | nvfortran| -+ | 001 | PASS | ERROR | ERROR | -+ | 002 | PASS | ERROR | ERROR | -+ | 003 | PASS | ERROR | ERROR | -+ | 004 | PASS | ERROR | ERROR | -+ | 005 | PASS | ERROR | ERROR | -+ | 006 | PASS | ERROR | ERROR | -+ | 007 | PASS | ERROR | ERROR | -+ | 008 | PASS | ERROR | ERROR | -+ | 009 | PASS | ERROR | ERROR | -+ | 010 | PASS | ERROR | ERROR | -+ | 011 | PASS | ERROR | ERROR | -+ | 012 | PASS | ERROR | ERROR | -+ | 013 | PASS | ERROR | ERROR | -+ | 014 | PASS | ERROR | ERROR | -+ | 015 | PASS | ERROR | ERROR | -+ | 016 | PASS | ERROR | ERROR | -+ | 017 | PASS | ERROR | ERROR | -+ | 018 | PASS | ERROR | ERROR | -+ | 019 | PASS | ERROR | ERROR | -+ | 020 | PASS | ERROR | ERROR | -+ | 021 | PASS | ERROR | ERROR | -+ | 022 | PASS | ERROR | ERROR | -+ | 023 | PASS | ERROR | ERROR | -+ | 024 | PASS | ERROR | ERROR | -+ | 025 | PASS | ERROR | ERROR | -+ | 026 | PASS | ERROR | ERROR | -+ | 027 | PASS | ERROR | PASS | -+ | 028 | ERROR | ERROR | ERROR | -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/run.sh b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/run.sh -new file mode 100644 -index 0000000..dbbd62f ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/001_fortran_call_c_function_ptr/run.sh -@@ -0,0 +1,22 @@ -+for i in {001..028} -+do -+echo "------- test $i ------." -+echo "----- gfortran result:" -+gcc c_func$i.c -c -o c-test.o -+gfortran fortran_main$i.f90 -fno-range-check -c -o fortran-test.o -+gfortran c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+echo "----- flang-new result : " -+clang c_func$i.c -c -o c-test.o -+flang-new fortran_main$i.f90 -c -o fortran-test.o -+flang-new -flang-experimental-exec c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+echo "----- nvfortran result : " -+clang c_func$i.c -c -o c-test.o -+nvfortran fortran_main$i.f90 -c -o fortran-test.o -+nvfortran c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+done -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func001.c b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func001.c -new file mode 100644 -index 0000000..89defd9 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func001.c -@@ -0,0 +1,5 @@ -+#include -+int* c_func_(int *a) { -+ printf("%5d\n", *a); -+ return a; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func002.c b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func002.c -new file mode 100644 -index 0000000..6c172b6 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func002.c -@@ -0,0 +1,5 @@ -+#include -+short* c_func_(short *a) { -+ printf("%5d\n", *a); -+ return a; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func003.c b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func003.c -new file mode 100644 -index 0000000..b1b4838 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func003.c -@@ -0,0 +1,5 @@ -+#include -+long* c_func_(long *a) { -+ printf("%5ld\n", *a); -+ return a; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func004.c b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func004.c -new file mode 100644 -index 0000000..90896f0 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func004.c -@@ -0,0 +1,5 @@ -+#include -+long long* c_func_(long long *a) { -+ printf("%lld\n", *a); -+ return a; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func005.c b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func005.c -new file mode 100644 -index 0000000..91e7d0d ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func005.c -@@ -0,0 +1,5 @@ -+#include -+signed char* c_func_(signed char *a) { -+ printf("%5c\n", *a); -+ return a; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func006.c b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func006.c -new file mode 100644 -index 0000000..13ec31a ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func006.c -@@ -0,0 +1,6 @@ -+#include -+#include -+size_t* c_func_(size_t *a) { -+ printf("%5ld\n", *a); -+ return a; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func007.c b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func007.c -new file mode 100644 -index 0000000..e883fd3 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func007.c -@@ -0,0 +1,6 @@ -+#include -+#include -+int8_t* c_func_(int8_t *a) { -+ printf("%5hhd\n", *a); -+ return a; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func008.c b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func008.c -new file mode 100644 -index 0000000..a8a3209 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func008.c -@@ -0,0 +1,6 @@ -+#include -+#include -+int16_t* c_func_(int16_t *a) { -+ printf("%5hd\n", *a); -+ return a; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func009.c b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func009.c -new file mode 100644 -index 0000000..9ad7e76 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func009.c -@@ -0,0 +1,6 @@ -+#include -+#include -+int32_t* c_func_(int32_t *a) { -+ printf("%5d\n", *a); -+ return a; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func010.c b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func010.c -new file mode 100644 -index 0000000..6bff1b5 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func010.c -@@ -0,0 +1,6 @@ -+#include -+#include -+int64_t* c_func_(int64_t *a) { -+ printf("%5ld\n", *a); -+ return a; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func011.c b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func011.c -new file mode 100644 -index 0000000..4a5970a ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func011.c -@@ -0,0 +1,6 @@ -+#include -+#include -+int_least8_t* c_func_(int_least8_t *a) { -+ printf("%5hhd\n", *a); -+ return a; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func012.c b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func012.c -new file mode 100644 -index 0000000..72ac1a4 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func012.c -@@ -0,0 +1,6 @@ -+#include -+#include -+int_least16_t* c_func_(int_least16_t *a) { -+ printf("%5hd\n", *a); -+ return a; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func013.c b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func013.c -new file mode 100644 -index 0000000..771e48b ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func013.c -@@ -0,0 +1,6 @@ -+#include -+#include -+int_least32_t* c_func_(int_least32_t *a) { -+ printf("%d\n", *a); -+ return a; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func014.c b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func014.c -new file mode 100644 -index 0000000..c782984 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func014.c -@@ -0,0 +1,6 @@ -+#include -+#include -+int_least64_t* c_func_(int_least64_t *a) { -+ printf("%5ld\n", *a); -+ return a; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func015.c b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func015.c -new file mode 100644 -index 0000000..96452b1 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func015.c -@@ -0,0 +1,6 @@ -+#include -+#include -+int_fast8_t* c_func_(int_fast8_t *a) { -+ printf("%5hhd\n", *a); -+ return a; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func016.c b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func016.c -new file mode 100644 -index 0000000..27bac38 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func016.c -@@ -0,0 +1,6 @@ -+#include -+#include -+int_fast16_t* c_func_(int_fast16_t *a) { -+ printf("%5ld\n", *a); -+ return a; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func017.c b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func017.c -new file mode 100644 -index 0000000..f4e0e76 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func017.c -@@ -0,0 +1,6 @@ -+#include -+#include -+int_fast32_t* c_func_(int_fast32_t *a) { -+ printf("%ld\n", *a); -+ return a; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func018.c b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func018.c -new file mode 100644 -index 0000000..ee80d9a ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func018.c -@@ -0,0 +1,6 @@ -+#include -+#include -+int_fast64_t* c_func_(int_fast64_t *a) { -+ printf("%5ld\n", *a); -+ return a; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func019.c b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func019.c -new file mode 100644 -index 0000000..a6205df ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func019.c -@@ -0,0 +1,6 @@ -+#include -+#include -+intmax_t* c_func_(intmax_t *a) { -+ printf("%5ld\n", *a); -+ return a; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func020.c b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func020.c -new file mode 100644 -index 0000000..3fc6c40 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func020.c -@@ -0,0 +1,6 @@ -+#include -+#include -+intptr_t* c_func_(intptr_t *a) { -+ printf("%5ld\n", *a); -+ return a; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func021.c b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func021.c -new file mode 100644 -index 0000000..4584a17 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func021.c -@@ -0,0 +1,5 @@ -+#include -+float* c_func_(float *a) { -+ printf("%0.20f\n", *a); -+ return a; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func022.c b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func022.c -new file mode 100644 -index 0000000..6c20627 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func022.c -@@ -0,0 +1,5 @@ -+#include -+double* c_func_(double *a) { -+ printf("%0.20lf\n", *a); -+ return a; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func023.c b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func023.c -new file mode 100644 -index 0000000..4067c00 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func023.c -@@ -0,0 +1,5 @@ -+#include -+long double* c_func_(long double *a) { -+ printf("%0.20Lf\n", *a); -+ return a; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func024.c b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func024.c -new file mode 100644 -index 0000000..8d5cbd6 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func024.c -@@ -0,0 +1,6 @@ -+#include -+#include -+float _Complex* c_func_(float _Complex *t) { -+ printf("%0.20f + %0.20fi\n", creal(*t), cimag(*t)); -+ return t; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func025.c b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func025.c -new file mode 100644 -index 0000000..2cc6c66 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func025.c -@@ -0,0 +1,6 @@ -+#include -+#include -+double _Complex* c_func_(double _Complex *t) { -+ printf("%0.20lf + %0.20lfi\n", creal(*t), cimag(*t)); -+ return t; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func026.c b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func026.c -new file mode 100644 -index 0000000..4cd06f9 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func026.c -@@ -0,0 +1,6 @@ -+#include -+#include -+long double _Complex* c_func_(long double _Complex *t) { -+ printf("%0.20f + %0.20fi\n", creal(*t), cimag(*t)); -+ return t; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func027.c b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func027.c -new file mode 100644 -index 0000000..d576c9e ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func027.c -@@ -0,0 +1,5 @@ -+#include -+_Bool* c_func_(_Bool *a) { -+ printf("%5d\n", *a); -+ return a; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func028.c b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func028.c -new file mode 100644 -index 0000000..6024629 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/c_func028.c -@@ -0,0 +1,5 @@ -+#include -+char* c_func_(char *t) { -+ printf("%c\n", *t); -+ return t; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main001.f90 b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main001.f90 -new file mode 100644 -index 0000000..eea8ab6 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main001.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the return type is ptr of type int with bindc -+! -+program main -+ integer :: my_x = 1 -+ interface -+ function c_func(b) result(res) bind(c, name = "c_func_") -+ integer :: b -+ integer, pointer :: res -+ end -+ end interface -+ print '(I5)', c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main002.f90 b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main002.f90 -new file mode 100644 -index 0000000..75ae05d ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main002.f90 -@@ -0,0 +1,13 @@ -+! Test fortran call c for the return type is ptr of type short with -+! bindc -+! -+program main -+ integer(2) :: my_x = 1 -+ interface -+ function c_func(b) result(res) bind(c, name = "c_func_") -+ integer(2) :: b -+ integer(2), pointer :: res -+ end -+ end interface -+ print '(I5)', c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main003.f90 b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main003.f90 -new file mode 100644 -index 0000000..0ddcedf ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main003.f90 -@@ -0,0 +1,13 @@ -+! Test fortran call c for the return type is ptr of type long with -+! bindc -+! -+program main -+ integer(8) :: my_x = 1 -+ interface -+ function c_func(b) result(res) bind(c, name = "c_func_") -+ integer(8) :: b -+ integer(8), pointer :: res -+ end -+ end interface -+ print '(I5)', c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main004.f90 b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main004.f90 -new file mode 100644 -index 0000000..7383644 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main004.f90 -@@ -0,0 +1,13 @@ -+! Test fortran call c for the return type is ptr of type long long with -+! bindc -+! -+program main -+ integer(8) :: my_x = 1 -+ interface -+ function c_func(b) result(res) bind(c, name = "c_func_") -+ integer(8) :: b -+ integer(8), pointer :: res -+ end -+ end interface -+ print '(I5)', c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main005.f90 b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main005.f90 -new file mode 100644 -index 0000000..641ec2f ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main005.f90 -@@ -0,0 +1,13 @@ -+! Test fortran call c for the return type is ptr of type signed char -+! with bindc -+! -+program main -+ integer(1) :: my_x = 65 -+ interface -+ function c_func(b) result(res) bind(c, name = "c_func_") -+ integer(1) :: b -+ integer(1), pointer :: res -+ end -+ end interface -+ print '(I5)', c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main006.f90 b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main006.f90 -new file mode 100644 -index 0000000..f5776ff ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main006.f90 -@@ -0,0 +1,13 @@ -+! Test fortran call c for the return type is ptr of type size_t with -+! bindc -+! -+program main -+ integer(8) :: my_x = 1 -+ interface -+ function c_func(b) result(res) bind(c, name = "c_func_") -+ integer(8) :: b -+ integer(8), pointer :: res -+ end -+ end interface -+ print '(I5)', c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main007.f90 b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main007.f90 -new file mode 100644 -index 0000000..9c8f25b ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main007.f90 -@@ -0,0 +1,13 @@ -+! Test fortran call c for the return type is ptr of type int8_t with -+! bindc -+! -+program main -+ integer(1) :: my_x = 1 -+ interface -+ function c_func(b) result(res) bind(c, name = "c_func_") -+ integer(1) :: b -+ integer(1), pointer :: res -+ end -+ end interface -+ print '(I5)', c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main008.f90 b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main008.f90 -new file mode 100644 -index 0000000..e057058 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main008.f90 -@@ -0,0 +1,13 @@ -+! Test fortran call c for the return type is ptr of type int16_t with -+! bindc -+! -+program main -+ integer(2) :: my_x = 1 -+ interface -+ function c_func(b) result(res) bind(c, name = "c_func_") -+ integer(2) :: b -+ integer(2), pointer :: res -+ end -+ end interface -+ print '(I5)', c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main009.f90 b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main009.f90 -new file mode 100644 -index 0000000..e9c35c1 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main009.f90 -@@ -0,0 +1,13 @@ -+! Test fortran call c for the return type is ptr of type int32_t with -+! bindc -+! -+program main -+ integer(4) :: my_x = 1 -+ interface -+ function c_func(b) result(res) bind(c, name = "c_func_") -+ integer(4) :: b -+ integer(4), pointer :: res -+ end -+ end interface -+ print '(I5)', c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main010.f90 b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main010.f90 -new file mode 100644 -index 0000000..d52b3f0 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main010.f90 -@@ -0,0 +1,13 @@ -+! Test fortran call c for the return type is ptr of type int64_t with -+! bindc -+! -+program main -+ integer(8) :: my_x = 1 -+ interface -+ function c_func(b) result(res) bind(c, name = "c_func_") -+ integer(8) :: b -+ integer(8), pointer :: res -+ end -+ end interface -+ print '(I5)', c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main011.f90 b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main011.f90 -new file mode 100644 -index 0000000..8427950 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main011.f90 -@@ -0,0 +1,13 @@ -+! Test fortran call c for the return type is ptr of type int_least8_t -+! with bindc -+! -+program main -+ integer(1) :: my_x = 1 -+ interface -+ function c_func(b) result(res) bind(c, name = "c_func_") -+ integer(1) :: b -+ integer(1), pointer :: res -+ end -+ end interface -+ print '(I5)', c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main012.f90 b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main012.f90 -new file mode 100644 -index 0000000..123a9b1 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main012.f90 -@@ -0,0 +1,13 @@ -+! Test fortran call c for the return type is ptr of type int_least16_t -+! with bindc -+! -+program main -+ integer(2) :: my_x = 1 -+ interface -+ function c_func(b) result(res) bind(c, name = "c_func_") -+ integer(2) :: b -+ integer(2), pointer :: res -+ end -+ end interface -+ print '(I5)', c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main013.f90 b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main013.f90 -new file mode 100644 -index 0000000..a8586ed ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main013.f90 -@@ -0,0 +1,13 @@ -+! Test fortran call c for the return type is ptr of type int_least32_t -+! with bindc -+! -+program main -+ integer(4) :: my_x = 1 -+ interface -+ function c_func(b) result(res) bind(c, name = "c_func_") -+ integer(4) :: b -+ integer(4), pointer :: res -+ end -+ end interface -+ print '(I5)', c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main014.f90 b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main014.f90 -new file mode 100644 -index 0000000..6634cd9 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main014.f90 -@@ -0,0 +1,13 @@ -+! Test fortran call c for the return type is ptr of type int_least64_t -+! with bindc -+! -+program main -+ integer(8) :: my_x = 1 -+ interface -+ function c_func(b) result(res) bind(c, name = "c_func_") -+ integer(8) :: b -+ integer(8), pointer :: res -+ end -+ end interface -+ print '(I5)', c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main015.f90 b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main015.f90 -new file mode 100644 -index 0000000..007d56d ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main015.f90 -@@ -0,0 +1,13 @@ -+! Test fortran call c for the return type is ptr of type int_fast8_t -+! with bindc -+! -+program main -+ integer(1) :: my_x = 1 -+ interface -+ function c_func(b) result(res) bind(c, name = "c_func_") -+ integer(1) :: b -+ integer(1), pointer :: res -+ end -+ end interface -+ print '(I5)', c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main016.f90 b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main016.f90 -new file mode 100644 -index 0000000..58c20b5 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main016.f90 -@@ -0,0 +1,13 @@ -+! Test fortran call c for the return type is ptr of type int_fast16_t -+! with bindc -+! -+program main -+ integer(8) :: my_x = 1 -+ interface -+ function c_func(b) result(res) bind(c, name = "c_func_") -+ integer(8) :: b -+ integer(8), pointer :: res -+ end -+ end interface -+ print '(I5)', c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main017.f90 b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main017.f90 -new file mode 100644 -index 0000000..64ed1d0 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main017.f90 -@@ -0,0 +1,13 @@ -+! Test fortran call c for the return type is ptr of type int_fast32_t -+! with bindc -+! -+program main -+ integer(8) :: my_x = 1 -+ interface -+ function c_func(b) result(res) bind(c, name = "c_func_") -+ integer(8) :: b -+ integer(8), pointer :: res -+ end -+ end interface -+ print '(I5)', c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main018.f90 b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main018.f90 -new file mode 100644 -index 0000000..b7ad882 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main018.f90 -@@ -0,0 +1,13 @@ -+! Test fortran call c for the return type is ptr of type int_fast64_t -+! with bindc -+! -+program main -+ integer(8) :: my_x = 1 -+ interface -+ function c_func(b) result(res) bind(c, name = "c_func_") -+ integer(8) :: b -+ integer(8), pointer :: res -+ end -+ end interface -+ print '(I5)', c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main019.f90 b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main019.f90 -new file mode 100644 -index 0000000..1197ccb ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main019.f90 -@@ -0,0 +1,13 @@ -+! Test fortran call c for the return type is ptr of type intmax_t with -+! bindc -+! -+program main -+ integer(8) :: my_x = 1 -+ interface -+ function c_func(b) result(res) bind(c, name = "c_func_") -+ integer(8) :: b -+ integer(8), pointer :: res -+ end -+ end interface -+ print *, c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main020.f90 b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main020.f90 -new file mode 100644 -index 0000000..9bf210b ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main020.f90 -@@ -0,0 +1,13 @@ -+! Test fortran call c for the return type is ptr of type intptr_t with -+! bindc -+! -+program main -+ integer(8) :: my_x = 1 -+ interface -+ function c_func(b) result(res) bind(c, name = "c_func_") -+ integer(8) :: b -+ integer(8), pointer :: res -+ end -+ end interface -+ print '(I5)', c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main021.f90 b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main021.f90 -new file mode 100644 -index 0000000..debcb13 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main021.f90 -@@ -0,0 +1,13 @@ -+! Test fortran call c for the return type is ptr of type float with -+! bindc -+! -+program main -+ real(4) :: my_x = 1.0 -+ interface -+ function c_func(b) result(res) bind(c, name = "c_func_") -+ real(4) :: b -+ real(4), pointer :: res -+ end -+ end interface -+ print '(F20.10)', c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main022.f90 b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main022.f90 -new file mode 100644 -index 0000000..20c50dc ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main022.f90 -@@ -0,0 +1,13 @@ -+! Test fortran call c for the return type is ptr of type double with -+! bindc -+! -+program main -+ real(8) :: my_x = 3.1415926535 -+ interface -+ function c_func(b) result(res) bind(c, name = "c_func_") -+ real(8) :: b -+ real(8), pointer :: res -+ end -+ end interface -+ print '(F20.10)', c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main023.f90 b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main023.f90 -new file mode 100644 -index 0000000..db15fba ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main023.f90 -@@ -0,0 +1,15 @@ -+! Test fortran call c for the return type is ptr of type long double -+! with bindc -+! -+program main -+ integer, parameter :: K = selected_real_kind(16) -+ real(K) :: my_x = 3.1415926535 -+ interface -+ function c_func(b) result(res) bind(c, name = "c_func_") -+ integer, parameter :: K = selected_real_kind(16) -+ real(K) :: b -+ real(K), pointer :: res -+ end -+ end interface -+ print '(F20.10)', c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main024.f90 b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main024.f90 -new file mode 100644 -index 0000000..418f3ef ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main024.f90 -@@ -0,0 +1,13 @@ -+! Test fortran call c for the return type is ptr of type float _Complex -+! with bindc -+! -+program main -+ complex(4) :: my_x = (3.1415926535, 1) -+ interface -+ function c_func(b) result(res) bind(c, name = "c_func_") -+ complex(4) :: b -+ complex(4), pointer :: res -+ end -+ end interface -+ print '(F20.10)', c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main025.f90 b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main025.f90 -new file mode 100644 -index 0000000..d895ead ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main025.f90 -@@ -0,0 +1,13 @@ -+! Test fortran call c for the return type is ptr of type double -+! _Complex with bindc -+! -+program main -+ complex(8) :: my_x = (3.1415926535, 1) -+ interface -+ function c_func(b) result(res) bind(c, name = "c_func_") -+ complex(8) :: b -+ complex(8), pointer :: res -+ end -+ end interface -+ print '(F20.10)', c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main026.f90 b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main026.f90 -new file mode 100644 -index 0000000..4a70cfe ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main026.f90 -@@ -0,0 +1,15 @@ -+! Test fortran call c for the return type is ptr of type long double -+! _Complex with bindc -+! -+program main -+ integer, parameter :: K = selected_real_kind(16) -+ complex(K) :: my_x = (3.1415926535, 1) -+ interface -+ function c_func(b) result(res) bind(c, name = "c_func_") -+ integer, parameter :: K = selected_real_kind(16) -+ complex(K) :: b -+ complex(K), pointer :: res -+ end -+ end interface -+ print '(F20.10)', c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main027.f90 b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main027.f90 -new file mode 100644 -index 0000000..7a59b51 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main027.f90 -@@ -0,0 +1,13 @@ -+! Test fortran call c for the return type is ptr of type _Bool with -+! bindc -+! -+program main -+ logical(1) :: my_x = .FALSE. -+ interface -+ function c_func(b) result(res) bind(c, name = "c_func_") -+ logical(1) :: b -+ logical(1), pointer :: res -+ end -+ end interface -+ print *, c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main028.f90 b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main028.f90 -new file mode 100644 -index 0000000..c76780f ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/fortran_main028.f90 -@@ -0,0 +1,13 @@ -+! Test fortran call c for the return type is ptr of type char with -+! bindc -+! -+program main -+ character(1) :: my_x = 'a' -+ interface -+ function c_func(b) result(res) bind(c, name = "c_func_") -+ character(1) :: b -+ character(1), pointer :: res -+ end -+ end interface -+ print *, c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/result.md b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/result.md -new file mode 100644 -index 0000000..c1f2643 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/result.md -@@ -0,0 +1,29 @@ -+ | test | gfortran | flang | nvfortran| -+ | 001 | PASS | ERROR | ERROR | -+ | 002 | PASS | ERROR | ERROR | -+ | 003 | PASS | ERROR | ERROR | -+ | 004 | PASS | ERROR | ERROR | -+ | 005 | PASS | ERROR | ERROR | -+ | 006 | PASS | ERROR | ERROR | -+ | 007 | PASS | ERROR | ERROR | -+ | 008 | PASS | ERROR | ERROR | -+ | 009 | PASS | ERROR | ERROR | -+ | 010 | PASS | ERROR | ERROR | -+ | 011 | PASS | ERROR | ERROR | -+ | 012 | PASS | ERROR | ERROR | -+ | 013 | PASS | ERROR | ERROR | -+ | 014 | PASS | ERROR | ERROR | -+ | 015 | PASS | ERROR | ERROR | -+ | 016 | PASS | ERROR | ERROR | -+ | 017 | PASS | ERROR | ERROR | -+ | 018 | PASS | ERROR | ERROR | -+ | 019 | PASS | ERROR | ERROR | -+ | 020 | PASS | ERROR | ERROR | -+ | 021 | PASS | ERROR | ERROR | -+ | 022 | PASS | ERROR | ERROR | -+ | 023 | PASS | ERROR | ERROR | -+ | 024 | PASS | ERROR | ERROR | -+ | 025 | PASS | ERROR | ERROR | -+ | 026 | PASS | ERROR | ERROR | -+ | 027 | PASS | ERROR | PASS | -+ | 028 | PASS | ERROR | ERROR | -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/run.sh b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/run.sh -new file mode 100644 -index 0000000..dbbd62f ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/002_fortran_call_c_function_ptr_bindc/run.sh -@@ -0,0 +1,22 @@ -+for i in {001..028} -+do -+echo "------- test $i ------." -+echo "----- gfortran result:" -+gcc c_func$i.c -c -o c-test.o -+gfortran fortran_main$i.f90 -fno-range-check -c -o fortran-test.o -+gfortran c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+echo "----- flang-new result : " -+clang c_func$i.c -c -o c-test.o -+flang-new fortran_main$i.f90 -c -o fortran-test.o -+flang-new -flang-experimental-exec c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+echo "----- nvfortran result : " -+clang c_func$i.c -c -o c-test.o -+nvfortran fortran_main$i.f90 -c -o fortran-test.o -+nvfortran c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+done -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func001.c b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func001.c -new file mode 100644 -index 0000000..92427a4 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func001.c -@@ -0,0 +1,5 @@ -+#include -+int c_func_(int *a) { -+ printf("%5d\n", *a); -+ return *a; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func002.c b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func002.c -new file mode 100644 -index 0000000..54747f2 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func002.c -@@ -0,0 +1,5 @@ -+#include -+short c_func_(short *a) { -+ printf("%5hd\n", *a); -+ return *a; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func003.c b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func003.c -new file mode 100644 -index 0000000..a9fde92 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func003.c -@@ -0,0 +1,5 @@ -+#include -+long c_func_(long *a) { -+ printf("%5ld\n", *a); -+ return *a; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func004.c b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func004.c -new file mode 100644 -index 0000000..2131b04 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func004.c -@@ -0,0 +1,5 @@ -+#include -+long long c_func_(long long *a) { -+ printf("%lld\n", *a); -+ return *a; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func005.c b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func005.c -new file mode 100644 -index 0000000..309b9d0 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func005.c -@@ -0,0 +1,5 @@ -+#include -+signed char c_func_(signed char *a) { -+ printf("%5c\n", *a); -+ return *a; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func006.c b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func006.c -new file mode 100644 -index 0000000..73982d0 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func006.c -@@ -0,0 +1,6 @@ -+#include -+#include -+size_t c_func_(size_t *a) { -+ printf("%5ld\n", *a); -+ return *a; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func007.c b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func007.c -new file mode 100644 -index 0000000..efaee56 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func007.c -@@ -0,0 +1,6 @@ -+#include -+#include -+int8_t c_func_(int8_t *a) { -+ printf("%5hhd\n", *a); -+ return *a; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func008.c b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func008.c -new file mode 100644 -index 0000000..5a57718 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func008.c -@@ -0,0 +1,6 @@ -+#include -+#include -+int16_t c_func_(int16_t *a) { -+ printf("%5hd\n", *a); -+ return *a; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func009.c b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func009.c -new file mode 100644 -index 0000000..e076c57 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func009.c -@@ -0,0 +1,6 @@ -+#include -+#include -+int32_t c_func_(int32_t *a) { -+ printf("%5d\n", *a); -+ return *a; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func010.c b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func010.c -new file mode 100644 -index 0000000..197e12b ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func010.c -@@ -0,0 +1,6 @@ -+#include -+#include -+int64_t c_func_(int64_t *a) { -+ printf("%5ld\n", *a); -+ return *a; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func011.c b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func011.c -new file mode 100644 -index 0000000..cc67a34 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func011.c -@@ -0,0 +1,6 @@ -+#include -+#include -+int_least8_t c_func_(int_least8_t *a) { -+ printf("%5hhd\n", *a); -+ return *a; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func012.c b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func012.c -new file mode 100644 -index 0000000..484de62 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func012.c -@@ -0,0 +1,6 @@ -+#include -+#include -+int_least16_t c_func_(int_least16_t *a) { -+ printf("%5hd\n", *a); -+ return *a; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func013.c b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func013.c -new file mode 100644 -index 0000000..7a1973e ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func013.c -@@ -0,0 +1,6 @@ -+#include -+#include -+int_least32_t c_func_(int_least32_t *a) { -+ printf("%d\n", *a); -+ return *a; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func014.c b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func014.c -new file mode 100644 -index 0000000..d535c60 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func014.c -@@ -0,0 +1,6 @@ -+#include -+#include -+int_least64_t c_func_(int_least64_t *a) { -+ printf("%5ld\n", *a); -+ return *a; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func015.c b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func015.c -new file mode 100644 -index 0000000..cb1989f ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func015.c -@@ -0,0 +1,6 @@ -+#include -+#include -+int_fast8_t c_func_(int_fast8_t *a) { -+ printf("%5hhd\n", *a); -+ return *a; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func016.c b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func016.c -new file mode 100644 -index 0000000..df1b16b ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func016.c -@@ -0,0 +1,6 @@ -+#include -+#include -+int_fast16_t c_func_(int_fast16_t *a) { -+ printf("%5ld\n", *a); -+ return *a; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func017.c b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func017.c -new file mode 100644 -index 0000000..6070d3e ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func017.c -@@ -0,0 +1,6 @@ -+#include -+#include -+int_fast32_t c_func_(int_fast32_t *a) { -+ printf("%ld\n", *a); -+ return *a; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func018.c b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func018.c -new file mode 100644 -index 0000000..18b6494 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func018.c -@@ -0,0 +1,6 @@ -+#include -+#include -+int_fast64_t c_func_(int_fast64_t *a) { -+ printf("%5ld\n", *a); -+ return *a; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func019.c b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func019.c -new file mode 100644 -index 0000000..b0a0b6f ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func019.c -@@ -0,0 +1,6 @@ -+#include -+#include -+intmax_t c_func_(intmax_t *a) { -+ printf("%5ld\n", *a); -+ return *a; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func020.c b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func020.c -new file mode 100644 -index 0000000..071f5c5 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func020.c -@@ -0,0 +1,6 @@ -+#include -+#include -+intptr_t c_func_(intptr_t *a) { -+ printf("%5ld\n", *a); -+ return *a; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func021.c b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func021.c -new file mode 100644 -index 0000000..2dee5f2 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func021.c -@@ -0,0 +1,5 @@ -+#include -+float c_func_(float *a) { -+ printf("%0.20f\n", *a); -+ return *a; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func022.c b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func022.c -new file mode 100644 -index 0000000..a2a9843 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func022.c -@@ -0,0 +1,5 @@ -+#include -+double c_func_(double *a) { -+ printf("%0.20lf\n", *a); -+ return *a; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func023.c b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func023.c -new file mode 100644 -index 0000000..c762a0a ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func023.c -@@ -0,0 +1,5 @@ -+#include -+long double c_func_(long double *a) { -+ printf("%0.20Lf\n", *a); -+ return *a; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func024.c b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func024.c -new file mode 100644 -index 0000000..87b3e4c ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func024.c -@@ -0,0 +1,6 @@ -+#include -+#include -+float _Complex c_func_(float _Complex *t) { -+ printf("%0.20f + %0.20fi\n", creal(*t), cimag(*t)); -+ return *t; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func025.c b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func025.c -new file mode 100644 -index 0000000..2d7b33f ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func025.c -@@ -0,0 +1,6 @@ -+#include -+#include -+double _Complex c_func_(double _Complex *t) { -+ printf("%0.20lf + %0.20lfi\n", creal(*t), cimag(*t)); -+ return *t; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func026.c b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func026.c -new file mode 100644 -index 0000000..78f93c9 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func026.c -@@ -0,0 +1,6 @@ -+#include -+#include -+long double _Complex c_func_(long double _Complex *t) { -+ printf("%0.20f + %0.20fi\n", creal(*t), cimag(*t)); -+ return *t; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func027.c b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func027.c -new file mode 100644 -index 0000000..2bf5cce ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func027.c -@@ -0,0 +1,5 @@ -+#include -+_Bool c_func_(_Bool *a) { -+ printf("%5d\n", *a); -+ return *a; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func028.c b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func028.c -new file mode 100644 -index 0000000..197c9b6 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/c_func028.c -@@ -0,0 +1,6 @@ -+#include -+#include -+char c_func_(char *t) { -+ printf("%c\n", *t); -+ return *t; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main001.f90 b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main001.f90 -new file mode 100644 -index 0000000..833d15b ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main001.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the return type is value of type int -+! -+program main -+ integer :: my_x = 1 -+ interface -+ function c_func(b) result(res) -+ integer :: b -+ integer :: res -+ end -+ end interface -+ print '(I5)', c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main002.f90 b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main002.f90 -new file mode 100644 -index 0000000..f3bf45c ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main002.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the return type is value of type short -+! -+program main -+ integer(2) :: my_x = 1 -+ interface -+ function c_func(b) result(res) -+ integer(2) :: b -+ integer(2) :: res -+ end -+ end interface -+ print '(I5)', c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main003.f90 b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main003.f90 -new file mode 100644 -index 0000000..be25937 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main003.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the return type is value of type long -+! -+program main -+ integer(8) :: my_x = 1 -+ interface -+ function c_func(b) result(res) -+ integer(8) :: b -+ integer(8) :: res -+ end -+ end interface -+ print '(I5)', c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main004.f90 b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main004.f90 -new file mode 100644 -index 0000000..f5a5c25 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main004.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the return type is value of type long long -+! -+program main -+ integer(8) :: my_x = 1 -+ interface -+ function c_func(b) result(res) -+ integer(8) :: b -+ integer(8) :: res -+ end -+ end interface -+ print '(I5)', c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main005.f90 b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main005.f90 -new file mode 100644 -index 0000000..ce67996 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main005.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the return type is value of type signed char -+! -+program main -+ integer(1) :: my_x = 65 -+ interface -+ function c_func(b) result(res) -+ integer(1) :: b -+ integer(1) :: res -+ end -+ end interface -+ print '(I5)', c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main006.f90 b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main006.f90 -new file mode 100644 -index 0000000..a334489 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main006.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the return type is value of type size_t -+! -+program main -+ integer(8) :: my_x = 1 -+ interface -+ function c_func(b) result(res) -+ integer(8) :: b -+ integer(8) :: res -+ end -+ end interface -+ print '(I5)', c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main007.f90 b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main007.f90 -new file mode 100644 -index 0000000..11b1e27 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main007.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the return type is value of type int8_t -+! -+program main -+ integer(1) :: my_x = 1 -+ interface -+ function c_func(b) result(res) -+ integer(1) :: b -+ integer(1) :: res -+ end -+ end interface -+ print '(I5)', c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main008.f90 b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main008.f90 -new file mode 100644 -index 0000000..6addc84 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main008.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the return type is value of type int16_t -+! -+program main -+ integer(2) :: my_x = 1 -+ interface -+ function c_func(b) result(res) -+ integer(2) :: b -+ integer(2) :: res -+ end -+ end interface -+ print '(I5)', c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main009.f90 b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main009.f90 -new file mode 100644 -index 0000000..20d49b4 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main009.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the return type is value of type int32_t -+! -+program main -+ integer(4) :: my_x = 1 -+ interface -+ function c_func(b) result(res) -+ integer(4) :: b -+ integer(4) :: res -+ end -+ end interface -+ print '(I5)', c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main010.f90 b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main010.f90 -new file mode 100644 -index 0000000..363fa19 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main010.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the return type is value of type int64_t -+! -+program main -+ integer(8) :: my_x = 1 -+ interface -+ function c_func(b) result(res) -+ integer(8) :: b -+ integer(8) :: res -+ end -+ end interface -+ print '(I5)', c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main011.f90 b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main011.f90 -new file mode 100644 -index 0000000..6e95d17 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main011.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the return type is value of type int_least8_t -+! -+program main -+ integer(1) :: my_x = 1 -+ interface -+ function c_func(b) result(res) -+ integer(1) :: b -+ integer(1) :: res -+ end -+ end interface -+ print '(I5)', c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main012.f90 b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main012.f90 -new file mode 100644 -index 0000000..b8b3c12 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main012.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the return type is value of int_least16_t -+! -+program main -+ integer(2) :: my_x = 1 -+ interface -+ function c_func(b) result(res) -+ integer(2) :: b -+ integer(2) :: res -+ end -+ end interface -+ print '(I5)', c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main013.f90 b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main013.f90 -new file mode 100644 -index 0000000..1eb9429 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main013.f90 -@@ -0,0 +1,13 @@ -+! Test fortran call c for the return type is value of type -+! int_least32_t -+! -+program main -+ integer(4) :: my_x = 1 -+ interface -+ function c_func(b) result(res) -+ integer(4) :: b -+ integer(4) :: res -+ end -+ end interface -+ print '(I5)', c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main014.f90 b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main014.f90 -new file mode 100644 -index 0000000..0d6fba6 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main014.f90 -@@ -0,0 +1,13 @@ -+! Test fortran call c for the return type is value of type -+! int_least64_t -+! -+program main -+ integer(8) :: my_x = 1 -+ interface -+ function c_func(b) result(res) -+ integer(8) :: b -+ integer(8) :: res -+ end -+ end interface -+ print '(I5)', c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main015.f90 b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main015.f90 -new file mode 100644 -index 0000000..78dd147 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main015.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the return type is value of type int_fast8_t -+! -+program main -+ integer(1) :: my_x = 1 -+ interface -+ function c_func(b) result(res) -+ integer(1) :: b -+ integer(1) :: res -+ end -+ end interface -+ print '(I5)', c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main016.f90 b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main016.f90 -new file mode 100644 -index 0000000..a12f03e ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main016.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the return type is value of type int_fast16_t -+! -+program main -+ integer(8) :: my_x = 1 -+ interface -+ function c_func(b) result(res) -+ integer(8) :: b -+ integer(8) :: res -+ end -+ end interface -+ print '(I5)', c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main017.f90 b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main017.f90 -new file mode 100644 -index 0000000..392a401 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main017.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the return type is value of type int_fast32_t -+! -+program main -+ integer(8) :: my_x = 1 -+ interface -+ function c_func(b) result(res) -+ integer(8) :: b -+ integer(8) :: res -+ end -+ end interface -+ print '(I5)', c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main018.f90 b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main018.f90 -new file mode 100644 -index 0000000..c24ad39 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main018.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the return type is value of type int_fast64_t -+! -+program main -+ integer(8) :: my_x = 1 -+ interface -+ function c_func(b) result(res) -+ integer(8) :: b -+ integer(8) :: res -+ end -+ end interface -+ print '(I5)', c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main019.f90 b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main019.f90 -new file mode 100644 -index 0000000..db38e53 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main019.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the return type is value of type intmax_t -+! -+program main -+ integer(8) :: my_x = 1 -+ interface -+ function c_func(b) result(res) -+ integer(8) :: b -+ integer(8) :: res -+ end -+ end interface -+ print *, c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main020.f90 b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main020.f90 -new file mode 100644 -index 0000000..d99e3d0 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main020.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the return type is value of type intptr_t -+! -+program main -+ integer(8) :: my_x = 1 -+ interface -+ function c_func(b) result(res) -+ integer(8) :: b -+ integer(8) :: res -+ end -+ end interface -+ print '(I5)', c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main021.f90 b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main021.f90 -new file mode 100644 -index 0000000..c61c8f1 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main021.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the return type is value of type float -+! -+program main -+ real(4) :: my_x = 1.0 -+ interface -+ function c_func(b) result(res) -+ real(4) :: b -+ real(4) :: res -+ end -+ end interface -+ print '(F20.10)', c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main022.f90 b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main022.f90 -new file mode 100644 -index 0000000..b5f5dd9 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main022.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the return type is value of type double -+! -+program main -+ real(8) :: my_x = 3.1415926535 -+ interface -+ function c_func(b) result(res) -+ real(8) :: b -+ real(8) :: res -+ end -+ end interface -+ print '(F20.10)', c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main023.f90 b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main023.f90 -new file mode 100644 -index 0000000..0dd6d35 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main023.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the return type is value of type long double -+! -+program main -+ integer, parameter :: K = selected_real_kind(16) -+ real(K) :: my_x = 3.1415926535 -+ interface -+ function c_func(b) result(res) -+ integer, parameter :: K = selected_real_kind(16) -+ real(K) :: b -+ real(K) :: res -+ end -+ end interface -+ print '(F20.10)', c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main024.f90 b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main024.f90 -new file mode 100644 -index 0000000..6af3f75 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main024.f90 -@@ -0,0 +1,13 @@ -+! Test fortran call c for the return type is value of type float -+! _Complex -+! -+program main -+ complex(4) :: my_x = (3.1415926535, 1) -+ interface -+ function c_func(b) result(res) -+ complex(4) :: b -+ complex(4) :: res -+ end -+ end interface -+ print '(F20.10)', c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main025.f90 b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main025.f90 -new file mode 100644 -index 0000000..5c7a953 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main025.f90 -@@ -0,0 +1,13 @@ -+! Test fortran call c for the return type is value of type double -+! _Complex -+! -+program main -+ complex(8) :: my_x = (3.1415926535, 1) -+ interface -+ function c_func(b) result(res) -+ complex(8) :: b -+ complex(8) :: res -+ end -+ end interface -+ print '(F20.10)', c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main026.f90 b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main026.f90 -new file mode 100644 -index 0000000..14ec793 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main026.f90 -@@ -0,0 +1,15 @@ -+! Test fortran call c for the return type is value of type long double -+! _Complex -+! -+program main -+ integer, parameter :: K = selected_real_kind(16) -+ complex(K) :: my_x = (3.1415926535, 1) -+ interface -+ function c_func(b) result(res) -+ integer, parameter :: K = selected_real_kind(16) -+ complex(K) :: b -+ complex(K) :: res -+ end -+ end interface -+ print '(F20.10)', c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main027.f90 b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main027.f90 -new file mode 100644 -index 0000000..203901c ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main027.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the return type is value of type _Bool -+! -+program main -+ logical(1) :: my_x = .FALSE. -+ interface -+ function c_func(b) result(res) -+ logical(1) :: b -+ logical(1) :: res -+ end -+ end interface -+ print *, c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main028.f90 b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main028.f90 -new file mode 100644 -index 0000000..537c6cb ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/fortran_main028.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the return type is value of type char -+! -+program main -+ character(1) :: my_x = 'a' -+ interface -+ function c_func(b) result(res) -+ character(1) :: b -+ character(1) :: res -+ end -+ end interface -+ print *, c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/result.md b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/result.md -new file mode 100644 -index 0000000..ce2fc5b ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/result.md -@@ -0,0 +1,29 @@ -+ | test | gfortran | flang | nvfortran| -+ | 001 | PASS | PASS | PASS | -+ | 002 | PASS | PASS | PASS | -+ | 003 | PASS | PASS | PASS | -+ | 004 | PASS | PASS | PASS | -+ | 005 | PASS | PASS | PASS | -+ | 006 | PASS | PASS | PASS | -+ | 007 | PASS | PASS | PASS | -+ | 008 | PASS | PASS | PASS | -+ | 009 | PASS | PASS | PASS | -+ | 010 | PASS | PASS | PASS | -+ | 011 | PASS | PASS | PASS | -+ | 012 | PASS | PASS | PASS | -+ | 013 | PASS | PASS | PASS | -+ | 014 | PASS | PASS | PASS | -+ | 015 | PASS | PASS | PASS | -+ | 016 | PASS | PASS | PASS | -+ | 017 | PASS | PASS | PASS | -+ | 018 | PASS | PASS | PASS | -+ | 019 | PASS | PASS | PASS | -+ | 020 | PASS | PASS | PASS | -+ | 021 | PASS | PASS | PASS | -+ | 022 | PASS | PASS | PASS | -+ | 023 | PASS | PASS | ERROR | -+ | 024 | PASS | PASS | ERROR | -+ | 025 | PASS | PASS | ERROR | -+ | 026 | PASS | ERROR | ERROR | -+ | 027 | PASS | PASS | PASS | -+ | 028 | ERROR | ERROR | ERROR | -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/run.sh b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/run.sh -new file mode 100644 -index 0000000..dbbd62f ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/003_fortran_call_c_function_value/run.sh -@@ -0,0 +1,22 @@ -+for i in {001..028} -+do -+echo "------- test $i ------." -+echo "----- gfortran result:" -+gcc c_func$i.c -c -o c-test.o -+gfortran fortran_main$i.f90 -fno-range-check -c -o fortran-test.o -+gfortran c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+echo "----- flang-new result : " -+clang c_func$i.c -c -o c-test.o -+flang-new fortran_main$i.f90 -c -o fortran-test.o -+flang-new -flang-experimental-exec c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+echo "----- nvfortran result : " -+clang c_func$i.c -c -o c-test.o -+nvfortran fortran_main$i.f90 -c -o fortran-test.o -+nvfortran c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+done -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func001.c b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func001.c -new file mode 100644 -index 0000000..92427a4 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func001.c -@@ -0,0 +1,5 @@ -+#include -+int c_func_(int *a) { -+ printf("%5d\n", *a); -+ return *a; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func002.c b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func002.c -new file mode 100644 -index 0000000..54747f2 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func002.c -@@ -0,0 +1,5 @@ -+#include -+short c_func_(short *a) { -+ printf("%5hd\n", *a); -+ return *a; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func003.c b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func003.c -new file mode 100644 -index 0000000..a9fde92 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func003.c -@@ -0,0 +1,5 @@ -+#include -+long c_func_(long *a) { -+ printf("%5ld\n", *a); -+ return *a; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func004.c b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func004.c -new file mode 100644 -index 0000000..2131b04 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func004.c -@@ -0,0 +1,5 @@ -+#include -+long long c_func_(long long *a) { -+ printf("%lld\n", *a); -+ return *a; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func005.c b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func005.c -new file mode 100644 -index 0000000..309b9d0 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func005.c -@@ -0,0 +1,5 @@ -+#include -+signed char c_func_(signed char *a) { -+ printf("%5c\n", *a); -+ return *a; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func006.c b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func006.c -new file mode 100644 -index 0000000..73982d0 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func006.c -@@ -0,0 +1,6 @@ -+#include -+#include -+size_t c_func_(size_t *a) { -+ printf("%5ld\n", *a); -+ return *a; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func007.c b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func007.c -new file mode 100644 -index 0000000..efaee56 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func007.c -@@ -0,0 +1,6 @@ -+#include -+#include -+int8_t c_func_(int8_t *a) { -+ printf("%5hhd\n", *a); -+ return *a; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func008.c b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func008.c -new file mode 100644 -index 0000000..5a57718 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func008.c -@@ -0,0 +1,6 @@ -+#include -+#include -+int16_t c_func_(int16_t *a) { -+ printf("%5hd\n", *a); -+ return *a; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func009.c b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func009.c -new file mode 100644 -index 0000000..e076c57 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func009.c -@@ -0,0 +1,6 @@ -+#include -+#include -+int32_t c_func_(int32_t *a) { -+ printf("%5d\n", *a); -+ return *a; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func010.c b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func010.c -new file mode 100644 -index 0000000..197e12b ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func010.c -@@ -0,0 +1,6 @@ -+#include -+#include -+int64_t c_func_(int64_t *a) { -+ printf("%5ld\n", *a); -+ return *a; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func011.c b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func011.c -new file mode 100644 -index 0000000..cc67a34 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func011.c -@@ -0,0 +1,6 @@ -+#include -+#include -+int_least8_t c_func_(int_least8_t *a) { -+ printf("%5hhd\n", *a); -+ return *a; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func012.c b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func012.c -new file mode 100644 -index 0000000..484de62 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func012.c -@@ -0,0 +1,6 @@ -+#include -+#include -+int_least16_t c_func_(int_least16_t *a) { -+ printf("%5hd\n", *a); -+ return *a; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func013.c b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func013.c -new file mode 100644 -index 0000000..7a1973e ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func013.c -@@ -0,0 +1,6 @@ -+#include -+#include -+int_least32_t c_func_(int_least32_t *a) { -+ printf("%d\n", *a); -+ return *a; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func014.c b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func014.c -new file mode 100644 -index 0000000..d535c60 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func014.c -@@ -0,0 +1,6 @@ -+#include -+#include -+int_least64_t c_func_(int_least64_t *a) { -+ printf("%5ld\n", *a); -+ return *a; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func015.c b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func015.c -new file mode 100644 -index 0000000..cb1989f ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func015.c -@@ -0,0 +1,6 @@ -+#include -+#include -+int_fast8_t c_func_(int_fast8_t *a) { -+ printf("%5hhd\n", *a); -+ return *a; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func016.c b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func016.c -new file mode 100644 -index 0000000..df1b16b ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func016.c -@@ -0,0 +1,6 @@ -+#include -+#include -+int_fast16_t c_func_(int_fast16_t *a) { -+ printf("%5ld\n", *a); -+ return *a; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func017.c b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func017.c -new file mode 100644 -index 0000000..6070d3e ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func017.c -@@ -0,0 +1,6 @@ -+#include -+#include -+int_fast32_t c_func_(int_fast32_t *a) { -+ printf("%ld\n", *a); -+ return *a; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func018.c b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func018.c -new file mode 100644 -index 0000000..18b6494 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func018.c -@@ -0,0 +1,6 @@ -+#include -+#include -+int_fast64_t c_func_(int_fast64_t *a) { -+ printf("%5ld\n", *a); -+ return *a; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func019.c b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func019.c -new file mode 100644 -index 0000000..b0a0b6f ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func019.c -@@ -0,0 +1,6 @@ -+#include -+#include -+intmax_t c_func_(intmax_t *a) { -+ printf("%5ld\n", *a); -+ return *a; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func020.c b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func020.c -new file mode 100644 -index 0000000..071f5c5 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func020.c -@@ -0,0 +1,6 @@ -+#include -+#include -+intptr_t c_func_(intptr_t *a) { -+ printf("%5ld\n", *a); -+ return *a; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func021.c b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func021.c -new file mode 100644 -index 0000000..2dee5f2 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func021.c -@@ -0,0 +1,5 @@ -+#include -+float c_func_(float *a) { -+ printf("%0.20f\n", *a); -+ return *a; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func022.c b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func022.c -new file mode 100644 -index 0000000..a2a9843 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func022.c -@@ -0,0 +1,5 @@ -+#include -+double c_func_(double *a) { -+ printf("%0.20lf\n", *a); -+ return *a; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func023.c b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func023.c -new file mode 100644 -index 0000000..c762a0a ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func023.c -@@ -0,0 +1,5 @@ -+#include -+long double c_func_(long double *a) { -+ printf("%0.20Lf\n", *a); -+ return *a; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func024.c b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func024.c -new file mode 100644 -index 0000000..87b3e4c ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func024.c -@@ -0,0 +1,6 @@ -+#include -+#include -+float _Complex c_func_(float _Complex *t) { -+ printf("%0.20f + %0.20fi\n", creal(*t), cimag(*t)); -+ return *t; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func025.c b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func025.c -new file mode 100644 -index 0000000..2d7b33f ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func025.c -@@ -0,0 +1,6 @@ -+#include -+#include -+double _Complex c_func_(double _Complex *t) { -+ printf("%0.20lf + %0.20lfi\n", creal(*t), cimag(*t)); -+ return *t; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func026.c b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func026.c -new file mode 100644 -index 0000000..78f93c9 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func026.c -@@ -0,0 +1,6 @@ -+#include -+#include -+long double _Complex c_func_(long double _Complex *t) { -+ printf("%0.20f + %0.20fi\n", creal(*t), cimag(*t)); -+ return *t; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func027.c b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func027.c -new file mode 100644 -index 0000000..2bf5cce ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func027.c -@@ -0,0 +1,5 @@ -+#include -+_Bool c_func_(_Bool *a) { -+ printf("%5d\n", *a); -+ return *a; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func028.c b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func028.c -new file mode 100644 -index 0000000..197c9b6 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/c_func028.c -@@ -0,0 +1,6 @@ -+#include -+#include -+char c_func_(char *t) { -+ printf("%c\n", *t); -+ return *t; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main001.f90 b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main001.f90 -new file mode 100644 -index 0000000..f7e19f7 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main001.f90 -@@ -0,0 +1,13 @@ -+! Test fortran call c for the return type is value of type int with -+! bindc -+! -+program main -+ integer :: my_x = 1 -+ interface -+ function c_func(b) result(res) bind(c, name = "c_func_") -+ integer :: b -+ integer :: res -+ end -+ end interface -+ print '(I5)', c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main002.f90 b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main002.f90 -new file mode 100644 -index 0000000..b7b2ab4 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main002.f90 -@@ -0,0 +1,13 @@ -+! Test fortran call c for the return type is value of type short with -+! bindc -+! -+program main -+ integer(2) :: my_x = 1 -+ interface -+ function c_func(b) result(res) bind(c, name = "c_func_") -+ integer(2) :: b -+ integer(2) :: res -+ end -+ end interface -+ print '(I5)', c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main003.f90 b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main003.f90 -new file mode 100644 -index 0000000..7fea817 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main003.f90 -@@ -0,0 +1,13 @@ -+! Test fortran call c for the return type is value of type long with -+! bindc -+! -+program main -+ integer(8) :: my_x = 1 -+ interface -+ function c_func(b) result(res) bind(c, name = "c_func_") -+ integer(8) :: b -+ integer(8) :: res -+ end -+ end interface -+ print '(I5)', c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main004.f90 b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main004.f90 -new file mode 100644 -index 0000000..c62ea01 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main004.f90 -@@ -0,0 +1,13 @@ -+! Test fortran call c for the return type is value of type long long -+! with bindc -+! -+program main -+ integer(8) :: my_x = 1 -+ interface -+ function c_func(b) result(res) bind(c, name = "c_func_") -+ integer(8) :: b -+ integer(8) :: res -+ end -+ end interface -+ print '(I5)', c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main005.f90 b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main005.f90 -new file mode 100644 -index 0000000..6c3185c ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main005.f90 -@@ -0,0 +1,13 @@ -+! Test fortran call c for the return type is value of type signed char -+! with bindc -+! -+program main -+ integer(1) :: my_x = 65 -+ interface -+ function c_func(b) result(res) bind(c, name = "c_func_") -+ integer(1) :: b -+ integer(1) :: res -+ end -+ end interface -+ print '(I5)', c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main006.f90 b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main006.f90 -new file mode 100644 -index 0000000..8be1fe5 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main006.f90 -@@ -0,0 +1,13 @@ -+! Test fortran call c for the return type is value of type size_t with -+! bindc -+! -+program main -+ integer(8) :: my_x = 1 -+ interface -+ function c_func(b) result(res) bind(c, name = "c_func_") -+ integer(8) :: b -+ integer(8) :: res -+ end -+ end interface -+ print '(I5)', c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main007.f90 b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main007.f90 -new file mode 100644 -index 0000000..5d909b1 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main007.f90 -@@ -0,0 +1,13 @@ -+! Test fortran call c for the return type is value of type int8_t with -+! bindc -+! -+program main -+ integer(1) :: my_x = 1 -+ interface -+ function c_func(b) result(res) bind(c, name = "c_func_") -+ integer(1) :: b -+ integer(1) :: res -+ end -+ end interface -+ print '(I5)', c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main008.f90 b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main008.f90 -new file mode 100644 -index 0000000..fbbfc82 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main008.f90 -@@ -0,0 +1,13 @@ -+! Test fortran call c for the return type is value of type int16_t with -+! bindc -+! -+program main -+ integer(2) :: my_x = 1 -+ interface -+ function c_func(b) result(res) bind(c, name = "c_func_") -+ integer(2) :: b -+ integer(2) :: res -+ end -+ end interface -+ print '(I5)', c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main009.f90 b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main009.f90 -new file mode 100644 -index 0000000..9cd04c3 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main009.f90 -@@ -0,0 +1,13 @@ -+! Test fortran call c for the return type is value of type int32_t with -+! bindc -+! -+program main -+ integer(4) :: my_x = 1 -+ interface -+ function c_func(b) result(res) bind(c, name = "c_func_") -+ integer(4) :: b -+ integer(4) :: res -+ end -+ end interface -+ print '(I5)', c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main010.f90 b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main010.f90 -new file mode 100644 -index 0000000..620d195 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main010.f90 -@@ -0,0 +1,13 @@ -+! Test fortran call c for the return type is value of type int64_t with -+! bindc -+! -+program main -+ integer(8) :: my_x = 1 -+ interface -+ function c_func(b) result(res) bind(c, name = "c_func_") -+ integer(8) :: b -+ integer(8) :: res -+ end -+ end interface -+ print '(I5)', c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main011.f90 b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main011.f90 -new file mode 100644 -index 0000000..c933b43 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main011.f90 -@@ -0,0 +1,13 @@ -+! Test fortran call c for the return type is value of type int_least8_t -+! with bindc -+! -+program main -+ integer(1) :: my_x = 1 -+ interface -+ function c_func(b) result(res) bind(c, name = "c_func_") -+ integer(1) :: b -+ integer(1) :: res -+ end -+ end interface -+ print '(I5)', c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main012.f90 b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main012.f90 -new file mode 100644 -index 0000000..35da307 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main012.f90 -@@ -0,0 +1,13 @@ -+! Test fortran call c for the return type is value of type -+! int_least16_t with bindc -+! -+program main -+ integer(2) :: my_x = 1 -+ interface -+ function c_func(b) result(res) bind(c, name = "c_func_") -+ integer(2) :: b -+ integer(2) :: res -+ end -+ end interface -+ print '(I5)', c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main013.f90 b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main013.f90 -new file mode 100644 -index 0000000..38eb044 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main013.f90 -@@ -0,0 +1,13 @@ -+! Test fortran call c for the return type is value of type -+! int_least32_t with bindc -+! -+program main -+ integer(4) :: my_x = 1 -+ interface -+ function c_func(b) result(res) bind(c, name = "c_func_") -+ integer(4) :: b -+ integer(4) :: res -+ end -+ end interface -+ print '(I5)', c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main014.f90 b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main014.f90 -new file mode 100644 -index 0000000..e7a3281 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main014.f90 -@@ -0,0 +1,13 @@ -+! Test fortran call c for the return type is value of type -+! int_least64_t with bindc -+! -+program main -+ integer(8) :: my_x = 1 -+ interface -+ function c_func(b) result(res) bind(c, name = "c_func_") -+ integer(8) :: b -+ integer(8) :: res -+ end -+ end interface -+ print '(I5)', c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main015.f90 b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main015.f90 -new file mode 100644 -index 0000000..6f41989 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main015.f90 -@@ -0,0 +1,12 @@ -+! Test fortran call c for the return type is value of type int_fast8_t -+! with bindc -+program main -+ integer(1) :: my_x = 1 -+ interface -+ function c_func(b) result(res) bind(c, name = "c_func_") -+ integer(1) :: b -+ integer(1) :: res -+ end -+ end interface -+ print '(I5)', c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main016.f90 b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main016.f90 -new file mode 100644 -index 0000000..8776c5f ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main016.f90 -@@ -0,0 +1,13 @@ -+! Test fortran call c for the return type is value of type int_fast16_t -+! with bindc -+! -+program main -+ integer(8) :: my_x = 1 -+ interface -+ function c_func(b) result(res) bind(c, name = "c_func_") -+ integer(8) :: b -+ integer(8) :: res -+ end -+ end interface -+ print '(I5)', c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main017.f90 b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main017.f90 -new file mode 100644 -index 0000000..1e153ae ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main017.f90 -@@ -0,0 +1,13 @@ -+! Test fortran call c for the return type is value of type int_fast32_t -+! with bindc -+! -+program main -+ integer(8) :: my_x = 1 -+ interface -+ function c_func(b) result(res) bind(c, name = "c_func_") -+ integer(8) :: b -+ integer(8) :: res -+ end -+ end interface -+ print '(I5)', c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main018.f90 b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main018.f90 -new file mode 100644 -index 0000000..210678d ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main018.f90 -@@ -0,0 +1,13 @@ -+! Test fortran call c for the return type is value of type int_fast64_t -+! with bindc -+! -+program main -+ integer(8) :: my_x = 1 -+ interface -+ function c_func(b) result(res) bind(c, name = "c_func_") -+ integer(8) :: b -+ integer(8) :: res -+ end -+ end interface -+ print '(I5)', c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main019.f90 b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main019.f90 -new file mode 100644 -index 0000000..46677d3 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main019.f90 -@@ -0,0 +1,13 @@ -+! Test fortran call c for the return type is value of type intmax_t -+! with bindc -+! -+program main -+ integer(8) :: my_x = 1 -+ interface -+ function c_func(b) result(res) bind(c, name = "c_func_") -+ integer(8) :: b -+ integer(8) :: res -+ end -+ end interface -+ print *, c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main020.f90 b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main020.f90 -new file mode 100644 -index 0000000..e5044e4 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main020.f90 -@@ -0,0 +1,13 @@ -+! Test fortran call c for the return type is value of type intptr_t -+! with bindc -+! -+program main -+ integer(8) :: my_x = 1 -+ interface -+ function c_func(b) result(res) bind(c, name = "c_func_") -+ integer(8) :: b -+ integer(8) :: res -+ end -+ end interface -+ print '(I5)', c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main021.f90 b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main021.f90 -new file mode 100644 -index 0000000..0e2a2c5 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main021.f90 -@@ -0,0 +1,13 @@ -+! Test fortran call c for the return type is value of type float with -+! bindc -+! -+program main -+ real(4) :: my_x = 1.0 -+ interface -+ function c_func(b) result(res) bind(c, name = "c_func_") -+ real(4) :: b -+ real(4) :: res -+ end -+ end interface -+ print '(F20.10)', c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main022.f90 b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main022.f90 -new file mode 100644 -index 0000000..5ba9920 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main022.f90 -@@ -0,0 +1,13 @@ -+! Test fortran call c for the return type is value of type double with -+! bindc -+! -+program main -+ real(8) :: my_x = 3.1415926535 -+ interface -+ function c_func(b) result(res) bind(c, name = "c_func_") -+ real(8) :: b -+ real(8) :: res -+ end -+ end interface -+ print '(F20.10)', c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main023.f90 b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main023.f90 -new file mode 100644 -index 0000000..cd87fb6 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main023.f90 -@@ -0,0 +1,15 @@ -+! Test fortran call c for the return type is value of type long double -+! with bindc -+! -+program main -+ integer, parameter :: K = selected_real_kind(16) -+ real(K) :: my_x = 3.1415926535 -+ interface -+ function c_func(b) result(res) bind(c, name = "c_func_") -+ integer, parameter :: K = selected_real_kind(16) -+ real(K) :: b -+ real(K) :: res -+ end -+ end interface -+ print '(F20.10)', c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main024.f90 b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main024.f90 -new file mode 100644 -index 0000000..890bd95 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main024.f90 -@@ -0,0 +1,13 @@ -+! Test fortran call c for the return type is value of type float -+! _Complex with bindc -+! -+program main -+ complex(4) :: my_x = (3.1415926535, 1) -+ interface -+ function c_func(b) result(res) bind(c, name = "c_func_") -+ complex(4) :: b -+ complex(4) :: res -+ end -+ end interface -+ print '(F20.10)', c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main025.f90 b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main025.f90 -new file mode 100644 -index 0000000..39ba319 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main025.f90 -@@ -0,0 +1,13 @@ -+! Test fortran call c for the return type is value of type double -+! _Complex with bindc -+! -+program main -+ complex(8) :: my_x = (3.1415926535, 1) -+ interface -+ function c_func(b) result(res) bind(c, name = "c_func_") -+ complex(8) :: b -+ complex(8) :: res -+ end -+ end interface -+ print '(F20.10)', c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main026.f90 b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main026.f90 -new file mode 100644 -index 0000000..5e7b4c5 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main026.f90 -@@ -0,0 +1,15 @@ -+! Test fortran call c for the return type is value of type long double -+! _Complex with bindc -+! -+program main -+ integer, parameter :: K = selected_real_kind(16) -+ complex(K) :: my_x = (3.1415926535, 1) -+ interface -+ function c_func(b) result(res) bind(c, name = "c_func_") -+ integer, parameter :: K = selected_real_kind(16) -+ complex(K) :: b -+ complex(K) :: res -+ end -+ end interface -+ print '(F20.10)', c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main027.f90 b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main027.f90 -new file mode 100644 -index 0000000..08b2d11 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main027.f90 -@@ -0,0 +1,13 @@ -+! Test fortran call c for the return type is value of type _Bool with -+! bindc -+! -+program main -+ logical(1) :: my_x = .FALSE. -+ interface -+ function c_func(b) result(res) bind(c, name = "c_func_") -+ logical(1) :: b -+ logical(1) :: res -+ end -+ end interface -+ print *, c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main028.f90 b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main028.f90 -new file mode 100644 -index 0000000..8174ac5 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/fortran_main028.f90 -@@ -0,0 +1,13 @@ -+! Test fortran call c for the return type is value of type char with -+! bindc -+! -+program main -+ character(1) :: my_x = 'a' -+ interface -+ function c_func(b) result(res) bind(c, name = "c_func_") -+ character(1) :: b -+ character(1) :: res -+ end -+ end interface -+ print *, c_func(my_x) -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/result.md b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/result.md -new file mode 100644 -index 0000000..fb1d886 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/result.md -@@ -0,0 +1,29 @@ -+ | test | gfortran | flang | nvfortran| -+ | 001 | PASS | PASS | PASS | -+ | 002 | PASS | PASS | PASS | -+ | 003 | PASS | PASS | PASS | -+ | 004 | PASS | PASS | PASS | -+ | 005 | PASS | PASS | PASS | -+ | 006 | PASS | PASS | PASS | -+ | 007 | PASS | PASS | PASS | -+ | 008 | PASS | PASS | PASS | -+ | 009 | PASS | PASS | PASS | -+ | 010 | PASS | PASS | PASS | -+ | 011 | PASS | PASS | PASS | -+ | 012 | PASS | PASS | PASS | -+ | 013 | PASS | PASS | PASS | -+ | 014 | PASS | PASS | PASS | -+ | 015 | PASS | PASS | PASS | -+ | 016 | PASS | PASS | PASS | -+ | 017 | PASS | PASS | PASS | -+ | 018 | PASS | PASS | PASS | -+ | 019 | PASS | PASS | PASS | -+ | 020 | PASS | PASS | PASS | -+ | 021 | PASS | PASS | PASS | -+ | 022 | PASS | PASS | PASS | -+ | 023 | PASS | PASS | ERROR | -+ | 024 | PASS | PASS | PASS | -+ | 025 | PASS | PASS | PASS | -+ | 026 | PASS | ERROR | ERROR | -+ | 027 | PASS | PASS | PASS | -+ | 028 | PASS | ERROR | ERROR | -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/run.sh b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/run.sh -new file mode 100644 -index 0000000..dbbd62f ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/004_fortran_call_c_function_value_bindc/run.sh -@@ -0,0 +1,22 @@ -+for i in {001..028} -+do -+echo "------- test $i ------." -+echo "----- gfortran result:" -+gcc c_func$i.c -c -o c-test.o -+gfortran fortran_main$i.f90 -fno-range-check -c -o fortran-test.o -+gfortran c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+echo "----- flang-new result : " -+clang c_func$i.c -c -o c-test.o -+flang-new fortran_main$i.f90 -c -o fortran-test.o -+flang-new -flang-experimental-exec c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+echo "----- nvfortran result : " -+clang c_func$i.c -c -o c-test.o -+nvfortran fortran_main$i.f90 -c -o fortran-test.o -+nvfortran c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+done -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func001.c b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func001.c -new file mode 100644 -index 0000000..5fc1da0 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func001.c -@@ -0,0 +1,8 @@ -+#include -+int* c_func_(int *s) -+{ -+ for(int i = 0; i < 4; i++) { -+ *(s + i) = i + 10; -+ } -+ return s; -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func002.c b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func002.c -new file mode 100644 -index 0000000..0adaedc ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func002.c -@@ -0,0 +1,8 @@ -+#include -+short* c_func_(short *s) -+{ -+ for(int i = 0; i < 4; i++) { -+ *(s + i) = i + 10; -+ } -+ return s; -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func003.c b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func003.c -new file mode 100644 -index 0000000..9e25ad4 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func003.c -@@ -0,0 +1,8 @@ -+#include -+long* c_func_(long *s) -+{ -+ for(int i = 0; i < 4; i++) { -+ *(s + i) = i + 10; -+ } -+ return s; -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func004.c b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func004.c -new file mode 100644 -index 0000000..224a535 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func004.c -@@ -0,0 +1,8 @@ -+#include -+long long* c_func_(long long *s) -+{ -+ for(int i = 0; i < 4; i++) { -+ *(s + i) = i + 10; -+ } -+ return s; -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func005.c b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func005.c -new file mode 100644 -index 0000000..ee7dadf ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func005.c -@@ -0,0 +1,8 @@ -+#include -+signed char* c_func_(signed char *s) -+{ -+ for(int i = 0; i < 4; i++) { -+ *(s + i) = i + 10; -+ } -+ return s; -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func006.c b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func006.c -new file mode 100644 -index 0000000..d1a350e ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func006.c -@@ -0,0 +1,8 @@ -+#include -+size_t* c_func_(size_t *s) -+{ -+ for(int i = 0; i < 4; i++) { -+ *(s + i) = i + 10; -+ } -+ return s; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func007.c b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func007.c -new file mode 100644 -index 0000000..8418d36 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func007.c -@@ -0,0 +1,9 @@ -+#include -+#include -+int8_t* c_func_(int8_t *s) -+{ -+ for(int i = 0; i < 4; i++) { -+ *(s + i) = i + 10; -+ } -+ return s; -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func008.c b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func008.c -new file mode 100644 -index 0000000..63df945 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func008.c -@@ -0,0 +1,9 @@ -+#include -+#include -+int16_t* c_func_(int16_t *s) -+{ -+ for(int i = 0; i < 4; i++) { -+ *(s + i) = i + 10; -+ } -+ return s; -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func009.c b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func009.c -new file mode 100644 -index 0000000..ee3be43 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func009.c -@@ -0,0 +1,9 @@ -+#include -+#include -+int32_t* c_func_(int32_t *s) -+{ -+ for(int i = 0; i < 4; i++) { -+ *(s + i) = i + 10; -+ } -+ return s; -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func010.c b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func010.c -new file mode 100644 -index 0000000..464e81c ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func010.c -@@ -0,0 +1,9 @@ -+#include -+#include -+int64_t* c_func_(int64_t *s) -+{ -+ for(int i = 0; i < 4; i++) { -+ *(s + i) = i + 10; -+ } -+ return s; -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func011.c b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func011.c -new file mode 100644 -index 0000000..aff58ed ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func011.c -@@ -0,0 +1,9 @@ -+#include -+#include -+int_least8_t* c_func_(int_least8_t *s) -+{ -+ for(int i = 0; i < 4; i++) { -+ *(s + i) = i + 10; -+ } -+ return s; -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func012.c b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func012.c -new file mode 100644 -index 0000000..446f20c ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func012.c -@@ -0,0 +1,9 @@ -+#include -+#include -+int_least16_t* c_func_(int_least16_t *s) -+{ -+ for(int i = 0; i < 4; i++) { -+ *(s + i) = i + 10; -+ } -+ return s; -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func013.c b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func013.c -new file mode 100644 -index 0000000..976133d ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func013.c -@@ -0,0 +1,9 @@ -+#include -+#include -+int_least32_t* c_func_(int_least32_t *s) -+{ -+ for(int i = 0; i < 4; i++) { -+ *(s + i) = i + 10; -+ } -+ return s; -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func014.c b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func014.c -new file mode 100644 -index 0000000..4358884 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func014.c -@@ -0,0 +1,9 @@ -+#include -+#include -+int_least64_t* c_func_(int_least64_t *s) -+{ -+ for(int i = 0; i < 4; i++) { -+ *(s + i) = i + 10; -+ } -+ return s; -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func015.c b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func015.c -new file mode 100644 -index 0000000..fea3e63 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func015.c -@@ -0,0 +1,9 @@ -+#include -+#include -+int_fast8_t* c_func_(int_fast8_t *s) -+{ -+ for(int i = 0; i < 4; i++) { -+ *(s + i) = i + 10; -+ } -+ return s; -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func016.c b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func016.c -new file mode 100644 -index 0000000..659acf6 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func016.c -@@ -0,0 +1,9 @@ -+#include -+#include -+int_fast16_t* c_func_(int_fast16_t *s) -+{ -+ for(int i = 0; i < 4; i++) { -+ *(s + i) = i + 10; -+ } -+ return s; -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func017.c b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func017.c -new file mode 100644 -index 0000000..f8834b4 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func017.c -@@ -0,0 +1,9 @@ -+#include -+#include -+int_fast32_t* c_func_(int_fast32_t *s) -+{ -+ for(int i = 0; i < 4; i++) { -+ *(s + i) = i + 10; -+ } -+ return s; -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func018.c b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func018.c -new file mode 100644 -index 0000000..f06b163 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func018.c -@@ -0,0 +1,9 @@ -+#include -+#include -+int_fast64_t* c_func_(int_fast64_t *s) -+{ -+ for(int i = 0; i < 4; i++) { -+ *(s + i) = i + 10; -+ } -+ return s; -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func019.c b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func019.c -new file mode 100644 -index 0000000..6e1ea95 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func019.c -@@ -0,0 +1,9 @@ -+#include -+#include -+intmax_t* c_func_(intmax_t *s) -+{ -+ for(int i = 0; i < 4; i++) { -+ *(s + i) = i + 10; -+ } -+ return s; -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func020.c b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func020.c -new file mode 100644 -index 0000000..d5b3db7 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func020.c -@@ -0,0 +1,9 @@ -+#include -+#include -+intptr_t* c_func_(intptr_t *s) -+{ -+ for(int i = 0; i < 4; i++) { -+ *(s + i) = i + 10; -+ } -+ return s; -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func021.c b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func021.c -new file mode 100644 -index 0000000..8aa0811 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func021.c -@@ -0,0 +1,8 @@ -+#include -+float* c_func_(float *s) -+{ -+ for(int i = 0; i < 4; i++) { -+ *(s + i) = i + 0.1314159265358979; -+ } -+ return s; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func022.c b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func022.c -new file mode 100644 -index 0000000..ec9fbf0 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func022.c -@@ -0,0 +1,8 @@ -+#include -+double* c_func_(double *s) -+{ -+ for(int i = 0; i < 4; i++) { -+ *(s + i) = i + 0.1314159265358979; -+ } -+ return s; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func023.c b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func023.c -new file mode 100644 -index 0000000..64d1980 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func023.c -@@ -0,0 +1,8 @@ -+#include -+long double* c_func_(long double *s) -+{ -+ for(int i = 0; i < 4; i++) { -+ *(s + i) = i + 0.1314159265358979; -+ } -+ return s; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func024.c b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func024.c -new file mode 100644 -index 0000000..63426c5 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func024.c -@@ -0,0 +1,6 @@ -+#include -+#include -+float _Complex* c_func_(float _Complex *s) -+{ -+ return s; -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func025.c b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func025.c -new file mode 100644 -index 0000000..8357f17 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func025.c -@@ -0,0 +1,6 @@ -+#include -+#include -+double _Complex* c_func_(double _Complex *s) -+{ -+ return s; -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func026.c b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func026.c -new file mode 100644 -index 0000000..f5871a9 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func026.c -@@ -0,0 +1,6 @@ -+#include -+#include -+long double _Complex* c_func_(long double _Complex *s) -+{ -+ return s; -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func027.c b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func027.c -new file mode 100644 -index 0000000..69cde43 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func027.c -@@ -0,0 +1,8 @@ -+#include -+_Bool* c_func_(_Bool *s) -+{ -+ for(int i = 0; i < 4; i++) { -+ *(s + i) = 1; -+ } -+ return s; -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func028.c b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func028.c -new file mode 100644 -index 0000000..25b531b ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func028.c -@@ -0,0 +1,8 @@ -+#include -+char* c_func_(char *s) -+{ -+ for(int i = 0; i < 4; i++) { -+ *(s + i) = 'a' + i; -+ } -+ return s; -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func029.c b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func029.c -new file mode 100644 -index 0000000..30526c7 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func029.c -@@ -0,0 +1,8 @@ -+#include -+int* c_func_(int *s) -+{ -+ for(int i = 0; i < 3; i++) { -+ *(s + i) = i + 10; -+ } -+ return s; -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func030.c b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func030.c -new file mode 100644 -index 0000000..542897f ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func030.c -@@ -0,0 +1,8 @@ -+#include -+int* c_func_(int *s) -+{ -+ for(int i = 0; i < 5; i++) { -+ *(s + i) = i + 10; -+ } -+ return s; -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func031.c b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func031.c -new file mode 100644 -index 0000000..8f4f7db ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func031.c -@@ -0,0 +1,8 @@ -+#include -+int* c_func_(int *s) -+{ -+ for(int i = 0; i < 6; i++) { -+ *(s + i) = i + 10; -+ } -+ return s; -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func032.c b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func032.c -new file mode 100644 -index 0000000..2f457db ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func032.c -@@ -0,0 +1,8 @@ -+#include -+int* c_func_(int *s) -+{ -+ for(int i = 0; i < 7; i++) { -+ *(s + i) = i + 10; -+ } -+ return s; -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func033.c b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func033.c -new file mode 100644 -index 0000000..f4d27c8 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func033.c -@@ -0,0 +1,8 @@ -+#include -+int* c_func_(int *s) -+{ -+ for(int i = 0; i < 8; i++) { -+ *(s + i) = i + 10; -+ } -+ return s; -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func034.c b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func034.c -new file mode 100644 -index 0000000..2cadd95 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func034.c -@@ -0,0 +1,8 @@ -+#include -+int* c_func_(int *s) -+{ -+ for(int i = 0; i < 26; i++) { -+ *(s + i) = i + 10; -+ } -+ return s; -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func035.c b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func035.c -new file mode 100644 -index 0000000..4d12dea ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/c_func035.c -@@ -0,0 +1,8 @@ -+#include -+int* c_func_(int *s) -+{ -+ for(int i = 0; i < 100; i++) { -+ *(s + i) = i + 10; -+ } -+ return s; -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main001.f90 b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main001.f90 -new file mode 100644 -index 0000000..09110c3 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main001.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the return type is array of type int -+! -+program main -+ integer :: my_x(4) -+ integer :: r(4) -+ interface -+ function c_func(b) result(res) -+ integer :: b(4) -+ integer :: res(4) -+ end -+ end interface -+ r = c_func(my_x) -+ print *, r -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main002.f90 b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main002.f90 -new file mode 100644 -index 0000000..aef86db ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main002.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the return type is array of type short -+! -+program main -+ integer(2) :: my_x(4) -+ integer(2) :: r(4) -+ interface -+ function c_func(b) result(res) -+ integer(2) :: b(4) -+ integer(2) :: res(4) -+ end -+ end interface -+ r = c_func(my_x) -+ print *, r -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main003.f90 b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main003.f90 -new file mode 100644 -index 0000000..ff59211 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main003.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the return type is array of type long -+! -+program main -+ integer(8) :: my_x(4) -+ integer(8) :: r(4) -+ interface -+ function c_func(b) result(res) -+ integer(8) :: b(4) -+ integer(8) :: res(4) -+ end -+ end interface -+ r = c_func(my_x) -+ print *, r -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main004.f90 b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main004.f90 -new file mode 100644 -index 0000000..7663281 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main004.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the return type is array of type long long -+! -+program main -+ integer(8) :: my_x(4) -+ integer(8) :: r(4) -+ interface -+ function c_func(b) result(res) -+ integer(8) :: b(4) -+ integer(8) :: res(4) -+ end -+ end interface -+ r = c_func(my_x) -+ print *, r -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main005.f90 b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main005.f90 -new file mode 100644 -index 0000000..ff162cd ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main005.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the return type is array of type signed char -+! -+program main -+ integer(1) :: my_x(4) -+ integer(1) :: r(4) -+ interface -+ function c_func(b) result(res) -+ integer(1) :: b(4) -+ integer(1) :: res(4) -+ end -+ end interface -+ r = c_func(my_x) -+ print *, r -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main006.f90 b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main006.f90 -new file mode 100644 -index 0000000..625924f ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main006.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the return type is array of type size_t -+! -+program main -+ integer(8) :: my_x(4) -+ integer(8) :: r(4) -+ interface -+ function c_func(b) result(res) -+ integer(8) :: b(4) -+ integer(8) :: res(4) -+ end -+ end interface -+ r = c_func(my_x) -+ print *, r -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main007.f90 b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main007.f90 -new file mode 100644 -index 0000000..e4a94ae ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main007.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the return type is array of type int8_t -+! -+program main -+ integer(1) :: my_x(4) -+ integer(1) :: r(4) -+ interface -+ function c_func(b) result(res) -+ integer(1) :: b(4) -+ integer(1) :: res(4) -+ end -+ end interface -+ r = c_func(my_x) -+ print *, r -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main008.f90 b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main008.f90 -new file mode 100644 -index 0000000..ea46cec ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main008.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the return type is array of type int16_t -+! -+program main -+ integer(2) :: my_x(4) -+ integer(2) :: r(4) -+ interface -+ function c_func(b) result(res) -+ integer(2) :: b(4) -+ integer(2) :: res(4) -+ end -+ end interface -+ r = c_func(my_x) -+ print *, r -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main009.f90 b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main009.f90 -new file mode 100644 -index 0000000..b4550ad ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main009.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the return type is array of type int32_t -+! -+program main -+ integer(4) :: my_x(4) -+ integer(4) :: r(4) -+ interface -+ function c_func(b) result(res) -+ integer(4) :: b(4) -+ integer(4) :: res(4) -+ end -+ end interface -+ r = c_func(my_x) -+ print *, r -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main010.f90 b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main010.f90 -new file mode 100644 -index 0000000..cbd8cce ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main010.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the return type is array of type int64_t -+! -+program main -+ integer(8) :: my_x(4) -+ integer(8) :: r(4) -+ interface -+ function c_func(b) result(res) -+ integer(8) :: b(4) -+ integer(8) :: res(4) -+ end -+ end interface -+ r = c_func(my_x) -+ print *, r -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main011.f90 b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main011.f90 -new file mode 100644 -index 0000000..f5d1730 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main011.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the return type is array of type int_least8_t -+! -+program main -+ integer(1) :: my_x(4) -+ integer(1) :: r(4) -+ interface -+ function c_func(b) result(res) -+ integer(1) :: b(4) -+ integer(1) :: res(4) -+ end -+ end interface -+ r = c_func(my_x) -+ print *, r -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main012.f90 b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main012.f90 -new file mode 100644 -index 0000000..2965f6a ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main012.f90 -@@ -0,0 +1,15 @@ -+! Test fortran call c for the return type is array of type -+! int_least16_t -+! -+program main -+ integer(2) :: my_x(4) -+ integer(2) :: r(4) -+ interface -+ function c_func(b) result(res) -+ integer(2) :: b(4) -+ integer(2) :: res(4) -+ end -+ end interface -+ r = c_func(my_x) -+ print *, r -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main013.f90 b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main013.f90 -new file mode 100644 -index 0000000..f2e9721 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main013.f90 -@@ -0,0 +1,15 @@ -+! Test fortran call c for the return type is array of type -+! int_least32_t -+! -+program main -+ integer(4) :: my_x(4) -+ integer(4) :: r(4) -+ interface -+ function c_func(b) result(res) -+ integer(4) :: b(4) -+ integer(4) :: res(4) -+ end -+ end interface -+ r = c_func(my_x) -+ print *, r -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main014.f90 b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main014.f90 -new file mode 100644 -index 0000000..9178983 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main014.f90 -@@ -0,0 +1,15 @@ -+! Test fortran call c for the return type is array of type -+! int_least64_t -+! -+program main -+ integer(8) :: my_x(4) -+ integer(8) :: r(4) -+ interface -+ function c_func(b) result(res) -+ integer(8) :: b(4) -+ integer(8) :: res(4) -+ end -+ end interface -+ r = c_func(my_x) -+ print *, r -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main015.f90 b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main015.f90 -new file mode 100644 -index 0000000..8c1c6b2 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main015.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the return type is array of type int_fast8_t -+! -+program main -+ integer(1) :: my_x(4) -+ integer(1) :: r(4) -+ interface -+ function c_func(b) result(res) -+ integer(1) :: b(4) -+ integer(1) :: res(4) -+ end -+ end interface -+ r = c_func(my_x) -+ print *, r -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main016.f90 b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main016.f90 -new file mode 100644 -index 0000000..9aae6b6 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main016.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the return type is array of type int_fast16_t -+! -+program main -+ integer(8) :: my_x(4) -+ integer(8) :: r(4) -+ interface -+ function c_func(b) result(res) -+ integer(8) :: b(4) -+ integer(8) :: res(4) -+ end -+ end interface -+ r = c_func(my_x) -+ print *, r -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main017.f90 b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main017.f90 -new file mode 100644 -index 0000000..c8c463f ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main017.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the return type is array of type int_fast32_t -+! -+program main -+ integer(8) :: my_x(4) -+ integer(8) :: r(4) -+ interface -+ function c_func(b) result(res) -+ integer(8) :: b(4) -+ integer(8) :: res(4) -+ end -+ end interface -+ r = c_func(my_x) -+ print *, r -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main018.f90 b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main018.f90 -new file mode 100644 -index 0000000..3b6119b ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main018.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the return type is array of type int_fast64_t -+! -+program main -+ integer(8) :: my_x(4) -+ integer(8) :: r(4) -+ interface -+ function c_func(b) result(res) -+ integer(8) :: b(4) -+ integer(8) :: res(4) -+ end -+ end interface -+ r = c_func(my_x) -+ print *, r -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main019.f90 b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main019.f90 -new file mode 100644 -index 0000000..8a6f8db ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main019.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the return type is array of type intmax_t -+! -+program main -+ integer(8) :: my_x(4) -+ integer(8) :: r(4) -+ interface -+ function c_func(b) result(res) -+ integer(8) :: b(4) -+ integer(8) :: res(4) -+ end -+ end interface -+ r = c_func(my_x) -+ print *, r -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main020.f90 b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main020.f90 -new file mode 100644 -index 0000000..43a77aa ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main020.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the return type is array of type intptr_t -+! -+program main -+ integer(8) :: my_x(4) -+ integer(8) :: r(4) -+ interface -+ function c_func(b) result(res) -+ integer(8) :: b(4) -+ integer(8) :: res(4) -+ end -+ end interface -+ r = c_func(my_x) -+ print *, r -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main021.f90 b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main021.f90 -new file mode 100644 -index 0000000..5c61f78 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main021.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the return type is array of type float -+! -+program main -+ real(4) :: my_x(4) -+ real(4) :: r(4) -+ interface -+ function c_func(b) result(res) -+ real(4) :: b(4) -+ real(4) :: res(4) -+ end -+ end interface -+ r = c_func(my_x) -+ print *, r -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main022.f90 b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main022.f90 -new file mode 100644 -index 0000000..ed540c4 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main022.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the return type is array of type double -+! -+program main -+ real(8) :: my_x(4) -+ real(8) :: r(4) -+ interface -+ function c_func(b) result(res) -+ real(8) :: b(4) -+ real(8) :: res(4) -+ end -+ end interface -+ r = c_func(my_x) -+ print *, r -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main023.f90 b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main023.f90 -new file mode 100644 -index 0000000..e549baa ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main023.f90 -@@ -0,0 +1,16 @@ -+! Test fortran call c for the return type is array of type long double -+! -+program main -+ integer, parameter :: K = selected_real_kind(16) -+ real(K) :: my_x(4) -+ real(K) :: r(4) -+ interface -+ function c_func(b) result(res) -+ integer, parameter :: K = selected_real_kind(16) -+ real(K) :: b(4) -+ real(K) :: res(4) -+ end -+ end interface -+ r = c_func(my_x) -+ print *, r -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main024.f90 b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main024.f90 -new file mode 100644 -index 0000000..96804fa ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main024.f90 -@@ -0,0 +1,15 @@ -+! Test fortran call c for the return type is array of type float -+! _Complex -+! -+program main -+ complex(4) :: my_x(4) = (-3.14159265358979, 1) -+ complex(4) :: r(4) -+ interface -+ function c_func(b) -+ complex(4) :: b(4) -+ complex(4) :: c_func(4) -+ end -+ end interface -+ r = c_func(my_x) -+ print *, r -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main025.f90 b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main025.f90 -new file mode 100644 -index 0000000..64768de ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main025.f90 -@@ -0,0 +1,16 @@ -+! Test fortran call c for the return type is array of type double -+! _Complex -+! -+program main -+ complex(8) :: my_x(4) = (-3.14159265358979, 1) -+ complex(8) :: r(4) -+ interface -+ function c_func(b) result(res) -+ complex(8) :: b(4) -+ complex(8) :: res(4) -+ end -+ end interface -+ r = c_func(my_x) -+ print *, r -+end -+ -diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main026.f90 b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main026.f90 -new file mode 100644 -index 0000000..f501e62 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main026.f90 -@@ -0,0 +1,18 @@ -+! Test fortran call c for the return type is array of type long double -+! _Complex -+! -+program main -+ integer, parameter :: K = selected_real_kind(16) -+ complex(K) :: my_x(4) = (-3.14159265358979, 1) -+ complex(K) :: r(4) -+ interface -+ function c_func(b) -+ integer, parameter :: K = selected_real_kind(16) -+ complex(K) :: b(4) -+ complex(K) :: c_func(4) -+ end -+ end interface -+ r = c_func(my_x) -+ print *, r -+end -+ -diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main027.f90 b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main027.f90 -new file mode 100644 -index 0000000..136e6ff ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main027.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the return type is array of type bool -+! -+program main -+ logical(1) :: my_x(4) = .False. -+ logical(1) :: r(4) -+ interface -+ function c_func(b) result(res) -+ logical(1) :: b(4) -+ logical(1) :: res(4) -+ end -+ end interface -+ r = c_func(my_x) -+ print *, r -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main028.f90 b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main028.f90 -new file mode 100644 -index 0000000..257cc07 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main028.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the return type is array of type char -+! -+program main -+ character(1) :: my_x(4) -+ character(1) :: r(4) -+ interface -+ function c_func(b) result(res) -+ character(1) :: b(4) -+ character(1) :: res(4) -+ end -+ end interface -+ r = c_func(my_x) -+ print *, r -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main029.f90 b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main029.f90 -new file mode 100644 -index 0000000..d681390 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main029.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the return type is array of different sizes -+! -+program main -+ integer :: my_x(3) -+ integer :: r(3) -+ interface -+ function c_func(b) result(res) -+ integer :: b(3) -+ integer :: res(3) -+ end -+ end interface -+ r = c_func(my_x) -+ print *, r -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main030.f90 b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main030.f90 -new file mode 100644 -index 0000000..ded2f28 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main030.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the return type is array of different sizes -+! -+program main -+ integer :: my_x(5) -+ integer :: r(5) -+ interface -+ function c_func(b) result(res) -+ integer :: b(5) -+ integer :: res(5) -+ end -+ end interface -+ r = c_func(my_x) -+ print *, r -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main031.f90 b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main031.f90 -new file mode 100644 -index 0000000..7705bf5 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main031.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the return type is array of different sizes -+! -+program main -+ integer :: my_x(6) -+ integer :: r(6) -+ interface -+ function c_func(b) result(res) -+ integer :: b(6) -+ integer :: res(6) -+ end -+ end interface -+ r = c_func(my_x) -+ print *, r -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main032.f90 b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main032.f90 -new file mode 100644 -index 0000000..21e1dfe ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main032.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the return type is array of different sizes -+! -+program main -+ integer :: my_x(7) -+ integer :: r(7) -+ interface -+ function c_func(b) result(res) -+ integer :: b(7) -+ integer :: res(7) -+ end -+ end interface -+ r = c_func(my_x) -+ print *, r -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main033.f90 b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main033.f90 -new file mode 100644 -index 0000000..82f2a25 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main033.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the return type is array of different sizes -+! -+program main -+ integer :: my_x(8) -+ integer :: r(8) -+ interface -+ function c_func(b) result(res) -+ integer :: b(8) -+ integer :: res(8) -+ end -+ end interface -+ r = c_func(my_x) -+ print *, r -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main034.f90 b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main034.f90 -new file mode 100644 -index 0000000..29275a0 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main034.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the return type is array of different sizes -+! -+program main -+ integer :: my_x(26) -+ integer :: r(26) -+ interface -+ function c_func(b) result(res) -+ integer :: b(26) -+ integer :: res(26) -+ end -+ end interface -+ r = c_func(my_x) -+ print *, r -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main035.f90 b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main035.f90 -new file mode 100644 -index 0000000..99e3c90 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/fortran_main035.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the return type is array of different sizes -+! -+program main -+ integer :: my_x(100) -+ integer :: r(100) -+ interface -+ function c_func(b) result(res) -+ integer :: b(100) -+ integer :: res(100) -+ end -+ end interface -+ r = c_func(my_x) -+ print *, r -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/result.md b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/result.md -new file mode 100644 -index 0000000..b7353ca ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/result.md -@@ -0,0 +1,36 @@ -+ | test | gfortran | flang | nvfortran| -+ | 001 | ERROR | PASS | PASS | -+ | 002 | ERROR | PASS | PASS | -+ | 003 | ERROR | PASS | PASS | -+ | 004 | ERROR | PASS | PASS | -+ | 005 | ERROR | PASS | PASS | -+ | 006 | ERROR | PASS | PASS | -+ | 007 | ERROR | PASS | PASS | -+ | 008 | ERROR | PASS | PASS | -+ | 009 | ERROR | PASS | PASS | -+ | 010 | ERROR | PASS | PASS | -+ | 011 | ERROR | PASS | PASS | -+ | 012 | ERROR | PASS | PASS | -+ | 013 | ERROR | PASS | PASS | -+ | 014 | ERROR | PASS | PASS | -+ | 015 | ERROR | PASS | PASS | -+ | 016 | ERROR | PASS | PASS | -+ | 017 | ERROR | PASS | PASS | -+ | 018 | ERROR | PASS | PASS | -+ | 019 | ERROR | PASS | PASS | -+ | 020 | ERROR | PASS | PASS | -+ | 021 | ERROR | PASS | PASS | -+ | 022 | ERROR | PASS | PASS | -+ | 023 | ERROR | PASS | ERROR | -+ | 024 | ERROR | ERROR | ERROR | -+ | 025 | ERROR | ERROR | ERROR | -+ | 026 | ERROR | ERROR | ERROR | -+ | 027 | PASS | PASS | PASS | -+ | 028 | ERROR | PASS | PASS | -+ | 029 | ERROR | PASS | PASS | -+ | 030 | ERROR | PASS | PASS | -+ | 031 | ERROR | PASS | PASS | -+ | 032 | ERROR | PASS | PASS | -+ | 033 | ERROR | PASS | PASS | -+ | 034 | ERROR | PASS | PASS | -+ | 035 | ERROR | PASS | PASS | -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/run.sh b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/run.sh -new file mode 100644 -index 0000000..27162b7 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/005_fortran_call_c_function_array/run.sh -@@ -0,0 +1,22 @@ -+for i in {001..035} -+do -+echo "------- test $i ------." -+echo "----- gfortran result:" -+gcc c_func$i.c -c -o c-test.o -+gfortran fortran_main$i.f90 -fno-range-check -c -o fortran-test.o -+gfortran c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+echo "----- flang-new result : " -+clang c_func$i.c -c -o c-test.o -+flang-new fortran_main$i.f90 -c -o fortran-test.o -+flang-new -flang-experimental-exec c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+echo "----- nvfortran result : " -+clang c_func$i.c -c -o c-test.o -+nvfortran fortran_main$i.f90 -c -o fortran-test.o -+nvfortran c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+done -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func001.c b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func001.c -new file mode 100644 -index 0000000..5fc1da0 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func001.c -@@ -0,0 +1,8 @@ -+#include -+int* c_func_(int *s) -+{ -+ for(int i = 0; i < 4; i++) { -+ *(s + i) = i + 10; -+ } -+ return s; -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func002.c b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func002.c -new file mode 100644 -index 0000000..0adaedc ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func002.c -@@ -0,0 +1,8 @@ -+#include -+short* c_func_(short *s) -+{ -+ for(int i = 0; i < 4; i++) { -+ *(s + i) = i + 10; -+ } -+ return s; -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func003.c b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func003.c -new file mode 100644 -index 0000000..9e25ad4 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func003.c -@@ -0,0 +1,8 @@ -+#include -+long* c_func_(long *s) -+{ -+ for(int i = 0; i < 4; i++) { -+ *(s + i) = i + 10; -+ } -+ return s; -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func004.c b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func004.c -new file mode 100644 -index 0000000..224a535 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func004.c -@@ -0,0 +1,8 @@ -+#include -+long long* c_func_(long long *s) -+{ -+ for(int i = 0; i < 4; i++) { -+ *(s + i) = i + 10; -+ } -+ return s; -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func005.c b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func005.c -new file mode 100644 -index 0000000..ee7dadf ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func005.c -@@ -0,0 +1,8 @@ -+#include -+signed char* c_func_(signed char *s) -+{ -+ for(int i = 0; i < 4; i++) { -+ *(s + i) = i + 10; -+ } -+ return s; -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func006.c b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func006.c -new file mode 100644 -index 0000000..d1a350e ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func006.c -@@ -0,0 +1,8 @@ -+#include -+size_t* c_func_(size_t *s) -+{ -+ for(int i = 0; i < 4; i++) { -+ *(s + i) = i + 10; -+ } -+ return s; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func007.c b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func007.c -new file mode 100644 -index 0000000..8418d36 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func007.c -@@ -0,0 +1,9 @@ -+#include -+#include -+int8_t* c_func_(int8_t *s) -+{ -+ for(int i = 0; i < 4; i++) { -+ *(s + i) = i + 10; -+ } -+ return s; -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func008.c b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func008.c -new file mode 100644 -index 0000000..63df945 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func008.c -@@ -0,0 +1,9 @@ -+#include -+#include -+int16_t* c_func_(int16_t *s) -+{ -+ for(int i = 0; i < 4; i++) { -+ *(s + i) = i + 10; -+ } -+ return s; -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func009.c b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func009.c -new file mode 100644 -index 0000000..ee3be43 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func009.c -@@ -0,0 +1,9 @@ -+#include -+#include -+int32_t* c_func_(int32_t *s) -+{ -+ for(int i = 0; i < 4; i++) { -+ *(s + i) = i + 10; -+ } -+ return s; -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func010.c b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func010.c -new file mode 100644 -index 0000000..464e81c ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func010.c -@@ -0,0 +1,9 @@ -+#include -+#include -+int64_t* c_func_(int64_t *s) -+{ -+ for(int i = 0; i < 4; i++) { -+ *(s + i) = i + 10; -+ } -+ return s; -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func011.c b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func011.c -new file mode 100644 -index 0000000..aff58ed ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func011.c -@@ -0,0 +1,9 @@ -+#include -+#include -+int_least8_t* c_func_(int_least8_t *s) -+{ -+ for(int i = 0; i < 4; i++) { -+ *(s + i) = i + 10; -+ } -+ return s; -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func012.c b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func012.c -new file mode 100644 -index 0000000..446f20c ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func012.c -@@ -0,0 +1,9 @@ -+#include -+#include -+int_least16_t* c_func_(int_least16_t *s) -+{ -+ for(int i = 0; i < 4; i++) { -+ *(s + i) = i + 10; -+ } -+ return s; -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func013.c b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func013.c -new file mode 100644 -index 0000000..976133d ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func013.c -@@ -0,0 +1,9 @@ -+#include -+#include -+int_least32_t* c_func_(int_least32_t *s) -+{ -+ for(int i = 0; i < 4; i++) { -+ *(s + i) = i + 10; -+ } -+ return s; -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func014.c b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func014.c -new file mode 100644 -index 0000000..4358884 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func014.c -@@ -0,0 +1,9 @@ -+#include -+#include -+int_least64_t* c_func_(int_least64_t *s) -+{ -+ for(int i = 0; i < 4; i++) { -+ *(s + i) = i + 10; -+ } -+ return s; -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func015.c b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func015.c -new file mode 100644 -index 0000000..fea3e63 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func015.c -@@ -0,0 +1,9 @@ -+#include -+#include -+int_fast8_t* c_func_(int_fast8_t *s) -+{ -+ for(int i = 0; i < 4; i++) { -+ *(s + i) = i + 10; -+ } -+ return s; -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func016.c b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func016.c -new file mode 100644 -index 0000000..659acf6 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func016.c -@@ -0,0 +1,9 @@ -+#include -+#include -+int_fast16_t* c_func_(int_fast16_t *s) -+{ -+ for(int i = 0; i < 4; i++) { -+ *(s + i) = i + 10; -+ } -+ return s; -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func017.c b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func017.c -new file mode 100644 -index 0000000..f8834b4 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func017.c -@@ -0,0 +1,9 @@ -+#include -+#include -+int_fast32_t* c_func_(int_fast32_t *s) -+{ -+ for(int i = 0; i < 4; i++) { -+ *(s + i) = i + 10; -+ } -+ return s; -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func018.c b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func018.c -new file mode 100644 -index 0000000..f06b163 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func018.c -@@ -0,0 +1,9 @@ -+#include -+#include -+int_fast64_t* c_func_(int_fast64_t *s) -+{ -+ for(int i = 0; i < 4; i++) { -+ *(s + i) = i + 10; -+ } -+ return s; -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func019.c b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func019.c -new file mode 100644 -index 0000000..6e1ea95 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func019.c -@@ -0,0 +1,9 @@ -+#include -+#include -+intmax_t* c_func_(intmax_t *s) -+{ -+ for(int i = 0; i < 4; i++) { -+ *(s + i) = i + 10; -+ } -+ return s; -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func020.c b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func020.c -new file mode 100644 -index 0000000..d5b3db7 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func020.c -@@ -0,0 +1,9 @@ -+#include -+#include -+intptr_t* c_func_(intptr_t *s) -+{ -+ for(int i = 0; i < 4; i++) { -+ *(s + i) = i + 10; -+ } -+ return s; -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func021.c b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func021.c -new file mode 100644 -index 0000000..8aa0811 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func021.c -@@ -0,0 +1,8 @@ -+#include -+float* c_func_(float *s) -+{ -+ for(int i = 0; i < 4; i++) { -+ *(s + i) = i + 0.1314159265358979; -+ } -+ return s; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func022.c b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func022.c -new file mode 100644 -index 0000000..ec9fbf0 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func022.c -@@ -0,0 +1,8 @@ -+#include -+double* c_func_(double *s) -+{ -+ for(int i = 0; i < 4; i++) { -+ *(s + i) = i + 0.1314159265358979; -+ } -+ return s; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func023.c b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func023.c -new file mode 100644 -index 0000000..64d1980 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func023.c -@@ -0,0 +1,8 @@ -+#include -+long double* c_func_(long double *s) -+{ -+ for(int i = 0; i < 4; i++) { -+ *(s + i) = i + 0.1314159265358979; -+ } -+ return s; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func024.c b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func024.c -new file mode 100644 -index 0000000..63426c5 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func024.c -@@ -0,0 +1,6 @@ -+#include -+#include -+float _Complex* c_func_(float _Complex *s) -+{ -+ return s; -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func025.c b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func025.c -new file mode 100644 -index 0000000..8357f17 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func025.c -@@ -0,0 +1,6 @@ -+#include -+#include -+double _Complex* c_func_(double _Complex *s) -+{ -+ return s; -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func026.c b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func026.c -new file mode 100644 -index 0000000..f5871a9 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func026.c -@@ -0,0 +1,6 @@ -+#include -+#include -+long double _Complex* c_func_(long double _Complex *s) -+{ -+ return s; -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func027.c b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func027.c -new file mode 100644 -index 0000000..69cde43 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func027.c -@@ -0,0 +1,8 @@ -+#include -+_Bool* c_func_(_Bool *s) -+{ -+ for(int i = 0; i < 4; i++) { -+ *(s + i) = 1; -+ } -+ return s; -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func028.c b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func028.c -new file mode 100644 -index 0000000..25b531b ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func028.c -@@ -0,0 +1,8 @@ -+#include -+char* c_func_(char *s) -+{ -+ for(int i = 0; i < 4; i++) { -+ *(s + i) = 'a' + i; -+ } -+ return s; -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func029.c b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func029.c -new file mode 100644 -index 0000000..30526c7 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func029.c -@@ -0,0 +1,8 @@ -+#include -+int* c_func_(int *s) -+{ -+ for(int i = 0; i < 3; i++) { -+ *(s + i) = i + 10; -+ } -+ return s; -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func030.c b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func030.c -new file mode 100644 -index 0000000..542897f ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func030.c -@@ -0,0 +1,8 @@ -+#include -+int* c_func_(int *s) -+{ -+ for(int i = 0; i < 5; i++) { -+ *(s + i) = i + 10; -+ } -+ return s; -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func031.c b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func031.c -new file mode 100644 -index 0000000..8f4f7db ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func031.c -@@ -0,0 +1,8 @@ -+#include -+int* c_func_(int *s) -+{ -+ for(int i = 0; i < 6; i++) { -+ *(s + i) = i + 10; -+ } -+ return s; -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func032.c b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func032.c -new file mode 100644 -index 0000000..2f457db ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func032.c -@@ -0,0 +1,8 @@ -+#include -+int* c_func_(int *s) -+{ -+ for(int i = 0; i < 7; i++) { -+ *(s + i) = i + 10; -+ } -+ return s; -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func033.c b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func033.c -new file mode 100644 -index 0000000..f4d27c8 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func033.c -@@ -0,0 +1,8 @@ -+#include -+int* c_func_(int *s) -+{ -+ for(int i = 0; i < 8; i++) { -+ *(s + i) = i + 10; -+ } -+ return s; -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func034.c b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func034.c -new file mode 100644 -index 0000000..2cadd95 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func034.c -@@ -0,0 +1,8 @@ -+#include -+int* c_func_(int *s) -+{ -+ for(int i = 0; i < 26; i++) { -+ *(s + i) = i + 10; -+ } -+ return s; -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func035.c b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func035.c -new file mode 100644 -index 0000000..4d12dea ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/c_func035.c -@@ -0,0 +1,8 @@ -+#include -+int* c_func_(int *s) -+{ -+ for(int i = 0; i < 100; i++) { -+ *(s + i) = i + 10; -+ } -+ return s; -+} -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main001.f90 b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main001.f90 -new file mode 100644 -index 0000000..86e491b ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main001.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the return type is array of type int -+! -+program main -+ integer :: my_x(4) -+ integer :: r(4) -+ interface -+ function c_func(b) result(res) bind(c, name = "c_func_") -+ integer :: b(4) -+ integer :: res(4) -+ end -+ end interface -+ r = c_func(my_x) -+ print *, r -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main002.f90 b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main002.f90 -new file mode 100644 -index 0000000..4aa33cc ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main002.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the return type is array of type short -+! -+program main -+ integer(2) :: my_x(4) -+ integer(2) :: r(4) -+ interface -+ function c_func(b) result(res) bind(c, name = "c_func_") -+ integer(2) :: b(4) -+ integer(2) :: res(4) -+ end -+ end interface -+ r = c_func(my_x) -+ print *, r -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main003.f90 b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main003.f90 -new file mode 100644 -index 0000000..fe26878 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main003.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the return type is array of type long -+! -+program main -+ integer(8) :: my_x(4) -+ integer(8) :: r(4) -+ interface -+ function c_func(b) result(res) bind(c, name = "c_func_") -+ integer(8) :: b(4) -+ integer(8) :: res(4) -+ end -+ end interface -+ r = c_func(my_x) -+ print *, r -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main004.f90 b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main004.f90 -new file mode 100644 -index 0000000..a6df6b7 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main004.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the return type is array of type long long -+! -+program main -+ integer(8) :: my_x(4) -+ integer(8) :: r(4) -+ interface -+ function c_func(b) result(res) bind(c, name = "c_func_") -+ integer(8) :: b(4) -+ integer(8) :: res(4) -+ end -+ end interface -+ r = c_func(my_x) -+ print *, r -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main005.f90 b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main005.f90 -new file mode 100644 -index 0000000..989272a ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main005.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the return type is array of type signed char -+! -+program main -+ integer(1) :: my_x(4) -+ integer(1) :: r(4) -+ interface -+ function c_func(b) result(res) bind(c, name = "c_func_") -+ integer(1) :: b(4) -+ integer(1) :: res(4) -+ end -+ end interface -+ r = c_func(my_x) -+ print *, r -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main006.f90 b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main006.f90 -new file mode 100644 -index 0000000..232ad83 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main006.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the return type is array of type size_t -+! -+program main -+ integer(8) :: my_x(4) -+ integer(8) :: r(4) -+ interface -+ function c_func(b) result(res) bind(c, name = "c_func_") -+ integer(8) :: b(4) -+ integer(8) :: res(4) -+ end -+ end interface -+ r = c_func(my_x) -+ print *, r -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main007.f90 b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main007.f90 -new file mode 100644 -index 0000000..87d03be ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main007.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the return type is array of type int8_t -+! -+program main -+ integer(1) :: my_x(4) -+ integer(1) :: r(4) -+ interface -+ function c_func(b) result(res) bind(c, name = "c_func_") -+ integer(1) :: b(4) -+ integer(1) :: res(4) -+ end -+ end interface -+ r = c_func(my_x) -+ print *, r -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main008.f90 b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main008.f90 -new file mode 100644 -index 0000000..e083e4e ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main008.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the return type is array of type int16_t -+! -+program main -+ integer(2) :: my_x(4) -+ integer(2) :: r(4) -+ interface -+ function c_func(b) result(res) bind(c, name = "c_func_") -+ integer(2) :: b(4) -+ integer(2) :: res(4) -+ end -+ end interface -+ r = c_func(my_x) -+ print *, r -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main009.f90 b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main009.f90 -new file mode 100644 -index 0000000..2f5daea ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main009.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the return type is array of type int32_t -+! -+program main -+ integer(4) :: my_x(4) -+ integer(4) :: r(4) -+ interface -+ function c_func(b) result(res) bind(c, name = "c_func_") -+ integer(4) :: b(4) -+ integer(4) :: res(4) -+ end -+ end interface -+ r = c_func(my_x) -+ print *, r -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main010.f90 b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main010.f90 -new file mode 100644 -index 0000000..32cd91a ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main010.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the return type is array of type int64_t -+! -+program main -+ integer(8) :: my_x(4) -+ integer(8) :: r(4) -+ interface -+ function c_func(b) result(res) bind(c, name = "c_func_") -+ integer(8) :: b(4) -+ integer(8) :: res(4) -+ end -+ end interface -+ r = c_func(my_x) -+ print *, r -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main011.f90 b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main011.f90 -new file mode 100644 -index 0000000..909ae51 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main011.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the return type is array of type int_least8_t -+! -+program main -+ integer(1) :: my_x(4) -+ integer(1) :: r(4) -+ interface -+ function c_func(b) result(res) bind(c, name = "c_func_") -+ integer(1) :: b(4) -+ integer(1) :: res(4) -+ end -+ end interface -+ r = c_func(my_x) -+ print *, r -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main012.f90 b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main012.f90 -new file mode 100644 -index 0000000..6c0eaa0 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main012.f90 -@@ -0,0 +1,15 @@ -+! Test fortran call c for the return type is array of type -+! int_least16_t -+! -+program main -+ integer(2) :: my_x(4) -+ integer(2) :: r(4) -+ interface -+ function c_func(b) result(res) bind(c, name = "c_func_") -+ integer(2) :: b(4) -+ integer(2) :: res(4) -+ end -+ end interface -+ r = c_func(my_x) -+ print *, r -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main013.f90 b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main013.f90 -new file mode 100644 -index 0000000..2b85f87 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main013.f90 -@@ -0,0 +1,15 @@ -+! Test fortran call c for the return type is array of type -+! int_least32_t -+! -+program main -+ integer(4) :: my_x(4) -+ integer(4) :: r(4) -+ interface -+ function c_func(b) result(res) bind(c, name = "c_func_") -+ integer(4) :: b(4) -+ integer(4) :: res(4) -+ end -+ end interface -+ r = c_func(my_x) -+ print *, r -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main014.f90 b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main014.f90 -new file mode 100644 -index 0000000..2ab17c7 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main014.f90 -@@ -0,0 +1,15 @@ -+! Test fortran call c for the return type is array of type -+! int_least64_t -+! -+program main -+ integer(8) :: my_x(4) -+ integer(8) :: r(4) -+ interface -+ function c_func(b) result(res) bind(c, name = "c_func_") -+ integer(8) :: b(4) -+ integer(8) :: res(4) -+ end -+ end interface -+ r = c_func(my_x) -+ print *, r -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main015.f90 b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main015.f90 -new file mode 100644 -index 0000000..8f8fdb0 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main015.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the return type is array of type int_fast8_t -+! -+program main -+ integer(1) :: my_x(4) -+ integer(1) :: r(4) -+ interface -+ function c_func(b) result(res) bind(c, name = "c_func_") -+ integer(1) :: b(4) -+ integer(1) :: res(4) -+ end -+ end interface -+ r = c_func(my_x) -+ print *, r -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main016.f90 b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main016.f90 -new file mode 100644 -index 0000000..2e55344 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main016.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the return type is array of type int_fast16_t -+! -+program main -+ integer(8) :: my_x(4) -+ integer(8) :: r(4) -+ interface -+ function c_func(b) result(res) bind(c, name = "c_func_") -+ integer(8) :: b(4) -+ integer(8) :: res(4) -+ end -+ end interface -+ r = c_func(my_x) -+ print *, r -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main017.f90 b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main017.f90 -new file mode 100644 -index 0000000..78f9802 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main017.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the return type is array of type int_fast32_t -+! -+program main -+ integer(8) :: my_x(4) -+ integer(8) :: r(4) -+ interface -+ function c_func(b) result(res) bind(c, name = "c_func_") -+ integer(8) :: b(4) -+ integer(8) :: res(4) -+ end -+ end interface -+ r = c_func(my_x) -+ print *, r -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main018.f90 b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main018.f90 -new file mode 100644 -index 0000000..a7208b8 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main018.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the return type is array of type int_fast64_t -+! -+program main -+ integer(8) :: my_x(4) -+ integer(8) :: r(4) -+ interface -+ function c_func(b) result(res) bind(c, name = "c_func_") -+ integer(8) :: b(4) -+ integer(8) :: res(4) -+ end -+ end interface -+ r = c_func(my_x) -+ print *, r -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main019.f90 b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main019.f90 -new file mode 100644 -index 0000000..95df634 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main019.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the return type is array of type intmax_t -+! -+program main -+ integer(8) :: my_x(4) -+ integer(8) :: r(4) -+ interface -+ function c_func(b) result(res) bind(c, name = "c_func_") -+ integer(8) :: b(4) -+ integer(8) :: res(4) -+ end -+ end interface -+ r = c_func(my_x) -+ print *, r -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main020.f90 b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main020.f90 -new file mode 100644 -index 0000000..a4220c2 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main020.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the return type is array of type intptr_t -+! -+program main -+ integer(8) :: my_x(4) -+ integer(8) :: r(4) -+ interface -+ function c_func(b) result(res) bind(c, name = "c_func_") -+ integer(8) :: b(4) -+ integer(8) :: res(4) -+ end -+ end interface -+ r = c_func(my_x) -+ print *, r -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main021.f90 b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main021.f90 -new file mode 100644 -index 0000000..b08d517 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main021.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the return type is array of type float -+! -+program main -+ real(4) :: my_x(4) -+ real(4) :: r(4) -+ interface -+ function c_func(b) result(res) bind(c, name = "c_func_") -+ real(4) :: b(4) -+ real(4) :: res(4) -+ end -+ end interface -+ r = c_func(my_x) -+ print *, r -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main022.f90 b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main022.f90 -new file mode 100644 -index 0000000..d47918e ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main022.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the return type is array of type double -+! -+program main -+ real(8) :: my_x(4) -+ real(8) :: r(4) -+ interface -+ function c_func(b) result(res) bind(c, name = "c_func_") -+ real(8) :: b(4) -+ real(8) :: res(4) -+ end -+ end interface -+ r = c_func(my_x) -+ print *, r -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main023.f90 b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main023.f90 -new file mode 100644 -index 0000000..a0d0575 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main023.f90 -@@ -0,0 +1,16 @@ -+! Test fortran call c for the return type is array of type long double -+! -+program main -+ integer, parameter :: K = selected_real_kind(16) -+ real(K) :: my_x(4) -+ real(K) :: r(4) -+ interface -+ function c_func(b) result(res) bind(c, name = "c_func_") -+ integer, parameter :: K = selected_real_kind(16) -+ real(K) :: b(4) -+ real(K) :: res(4) -+ end -+ end interface -+ r = c_func(my_x) -+ print *, r -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main024.f90 b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main024.f90 -new file mode 100644 -index 0000000..07685eb ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main024.f90 -@@ -0,0 +1,15 @@ -+! Test fortran call c for the return type is array of type float -+! _Complex -+! -+program main -+ complex(4) :: my_x(4) = (-3.14159265358979, 1) -+ complex(4) :: r(4) -+ interface -+ function c_func(b) bind(c, name = "c_func_") -+ complex(4) :: b(4) -+ complex(4) :: c_func(4) -+ end -+ end interface -+ r = c_func(my_x) -+ print *, r -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main025.f90 b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main025.f90 -new file mode 100644 -index 0000000..9e5457f ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main025.f90 -@@ -0,0 +1,16 @@ -+! Test fortran call c for the return type is array of type double -+! _Complex -+! -+program main -+ complex(8) :: my_x(4) = (-3.14159265358979, 1) -+ complex(8) :: r(4) -+ interface -+ function c_func(b) result(res) bind(c, name = "c_func_") -+ complex(8) :: b(4) -+ complex(8) :: res(4) -+ end -+ end interface -+ r = c_func(my_x) -+ print *, r -+end -+ -diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main026.f90 b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main026.f90 -new file mode 100644 -index 0000000..72412b2 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main026.f90 -@@ -0,0 +1,18 @@ -+! Test fortran call c for the return type is array of type long double -+! _Complex -+! -+program main -+ integer, parameter :: K = selected_real_kind(16) -+ complex(K) :: my_x(4) = (-3.14159265358979, 1) -+ complex(K) :: r(4) -+ interface -+ function c_func(b) bind(c, name = "c_func_") -+ integer, parameter :: K = selected_real_kind(16) -+ complex(K) :: b(4) -+ complex(K) :: c_func(4) -+ end -+ end interface -+ r = c_func(my_x) -+ print *, r -+end -+ -diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main027.f90 b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main027.f90 -new file mode 100644 -index 0000000..16dfa87 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main027.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the return type is array of type bool -+! -+program main -+ logical(1) :: my_x(4) = .False. -+ logical(1) :: r(4) -+ interface -+ function c_func(b) result(res) bind(c, name = "c_func_") -+ logical(1) :: b(4) -+ logical(1) :: res(4) -+ end -+ end interface -+ r = c_func(my_x) -+ print *, r -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main028.f90 b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main028.f90 -new file mode 100644 -index 0000000..8616ed4 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main028.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the return type is array of type char -+! -+program main -+ character(1) :: my_x(4) -+ character(1) :: r(4) -+ interface -+ function c_func(b) result(res) bind(c, name = "c_func_") -+ character(1) :: b(4) -+ character(1) :: res(4) -+ end -+ end interface -+ r = c_func(my_x) -+ print *, r -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main029.f90 b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main029.f90 -new file mode 100644 -index 0000000..a5a7bd8 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main029.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the return type is array of different sizes -+! -+program main -+ integer :: my_x(3) -+ integer :: r(3) -+ interface -+ function c_func(b) result(res) bind(c, name = "c_func_") -+ integer :: b(3) -+ integer :: res(3) -+ end -+ end interface -+ r = c_func(my_x) -+ print *, r -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main030.f90 b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main030.f90 -new file mode 100644 -index 0000000..186f3d9 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main030.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the return type is array of different sizes -+! -+program main -+ integer :: my_x(5) -+ integer :: r(5) -+ interface -+ function c_func(b) result(res) bind(c, name = "c_func_") -+ integer :: b(5) -+ integer :: res(5) -+ end -+ end interface -+ r = c_func(my_x) -+ print *, r -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main031.f90 b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main031.f90 -new file mode 100644 -index 0000000..8ccc524 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main031.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the return type is array of different sizes -+! -+program main -+ integer :: my_x(6) -+ integer :: r(6) -+ interface -+ function c_func(b) result(res) bind(c, name = "c_func_") -+ integer :: b(6) -+ integer :: res(6) -+ end -+ end interface -+ r = c_func(my_x) -+ print *, r -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main032.f90 b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main032.f90 -new file mode 100644 -index 0000000..8884e3a ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main032.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the return type is array of different sizes -+! -+program main -+ integer :: my_x(7) -+ integer :: r(7) -+ interface -+ function c_func(b) result(res) bind(c, name = "c_func_") -+ integer :: b(7) -+ integer :: res(7) -+ end -+ end interface -+ r = c_func(my_x) -+ print *, r -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main033.f90 b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main033.f90 -new file mode 100644 -index 0000000..e2b6170 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main033.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the return type is array of different sizes -+! -+program main -+ integer :: my_x(8) -+ integer :: r(8) -+ interface -+ function c_func(b) result(res) bind(c, name = "c_func_") -+ integer :: b(8) -+ integer :: res(8) -+ end -+ end interface -+ r = c_func(my_x) -+ print *, r -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main034.f90 b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main034.f90 -new file mode 100644 -index 0000000..31fd7ed ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main034.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the return type is array of different sizes -+! -+program main -+ integer :: my_x(26) -+ integer :: r(26) -+ interface -+ function c_func(b) result(res) bind(c, name = "c_func_") -+ integer :: b(26) -+ integer :: res(26) -+ end -+ end interface -+ r = c_func(my_x) -+ print *, r -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main035.f90 b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main035.f90 -new file mode 100644 -index 0000000..99e3c90 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/fortran_main035.f90 -@@ -0,0 +1,14 @@ -+! Test fortran call c for the return type is array of different sizes -+! -+program main -+ integer :: my_x(100) -+ integer :: r(100) -+ interface -+ function c_func(b) result(res) -+ integer :: b(100) -+ integer :: res(100) -+ end -+ end interface -+ r = c_func(my_x) -+ print *, r -+end -diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/result.md b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/result.md -new file mode 100644 -index 0000000..54fff94 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/result.md -@@ -0,0 +1,36 @@ -+ | test | gfortran | flang | nvfortran| -+ | 001 | ERROR | PASS | PASS | -+ | 002 | ERROR | PASS | PASS | -+ | 003 | ERROR | PASS | PASS | -+ | 004 | ERROR | PASS | PASS | -+ | 005 | ERROR | PASS | PASS | -+ | 006 | ERROR | PASS | PASS | -+ | 007 | ERROR | PASS | PASS | -+ | 008 | ERROR | PASS | PASS | -+ | 009 | ERROR | PASS | PASS | -+ | 010 | ERROR | PASS | PASS | -+ | 011 | ERROR | PASS | PASS | -+ | 012 | ERROR | PASS | PASS | -+ | 013 | ERROR | PASS | PASS | -+ | 014 | ERROR | PASS | PASS | -+ | 015 | ERROR | PASS | PASS | -+ | 016 | ERROR | PASS | PASS | -+ | 017 | ERROR | PASS | PASS | -+ | 018 | ERROR | PASS | PASS | -+ | 019 | ERROR | PASS | PASS | -+ | 020 | ERROR | PASS | PASS | -+ | 021 | ERROR | PASS | PASS | -+ | 022 | ERROR | PASS | PASS | -+ | 023 | ERROR | PASS | ERROR | -+ | 024 | ERROR | ERROR | ERROR | -+ | 025 | ERROR | ERROR | ERROR | -+ | 026 | ERROR | ERROR | ERROR | -+ | 027 | ERROR | PASS | PASS | -+ | 028 | ERROR | PASS | PASS | -+ | 029 | ERROR | PASS | PASS | -+ | 030 | ERROR | PASS | PASS | -+ | 031 | ERROR | PASS | PASS | -+ | 032 | ERROR | PASS | PASS | -+ | 033 | ERROR | PASS | PASS | -+ | 034 | ERROR | PASS | PASS | -+ | 035 | ERROR | PASS | PASS | -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/run.sh b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/run.sh -new file mode 100644 -index 0000000..2316030 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/006_fortran_call_c_function_array_bindc/run.sh -@@ -0,0 +1,22 @@ -+for i in {001..035} -+do -+echo "------- test $i ------." -+#echo "----- gfortran result:" -+#gcc c_func$i.c -c -o c-test.o -+#gfortran fortran_main$i.f90 -fno-range-check -c -o fortran-test.o -+#gfortran c-test.o fortran-test.o -+#./a.out -+#rm *.o a.out -+echo "----- flang-new result : " -+clang c_func$i.c -c -o c-test.o -+flang-new fortran_main$i.f90 -c -o fortran-test.o -+flang-new -flang-experimental-exec c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+echo "----- nvfortran result : " -+clang c_func$i.c -c -o c-test.o -+nvfortran fortran_main$i.f90 -c -o fortran-test.o -+nvfortran c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+done -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_function/007_fortran_call_c_function_struct_ptr/c_func001.c b/test/interoperability_with_c_fortran_call_c_function/007_fortran_call_c_function_struct_ptr/c_func001.c -new file mode 100644 -index 0000000..4129bb3 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/007_fortran_call_c_function_struct_ptr/c_func001.c -@@ -0,0 +1,7 @@ -+struct t1 { -+ int n; -+}t; -+struct t1 *c_func_(struct t1 *x) { -+ x->n = 1; -+ return x; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/007_fortran_call_c_function_struct_ptr/c_func002.c b/test/interoperability_with_c_fortran_call_c_function/007_fortran_call_c_function_struct_ptr/c_func002.c -new file mode 100644 -index 0000000..e71f527 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/007_fortran_call_c_function_struct_ptr/c_func002.c -@@ -0,0 +1,10 @@ -+#include -+struct t1 { -+ int16_t n2; -+ int8_t n; -+}t; -+struct t1 *c_func_(struct t1 *x) { -+ x->n = 1; -+ x->n2 = 2; -+ return x; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/007_fortran_call_c_function_struct_ptr/c_func003.c b/test/interoperability_with_c_fortran_call_c_function/007_fortran_call_c_function_struct_ptr/c_func003.c -new file mode 100644 -index 0000000..e7d056a ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/007_fortran_call_c_function_struct_ptr/c_func003.c -@@ -0,0 +1,12 @@ -+#include -+struct t1 { -+ int32_t n3; -+ int16_t n2; -+ int8_t n; -+}t; -+struct t1 *c_func_(struct t1 *x) { -+ x->n = 1; -+ x->n2 = 2; -+ x->n3 = 3; -+ return x; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/007_fortran_call_c_function_struct_ptr/c_func004.c b/test/interoperability_with_c_fortran_call_c_function/007_fortran_call_c_function_struct_ptr/c_func004.c -new file mode 100644 -index 0000000..93641b3 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/007_fortran_call_c_function_struct_ptr/c_func004.c -@@ -0,0 +1,14 @@ -+#include -+struct t1 { -+ int64_t n4; -+ int32_t n3; -+ int16_t n2; -+ int8_t n; -+}t; -+struct t1 *c_func_(struct t1 *x) { -+ x->n = 1; -+ x->n2 = 2; -+ x->n3 = 3; -+ x->n4 = 4; -+ return x; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/007_fortran_call_c_function_struct_ptr/c_func005.c b/test/interoperability_with_c_fortran_call_c_function/007_fortran_call_c_function_struct_ptr/c_func005.c -new file mode 100644 -index 0000000..b751e28 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/007_fortran_call_c_function_struct_ptr/c_func005.c -@@ -0,0 +1,17 @@ -+#include -+struct t1 { -+ int64_t n5[2]; -+ int64_t n4; -+ int32_t n3; -+ int16_t n2; -+ int8_t n; -+}t; -+struct t1 *c_func_(struct t1 *x) { -+ x->n = 1; -+ x->n2 = 2; -+ x->n3 = 3; -+ x->n4 = 4; -+ x->n5[1] = 0; -+ x->n5[0] = 5; -+ return x; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/007_fortran_call_c_function_struct_ptr/c_func006.c b/test/interoperability_with_c_fortran_call_c_function/007_fortran_call_c_function_struct_ptr/c_func006.c -new file mode 100644 -index 0000000..6ce4085 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/007_fortran_call_c_function_struct_ptr/c_func006.c -@@ -0,0 +1,16 @@ -+#include -+struct t1 { -+ int64_t n4[2]; -+ int32_t n3[2]; -+ int16_t n2[2]; -+ int8_t n[2]; -+}t; -+struct t1 *c_func_(struct t1 *x) { -+ for(int i = 0; i < 2; i++) { -+ x->n[i] = 1; -+ x->n2[i] = 2; -+ x->n3[i] = 3; -+ x->n4[i] = 4; -+ } -+ return x; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/007_fortran_call_c_function_struct_ptr/c_func007.c b/test/interoperability_with_c_fortran_call_c_function/007_fortran_call_c_function_struct_ptr/c_func007.c -new file mode 100644 -index 0000000..8ba94e3 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/007_fortran_call_c_function_struct_ptr/c_func007.c -@@ -0,0 +1,16 @@ -+#include -+struct t1 { -+ int64_t n4; -+ int32_t n3; -+ int16_t n2; -+ int8_t n; -+}t; -+struct t1 *c_func_(struct t1 *x) { -+ for(int i = 0; i < 4; i++) { -+ x[i].n = 1; -+ x[i].n2 = 2; -+ x[i].n3 = 3; -+ x[i].n4 = 4; -+ } -+ return x; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/007_fortran_call_c_function_struct_ptr/fortran_main001.f90 b/test/interoperability_with_c_fortran_call_c_function/007_fortran_call_c_function_struct_ptr/fortran_main001.f90 -new file mode 100644 -index 0000000..6517e69 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/007_fortran_call_c_function_struct_ptr/fortran_main001.f90 -@@ -0,0 +1,18 @@ -+! test fortran call C for function return pointer of struct -+! -+program main -+ type t -+ integer :: n -+ end type t -+ interface -+ function c_func(x) -+ import :: t -+ type(t) :: x -+ type(t), pointer :: c_func -+ end -+ end interface -+ type(t) :: my_x -+ type(t) :: res -+ res = c_func(my_x) -+ print *, res -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_function/007_fortran_call_c_function_struct_ptr/fortran_main002.f90 b/test/interoperability_with_c_fortran_call_c_function/007_fortran_call_c_function_struct_ptr/fortran_main002.f90 -new file mode 100644 -index 0000000..5c6f2ca ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/007_fortran_call_c_function_struct_ptr/fortran_main002.f90 -@@ -0,0 +1,19 @@ -+! test fortran call C for function return pointer of struct -+! -+program main -+ type t -+ integer(2) :: n2 -+ integer(1) :: n -+ end type t -+ interface -+ function c_func(x) -+ import :: t -+ type(t) :: x -+ type(t), pointer :: c_func -+ end -+ end interface -+ type(t) :: my_x -+ type(t) :: res -+ res = c_func(my_x) -+ print *, res -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_function/007_fortran_call_c_function_struct_ptr/fortran_main003.f90 b/test/interoperability_with_c_fortran_call_c_function/007_fortran_call_c_function_struct_ptr/fortran_main003.f90 -new file mode 100644 -index 0000000..7e1aae2 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/007_fortran_call_c_function_struct_ptr/fortran_main003.f90 -@@ -0,0 +1,20 @@ -+! test fortran call C for function return pointer of struct -+! -+program main -+ type t -+ integer(4) :: n3 -+ integer(2) :: n2 -+ integer(1) :: n -+ end type t -+ interface -+ function c_func(x) -+ import :: t -+ type(t) :: x -+ type(t), pointer :: c_func -+ end -+ end interface -+ type(t) :: my_x -+ type(t) :: res -+ res = c_func(my_x) -+ print *, res -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_function/007_fortran_call_c_function_struct_ptr/fortran_main004.f90 b/test/interoperability_with_c_fortran_call_c_function/007_fortran_call_c_function_struct_ptr/fortran_main004.f90 -new file mode 100644 -index 0000000..7197fd2 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/007_fortran_call_c_function_struct_ptr/fortran_main004.f90 -@@ -0,0 +1,21 @@ -+! test fortran call C for function return pointer of struct -+! -+program main -+ type t -+ integer(8) :: n4 -+ integer(4) :: n3 -+ integer(2) :: n2 -+ integer(1) :: n -+ end type t -+ interface -+ function c_func(x) -+ import :: t -+ type(t) :: x -+ type(t), pointer :: c_func -+ end -+ end interface -+ type(t) :: my_x -+ type(t) :: res -+ res = c_func(my_x) -+ print *, res -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_function/007_fortran_call_c_function_struct_ptr/fortran_main005.f90 b/test/interoperability_with_c_fortran_call_c_function/007_fortran_call_c_function_struct_ptr/fortran_main005.f90 -new file mode 100644 -index 0000000..0e5301d ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/007_fortran_call_c_function_struct_ptr/fortran_main005.f90 -@@ -0,0 +1,22 @@ -+! test fortran call C for function return pointer of struct -+! -+program main -+ type t -+ integer(16) :: n5 -+ integer(8) :: n4 -+ integer(4) :: n3 -+ integer(2) :: n2 -+ integer(1) :: n -+ end type t -+ interface -+ function c_func(x) -+ import :: t -+ type(t) :: x -+ type(t), pointer :: c_func -+ end -+ end interface -+ type(t) :: my_x -+ type(t) :: res -+ res = c_func(my_x) -+ print *, res -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_function/007_fortran_call_c_function_struct_ptr/fortran_main006.f90 b/test/interoperability_with_c_fortran_call_c_function/007_fortran_call_c_function_struct_ptr/fortran_main006.f90 -new file mode 100644 -index 0000000..5339b10 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/007_fortran_call_c_function_struct_ptr/fortran_main006.f90 -@@ -0,0 +1,21 @@ -+! test fortran call C for function return pointer of struct -+! -+program main -+ type t -+ integer(8) :: n4(2) -+ integer(4) :: n3(2) -+ integer(2) :: n2(2) -+ integer(1) :: n(2) -+ end type t -+ interface -+ function c_func(x) -+ import :: t -+ type(t) :: x -+ type(t), pointer :: c_func -+ end -+ end interface -+ type(t) :: my_x -+ type(t) :: res -+ res = c_func(my_x) -+ print *, res -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_function/007_fortran_call_c_function_struct_ptr/fortran_main007.f90 b/test/interoperability_with_c_fortran_call_c_function/007_fortran_call_c_function_struct_ptr/fortran_main007.f90 -new file mode 100644 -index 0000000..a3d193e ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/007_fortran_call_c_function_struct_ptr/fortran_main007.f90 -@@ -0,0 +1,21 @@ -+! test fortran call C for function return array of struct -+! -+program main -+ type t -+ integer(8) :: n4 -+ integer(4) :: n3 -+ integer(2) :: n2 -+ integer(1) :: n -+ end type t -+ interface -+ function c_func(x) -+ import :: t -+ type(t) :: x(4) -+ type(t) :: c_func(4) -+ end -+ end interface -+ type(t) :: my_x(4) -+ type(t) :: res(4) -+ res = c_func(my_x) -+ print *, res -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_function/007_fortran_call_c_function_struct_ptr/result.md b/test/interoperability_with_c_fortran_call_c_function/007_fortran_call_c_function_struct_ptr/result.md -new file mode 100644 -index 0000000..0721a01 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/007_fortran_call_c_function_struct_ptr/result.md -@@ -0,0 +1,8 @@ -+ | test | gfortran | flang | nvfortran| -+ | 001 | PASS | ERROR | ERROR | -+ | 002 | PASS | ERROR | ERROR | -+ | 003 | PASS | ERROR | ERROR | -+ | 004 | PASS | ERROR | ERROR | -+ | 005 | PASS | ERROR | ERROR | -+ | 006 | PASS | ERROR | ERROR | -+ | 007 | ERROR | PASS | PASS | -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_function/007_fortran_call_c_function_struct_ptr/run.sh b/test/interoperability_with_c_fortran_call_c_function/007_fortran_call_c_function_struct_ptr/run.sh -new file mode 100644 -index 0000000..d26dcea ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/007_fortran_call_c_function_struct_ptr/run.sh -@@ -0,0 +1,22 @@ -+for i in {001..007} -+do -+echo "------- test $i ------." -+echo "----- gfortran result:" -+gcc c_func$i.c -c -o c-test.o -+gfortran fortran_main$i.f90 -fno-range-check -c -o fortran-test.o -+gfortran c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+echo "----- flang-new result : " -+clang c_func$i.c -c -o c-test.o -+flang-new fortran_main$i.f90 -c -o fortran-test.o -+flang-new -flang-experimental-exec c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+echo "----- nvfortran result : " -+clang c_func$i.c -c -o c-test.o -+nvfortran fortran_main$i.f90 -c -o fortran-test.o -+nvfortran c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+done -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_function/008_fortran_call_c_function_struct_ptr_bindc/c_func001.c b/test/interoperability_with_c_fortran_call_c_function/008_fortran_call_c_function_struct_ptr_bindc/c_func001.c -new file mode 100644 -index 0000000..4129bb3 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/008_fortran_call_c_function_struct_ptr_bindc/c_func001.c -@@ -0,0 +1,7 @@ -+struct t1 { -+ int n; -+}t; -+struct t1 *c_func_(struct t1 *x) { -+ x->n = 1; -+ return x; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/008_fortran_call_c_function_struct_ptr_bindc/c_func002.c b/test/interoperability_with_c_fortran_call_c_function/008_fortran_call_c_function_struct_ptr_bindc/c_func002.c -new file mode 100644 -index 0000000..e71f527 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/008_fortran_call_c_function_struct_ptr_bindc/c_func002.c -@@ -0,0 +1,10 @@ -+#include -+struct t1 { -+ int16_t n2; -+ int8_t n; -+}t; -+struct t1 *c_func_(struct t1 *x) { -+ x->n = 1; -+ x->n2 = 2; -+ return x; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/008_fortran_call_c_function_struct_ptr_bindc/c_func003.c b/test/interoperability_with_c_fortran_call_c_function/008_fortran_call_c_function_struct_ptr_bindc/c_func003.c -new file mode 100644 -index 0000000..e7d056a ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/008_fortran_call_c_function_struct_ptr_bindc/c_func003.c -@@ -0,0 +1,12 @@ -+#include -+struct t1 { -+ int32_t n3; -+ int16_t n2; -+ int8_t n; -+}t; -+struct t1 *c_func_(struct t1 *x) { -+ x->n = 1; -+ x->n2 = 2; -+ x->n3 = 3; -+ return x; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/008_fortran_call_c_function_struct_ptr_bindc/c_func004.c b/test/interoperability_with_c_fortran_call_c_function/008_fortran_call_c_function_struct_ptr_bindc/c_func004.c -new file mode 100644 -index 0000000..93641b3 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/008_fortran_call_c_function_struct_ptr_bindc/c_func004.c -@@ -0,0 +1,14 @@ -+#include -+struct t1 { -+ int64_t n4; -+ int32_t n3; -+ int16_t n2; -+ int8_t n; -+}t; -+struct t1 *c_func_(struct t1 *x) { -+ x->n = 1; -+ x->n2 = 2; -+ x->n3 = 3; -+ x->n4 = 4; -+ return x; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/008_fortran_call_c_function_struct_ptr_bindc/c_func005.c b/test/interoperability_with_c_fortran_call_c_function/008_fortran_call_c_function_struct_ptr_bindc/c_func005.c -new file mode 100644 -index 0000000..b751e28 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/008_fortran_call_c_function_struct_ptr_bindc/c_func005.c -@@ -0,0 +1,17 @@ -+#include -+struct t1 { -+ int64_t n5[2]; -+ int64_t n4; -+ int32_t n3; -+ int16_t n2; -+ int8_t n; -+}t; -+struct t1 *c_func_(struct t1 *x) { -+ x->n = 1; -+ x->n2 = 2; -+ x->n3 = 3; -+ x->n4 = 4; -+ x->n5[1] = 0; -+ x->n5[0] = 5; -+ return x; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/008_fortran_call_c_function_struct_ptr_bindc/c_func006.c b/test/interoperability_with_c_fortran_call_c_function/008_fortran_call_c_function_struct_ptr_bindc/c_func006.c -new file mode 100644 -index 0000000..6ce4085 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/008_fortran_call_c_function_struct_ptr_bindc/c_func006.c -@@ -0,0 +1,16 @@ -+#include -+struct t1 { -+ int64_t n4[2]; -+ int32_t n3[2]; -+ int16_t n2[2]; -+ int8_t n[2]; -+}t; -+struct t1 *c_func_(struct t1 *x) { -+ for(int i = 0; i < 2; i++) { -+ x->n[i] = 1; -+ x->n2[i] = 2; -+ x->n3[i] = 3; -+ x->n4[i] = 4; -+ } -+ return x; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/008_fortran_call_c_function_struct_ptr_bindc/c_func007.c b/test/interoperability_with_c_fortran_call_c_function/008_fortran_call_c_function_struct_ptr_bindc/c_func007.c -new file mode 100644 -index 0000000..8ba94e3 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/008_fortran_call_c_function_struct_ptr_bindc/c_func007.c -@@ -0,0 +1,16 @@ -+#include -+struct t1 { -+ int64_t n4; -+ int32_t n3; -+ int16_t n2; -+ int8_t n; -+}t; -+struct t1 *c_func_(struct t1 *x) { -+ for(int i = 0; i < 4; i++) { -+ x[i].n = 1; -+ x[i].n2 = 2; -+ x[i].n3 = 3; -+ x[i].n4 = 4; -+ } -+ return x; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/008_fortran_call_c_function_struct_ptr_bindc/fortran_main001.f90 b/test/interoperability_with_c_fortran_call_c_function/008_fortran_call_c_function_struct_ptr_bindc/fortran_main001.f90 -new file mode 100644 -index 0000000..047bfcb ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/008_fortran_call_c_function_struct_ptr_bindc/fortran_main001.f90 -@@ -0,0 +1,18 @@ -+! test fortran call C for function return pointer of struct with bindc -+! -+program main -+ type, bind(c) :: t -+ integer :: n -+ end type t -+ interface -+ function c_func(x) bind(c, name = "c_func_") result(res) -+ import :: t -+ type(t) :: x -+ type(t), pointer :: res -+ end -+ end interface -+ type(t) :: my_x -+ type(t) :: res -+ res = c_func(my_x) -+ print *, res -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_function/008_fortran_call_c_function_struct_ptr_bindc/fortran_main002.f90 b/test/interoperability_with_c_fortran_call_c_function/008_fortran_call_c_function_struct_ptr_bindc/fortran_main002.f90 -new file mode 100644 -index 0000000..0bb349a ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/008_fortran_call_c_function_struct_ptr_bindc/fortran_main002.f90 -@@ -0,0 +1,19 @@ -+! test fortran call C for function return pointer of struct with bindc -+! -+program main -+ type, bind(c) :: t -+ integer(2) :: n2 -+ integer(1) :: n -+ end type t -+ interface -+ function c_func(x) bind(c, name = "c_func_") result(res) -+ import :: t -+ type(t) :: x -+ type(t), pointer :: res -+ end -+ end interface -+ type(t) :: my_x -+ type(t) :: res -+ res = c_func(my_x) -+ print *, res -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_function/008_fortran_call_c_function_struct_ptr_bindc/fortran_main003.f90 b/test/interoperability_with_c_fortran_call_c_function/008_fortran_call_c_function_struct_ptr_bindc/fortran_main003.f90 -new file mode 100644 -index 0000000..f5b716a ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/008_fortran_call_c_function_struct_ptr_bindc/fortran_main003.f90 -@@ -0,0 +1,20 @@ -+! test fortran call C for function return pointer of struct with bindc -+! -+program main -+ type, bind(c) :: t -+ integer(4) :: n3 -+ integer(2) :: n2 -+ integer(1) :: n -+ end type t -+ interface -+ function c_func(x) bind(c, name = "c_func_") result(res) -+ import :: t -+ type(t) :: x -+ type(t), pointer :: res -+ end -+ end interface -+ type(t) :: my_x -+ type(t) :: res -+ res = c_func(my_x) -+ print *, res -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_function/008_fortran_call_c_function_struct_ptr_bindc/fortran_main004.f90 b/test/interoperability_with_c_fortran_call_c_function/008_fortran_call_c_function_struct_ptr_bindc/fortran_main004.f90 -new file mode 100644 -index 0000000..f5da393 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/008_fortran_call_c_function_struct_ptr_bindc/fortran_main004.f90 -@@ -0,0 +1,21 @@ -+! test fortran call C for function return pointer of struct with bindc -+! -+program main -+ type, bind(c) :: t -+ integer(8) :: n4 -+ integer(4) :: n3 -+ integer(2) :: n2 -+ integer(1) :: n -+ end type t -+ interface -+ function c_func(x) bind(c, name = "c_func_") result(res) -+ import :: t -+ type(t) :: x -+ type(t), pointer :: res -+ end -+ end interface -+ type(t) :: my_x -+ type(t) :: res -+ res = c_func(my_x) -+ print *, res -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_function/008_fortran_call_c_function_struct_ptr_bindc/fortran_main005.f90 b/test/interoperability_with_c_fortran_call_c_function/008_fortran_call_c_function_struct_ptr_bindc/fortran_main005.f90 -new file mode 100644 -index 0000000..631a3f8 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/008_fortran_call_c_function_struct_ptr_bindc/fortran_main005.f90 -@@ -0,0 +1,22 @@ -+! test fortran call C for function return pointer of struct with bindc -+! -+program main -+ type, bind(c) :: t -+ integer(16) :: n5 -+ integer(8) :: n4 -+ integer(4) :: n3 -+ integer(2) :: n2 -+ integer(1) :: n -+ end type t -+ interface -+ function c_func(x) bind(c, name = "c_func_") result(res) -+ import :: t -+ type(t) :: x -+ type(t), pointer :: res -+ end -+ end interface -+ type(t) :: my_x -+ type(t) :: res -+ res = c_func(my_x) -+ print *, res -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_function/008_fortran_call_c_function_struct_ptr_bindc/fortran_main006.f90 b/test/interoperability_with_c_fortran_call_c_function/008_fortran_call_c_function_struct_ptr_bindc/fortran_main006.f90 -new file mode 100644 -index 0000000..d1e9eed ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/008_fortran_call_c_function_struct_ptr_bindc/fortran_main006.f90 -@@ -0,0 +1,21 @@ -+! test fortran call C for function return pointer of struct with bindc -+! -+program main -+ type, bind(c) :: t -+ integer(8) :: n4(2) -+ integer(4) :: n3(2) -+ integer(2) :: n2(2) -+ integer(1) :: n(2) -+ end type t -+ interface -+ function c_func(x) bind(c, name = "c_func_") result(res) -+ import :: t -+ type(t) :: x -+ type(t), pointer :: res -+ end -+ end interface -+ type(t) :: my_x -+ type(t) :: res -+ res = c_func(my_x) -+ print *, res -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_function/008_fortran_call_c_function_struct_ptr_bindc/fortran_main007.f90 b/test/interoperability_with_c_fortran_call_c_function/008_fortran_call_c_function_struct_ptr_bindc/fortran_main007.f90 -new file mode 100644 -index 0000000..e47d3f2 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/008_fortran_call_c_function_struct_ptr_bindc/fortran_main007.f90 -@@ -0,0 +1,21 @@ -+! test fortran call C for function return array of struct with bindc -+! -+program main -+ type, bind(c) :: t -+ integer(8) :: n4 -+ integer(4) :: n3 -+ integer(2) :: n2 -+ integer(1) :: n -+ end type t -+ interface -+ function c_func(x) bind(c, name = "c_func_") result(res) -+ import :: t -+ type(t) :: x(4) -+ type(t) :: res(4) -+ end -+ end interface -+ type(t) :: my_x(4) -+ type(t) :: res(4) -+ res = c_func(my_x) -+ print *, res -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_function/008_fortran_call_c_function_struct_ptr_bindc/result.md b/test/interoperability_with_c_fortran_call_c_function/008_fortran_call_c_function_struct_ptr_bindc/result.md -new file mode 100644 -index 0000000..0721a01 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/008_fortran_call_c_function_struct_ptr_bindc/result.md -@@ -0,0 +1,8 @@ -+ | test | gfortran | flang | nvfortran| -+ | 001 | PASS | ERROR | ERROR | -+ | 002 | PASS | ERROR | ERROR | -+ | 003 | PASS | ERROR | ERROR | -+ | 004 | PASS | ERROR | ERROR | -+ | 005 | PASS | ERROR | ERROR | -+ | 006 | PASS | ERROR | ERROR | -+ | 007 | ERROR | PASS | PASS | -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_function/008_fortran_call_c_function_struct_ptr_bindc/run.sh b/test/interoperability_with_c_fortran_call_c_function/008_fortran_call_c_function_struct_ptr_bindc/run.sh -new file mode 100644 -index 0000000..d26dcea ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/008_fortran_call_c_function_struct_ptr_bindc/run.sh -@@ -0,0 +1,22 @@ -+for i in {001..007} -+do -+echo "------- test $i ------." -+echo "----- gfortran result:" -+gcc c_func$i.c -c -o c-test.o -+gfortran fortran_main$i.f90 -fno-range-check -c -o fortran-test.o -+gfortran c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+echo "----- flang-new result : " -+clang c_func$i.c -c -o c-test.o -+flang-new fortran_main$i.f90 -c -o fortran-test.o -+flang-new -flang-experimental-exec c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+echo "----- nvfortran result : " -+clang c_func$i.c -c -o c-test.o -+nvfortran fortran_main$i.f90 -c -o fortran-test.o -+nvfortran c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+done -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_function/009_fortran_call_c_function_struct_value/c_func001.c b/test/interoperability_with_c_fortran_call_c_function/009_fortran_call_c_function_struct_value/c_func001.c -new file mode 100644 -index 0000000..4e3db6b ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/009_fortran_call_c_function_struct_value/c_func001.c -@@ -0,0 +1,7 @@ -+struct t1 { -+ int n; -+}t; -+struct t1 c_func_(struct t1 *x) { -+ x->n = 1; -+ return *x; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/009_fortran_call_c_function_struct_value/c_func002.c b/test/interoperability_with_c_fortran_call_c_function/009_fortran_call_c_function_struct_value/c_func002.c -new file mode 100644 -index 0000000..c92ad00 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/009_fortran_call_c_function_struct_value/c_func002.c -@@ -0,0 +1,10 @@ -+#include -+struct t1 { -+ int16_t n2; -+ int8_t n; -+}t; -+struct t1 c_func_(struct t1 *x) { -+ x->n = 1; -+ x->n2 = 2; -+ return *x; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/009_fortran_call_c_function_struct_value/c_func003.c b/test/interoperability_with_c_fortran_call_c_function/009_fortran_call_c_function_struct_value/c_func003.c -new file mode 100644 -index 0000000..fa9fc83 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/009_fortran_call_c_function_struct_value/c_func003.c -@@ -0,0 +1,12 @@ -+#include -+struct t1 { -+ int32_t n3; -+ int16_t n2; -+ int8_t n; -+}t; -+struct t1 c_func_(struct t1 *x) { -+ x->n = 1; -+ x->n2 = 2; -+ x->n3 = 3; -+ return *x; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/009_fortran_call_c_function_struct_value/c_func004.c b/test/interoperability_with_c_fortran_call_c_function/009_fortran_call_c_function_struct_value/c_func004.c -new file mode 100644 -index 0000000..5ba556b ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/009_fortran_call_c_function_struct_value/c_func004.c -@@ -0,0 +1,14 @@ -+#include -+struct t1 { -+ int64_t n4; -+ int32_t n3; -+ int16_t n2; -+ int8_t n; -+}t; -+struct t1 c_func_(struct t1 *x) { -+ x->n = 1; -+ x->n2 = 2; -+ x->n3 = 3; -+ x->n4 = 4; -+ return *x; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/009_fortran_call_c_function_struct_value/c_func005.c b/test/interoperability_with_c_fortran_call_c_function/009_fortran_call_c_function_struct_value/c_func005.c -new file mode 100644 -index 0000000..8561efe ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/009_fortran_call_c_function_struct_value/c_func005.c -@@ -0,0 +1,17 @@ -+#include -+struct t1 { -+ int64_t n5[2]; -+ int64_t n4; -+ int32_t n3; -+ int16_t n2; -+ int8_t n; -+}t; -+struct t1 c_func_(struct t1 *x) { -+ x->n = 1; -+ x->n2 = 2; -+ x->n3 = 3; -+ x->n4 = 4; -+ x->n5[1] = 0; -+ x->n5[0] = 5; -+ return *x; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/009_fortran_call_c_function_struct_value/c_func006.c b/test/interoperability_with_c_fortran_call_c_function/009_fortran_call_c_function_struct_value/c_func006.c -new file mode 100644 -index 0000000..8400cce ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/009_fortran_call_c_function_struct_value/c_func006.c -@@ -0,0 +1,16 @@ -+#include -+struct t1 { -+ int64_t n4[2]; -+ int32_t n3[2]; -+ int16_t n2[2]; -+ int8_t n[2]; -+}t; -+struct t1 c_func_(struct t1 *x) { -+ for(int i = 0; i < 2; i++) { -+ x->n[i] = 1; -+ x->n2[i] = 2; -+ x->n3[i] = 3; -+ x->n4[i] = 4; -+ } -+ return *x; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/009_fortran_call_c_function_struct_value/c_func007.c b/test/interoperability_with_c_fortran_call_c_function/009_fortran_call_c_function_struct_value/c_func007.c -new file mode 100644 -index 0000000..8ba94e3 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/009_fortran_call_c_function_struct_value/c_func007.c -@@ -0,0 +1,16 @@ -+#include -+struct t1 { -+ int64_t n4; -+ int32_t n3; -+ int16_t n2; -+ int8_t n; -+}t; -+struct t1 *c_func_(struct t1 *x) { -+ for(int i = 0; i < 4; i++) { -+ x[i].n = 1; -+ x[i].n2 = 2; -+ x[i].n3 = 3; -+ x[i].n4 = 4; -+ } -+ return x; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/009_fortran_call_c_function_struct_value/fortran_main001.f90 b/test/interoperability_with_c_fortran_call_c_function/009_fortran_call_c_function_struct_value/fortran_main001.f90 -new file mode 100644 -index 0000000..a377e57 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/009_fortran_call_c_function_struct_value/fortran_main001.f90 -@@ -0,0 +1,18 @@ -+! test fortran call C for function return value of struct -+! -+program main -+ type t -+ integer :: n -+ end type t -+ interface -+ function c_func(x) -+ import :: t -+ type(t) :: x -+ type(t) :: c_func -+ end -+ end interface -+ type(t) :: my_x -+ type(t) :: res -+ res = c_func(my_x) -+ print *, res -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_function/009_fortran_call_c_function_struct_value/fortran_main002.f90 b/test/interoperability_with_c_fortran_call_c_function/009_fortran_call_c_function_struct_value/fortran_main002.f90 -new file mode 100644 -index 0000000..b7fb3a2 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/009_fortran_call_c_function_struct_value/fortran_main002.f90 -@@ -0,0 +1,19 @@ -+! test fortran call C for function return value of struct -+! -+program main -+ type t -+ integer(2) :: n2 -+ integer(1) :: n -+ end type t -+ interface -+ function c_func(x) -+ import :: t -+ type(t) :: x -+ type(t) :: c_func -+ end -+ end interface -+ type(t) :: my_x -+ type(t) :: res -+ res = c_func(my_x) -+ print *, res -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_function/009_fortran_call_c_function_struct_value/fortran_main003.f90 b/test/interoperability_with_c_fortran_call_c_function/009_fortran_call_c_function_struct_value/fortran_main003.f90 -new file mode 100644 -index 0000000..606c4b8 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/009_fortran_call_c_function_struct_value/fortran_main003.f90 -@@ -0,0 +1,20 @@ -+! test fortran call C for function return value of struct -+! -+program main -+ type t -+ integer(4) :: n3 -+ integer(2) :: n2 -+ integer(1) :: n -+ end type t -+ interface -+ function c_func(x) -+ import :: t -+ type(t) :: x -+ type(t) :: c_func -+ end -+ end interface -+ type(t) :: my_x -+ type(t) :: res -+ res = c_func(my_x) -+ print *, res -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_function/009_fortran_call_c_function_struct_value/fortran_main004.f90 b/test/interoperability_with_c_fortran_call_c_function/009_fortran_call_c_function_struct_value/fortran_main004.f90 -new file mode 100644 -index 0000000..4fd8721 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/009_fortran_call_c_function_struct_value/fortran_main004.f90 -@@ -0,0 +1,21 @@ -+! test fortran call C for function return value of struct -+! -+program main -+ type t -+ integer(8) :: n4 -+ integer(4) :: n3 -+ integer(2) :: n2 -+ integer(1) :: n -+ end type t -+ interface -+ function c_func(x) -+ import :: t -+ type(t) :: x -+ type(t) :: c_func -+ end -+ end interface -+ type(t) :: my_x -+ type(t) :: res -+ res = c_func(my_x) -+ print *, res -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_function/009_fortran_call_c_function_struct_value/fortran_main005.f90 b/test/interoperability_with_c_fortran_call_c_function/009_fortran_call_c_function_struct_value/fortran_main005.f90 -new file mode 100644 -index 0000000..3811bf4 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/009_fortran_call_c_function_struct_value/fortran_main005.f90 -@@ -0,0 +1,22 @@ -+! test fortran call C for function return value of struct -+! -+program main -+ type t -+ integer(16) :: n5 -+ integer(8) :: n4 -+ integer(4) :: n3 -+ integer(2) :: n2 -+ integer(1) :: n -+ end type t -+ interface -+ function c_func(x) -+ import :: t -+ type(t) :: x -+ type(t) :: c_func -+ end -+ end interface -+ type(t) :: my_x -+ type(t) :: res -+ res = c_func(my_x) -+ print *, res -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_function/009_fortran_call_c_function_struct_value/fortran_main006.f90 b/test/interoperability_with_c_fortran_call_c_function/009_fortran_call_c_function_struct_value/fortran_main006.f90 -new file mode 100644 -index 0000000..a61bff9 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/009_fortran_call_c_function_struct_value/fortran_main006.f90 -@@ -0,0 +1,21 @@ -+! test fortran call C for function return value of struct -+! -+program main -+ type t -+ integer(8) :: n4(2) -+ integer(4) :: n3(2) -+ integer(2) :: n2(2) -+ integer(1) :: n(2) -+ end type t -+ interface -+ function c_func(x) -+ import :: t -+ type(t) :: x -+ type(t) :: c_func -+ end -+ end interface -+ type(t) :: my_x -+ type(t) :: res -+ res = c_func(my_x) -+ print *, res -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_function/009_fortran_call_c_function_struct_value/fortran_main007.f90 b/test/interoperability_with_c_fortran_call_c_function/009_fortran_call_c_function_struct_value/fortran_main007.f90 -new file mode 100644 -index 0000000..a3d193e ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/009_fortran_call_c_function_struct_value/fortran_main007.f90 -@@ -0,0 +1,21 @@ -+! test fortran call C for function return array of struct -+! -+program main -+ type t -+ integer(8) :: n4 -+ integer(4) :: n3 -+ integer(2) :: n2 -+ integer(1) :: n -+ end type t -+ interface -+ function c_func(x) -+ import :: t -+ type(t) :: x(4) -+ type(t) :: c_func(4) -+ end -+ end interface -+ type(t) :: my_x(4) -+ type(t) :: res(4) -+ res = c_func(my_x) -+ print *, res -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_function/009_fortran_call_c_function_struct_value/result.md b/test/interoperability_with_c_fortran_call_c_function/009_fortran_call_c_function_struct_value/result.md -new file mode 100644 -index 0000000..70c861c ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/009_fortran_call_c_function_struct_value/result.md -@@ -0,0 +1,8 @@ -+ | test | gfortran | flang | nvfortran| -+ | 001 | PASS | PASS | PASS | -+ | 002 | PASS | PASS | PASS | -+ | 003 | PASS | PASS | PASS | -+ | 004 | PASS | PASS | PASS | -+ | 005 | PASS | PASS | ERROR | -+ | 006 | PASS | PASS | PASS | -+ | 007 | ERROR | PASS | PASS | -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_function/009_fortran_call_c_function_struct_value/run.sh b/test/interoperability_with_c_fortran_call_c_function/009_fortran_call_c_function_struct_value/run.sh -new file mode 100644 -index 0000000..d26dcea ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/009_fortran_call_c_function_struct_value/run.sh -@@ -0,0 +1,22 @@ -+for i in {001..007} -+do -+echo "------- test $i ------." -+echo "----- gfortran result:" -+gcc c_func$i.c -c -o c-test.o -+gfortran fortran_main$i.f90 -fno-range-check -c -o fortran-test.o -+gfortran c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+echo "----- flang-new result : " -+clang c_func$i.c -c -o c-test.o -+flang-new fortran_main$i.f90 -c -o fortran-test.o -+flang-new -flang-experimental-exec c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+echo "----- nvfortran result : " -+clang c_func$i.c -c -o c-test.o -+nvfortran fortran_main$i.f90 -c -o fortran-test.o -+nvfortran c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+done -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_function/010_fortran_call_c_function_struct_value_bindc/c_func001.c b/test/interoperability_with_c_fortran_call_c_function/010_fortran_call_c_function_struct_value_bindc/c_func001.c -new file mode 100644 -index 0000000..4e3db6b ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/010_fortran_call_c_function_struct_value_bindc/c_func001.c -@@ -0,0 +1,7 @@ -+struct t1 { -+ int n; -+}t; -+struct t1 c_func_(struct t1 *x) { -+ x->n = 1; -+ return *x; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/010_fortran_call_c_function_struct_value_bindc/c_func002.c b/test/interoperability_with_c_fortran_call_c_function/010_fortran_call_c_function_struct_value_bindc/c_func002.c -new file mode 100644 -index 0000000..c92ad00 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/010_fortran_call_c_function_struct_value_bindc/c_func002.c -@@ -0,0 +1,10 @@ -+#include -+struct t1 { -+ int16_t n2; -+ int8_t n; -+}t; -+struct t1 c_func_(struct t1 *x) { -+ x->n = 1; -+ x->n2 = 2; -+ return *x; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/010_fortran_call_c_function_struct_value_bindc/c_func003.c b/test/interoperability_with_c_fortran_call_c_function/010_fortran_call_c_function_struct_value_bindc/c_func003.c -new file mode 100644 -index 0000000..fa9fc83 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/010_fortran_call_c_function_struct_value_bindc/c_func003.c -@@ -0,0 +1,12 @@ -+#include -+struct t1 { -+ int32_t n3; -+ int16_t n2; -+ int8_t n; -+}t; -+struct t1 c_func_(struct t1 *x) { -+ x->n = 1; -+ x->n2 = 2; -+ x->n3 = 3; -+ return *x; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/010_fortran_call_c_function_struct_value_bindc/c_func004.c b/test/interoperability_with_c_fortran_call_c_function/010_fortran_call_c_function_struct_value_bindc/c_func004.c -new file mode 100644 -index 0000000..5ba556b ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/010_fortran_call_c_function_struct_value_bindc/c_func004.c -@@ -0,0 +1,14 @@ -+#include -+struct t1 { -+ int64_t n4; -+ int32_t n3; -+ int16_t n2; -+ int8_t n; -+}t; -+struct t1 c_func_(struct t1 *x) { -+ x->n = 1; -+ x->n2 = 2; -+ x->n3 = 3; -+ x->n4 = 4; -+ return *x; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/010_fortran_call_c_function_struct_value_bindc/c_func005.c b/test/interoperability_with_c_fortran_call_c_function/010_fortran_call_c_function_struct_value_bindc/c_func005.c -new file mode 100644 -index 0000000..8561efe ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/010_fortran_call_c_function_struct_value_bindc/c_func005.c -@@ -0,0 +1,17 @@ -+#include -+struct t1 { -+ int64_t n5[2]; -+ int64_t n4; -+ int32_t n3; -+ int16_t n2; -+ int8_t n; -+}t; -+struct t1 c_func_(struct t1 *x) { -+ x->n = 1; -+ x->n2 = 2; -+ x->n3 = 3; -+ x->n4 = 4; -+ x->n5[1] = 0; -+ x->n5[0] = 5; -+ return *x; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/010_fortran_call_c_function_struct_value_bindc/c_func006.c b/test/interoperability_with_c_fortran_call_c_function/010_fortran_call_c_function_struct_value_bindc/c_func006.c -new file mode 100644 -index 0000000..8400cce ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/010_fortran_call_c_function_struct_value_bindc/c_func006.c -@@ -0,0 +1,16 @@ -+#include -+struct t1 { -+ int64_t n4[2]; -+ int32_t n3[2]; -+ int16_t n2[2]; -+ int8_t n[2]; -+}t; -+struct t1 c_func_(struct t1 *x) { -+ for(int i = 0; i < 2; i++) { -+ x->n[i] = 1; -+ x->n2[i] = 2; -+ x->n3[i] = 3; -+ x->n4[i] = 4; -+ } -+ return *x; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/010_fortran_call_c_function_struct_value_bindc/c_func007.c b/test/interoperability_with_c_fortran_call_c_function/010_fortran_call_c_function_struct_value_bindc/c_func007.c -new file mode 100644 -index 0000000..8ba94e3 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/010_fortran_call_c_function_struct_value_bindc/c_func007.c -@@ -0,0 +1,16 @@ -+#include -+struct t1 { -+ int64_t n4; -+ int32_t n3; -+ int16_t n2; -+ int8_t n; -+}t; -+struct t1 *c_func_(struct t1 *x) { -+ for(int i = 0; i < 4; i++) { -+ x[i].n = 1; -+ x[i].n2 = 2; -+ x[i].n3 = 3; -+ x[i].n4 = 4; -+ } -+ return x; -+} -diff --git a/test/interoperability_with_c_fortran_call_c_function/010_fortran_call_c_function_struct_value_bindc/fortran_main001.f90 b/test/interoperability_with_c_fortran_call_c_function/010_fortran_call_c_function_struct_value_bindc/fortran_main001.f90 -new file mode 100644 -index 0000000..c2fa9a1 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/010_fortran_call_c_function_struct_value_bindc/fortran_main001.f90 -@@ -0,0 +1,18 @@ -+! test fortran call C for function return value of struct with bindc -+! -+program main -+ type, bind(c) :: t -+ integer :: n -+ end type t -+ interface -+ function c_func(x) bind(c, name = "c_func_") -+ import :: t -+ type(t) :: x -+ type(t) :: c_func -+ end -+ end interface -+ type(t) :: my_x -+ type(t) :: res -+ res = c_func(my_x) -+ print *, res -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_function/010_fortran_call_c_function_struct_value_bindc/fortran_main002.f90 b/test/interoperability_with_c_fortran_call_c_function/010_fortran_call_c_function_struct_value_bindc/fortran_main002.f90 -new file mode 100644 -index 0000000..5130268 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/010_fortran_call_c_function_struct_value_bindc/fortran_main002.f90 -@@ -0,0 +1,19 @@ -+! test fortran call C for function return value of struct with bindc -+! -+program main -+ type, bind(c) :: t -+ integer(2) :: n2 -+ integer(1) :: n -+ end type t -+ interface -+ function c_func(x) bind(c, name = "c_func_") -+ import :: t -+ type(t) :: x -+ type(t) :: c_func -+ end -+ end interface -+ type(t) :: my_x -+ type(t) :: res -+ res = c_func(my_x) -+ print *, res -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_function/010_fortran_call_c_function_struct_value_bindc/fortran_main003.f90 b/test/interoperability_with_c_fortran_call_c_function/010_fortran_call_c_function_struct_value_bindc/fortran_main003.f90 -new file mode 100644 -index 0000000..de19bad ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/010_fortran_call_c_function_struct_value_bindc/fortran_main003.f90 -@@ -0,0 +1,20 @@ -+! test fortran call C for function return value of struct with bindc -+! -+program main -+ type, bind(c) :: t -+ integer(4) :: n3 -+ integer(2) :: n2 -+ integer(1) :: n -+ end type t -+ interface -+ function c_func(x) bind(c, name = "c_func_") -+ import :: t -+ type(t) :: x -+ type(t) :: c_func -+ end -+ end interface -+ type(t) :: my_x -+ type(t) :: res -+ res = c_func(my_x) -+ print *, res -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_function/010_fortran_call_c_function_struct_value_bindc/fortran_main004.f90 b/test/interoperability_with_c_fortran_call_c_function/010_fortran_call_c_function_struct_value_bindc/fortran_main004.f90 -new file mode 100644 -index 0000000..835bd34 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/010_fortran_call_c_function_struct_value_bindc/fortran_main004.f90 -@@ -0,0 +1,21 @@ -+! test fortran call C for function return value of struct with bindc -+! -+program main -+ type, bind(c) :: t -+ integer(8) :: n4 -+ integer(4) :: n3 -+ integer(2) :: n2 -+ integer(1) :: n -+ end type t -+ interface -+ function c_func(x) bind(c, name = "c_func_") -+ import :: t -+ type(t) :: x -+ type(t) :: c_func -+ end -+ end interface -+ type(t) :: my_x -+ type(t) :: res -+ res = c_func(my_x) -+ print *, res -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_function/010_fortran_call_c_function_struct_value_bindc/fortran_main005.f90 b/test/interoperability_with_c_fortran_call_c_function/010_fortran_call_c_function_struct_value_bindc/fortran_main005.f90 -new file mode 100644 -index 0000000..27e0c78 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/010_fortran_call_c_function_struct_value_bindc/fortran_main005.f90 -@@ -0,0 +1,22 @@ -+! test fortran call C for function return value of struct with bindc -+! -+program main -+ type, bind(c) :: t -+ integer(16) :: n5 -+ integer(8) :: n4 -+ integer(4) :: n3 -+ integer(2) :: n2 -+ integer(1) :: n -+ end type t -+ interface -+ function c_func(x) bind(c, name = "c_func_") -+ import :: t -+ type(t) :: x -+ type(t) :: c_func -+ end -+ end interface -+ type(t) :: my_x -+ type(t) :: res -+ res = c_func(my_x) -+ print *, res -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_function/010_fortran_call_c_function_struct_value_bindc/fortran_main006.f90 b/test/interoperability_with_c_fortran_call_c_function/010_fortran_call_c_function_struct_value_bindc/fortran_main006.f90 -new file mode 100644 -index 0000000..e48cbdb ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/010_fortran_call_c_function_struct_value_bindc/fortran_main006.f90 -@@ -0,0 +1,21 @@ -+! test fortran call C for function return value of struct with bindc -+! -+program main -+ type, bind(c) :: t -+ integer(8) :: n4(2) -+ integer(4) :: n3(2) -+ integer(2) :: n2(2) -+ integer(1) :: n(2) -+ end type t -+ interface -+ function c_func(x) bind(c, name = "c_func_") -+ import :: t -+ type(t) :: x -+ type(t) :: c_func -+ end -+ end interface -+ type(t) :: my_x -+ type(t) :: res -+ res = c_func(my_x) -+ print *, res -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_function/010_fortran_call_c_function_struct_value_bindc/fortran_main007.f90 b/test/interoperability_with_c_fortran_call_c_function/010_fortran_call_c_function_struct_value_bindc/fortran_main007.f90 -new file mode 100644 -index 0000000..e47d3f2 ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/010_fortran_call_c_function_struct_value_bindc/fortran_main007.f90 -@@ -0,0 +1,21 @@ -+! test fortran call C for function return array of struct with bindc -+! -+program main -+ type, bind(c) :: t -+ integer(8) :: n4 -+ integer(4) :: n3 -+ integer(2) :: n2 -+ integer(1) :: n -+ end type t -+ interface -+ function c_func(x) bind(c, name = "c_func_") result(res) -+ import :: t -+ type(t) :: x(4) -+ type(t) :: res(4) -+ end -+ end interface -+ type(t) :: my_x(4) -+ type(t) :: res(4) -+ res = c_func(my_x) -+ print *, res -+end -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_function/010_fortran_call_c_function_struct_value_bindc/result.md b/test/interoperability_with_c_fortran_call_c_function/010_fortran_call_c_function_struct_value_bindc/result.md -new file mode 100644 -index 0000000..70c861c ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/010_fortran_call_c_function_struct_value_bindc/result.md -@@ -0,0 +1,8 @@ -+ | test | gfortran | flang | nvfortran| -+ | 001 | PASS | PASS | PASS | -+ | 002 | PASS | PASS | PASS | -+ | 003 | PASS | PASS | PASS | -+ | 004 | PASS | PASS | PASS | -+ | 005 | PASS | PASS | ERROR | -+ | 006 | PASS | PASS | PASS | -+ | 007 | ERROR | PASS | PASS | -\ No newline at end of file -diff --git a/test/interoperability_with_c_fortran_call_c_function/010_fortran_call_c_function_struct_value_bindc/run.sh b/test/interoperability_with_c_fortran_call_c_function/010_fortran_call_c_function_struct_value_bindc/run.sh -new file mode 100644 -index 0000000..d26dcea ---- /dev/null -+++ b/test/interoperability_with_c_fortran_call_c_function/010_fortran_call_c_function_struct_value_bindc/run.sh -@@ -0,0 +1,22 @@ -+for i in {001..007} -+do -+echo "------- test $i ------." -+echo "----- gfortran result:" -+gcc c_func$i.c -c -o c-test.o -+gfortran fortran_main$i.f90 -fno-range-check -c -o fortran-test.o -+gfortran c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+echo "----- flang-new result : " -+clang c_func$i.c -c -o c-test.o -+flang-new fortran_main$i.f90 -c -o fortran-test.o -+flang-new -flang-experimental-exec c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+echo "----- nvfortran result : " -+clang c_func$i.c -c -o c-test.o -+nvfortran fortran_main$i.f90 -c -o fortran-test.o -+nvfortran c-test.o fortran-test.o -+./a.out -+rm *.o a.out -+done -\ No newline at end of file --- -2.25.1 - diff --git a/fedora-0001-flang-Remove-the-dependency-on-Bye.patch b/fedora-0001-flang-Remove-the-dependency-on-Bye.patch new file mode 100644 index 0000000000000000000000000000000000000000..2a4e0f4e1dc38b71e65e6c122a83928283bca58e --- /dev/null +++ b/fedora-0001-flang-Remove-the-dependency-on-Bye.patch @@ -0,0 +1,47 @@ +From 11af57106d4b6a2db178d932f58bd3285d1eefc1 Mon Sep 17 00:00:00 2001 +From: Tulio Magno Quites Machado Filho +Date: Wed, 22 Feb 2023 18:46:40 -0300 +Subject: [PATCH] [flang] Remove the dependency on Bye + +This plugin is not distributed on Fedora. +--- + flang/test/CMakeLists.txt | 4 ---- + flang/test/Driver/frontend-forwarding.f90 | 2 -- + 2 files changed, 6 deletions(-) + +diff --git a/flang/test/CMakeLists.txt b/flang/test/CMakeLists.txt +index 7d96a72e5f36..73a1f11b4533 100644 +--- a/flang/test/CMakeLists.txt ++++ b/flang/test/CMakeLists.txt +@@ -65,9 +65,6 @@ set(FLANG_TEST_DEPENDS + Fortran_main + FortranDecimal + ) +-if (LLVM_ENABLE_PLUGINS AND NOT WIN32) +- list(APPEND FLANG_TEST_DEPENDS Bye) +-endif() + + if (FLANG_INCLUDE_TESTS) + if (FLANG_GTEST_AVAIL) +diff --git a/flang/test/Driver/frontend-forwarding.f90 b/flang/test/Driver/frontend-forwarding.f90 +index e953c957d2d0..38ad48f2b4bd 100644 +--- a/flang/test/Driver/frontend-forwarding.f90 ++++ b/flang/test/Driver/frontend-forwarding.f90 +@@ -14,7 +14,6 @@ + ! RUN: -fno-signed-zeros \ + ! RUN: -fassociative-math \ + ! RUN: -freciprocal-math \ +-! RUN: -fpass-plugin=Bye%pluginext \ + ! RUN: -fversion-loops-for-stride \ + ! RUN: -flang-experimental-polymorphism \ + ! RUN: -mllvm -print-before-all \ +@@ -35,7 +34,6 @@ + ! CHECK: "-mreassociate" + ! CHECK: "-freciprocal-math" + ! CHECK: "-fconvert=little-endian" +-! CHECK: "-fpass-plugin=Bye + ! CHECK: "-flang-experimental-polymorphism" + ! CHECK: "-fversion-loops-for-stride" + ! CHECK: "-mllvm" "-print-before-all" +-- +2.39.1 \ No newline at end of file diff --git a/flang-17.0.6.src.tar.xz b/flang-17.0.6.src.tar.xz new file mode 100644 index 0000000000000000000000000000000000000000..1f6f37fcbed622f0850f2ce9298546db26b349cb Binary files /dev/null and b/flang-17.0.6.src.tar.xz differ diff --git a/flang-flang_20210324.tar.gz b/flang-flang_20210324.tar.gz deleted file mode 100644 index 3f68d7585c41f9e0b4fa2e48ec2aabc587386628..0000000000000000000000000000000000000000 Binary files a/flang-flang_20210324.tar.gz and /dev/null differ diff --git a/flang.spec b/flang.spec index 00ea7be56f0db573674338691a929d6ad90d1b82..356f65e8844dbeed69299a087f92ca6cdc4119d7 100644 --- a/flang.spec +++ b/flang.spec @@ -1,62 +1,190 @@ -%global debug_package %{nil} - -Name: flang -Version: flang_20210324 -Release: 29 -Summary: Fortran language compiler targeting LLVM - -License: Apache-2.0 -URL: https://github.com/flang-compiler/flang -Source0: flang-flang_20210324.tar.gz - -BuildRequires: gcc -Requires: gcc >= 9.3.0 -Patch0: 1-flang-runtime-inline.patch -Patch1: 2-inline_f90_str_copy_klen.patch -Patch2: 3-test-interoperability-with-c-fortran-call-c-scalar.patch -Patch3: 4-add-test-cases-for-openmp-optimization.patch -Patch4: 5-test-interoperability-with-c-c-call-fortran-scalar.patch -Patch5: 6-Add-test-cases-for-types.patch -Patch6: 7-add-test-cases-for-attribute-declarations-and-specifications.patch -Patch7: 8-test-interoperability-with-c-fortran-call-c-array.patch -Patch8: 9-test-interoperability-with-c-fortran-call-c-function.patch -Patch9: 10-test-interoperability-with-c-fortran-call-c-global-and-struct.patch -Patch10: 11-test-interoperability-with-c-c-call-fortran-array.patch -Patch11: 12-test-interoperability-with-c-c-call-fortran-function.patch -Patch12: 13-test-interoperability-with-c-c-call-fortran-global-and-struct.patch -Patch13: 14-add-test-cases-for-attribute-declarations-and-specifications-2.patch -Patch14: 15-add-test-cases-for-types-2.patch -Patch15: 16-add-c-and-cxx-memory-align-investigation.patch -Patch16: 17-add-fortran-memory-align-investigation.patch -Patch17: 18-add-test-cases-for-attribute-declarations-and-specifications-3.patch -Patch18: 19-add-test-cases-for-types-3.patch -Patch19: 20-add-align-prgma-for-derived-type.patch -Patch20: 21-add-align-prgma-for-fix-shape-array-character-type.patch -Patch21: 22-fix-import-use.patch -Patch22: 23-fix-bug-about-sizeof-for-data-with-Bind-C.patch -Patch23: 24-fix-retun-dynamic-multidimensional-array-bug.patch -Patch24: 25-add-align-pragma-for-scalar-variables.patch +%bcond_without sys_llvm +%bcond_without check + +%global maj_ver 17 +%global min_ver 0 +%global patch_ver 6 + +%if %{with sys_llvm} +%global pkg_name flang +%global bin_suffix %{nil} +%global install_prefix %{_prefix} +%else +%global pkg_name flang%{maj_ver} +%global bin_suffix -%{maj_ver} +%global install_prefix %{_libdir}/%{name} +%endif + +%global install_bindir %{install_prefix}/bin +%global install_bindir %{install_prefix}/bin +%global install_includedir %{install_prefix}/include +%global install_libdir %{install_prefix}/%{_lib} + +%global flang_version %{maj_ver}.%{min_ver}.%{patch_ver} +%global flang_srcdir flang-%{flang_version}.src +%global mlir_srcdir mlir-%{flang_version}.src + +# Disable LTO as this causes crash if gcc lto enabled. +%global _lto_cflags %{nil} +%global _smp_mflags -j20 +%global max_link_jobs 2 + +Name: %{pkg_name} +Version: %{flang_version} +Release: 1 +Summary: a Fortran language front-end designed for integration with LLVM + +License: Apache-2.0 WITH LLVM-exception +URL: https://flang.llvm.org +Source0: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{flang_version}/%{flang_srcdir}.tar.xz +# Flang test include mlir/test/lib/Analysis/TestAliasAnalysis.h, to fix build error +Source1: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{mlir_version}/%{mlir_srcdir}.tar.xz + +# The Bye plugin is not distributed +Patch0: fedora-0001-flang-Remove-the-dependency-on-Bye.patch + +BuildRequires: gcc +BuildRequires: gcc-c++ +BuildRequires: cmake +BuildRequires: zlib-devel +BuildRequires: mlir-devel = %{version} +BuildRequires: ninja-build +BuildRequires: python3-lit >= 12.0.0 +BuildRequires: clang-tools-extra = %{version} +# The new flang drive requires clang-devel +BuildRequires: clang-devel = %{version} +BuildRequires: clang = %{version} +%if %{with sys_llvm} +BuildRequires: llvm-devel = %{version} +BuildRequires: llvm-googletest = %{version} +BuildRequires: llvm-test = %{version} +BuildRequires: llvm-cmake-utils = %{version} +%else +BuildRequires: llvm%{maj_ver}-devel = %{version} +BuildRequires: llvm%{maj_ver}-googletest = %{version} +BuildRequires: llvm%{maj_ver}-test = %{version} +BuildRequires: llvm%{maj_ver}-cmake-utils = %{version} +%endif %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. -Link to build Flang based on the fork of LLVM project: https://github.com/flang-compiler/flang/wiki/Building-Flang -TODO: support build Flang. + +Flang is a ground-up implementation of a Fortran front end written in modern +C++. + +%package devel +Summary: Flang header files +Requires: %{name}%{?_isa} = %{version}-%{release} + +%description devel +Flang header files. %prep -%autosetup -p1 +%setup -T -q -b 1 -n %{mlir_srcdir} +%autosetup -n %{flang_srcdir} -p2 +mkdir -p include/mlir/test/lib/Analysis/ +cp ../%{mlir_srcdir}/test/lib/Analysis/TestAliasAnalysis.h include/mlir/test/lib/Analysis/ %build +mkdir -p _build +cd _build + +%cmake .. -GNinja \ + -DMLIR_TABLEGEN_EXE=%{install_bindir}/mlir-tblgen \ + -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DCMAKE_SKIP_RPATH:BOOL=ON \ + -DCLANG_DIR=%{install_libdir}/cmake/clang \ + -DCLANG_LINK_CLANG_DYLIB:BOOL=ON \ + -DLLVM_MAIN_SRC_DIR=%{install_prefix}/src \ + -DBUILD_SHARED_LIBS:BOOL=ON \ + -DLLVM_LINK_LLVM_DYLIB:BOOL=ON \ + -DLLVM_PARALLEL_LINK_JOBS=%{max_link_jobs} \ + -DLLVM_EXTERNAL_LIT=%{_bindir}/lit \ + -DCMAKE_PREFIX_PATH=%{install_libdir}/cmake/llvm/ \ + -DLLVM_COMMON_CMAKE_UTILS=%{_datadir}/llvm/cmake \ +\ +%if 0%{?__isa_bits} == 64 + -DLLVM_LIBDIR_SUFFIX=64 +%else + -DLLVM_LIBDIR_SUFFIX= +%endif + +export LD_LIBRARY_PATH=%{_builddir}/%{flang_srcdir}/_build/lib +%ninja_build %install +%ninja_install -C _build +# this is a test binary +rm -f %{buildroot}%{_bindir}/f18-parse-demo -%files -%license LICENSE.txt +%check +%if %{with check} + +# fail on both aarch64 and x86_64, need to be find the casue. +rm -f test/Driver/fast_math.f90 + +export LD_LIBRARY_PATH=%{_builddir}/%{flang_srcdir}/_build/lib +%{ninja_build} check-flang -C ./_build/ +%endif + +%files +%license LICENSE.TXT +%{install_bindir}/tco +%{install_bindir}/bbc +%{install_bindir}/flang-to-external-fc +%{install_bindir}/fir-opt +%{install_bindir}/flang-new +%{install_libdir}/libFortranLower.so.%{maj_ver}* +%{install_libdir}/libFortranSemantics.so.%{maj_ver}* +%{install_libdir}/libFortranCommon.so.%{maj_ver}* +%{install_libdir}/libFortranRuntime.so.%{maj_ver}* +%{install_libdir}/libFortranDecimal.so.%{maj_ver}* +%{install_libdir}/libFortranEvaluate.so.%{maj_ver}* +%{install_libdir}/libFortranParser.so.%{maj_ver}* +%{install_libdir}/libflangFrontend.so.%{maj_ver}* +%{install_libdir}/libflangFrontendTool.so.%{maj_ver}* +%{install_libdir}/libFIRAnalysis.so.%{maj_ver} +%{install_libdir}/libFIRBuilder.so.%{maj_ver}* +%{install_libdir}/libFIRCodeGen.so.%{maj_ver}* +%{install_libdir}/libFIRDialect.so.%{maj_ver}* +%{install_libdir}/libFIRDialectSupport.so.%{maj_ver} +%{install_libdir}/libFIRSupport.so.%{maj_ver}* +%{install_libdir}/libFIRTestAnalysis.so.%{maj_ver} +%{install_libdir}/libFIRTransforms.so.%{maj_ver}* +%{install_libdir}/libHLFIRDialect.so.%{maj_ver} +%{install_libdir}/libHLFIRTransforms.so.%{maj_ver} + +%files devel +%{install_libdir}/libFortranLower.so +%{install_libdir}/libFortranParser.so +%{install_libdir}/libFortranCommon.so +%{install_libdir}/libFortranSemantics.so +%{install_libdir}/libFortran_main.a +%{install_libdir}/libFIRAnalysis.so +%{install_libdir}/libFIRBuilder.so +%{install_libdir}/libFIRCodeGen.so +%{install_libdir}/libFIRDialect.so +%{install_libdir}/libFIRDialectSupport.so +%{install_libdir}/libFIRSupport.so +%{install_libdir}/libFIRTestAnalysis.so +%{install_libdir}/libFIRTransforms.so +%{install_libdir}/libFortranDecimal.so +%{install_libdir}/libFortranRuntime.so +%{install_libdir}/libFortranEvaluate.so +%{install_libdir}/libflangFrontend.so +%{install_libdir}/libflangFrontendTool.so +%{install_libdir}/libHLFIRDialect.so +%{install_libdir}/libHLFIRTransforms.so +%{install_includedir}/flang +%{install_libdir}/cmake/ %changelog +* Tue Dec 5 2023 zhoujing - 17.0.6-1 +- Update to 17.0.6 + * Wed Oct 25 2023 HuQingYuan - flang_20210324-29 - Add patch for add align pragma for scalar variables diff --git a/mlir-17.0.6.src.tar.xz b/mlir-17.0.6.src.tar.xz new file mode 100644 index 0000000000000000000000000000000000000000..22f5ecd892ef2fbaceafeead4b33fdf4e2328647 Binary files /dev/null and b/mlir-17.0.6.src.tar.xz differ